/*
 * GameCube public site. Theme "GameCube": the console's indigo with the orange
 * of the community logo.
 */
:root {
  color-scheme: dark;

  --bg-root: #0f0e1f;
  --bg-panel: #1b1936;
  --bg-panel-hover: #221f44;
  --bg-elevated: #26234d;
  --bg-glass: rgba(15, 14, 31, 0.88);

  --border: #2e2b5a;
  --border-soft: rgba(46, 43, 90, 0.7);
  --border-accent: rgba(123, 104, 238, 0.45);

  --text: #ecebff;
  --text-muted: #a3a0cc;
  --text-dim: #6c6996;

  --accent: #7b68ee;
  --accent-soft: rgba(123, 104, 238, 0.16);
  --accent-glow: rgba(123, 104, 238, 0.45);
  --accent-2: #ff9f1c;
  --accent-2-soft: rgba(255, 159, 28, 0.14);
  --success: #34d399;
  --success-glow: rgba(52, 211, 153, 0.55);
  --danger: #ff5c7a;
  --warning: #ffb020;
  --discord: #5865f2;
  --discord-hover: #4752c4;

  --font-sans: Inter, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, "Cascadia Mono", "SF Mono", Menlo, monospace;

  --content-max: 1120px;
  --header-height: 68px;
  --gutter: clamp(16px, 4vw, 48px);
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 14px 32px rgba(0, 0, 0, 0.28);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --duration: 0.18s;
}

/* Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg-root);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

.gc-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: var(--accent-soft);
}

.gc-muted {
  color: var(--text-muted);
}

.gc-small {
  font-size: 0.85rem;
}

.gc-placeholder {
  color: var(--text-dim);
  list-style: none;
}

/* Background */
.gc-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 85% 8%, rgba(123, 104, 238, 0.2), transparent 38%),
    radial-gradient(circle at 12% 88%, rgba(255, 159, 28, 0.08), transparent 32%),
    var(--bg-root);
}

.gc-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(39, 50, 68, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(39, 50, 68, 0.35) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 20%, transparent 75%);
}

/* Header */
.gc-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: var(--header-height);
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
}

.gc-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.gc-logo:hover {
  text-decoration: none;
}

.gc-logo-mark {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

/* Header links: the signed-in user's Authentik applications */
.gc-apps {
  display: flex;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.gc-apps::-webkit-scrollbar {
  display: none;
}

.gc-app-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
}

.gc-app-link:hover {
  color: var(--text);
  background: var(--bg-panel-hover);
  text-decoration: none;
}

.gc-app-link .gc-app-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 0.65rem;
}

.gc-app-link .gc-app-icon:has(img) {
  background: transparent;
}

.gc-app-link .gc-app-icon img {
  object-fit: contain;
}

.gc-apps.is-reordering {
  padding: 3px;
  border: 1px dashed var(--border-accent);
  border-radius: 10px;
}

.gc-apps.is-reordering .gc-app-link {
  cursor: grab;
}

.gc-app-link.is-dragging {
  opacity: 0.45;
}

/* Edit mode: a hidden link stays in place, dimmed and struck through, until shown again. */
.gc-app-link.is-hidden {
  opacity: 0.45;
}

.gc-app-link.is-hidden .gc-app-name {
  text-decoration: line-through;
}

.gc-app-toggle {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-left: -2px;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}

.gc-app-toggle:hover,
.gc-app-toggle:focus-visible {
  color: var(--text);
  background: var(--bg-panel-hover);
}

.gc-app-link .gc-dot {
  width: 7px;
  height: 7px;
}

.gc-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* The language is the account's (set in /account/); CZ / EN only choose which
   texts an admin is writing while editing the page. */
.gc-lang {
  display: none;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-panel);
}

body.gc-editing .gc-lang {
  display: inline-flex;
}

.gc-lang-btn {
  border: 0;
  padding: 4px 9px;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.gc-lang-btn.is-active {
  background: var(--bg-elevated);
  color: var(--text);
}

/* Buttons */
.gc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.gc-btn:hover {
  text-decoration: none;
}

.gc-btn:active {
  transform: translateY(1px);
}

.gc-btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.gc-btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 24px rgba(123, 104, 238, 0.3);
}

.gc-btn-primary:hover {
  background: #6a56e6;
  box-shadow: 0 12px 28px var(--accent-glow);
}

.gc-btn-ghost {
  background: var(--bg-panel);
  border-color: var(--border);
  color: var(--text);
}

.gc-btn-ghost:hover {
  background: var(--bg-panel-hover);
  border-color: var(--border-accent);
}

.gc-btn-discord {
  background: var(--discord);
  color: #fff;
  box-shadow: 0 8px 24px rgba(88, 101, 242, 0.25);
}

.gc-btn-discord:hover {
  background: var(--discord-hover);
}

.gc-header .gc-btn {
  padding: 8px 14px;
}

.gc-btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
}

.gc-btn-block {
  width: 100%;
}

.gc-btn-link {
  border: 0;
  padding: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.gc-btn-link:hover {
  text-decoration: underline;
}

.gc-btn-icon {
  flex-shrink: 0;
}

/* Account dropdown */
.gc-account {
  position: relative;
}

.gc-account-btn [data-account-label] {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gc-account-btn .gc-chevron {
  transition: transform var(--duration) var(--ease);
}

.gc-account-btn[aria-expanded="true"] .gc-chevron {
  transform: rotate(180deg);
}

/* Signed out the button just goes to /login/: no menu to unfold. */
.gc-account:not(.is-signed-in) .gc-chevron {
  display: none;
}

.gc-account.is-signed-in .gc-account-btn {
  background: var(--bg-panel);
  border-color: var(--border);
  box-shadow: none;
  color: var(--text);
  padding-left: 6px;
}

.gc-account-avatar,
.gc-app-icon {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.gc-account-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.75rem;
}

.gc-account-avatar img,
.gc-app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gc-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  width: min(340px, calc(100vw - 32px));
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  box-shadow: var(--shadow);
  animation: gc-pop var(--duration) var(--ease);
}

@keyframes gc-pop {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.gc-popover h3 {
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.gc-popover-sub {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.gc-form {
  display: grid;
  gap: 14px;
}

.gc-field {
  display: grid;
  gap: 6px;
}

.gc-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.gc-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-root);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}

.gc-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.gc-input--code {
  font-family: var(--font-mono);
  letter-spacing: 0.3em;
  text-align: center;
  font-size: 1.15rem;
}

.gc-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}

.gc-check input {
  accent-color: var(--accent);
}

.gc-form-error {
  padding: 10px 12px;
  border: 1px solid rgba(255, 92, 122, 0.35);
  border-radius: 10px;
  background: rgba(255, 92, 122, 0.08);
  color: #ffb3c1;
  font-size: 0.85rem;
}

.gc-form-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.gc-identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-root);
  font-size: 0.9rem;
  overflow: hidden;
}

.gc-identity strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gc-menu {
  display: grid;
  gap: 2px;
  margin: 12px -8px 0;
}

.gc-menu a,
.gc-menu button {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
}

.gc-menu a:hover,
.gc-menu button:hover {
  background: var(--bg-panel-hover);
  text-decoration: none;
}

.gc-menu .gc-menu-danger {
  color: #ffb3c1;
}

.gc-user-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gc-user-head .gc-account-avatar {
  width: 40px;
  height: 40px;
  font-size: 0.95rem;
}

.gc-user-head strong {
  display: block;
}

/* Sign-in page (/login/) */
.gc-main.gc-login-main {
  display: grid;
  place-items: start center;
  padding-top: clamp(32px, 9vh, 96px);
  padding-bottom: clamp(32px, 9vh, 96px);
}

.gc-login {
  width: min(400px, 100%);
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  box-shadow: var(--shadow);
  animation: gc-pop var(--duration) var(--ease);
}

.gc-login h1 {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.gc-login-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.gc-login .gc-form-links {
  margin-top: 14px;
}

.gc-login .gc-form-error + .gc-btn {
  margin-top: 12px;
}

.gc-login h1 + .gc-form-error {
  margin-top: 16px;
}

.gc-login-notice {
  margin-bottom: 16px;
}

/* Progress: spinner, "loading" line, a bar running across a waiting form */
.gc-spinner {
  display: inline-block;
  flex: none;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -0.15em;
  animation: gc-spin 0.7s linear infinite;
}

.gc-btn .gc-spinner {
  margin-right: 8px;
}

.gc-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.gc-loading .gc-spinner {
  color: var(--accent);
}

.gc-busy-bar {
  position: relative;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--accent-soft);
}

.gc-busy-bar::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 35%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  animation: gc-busy 1.1s var(--ease) infinite;
}

/* On a card the bar runs along its top edge. */
.gc-login > .gc-busy-bar {
  margin: calc(-1 * clamp(20px, 4vw, 32px)) calc(-1 * clamp(20px, 4vw, 32px)) clamp(17px, 4vw, 29px);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

@media (prefers-reduced-motion: reduce) {
  .gc-busy-bar::after {
    width: 100%;
    opacity: 0.6;
    animation: none;
  }
}

@keyframes gc-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes gc-busy {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(290%);
  }
}

/* Authentik flows run on this site (flow-form.js): account settings, registration */
.gc-flow {
  display: grid;
  gap: 14px;
}

.gc-flow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gc-flow-done {
  padding: 10px 12px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 10px;
  background: rgba(52, 211, 153, 0.08);
  color: #a7f3d0;
  font-size: 0.85rem;
}

.gc-radio-group {
  margin: 0;
  padding: 0;
  border: 0;
}

.gc-radio-group legend {
  margin-bottom: 6px;
  padding: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.gc-radio-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.gc-check input[type="radio"] {
  accent-color: var(--accent);
}

.gc-field-help {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.gc-field-error {
  color: #ffb3c1;
  font-size: 0.8rem;
}

.gc-flow-separator {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--border-soft);
}

.gc-qr-wrap {
  display: flex;
  justify-content: center;
}

.gc-qr {
  width: min(220px, 100%);
  height: auto;
  border-radius: 10px;
}

.gc-flow-secret {
  display: grid;
  gap: 4px;
  text-align: center;
}

.gc-flow-secret code,
.gc-flow-codes code {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
}

.gc-flow-codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 16px;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-root);
  list-style: none;
}

.gc-danger {
  color: #ffb3c1;
}

/* Account settings page (/account/) */
.gc-main.gc-account-main {
  padding-top: clamp(24px, 6vh, 64px);
  padding-bottom: clamp(32px, 8vh, 80px);
}

.gc-account-page {
  display: grid;
  gap: 16px;
  width: min(640px, 100%);
  margin: 0 auto;
}

.gc-account-head {
  margin-bottom: 8px;
}

.gc-account-head h1 {
  font-size: 1.5rem;
}

.gc-account-head .gc-account-avatar {
  width: 52px;
  height: 52px;
  font-size: 1.1rem;
}

.gc-account-section {
  display: grid;
  gap: 14px;
  justify-items: start;
  padding: clamp(18px, 3vw, 24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
}

.gc-account-section > * {
  width: 100%;
}

.gc-account-section > .gc-btn {
  width: auto;
}

.gc-account-section h2 {
  font-size: 1.05rem;
  margin-bottom: 2px;
}

.gc-device-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gc-device-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-root);
}

.gc-device-list li > div {
  display: grid;
  min-width: 0;
}

.gc-device-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gc-header-logout {
  color: #ffb3c1;
}

/* Layout */
.gc-main {
  flex: 1;
  width: 100%;
  max-width: calc(var(--content-max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.gc-kicker {
  color: var(--accent-2);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Home: intro on top, server status below across the full content width */
.gc-home {
  display: grid;
  gap: clamp(28px, 4vw, 44px);
  padding: clamp(40px, 7vw, 80px) 0 clamp(40px, 6vw, 72px);
  animation: gc-fade 0.3s var(--ease);
}

@keyframes gc-fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.gc-intro h1 {
  margin: 10px 0 16px;
  font-size: clamp(2rem, 5vw, 3.2rem);
}

.gc-lead {
  max-width: 640px;
  color: var(--text-muted);
  font-size: 1.08rem;
}

.gc-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 28px;
}

.gc-btn-lg {
  padding: 13px 22px;
  font-size: 1rem;
}

.gc-discord-online {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Dots */
.gc-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-dim);
}

.gc-dot--up {
  background: var(--success);
  box-shadow: 0 0 10px var(--success-glow);
}

.gc-dot--down {
  background: var(--danger);
}

.gc-dot--muted {
  background: var(--text-dim);
}

/* Server status drawn like Wazowski's Discord message (Components V2 container) */
.gc-dstatus {
  --d-accent: #5b6270;
  display: grid;
  gap: 8px;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--d-accent);
  border-radius: 8px;
  background: var(--bg-panel);
  font-size: 0.95rem;
  line-height: 1.45;
  min-width: 0;
}

.gc-dstatus--ok {
  --d-accent: #7ccf2c;
}

.gc-dstatus--some {
  --d-accent: #f0a020;
}

.gc-dstatus--down {
  --d-accent: #e0413a;
}

.gc-dstatus-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.gc-dstatus-head h2 {
  font-size: 1.15rem;
  letter-spacing: 0;
  margin-bottom: 2px;
}

.gc-dsep {
  width: 100%;
  margin: 4px 0;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.gc-dgroup {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.gc-dgroup--gap {
  margin-top: 8px;
}

.gc-drow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.gc-drow-text {
  min-width: 0;
}

.gc-drow-head {
  overflow-wrap: anywhere;
}

.gc-drow-head strong {
  font-weight: 600;
}

.gc-dsmall {
  color: var(--text-muted);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.gc-dsmall strong {
  color: var(--text);
}

.gc-dprojects-title {
  font-weight: 600;
}

/* Discord's grey "secondary" button: address to copy, link top right */
.gc-drow-ip {
  flex-shrink: 0;
  max-width: 46%;
  padding: 5px 12px;
  border: 0;
  border-radius: 6px;
  background: #3a3670;
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}

.gc-drow-ip:hover {
  background: #4a4590;
  text-decoration: none;
}

/* Skeleton while the very first status loads */
.gc-skel {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #26234d 0%, #322e63 50%, #26234d 100%);
  background-size: 200% 100%;
  animation: gc-skel 1.2s ease-in-out infinite;
}

.gc-skel-lines {
  display: grid;
  gap: 8px;
  flex: 1;
  padding: 4px 0;
}

.gc-skel[data-w="18"] { width: 18%; }
.gc-skel[data-w="25"] { width: 25%; }
.gc-skel[data-w="30"] { width: 30%; height: 16px; }
.gc-skel[data-w="40"] { width: 40%; height: 14px; }

.gc-skel-ip {
  width: 150px;
  height: 28px;
  flex-shrink: 0;
}

@keyframes gc-skel {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

.gc-dfoot {
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 0.75rem;
}

/* Page grid (GridStack) and widget frames */
.gc-page {
  margin: clamp(20px, 4vw, 40px) -8px clamp(32px, 5vw, 56px);
  min-height: 200px;
}

.gc-w {
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: var(--text);
}

.gc-w-body {
  min-height: 100%;
}

.gc-w-bg-none { background: transparent; }
.gc-w-bg-panel { background: var(--bg-panel); }
.gc-w-bg-elevated { background: var(--bg-elevated); }
.gc-w-bg-accent { background: linear-gradient(135deg, rgba(123, 104, 238, 0.28), rgba(123, 104, 238, 0.1)); }
.gc-w-bg-accent2 { background: linear-gradient(135deg, rgba(255, 159, 28, 0.24), rgba(255, 159, 28, 0.08)); }

.gc-w-border-none { border: 0; }
.gc-w-border-soft { border: 1px solid var(--border); }
.gc-w-border-accent { border: 1px solid var(--accent); box-shadow: 0 0 0 1px rgba(123, 104, 238, 0.2), 0 12px 32px rgba(123, 104, 238, 0.15); }
.gc-w-border-accent2 { border: 1px solid var(--accent-2); box-shadow: 0 12px 32px rgba(255, 159, 28, 0.12); }

.gc-w-pad-none > .gc-w-body { padding: 0; }
.gc-w-pad-s > .gc-w-body { padding: 12px; }
.gc-w-pad-m > .gc-w-body { padding: 20px; }
.gc-w-pad-l > .gc-w-body { padding: 32px; }

.gc-w-align-left { text-align: left; }
.gc-w-align-center { text-align: center; }
.gc-w-align-right { text-align: right; }

.gc-wempty {
  display: grid;
  place-items: center;
  min-height: 80px;
  padding: 16px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* Rich text widget */
.gc-rich {
  overflow-wrap: anywhere;
}

.gc-rich > * + * {
  margin-top: 0.6em;
}

.gc-rich h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin-top: 0.15em;
}

.gc-rich h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
}

.gc-rich h3 {
  font-size: 1.15rem;
}

.gc-rich .gc-lead {
  color: var(--text-muted);
  font-size: 1.08rem;
  max-width: 640px;
}

.gc-w-align-center .gc-rich .gc-lead { margin-inline: auto; }
.gc-w-align-right .gc-rich .gc-lead { margin-left: auto; }

.gc-rich ul,
.gc-rich ol {
  padding-left: 1.4em;
}

.gc-rich a {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.gc-rich hr {
  border: 0;
  border-top: 1px solid var(--border);
}

.gc-rich blockquote {
  padding-left: 12px;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
}

/* Discord, image, buttons, notice and changelog widgets */
.gc-wdiscord {
  display: grid;
  gap: 16px;
  height: 100%;
  align-content: start;
}

.gc-wdiscord .gc-discord-head h3 {
  font-size: 1.1rem;
}

.gc-discord-head {
  display: flex;
  gap: 14px;
  align-items: center;
}

.gc-discord-head p {
  margin-top: 4px;
  font-size: 0.9rem;
}

.gc-discord-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 16px;
  overflow: hidden;
  background: var(--discord);
  color: #fff;
  font-weight: 700;
}

.gc-discord-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gc-discord-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--text-muted);
}

.gc-discord-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gc-discord-stat strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1.1rem;
}

.gc-wimage {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 120px;
}

.gc-wimage--cover { object-fit: cover; }
.gc-wimage--contain { object-fit: contain; }

.gc-wimage-link {
  display: block;
  height: 100%;
}

.gc-wbuttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gc-w-align-center .gc-wbuttons { justify-content: center; }
.gc-w-align-right .gc-wbuttons { justify-content: flex-end; }

.gc-wnotice {
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid;
  white-space: pre-line;
}

.gc-wnotice--info { border-color: var(--border-accent); background: var(--accent-soft); }
.gc-wnotice--warning { border-color: rgba(255, 176, 32, 0.45); background: rgba(255, 176, 32, 0.1); }
.gc-wnotice--success { border-color: rgba(52, 211, 153, 0.45); background: rgba(52, 211, 153, 0.1); }
.gc-wnotice--danger { border-color: rgba(255, 92, 122, 0.5); background: rgba(255, 92, 122, 0.1); }

.gc-wtitle {
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.gc-wchangelog {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.gc-wchangelog li {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.gc-wchangelog small {
  display: block;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.gc-changelog-light {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
}

.gc-changelog-light--green { background: var(--success); }
.gc-changelog-light--yellow { background: var(--warning); }
.gc-changelog-light--red { background: var(--danger); }
.gc-changelog-light--none { background: transparent; border: 1px solid var(--text-dim); }

/* Edit mode */
.gc-editbar {
  position: sticky;
  top: var(--header-height);
  z-index: 25;
  display: grid;
  gap: 8px;
  padding: 10px var(--gutter);
  border-bottom: 1px solid var(--border-accent);
  background: rgba(27, 25, 54, 0.96);
  backdrop-filter: blur(10px);
}

.gc-editbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.gc-editbar-actions {
  justify-content: flex-end;
  gap: 10px;
}

.gc-editbar-actions > span {
  margin-right: auto;
}

.gc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.gc-tool,
.gc-tool-select {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-panel);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.gc-tool:hover,
.gc-tool-select:hover {
  border-color: var(--border-accent);
  background: var(--bg-panel-hover);
}

.gc-add {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.gc-swatch {
  width: 22px;
  height: 22px;
  border: 2px solid var(--bg-root);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--border);
  cursor: pointer;
}

.gc-swatch--text { background: #ecebff; }
.gc-swatch--muted { background: #a3a0cc; }
.gc-swatch--accent { background: #7b68ee; }
.gc-swatch--accent2 { background: #ff9f1c; }
.gc-swatch--success { background: #34d399; }
.gc-swatch--danger { background: #ff5c7a; }

.gc-page.is-editing .grid-stack-item-content {
  outline: 1px dashed var(--border-accent);
  outline-offset: -1px;
}

.gc-page.is-editing .grid-stack-item:hover .grid-stack-item-content {
  outline: 1px solid var(--accent);
}

.gc-w-edit {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--border-accent);
  border-radius: 10px;
  background: rgba(15, 14, 31, 0.92);
  font-size: 0.78rem;
}

.gc-w-edit button,
.gc-w-handle {
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.gc-w-handle {
  cursor: grab;
  font-size: 1rem;
}

.gc-w-edit button:hover,
.gc-w-handle:hover {
  background: var(--bg-panel-hover);
}

.gc-w-delete:hover {
  color: var(--danger);
}

.gc-w-type {
  padding: 0 6px;
  color: var(--text-muted);
}

.gc-rich--editing {
  min-height: 40px;
  outline: none;
  cursor: text;
}

.gc-rich--editing:empty::before {
  content: attr(data-placeholder);
  color: var(--text-dim);
}

.gc-rich--editing:focus {
  box-shadow: 0 0 0 2px var(--accent-soft);
  border-radius: 6px;
}

.gc-fieldset {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.gc-fieldset legend {
  padding: 0 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gc-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.gc-field-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.gc-button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
}

.gc-danger-link {
  color: var(--danger);
  justify-self: start;
}

.gc-set-preview {
  max-height: 120px;
  width: auto;
  border-radius: 8px;
  margin-top: 6px;
}

select.gc-input {
  cursor: pointer;
}

/* GridStack placeholder while dragging */
.grid-stack > .grid-stack-placeholder > .placeholder-content {
  border: 2px dashed var(--accent);
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
}

/* Announcement bar (Nastaveni webu) */
.gc-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px var(--gutter);
  border-bottom: 1px solid var(--border-accent);
  background: linear-gradient(90deg, rgba(123, 104, 238, 0.22), rgba(255, 159, 28, 0.14));
  color: var(--text);
  font-size: 0.92rem;
  text-align: center;
  white-space: pre-line;
}

/* Website settings editor (admins) */
.gc-dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

.gc-dialog::backdrop {
  background: rgba(5, 8, 12, 0.7);
  backdrop-filter: blur(4px);
}

.gc-admin {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.gc-admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gc-admin-head h2 {
  font-size: 1.2rem;
}

.gc-admin-langs {
  justify-self: start;
}

.gc-admin textarea.gc-input {
  resize: vertical;
  font: inherit;
  line-height: 1.5;
}

.gc-admin .gc-input::placeholder {
  color: var(--text-dim);
}

.gc-admin-ok {
  padding: 10px 12px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 10px;
  background: rgba(52, 211, 153, 0.08);
  color: var(--success);
  font-size: 0.85rem;
}

.gc-admin-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Footer */
.gc-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 24px var(--gutter);
  border-top: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 1080px) {
  .gc-header {
    flex-wrap: wrap;
    gap: 8px 12px;
    padding-top: 10px;
    padding-bottom: 6px;
  }

  .gc-apps {
    order: 3;
    flex-basis: 100%;
    margin: 0 calc(-1 * var(--gutter));
    padding: 0 var(--gutter);
  }
}

@media (max-width: 560px) {
  .gc-hide-sm {
    display: none;
  }

  .gc-header .gc-btn-discord {
    padding: 8px 10px;
  }

  .gc-account-btn [data-account-label] {
    max-width: 110px;
  }

  .gc-dstatus {
    padding: 14px;
  }

  /* The header's backdrop-filter makes it the containing block of fixed
     children, so this pins the dropdown right under the (wrapped) header. */
  .gc-popover {
    position: fixed;
    top: calc(100% + 8px);
    left: 16px;
    right: 16px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
