/* XHub Unlock - red / black / white (Fredoka / #E10600) */

.gk-body {
  min-height: 100vh;
  --gk-red: #E10600;
  --gk-red-dim: rgba(225, 6, 0, 0.16);
  --gk-red-border: rgba(225, 6, 0, 0.4);
}

.gk-denied {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center; padding: 28px;
  background:
    radial-gradient(ellipse 70% 50% at 50% 30%, rgba(225, 6, 0, 0.16), transparent 60%),
    rgba(0, 0, 0, 0.55);
}
.gk-denied-card {
  max-width: 440px; text-align: center; align-items: center;
  padding: 36px 28px !important;
  border-color: var(--gk-red-border) !important;
  box-shadow: 0 0 40px rgba(225, 6, 0, 0.14), 0 20px 50px rgba(0, 0, 0, 0.35);
}
.gk-denied-logo {
  border-radius: 12px;
  border: 1px solid rgba(225, 6, 0, 0.5);
  background: #000;
  box-shadow: 0 0 24px rgba(225, 6, 0, 0.28);
  margin-bottom: 4px;
}
.gk-denied-card .brand-wordmark {
  font-size: 2.4rem !important;
  margin: 8px 0 6px !important;
}
.gk-denied-title {
  font-family: var(--font-display, 'Fredoka', system-ui, sans-serif);
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.gk-denied-card p { color: var(--dim); font-size: 1rem; margin-bottom: 16px; line-height: 1.55; }

.gk-hero-compact { margin-bottom: 32px; }
.gk-hero-mark {
  font-size: clamp(2.6rem, 10vw, 4rem) !important;
  margin: 0 0 8px !important;
  line-height: 0.95 !important;
}
.gk-hero-compact .dx-hero-title {
  font-family: var(--font-display, 'Fredoka', system-ui, sans-serif);
  font-size: clamp(1.2rem, 3vw, 1.55rem);
  margin-bottom: 10px;
}

.gk-steps-grid { margin-bottom: 24px; }

.gk-step-card {
  transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.2s ease;
}
.gk-step-card.done {
  border-color: var(--gk-red-border) !important;
  background: color-mix(in srgb, var(--card-alt) 90%, rgba(225, 6, 0, 0.08));
  box-shadow: inset 3px 0 0 var(--gk-red), 0 0 20px rgba(225, 6, 0, 0.06);
}
.gk-step-card.done .gk-step-status {
  color: var(--gk-red);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.gk-step-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.gk-step-status { font-size: 0.9rem; color: var(--dim); }

.gk-code-label {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--dim); margin: 12px 0 8px; display: block;
}
.gk-code-input {
  width: 100%; padding: 13px 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--mono); font-size: 1rem; outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.gk-code-input:focus {
  border-color: var(--gk-red);
  box-shadow: 0 0 0 3px var(--gk-red-dim);
}

.gk-generate-wrap {
  text-align: center;
  margin-bottom: 32px;
  animation: gkRise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes gkRise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.gk-generate-btn {
  min-width: 240px;
  min-height: 52px;
  font-size: 1.02rem !important;
  letter-spacing: 0.02em;
}

.gk-key-card {
  gap: 16px !important;
  padding: 28px 24px !important;
  border-color: var(--gk-red-border) !important;
  background:
    linear-gradient(180deg, rgba(225, 6, 0, 0.07) 0%, transparent 40%),
    var(--card-alt) !important;
  box-shadow: 0 0 0 1px rgba(225, 6, 0, 0.12), 0 20px 50px rgba(0, 0, 0, 0.15) !important;
  animation: gkRise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.gk-key-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.gk-key-top h2 {
  font-family: var(--font-display, 'Fredoka', system-ui, sans-serif);
  font-size: 1.35rem;
  font-weight: 800;
  margin-top: 6px;
  letter-spacing: -0.02em;
}

.gk-tier-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--gk-red);
  vertical-align: middle;
}

.gk-timer-wrap {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 0;
}
.gk-timer-label {
  font-family: var(--font-display, 'Fredoka', system-ui, sans-serif);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  line-height: 1.2;
}
/* Raw string kept for screen readers / aria-live; units are the visual countdown */
.gk-timer {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.gk-timer.expired {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  clip: auto;
  overflow: visible;
  white-space: normal;
  font-family: var(--font-display, 'Fredoka', system-ui, sans-serif);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gk-red);
  text-shadow: none;
}
.gk-timer-units {
  display: flex;
  align-items: stretch;
  gap: 6px;
  justify-content: flex-end;
}
.gk-timer-units.is-expired {
  opacity: 0.45;
  filter: grayscale(0.35);
}
.gk-timer-unit {
  min-width: 52px;
  padding: 8px 10px 7px;
  border: 1px solid rgba(225, 6, 0, 0.32);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(225, 6, 0, 0.1), transparent 70%),
    rgba(0, 0, 0, 0.42);
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.gk-timer-unit strong {
  display: block;
  font-family: 'JetBrains Mono', var(--mono, ui-monospace, monospace);
  font-size: 1.28rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.15;
}
.gk-timer-unit span {
  display: block;
  margin-top: 3px;
  font-family: var(--font-display, 'Fredoka', system-ui, sans-serif);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.gk-key-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--card) 90%, #000);
  border: 1px solid rgba(225, 6, 0, 0.28);
  border-radius: var(--radius-sm);
}
.gk-key-row code {
  font-family: var(--mono);
  font-size: 1rem;
  flex: 1;
  word-break: break-all;
  color: var(--text);
}

.gk-info-grid {
  display: grid; gap: 10px; font-size: 0.95rem;
  border-top: 1px solid var(--border); padding-top: 14px;
}
.gk-info-grid > div { display: flex; justify-content: space-between; color: var(--dim); }
.gk-info-grid strong { color: var(--text); font-weight: 600; }
.gk-info-value--active {
  color: #22c55e !important;
  text-shadow: 0 0 14px rgba(34, 197, 94, 0.28);
}
.gk-info-value--expired { color: var(--gk-red) !important; }

.gk-extend {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gk-extend.hidden { display: none !important; }
.gk-extend h3 {
  font-family: var(--font-display, 'Fredoka', system-ui, sans-serif);
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0;
}
.gk-extend-desc { margin: 0; color: var(--dim); font-size: 0.92rem; line-height: 1.5; }
.gk-extend-confirm { display: flex; flex-direction: column; gap: 8px; }
.gk-extend-confirm.hidden { display: none !important; }

.gk-revoked-card { gap: 14px !important; }
.gk-revoked-reason {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(225, 6, 0, 0.22);
}
.gk-revoked-reason span {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
}
.gk-revoked-reason strong {
  font-size: 0.98rem;
  line-height: 1.45;
  font-weight: 650;
  white-space: pre-wrap;
  word-break: break-word;
}
#btn-extend-48.is-disabled,
#btn-extend-48:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

/* Admin gate styles live in admin-gate.js (theme-aware light/dark). Keep overflow lock only. */
body.xag-open { overflow: hidden; }

html[data-site-theme="light"] .gk-step-card.done { background: #fff5f5; }
html[data-site-theme="light"] .gk-key-row { background: #fafafa; }
html[data-site-theme="light"] .gk-timer-unit {
  background: linear-gradient(180deg, #fff5f5, #fff);
  border-color: rgba(225, 6, 0, 0.22);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
html[data-site-theme="light"] .gk-timer-unit strong { color: #111; }
html[data-site-theme="light"] .gk-timer-unit span { color: rgba(0, 0, 0, 0.42); }
html[data-site-theme="light"] .gk-info-value--active {
  text-shadow: none;
}
html[data-site-theme="dark"] .gk-denied {
  background:
    radial-gradient(ellipse 70% 50% at 50% 30%, rgba(225, 6, 0, 0.18), transparent 60%),
    #000;
}

@media (max-width: 900px) {
  .gk-key-card { padding: 22px 16px !important; }
  .gk-timer-wrap {
    text-align: center;
    width: 100%;
    align-items: center;
  }
  .gk-timer-units {
    justify-content: center;
    width: 100%;
  }
  .gk-timer-unit {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 6px 7px;
  }
  .gk-timer-unit strong { font-size: 1.15rem; }
  .gk-generate-btn { width: 100%; min-width: 0; min-height: 48px; }
  .gk-generate-wrap {
    width: 100%;
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
  }
  .dx-btn, .dx-btn--sm { min-height: 44px; padding: 12px 16px; }
  .dx-section-head--row { flex-direction: column; align-items: stretch; gap: 10px; }
  .dx-code-pre { font-size: 0.78rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #hub-loadstring-value, #portal-loadstring-value { word-break: break-all; white-space: pre-wrap; }
  .gk-hero-compact { text-align: center; }
  .gk-step-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .gk-step-actions .dx-btn { width: 100%; min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .gk-generate-wrap,
  .gk-key-card { animation: none !important; }
}
