/* ============================================================
   access-gate.css
   Friendly, kid-appropriate gate screen for Coin & Pulse quests.
   Matches the storybook (Spiced Amber) palette: deep paper +
   gold primary + coral/leaf accents.
   ============================================================ */

#ks-gate-root[hidden] { display: none; }

.ksg-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background:
    radial-gradient(ellipse at 18% 0%, rgba(255,210,80,.10), transparent 55%),
    radial-gradient(ellipse at 82% 100%, rgba(255,128,96,.10), transparent 55%),
    linear-gradient(165deg, #1d242a 0%, #14181c 60%, #0f1316 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  -webkit-font-smoothing: antialiased;
  font-family: 'Nunito Sans', system-ui, -apple-system, sans-serif;
  color: #eef3f2;
  animation: ksgFadeIn .35s ease-out;
}

@keyframes ksgFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.ksg-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, #1f2a30 0%, #1a2025 100%);
  border: 1px solid #2c363c;
  border-radius: 22px;
  padding: 32px 26px 24px;
  box-shadow:
    0 36px 80px -28px rgba(0,0,0,.75),
    0 0 0 1px rgba(255,210,80,.04) inset;
  text-align: center;
  animation: ksgRise .45s cubic-bezier(.2,.8,.2,1);
}

@keyframes ksgRise {
  from { transform: translateY(14px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── BADGE ── */
.ksg-badge {
  display: inline-block;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #f2cc5a;
  background: rgba(242,204,90,.12);
  border: 1px solid rgba(242,204,90,.28);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.ksg-badge.ksg-badge-warn {
  color: #ff9a7a;
  background: rgba(255,128,96,.12);
  border-color: rgba(255,128,96,.28);
}

/* ── HEADINGS ── */
.ksg-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 1.55rem;
  line-height: 1.2;
  color: #eef3f2;
  margin: 0 0 10px;
}

.ksg-sub {
  font-size: .92rem;
  line-height: 1.55;
  color: #aebcc0;
  margin: 0 0 22px;
}

/* ── ACTIONS ── */
.ksg-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}

.ksg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px 18px;
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 700;
  font-size: .98rem;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}

.ksg-btn:hover  { transform: translateY(-1px); }
.ksg-btn:active { transform: translateY(0); }
.ksg-btn[disabled] { opacity: .55; cursor: wait; transform: none; }

.ksg-btn-primary {
  color: #241a05;
  background: linear-gradient(160deg, #ffe07a, #f5c542);
  box-shadow:
    0 14px 32px -10px rgba(255,210,80,.65),
    0 0 0 1px rgba(255,225,130,.4) inset;
}
.ksg-btn-primary:hover {
  filter: brightness(1.08);
  box-shadow:
    0 16px 38px -10px rgba(255,210,80,.8),
    0 0 0 1px rgba(255,225,130,.55) inset;
}

.ksg-btn-ghost {
  color: #f2cc5a;
  background: transparent;
  border: 1px solid rgba(242,204,90,.35);
}
.ksg-btn-ghost:hover {
  background: rgba(242,204,90,.08);
  border-color: rgba(242,204,90,.55);
}

/* ── FORM ── */
.ksg-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed rgba(174,188,192,.18);
  text-align: left;
  animation: ksgRise .3s ease-out;
}
.ksg-form[hidden] { display: none; }

.ksg-label {
  display: block;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: .76rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #aebcc0;
  margin: 12px 0 6px;
}
.ksg-label:first-child { margin-top: 0; }

.ksg-input {
  width: 100%;
  background: #14181c;
  border: 1.5px solid #2c363c;
  border-radius: 12px;
  padding: 13px 14px;
  font-family: 'Nunito Sans', sans-serif;
  font-size: .98rem;
  color: #eef3f2;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ksg-input::placeholder { color: #6f8086; }
.ksg-input:focus {
  outline: none;
  border-color: #f2cc5a;
  box-shadow: 0 0 0 3px rgba(242,204,90,.18);
}
#ksg-code-inp { letter-spacing: .08em; font-weight: 600; }

.ksg-btn-submit {
  margin-top: 16px;
}

.ksg-msg {
  margin-top: 12px;
  font-size: .88rem;
  line-height: 1.4;
  text-align: center;
  min-height: 1.4em;
  color: #aebcc0;
}
.ksg-msg-err  { color: #ff9a7a; }
.ksg-msg-ok   { color: #37b89a; }
.ksg-msg-info { color: #aebcc0; }

.ksg-back {
  display: inline-block;
  margin-top: 22px;
  font-size: .82rem;
  color: #6f8086;
  text-decoration: none;
  border-bottom: 1px dotted rgba(174,188,192,.3);
  padding-bottom: 1px;
}
.ksg-back:hover { color: #aebcc0; border-bottom-color: #aebcc0; }

/* ── COMPANION IMAGE (daily-lock overlay) ── */
.ksg-companion {
  margin-bottom: 14px;
}
.ksg-companion-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 8px 22px rgba(0,0,0,.55));
  mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, black 38%, transparent 74%);
  -webkit-mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, black 38%, transparent 74%);
}

/* ── PHONE TUNING ── */
@media (max-width: 420px) {
  .ksg-card  { padding: 26px 20px 20px; border-radius: 18px; }
  .ksg-title { font-size: 1.35rem; }
  .ksg-sub   { font-size: .88rem; }
  .ksg-companion-img { width: 100px; height: 100px; }
}
