/* ============================================================
   Pharmordle — premium theme
   Fonts: Fraunces (editorial serif display) + Inter (UI)
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* ink & neutrals (on the light card) */
  --ink: #191634;
  --ink-soft: #4a4668;
  --faint: #8b87a8;
  --hair: rgba(25, 22, 52, 0.09);

  /* deep backdrop */
  --bg-0: #090c1a;
  --bg-1: #12102e;
  --bg-2: #1a1440;

  /* card */
  --card: #fcfbf8;
  --card-2: #f5f4fb;

  /* brand accents */
  --indigo: #6366f1;
  --indigo-2: #8b5cf6;
  --indigo-3: #a5b4fc;
  --indigo-ink: #4338ca;
  --gold: #b98f37;
  --gold-2: #d9b45a;
  --gold-3: #e9d08a;

  /* semantic */
  --clue-bg: #f3f3fd;
  --clue-edge: #e4e3f7;
  --clue-ink: #221f45;
  --red: #b23052;
  --red-bg: #fdeef1;
  --red-edge: #f4cdd7;
  --green: #0c8a5f;
  --green-bg: #e7f7ef;
  --green-edge: #bfe8d4;

  --shadow-card:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 18px 50px -12px rgba(6, 8, 22, 0.55),
    0 6px 18px -8px rgba(6, 8, 22, 0.4);
  --radius: 20px;
}

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

body {
  font-family: var(--font-body);
  color: var(--ink);
  min-height: 100vh;
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* layered aurora backdrop */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(60% 45% at 50% -8%, rgba(139, 92, 246, 0.38), transparent 70%),
    radial-gradient(45% 35% at 12% 8%, rgba(99, 102, 241, 0.28), transparent 70%),
    radial-gradient(55% 45% at 92% 22%, rgba(185, 143, 55, 0.16), transparent 70%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 55%, #070a16 100%);
  pointer-events: none;
}
/* fine grain for richness */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 0;
  opacity: 0.5; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

::selection { background: rgba(139, 92, 246, 0.28); }

/* ---------------- Top bar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  padding: 14px 16px;
  background: rgba(9, 12, 26, 0.72);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid rgba(165, 180, 252, 0.14);
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(217, 180, 90, 0.5), rgba(165,180,252,0.4), transparent);
}
.brand-wrap {
  display: flex; flex-direction: row; align-items: center; gap: 10px;
}
.brand-mark { display: inline-flex; }
.brand-mark svg { width: 27px; height: 27px; display: block;
  filter: drop-shadow(0 2px 6px rgba(139,92,246,0.4)); }
.brand {
  display: inline-flex; align-items: baseline;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: 0.2px;
  color: #f6f5ff;
  line-height: 1;
}
.brand sup { font-family: var(--font-body); font-size: 0.5rem; font-weight: 500;
  color: var(--indigo-3); margin-left: 1px; }
.brand-by {
  font-size: 0.62rem; font-weight: 600; letter-spacing: 2.4px; text-transform: uppercase;
  color: var(--gold-3);
}
.brand-emoji { display: none; }

.menu-btn {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.04); border: 1px solid rgba(165,180,252,0.16);
  border-radius: 10px; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px; padding: 9px 8px;
  transition: background .18s ease, border-color .18s ease;
}
.menu-btn:hover { background: rgba(255,255,255,0.09); border-color: rgba(165,180,252,0.3); }
.menu-btn span { width: 20px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--indigo-3), #fff); }

/* ---------------- Drawer ---------------- */
.drawer {
  position: fixed; top: 62px; left: 12px; z-index: 19;
  background: rgba(18, 16, 40, 0.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(165,180,252,0.18);
  border-radius: 16px;
  box-shadow: 0 20px 50px -12px rgba(0,0,0,0.6);
  display: flex; flex-direction: column; min-width: 210px; overflow: hidden;
  transform: translateX(calc(-100% - 20px));
  opacity: 0;
  transition: transform .26s cubic-bezier(.22,1,.36,1), opacity .2s ease;
}
.drawer.open { transform: translateX(0); opacity: 1; }
.drawer-link {
  background: none; border: none; text-align: left; cursor: pointer;
  padding: 13px 20px; font-family: var(--font-body); font-size: 0.96rem; font-weight: 500;
  color: #e9e8fb; letter-spacing: 0.2px;
  border-bottom: 1px solid rgba(165,180,252,0.09);
  transition: background .15s ease, padding-left .15s ease, color .15s ease;
}
.drawer-link:last-child { border-bottom: none; }
.drawer-link:hover { background: rgba(139,92,246,0.16); padding-left: 26px; color: #fff; }

/* ---------------- Layout ---------------- */
main {
  position: relative; z-index: 1;
  display: flex; justify-content: center;
  padding: 42px 16px 72px;
}
.card {
  position: relative;
  background:
    linear-gradient(180deg, #ffffff, var(--card) 40%, var(--card-2));
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 46px 46px 40px;
  width: 100%; max-width: 660px;
}
/* gradient hairline frame */
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius);
  padding: 1px; pointer-events: none;
  background: linear-gradient(160deg, rgba(217,180,90,0.55), rgba(165,180,252,0.4) 32%, rgba(255,255,255,0) 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}

.card-title {
  font-family: var(--font-display); font-optical-sizing: auto;
  font-weight: 600; font-size: 2.1rem; line-height: 1.08;
  text-align: center; color: var(--ink); letter-spacing: -0.4px;
}
.title-rule {
  position: relative;
  width: 64px; height: 2px; margin: 14px auto 8px;
  background: linear-gradient(90deg, transparent, var(--indigo), var(--gold-2), transparent);
  border-radius: 2px;
}
.title-rule::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 5px; height: 5px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--gold-2); box-shadow: 0 0 8px rgba(217,180,90,0.7);
}
.puzzle-label {
  text-align: center; color: var(--faint);
  font-size: 0.72rem; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase;
  margin-bottom: 26px;
}

/* ---------------- Clues ---------------- */
.clues { display: flex; flex-direction: column; gap: 13px; margin-bottom: 30px;
  counter-reset: clue; }
.clue {
  position: relative;
  background: linear-gradient(180deg, #fbfbff, var(--clue-bg));
  border: 1px solid var(--clue-edge);
  border-radius: 14px;
  padding: 18px 22px 18px 46px;
  text-align: center;
  font-weight: 500; font-size: 1.02rem; line-height: 1.5;
  min-height: 58px; color: var(--clue-ink);
  counter-increment: clue;
  box-shadow: 0 1px 2px rgba(25,22,52,0.03);
}
.clue::before {
  content: counter(clue);
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-body); font-size: 0.72rem; font-weight: 700;
  color: var(--indigo-ink);
  background: #eceafc; border: 1px solid #dcd9f6;
}
.clue.revealed { animation: clueIn .45s cubic-bezier(.22,1,.36,1); }
@keyframes clueIn {
  from { opacity: 0; transform: translateY(-8px) scale(.99); }
  to   { opacity: 1; transform: none; }
}
/* locked / unrevealed clue: shimmer placeholder */
.clue.blank {
  color: transparent; user-select: none;
  background: linear-gradient(180deg, #f6f6fb, #f0f0f8);
  border-style: dashed; border-color: #e6e5f2;
  box-shadow: none;
}
.clue.blank::before { color: #b9b6d6; background: #f0eff8; border-color: #e6e5f2; }
.clue.blank::after {
  content: ""; position: absolute; inset: 0; border-radius: 14px; overflow: hidden;
  background: linear-gradient(100deg, transparent 30%, rgba(139,92,246,0.06) 50%, transparent 70%);
  background-size: 220% 100%;
  animation: shimmer 2.6s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 140% 0; } 100% { background-position: -40% 0; } }

/* ---------------- Input row ---------------- */
.input-row { display: flex; gap: 10px; margin-bottom: 20px; }
.autocomplete-wrap { position: relative; flex: 1; }
#guessInput {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid #dcdbeb;
  border-radius: 12px;
  font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  background: #fff;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(25,22,52,0.05);
  transition: border-color .16s ease, box-shadow .16s ease;
}
#guessInput::placeholder { color: #a7a4c0; }
#guessInput:focus {
  border-color: var(--indigo);
  box-shadow: inset 0 1px 2px rgba(25,22,52,0.05), 0 0 0 4px rgba(99,102,241,0.16);
}
#guessInput:disabled { background: #f0eff5; color: var(--faint); }

.suggestions {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 15;
  background: #fff; border: 1px solid #e6e5f2; border-radius: 14px;
  box-shadow: 0 18px 40px -12px rgba(6,8,22,0.35);
  list-style: none; max-height: 244px; overflow-y: auto; padding: 6px;
  display: none;
}
.suggestions.open { display: block; }
.suggestions li {
  padding: 11px 14px; cursor: pointer; border-radius: 9px;
  font-size: 0.97rem; color: var(--ink); transition: background .12s ease;
}
.suggestions li:hover, .suggestions li.active { background: var(--clue-bg); color: var(--indigo-ink); }

/* ---------------- Buttons ---------------- */
.btn {
  border: none; border-radius: 12px; cursor: pointer;
  font-family: var(--font-body); font-size: 1rem; font-weight: 600; padding: 14px 24px;
  transition: transform .12s ease, box-shadow .16s ease, background .16s ease, opacity .16s ease;
}
.btn:disabled { opacity: 0.45; cursor: default; }
.btn:active:not(:disabled) { transform: translateY(1px); }

.btn-submit {
  color: #fff;
  background: linear-gradient(180deg, #7c7ff5, var(--indigo) 55%, #5457e6);
  box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 8px 18px -6px rgba(99,102,241,0.6);
}
.btn-submit:hover:not(:disabled) { transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.3) inset, 0 12px 24px -8px rgba(99,102,241,0.7); }
.btn-skip {
  color: var(--ink-soft); background: #fff; border: 1.5px solid #e0dfee;
}
.btn-skip:hover:not(:disabled) { background: #f7f6fd; border-color: #cfceea; color: var(--ink); }

/* ---------------- Guess rows ---------------- */
.guesses { display: flex; flex-direction: column; gap: 10px; }
.guess-row {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid #e7e6f2; border-radius: 26px;
  background: #faf9fe;
  padding: 11px 18px;
  color: var(--faint); font-weight: 600; font-size: 0.98rem;
  animation: clueIn .3s ease;
}
.guess-num {
  width: 25px; height: 25px; flex: none;
  border-radius: 50%; background: #e5e3f2; color: #7d79a0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700;
}
.guess-text { flex: 1; text-align: center; letter-spacing: 0.2px; }
.guess-mark { flex: none; width: 20px; text-align: center; font-weight: 700; }
.guess-row.wrong { background: var(--red-bg); border-color: var(--red-edge); color: var(--red); }
.guess-row.wrong .guess-num { background: #f4c4d0; color: var(--red); }
.guess-row.correct { background: var(--green-bg); border-color: var(--green-edge); color: var(--green); }
.guess-row.correct .guess-num { background: #a9e6c8; color: var(--green); }

.disclaimer {
  margin-top: 30px; text-align: center;
  color: var(--faint); font-size: 0.76rem; font-style: italic; line-height: 1.6;
}

/* ---------------- Archive ---------------- */
.archive-grid {
  margin-top: 24px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.archive-item {
  position: relative;
  background: linear-gradient(180deg, #fbfbff, var(--clue-bg));
  border: 1px solid var(--clue-edge); border-radius: 14px;
  padding: 15px 16px; cursor: pointer; text-align: left;
  transition: transform .14s ease, box-shadow .16s ease, border-color .16s ease;
}
.archive-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 26px -12px rgba(6,8,22,0.3);
  border-color: rgba(217,180,90,0.55);
}
.archive-num { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; color: var(--ink); }
.archive-date { color: var(--faint); font-size: 0.82rem; margin-top: 3px; font-weight: 500; }
.archive-done { font-size: 0.8rem; margin-top: 5px; font-weight: 600; }

/* ---------------- Modal ---------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(7, 9, 20, 0.62);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 44px 16px;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative;
  background: linear-gradient(180deg, #ffffff, var(--card));
  border-radius: 22px;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,0.6);
  width: 100%; max-width: 540px;
  padding: 50px 38px 38px;
  animation: modalIn .3s cubic-bezier(.22,1,.36,1);
}
.modal::before {
  content: ""; position: absolute; inset: 0; border-radius: 22px; padding: 1px; pointer-events: none;
  background: linear-gradient(160deg, rgba(217,180,90,0.6), rgba(165,180,252,0.4) 34%, rgba(255,255,255,0) 62%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-close {
  position: absolute; top: 16px; right: 18px;
  background: #f3f2f9; border: 1px solid #e6e5f2; cursor: pointer;
  width: 32px; height: 32px; border-radius: 9px;
  font-size: 1.3rem; line-height: 1; color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease, color .15s ease;
}
.modal-close:hover { background: #eceafc; color: var(--ink); }

.banner {
  border: 1px solid var(--gold-3);
  background: linear-gradient(180deg, #fffdf5, #fdf6e3);
  border-radius: 14px;
  padding: 18px 22px;
  text-align: center; font-weight: 600; font-size: 1.12rem; line-height: 1.42;
  margin-bottom: 24px; color: #6b5518;
}
.banner strong { font-weight: 800; }
.banner.win {
  border-color: var(--green-edge);
  background: linear-gradient(180deg, #f1fbf5, #e3f6ec);
  color: #0b6b48;
}

/* stats */
.stats-box {
  background: linear-gradient(180deg, #fbfbfe, #f5f4fb);
  border: 1px solid #ececf6; border-radius: 16px;
  padding: 26px 24px;
}
.stats-title {
  font-family: var(--font-display); font-weight: 600;
  text-align: center; font-size: 1.4rem; margin-bottom: 20px; color: var(--ink);
  letter-spacing: -0.2px;
}
.stat-tiles { display: flex; gap: 11px; justify-content: center; }
.stat-tile {
  background: #fff; border: 1px solid #ececf6; border-radius: 13px;
  padding: 16px 8px; flex: 1; max-width: 112px; text-align: center;
  box-shadow: 0 2px 6px -3px rgba(6,8,22,0.12);
}
.stat-value {
  font-family: var(--font-display); font-size: 2rem; font-weight: 600; line-height: 1;
  background: linear-gradient(160deg, var(--indigo), var(--indigo-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-label { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.8px; color: var(--faint);
  margin-top: 8px; text-transform: uppercase; line-height: 1.3; }

.dist-box { margin-top: 22px; background: #fff; border: 1px solid #ececf6; border-radius: 13px; padding: 20px; }
.dist-box h4 { font-family: var(--font-display); font-weight: 600; text-align: center; color: var(--ink);
  margin-bottom: 16px; font-size: 1.05rem; }
.dist-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.dist-label { width: 14px; text-align: right; font-weight: 700; color: var(--ink-soft); font-size: 0.9rem; }
.dist-bar-track { flex: 1; background: #efeef6; border-radius: 7px; height: 24px; overflow: hidden; }
.dist-bar {
  height: 100%; border-radius: 7px;
  background: linear-gradient(90deg, var(--indigo), var(--indigo-2));
  color: #fff; font-size: 0.78rem; font-weight: 700;
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 9px; min-width: 0;
  transition: width .5s cubic-bezier(.22,1,.36,1);
}
.dist-bar.empty { background: transparent; }

/* explain */
.btn-explain {
  display: block; margin: 24px auto 0;
  color: #fff; font-size: 1rem; padding: 14px 26px;
  background: linear-gradient(180deg, #2a2550, #1a1638);
  box-shadow: 0 8px 18px -8px rgba(26,22,56,0.7);
}
.btn-explain:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -8px rgba(26,22,56,0.8); }

.explain-box {
  margin-top: 20px;
  background: linear-gradient(180deg, #fbfbff, var(--clue-bg));
  border: 1px solid var(--clue-edge);
  border-radius: 16px; padding: 24px; text-align: left;
  animation: clueIn .3s ease;
}
.explain-box h4 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.35rem; color: var(--ink); margin-bottom: 4px; letter-spacing: -0.2px;
}
.explain-class {
  font-size: 0.72rem; font-weight: 700; color: var(--gold);
  text-transform: uppercase; letter-spacing: 1.4px; margin-bottom: 12px;
}
.explain-use { margin-bottom: 14px; line-height: 1.55; color: var(--ink); font-size: 0.97rem; }
.explain-use strong { color: var(--indigo-ink); }
.explain-box ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.explain-box li {
  position: relative; padding-left: 20px; line-height: 1.55; color: var(--ink-soft); font-size: 0.95rem;
}
.explain-box li::before {
  content: ""; position: absolute; left: 2px; top: 9px;
  width: 6px; height: 6px; border-radius: 50%;
  background: linear-gradient(160deg, var(--indigo), var(--gold-2));
}

/* promo — premium gold offer */
.promo {
  margin-top: 26px;
  background: linear-gradient(165deg, #fffdf6, #fdf4dd);
  border: 1px solid var(--gold-3);
  border-radius: 16px; padding: 24px; text-align: center;
  box-shadow: 0 10px 30px -14px rgba(185,143,55,0.5);
}
.promo-title { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem;
  color: #6b5518; margin-bottom: 8px; letter-spacing: -0.2px; }
.promo-text { font-size: 0.92rem; line-height: 1.55; color: #7a6224; margin-bottom: 18px; }
.promo-text strong { color: #5c4a12; }
.btn-promo {
  display: inline-block; text-decoration: none;
  color: #2a2107; font-weight: 700; font-size: 0.98rem; letter-spacing: 0.2px;
  padding: 13px 28px; border-radius: 11px;
  background: linear-gradient(180deg, var(--gold-3), var(--gold-2) 60%, var(--gold));
  box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 8px 18px -6px rgba(185,143,55,0.65);
  transition: transform .12s ease, box-shadow .16s ease;
}
.btn-promo:hover { transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset, 0 12px 26px -8px rgba(185,143,55,0.8); }

.btn-share {
  display: block; margin: 22px auto 0;
  color: #fff; font-size: 1rem; padding: 14px 28px;
  background: linear-gradient(180deg, #7c7ff5, var(--indigo) 55%, #5457e6);
  box-shadow: 0 8px 18px -8px rgba(99,102,241,0.6);
}
.btn-share:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -8px rgba(99,102,241,0.7); }

/* ---------- Guide sample ("play a piece of the guide") ---------- */
.sample {
  position: relative;
  margin-top: 24px;
  background: linear-gradient(165deg, #f7f6ff, #eef0ff);
  border-radius: 16px; padding: 22px 24px;
  box-shadow: 0 12px 34px -16px rgba(99,102,241,0.5);
  animation: clueIn .3s ease;
}
.sample::before {
  content: ""; position: absolute; inset: 0; border-radius: 16px; padding: 1.4px; pointer-events: none;
  background: linear-gradient(150deg, var(--gold-2), var(--indigo-2) 45%, var(--indigo) 80%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.sample-badge {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 0.72rem; margin-bottom: 12px;
}
.sample-icon { font-size: 1rem; }
.sample-tag {
  font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase;
  color: #2a2107;
  background: linear-gradient(180deg, var(--gold-3), var(--gold-2));
  padding: 3px 9px; border-radius: 20px;
}
.sample-source { color: var(--ink-soft); letter-spacing: 0.3px; }
.sample-source strong { color: var(--indigo-ink); font-weight: 700; }
.sample-front {
  font-family: var(--font-display); font-weight: 500; font-size: 1.12rem; line-height: 1.4;
  color: var(--ink); letter-spacing: -0.2px; margin-bottom: 16px;
}
.btn-reveal {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--indigo-ink); background: #fff;
  border: 1.5px solid #d7d6ef; font-size: 0.92rem; font-weight: 700;
  padding: 10px 18px; border-radius: 10px;
}
.btn-reveal:hover { background: #f5f4ff; border-color: var(--indigo-3); transform: translateY(-1px); }
.sample-reveal {
  background: #fff; border: 1px solid #e3e2f4; border-left: 3px solid var(--indigo);
  border-radius: 10px; padding: 15px 17px; margin-bottom: 16px;
  font-size: 0.96rem; line-height: 1.55; color: var(--ink);
  animation: clueIn .3s ease;
}
.sample-cta {
  display: block; width: 100%; text-align: center; text-decoration: none;
  color: #2a2107; font-weight: 800; font-size: 1rem; letter-spacing: 0.2px;
  padding: 14px 20px; border-radius: 12px;
  background: linear-gradient(180deg, var(--gold-3), var(--gold-2) 60%, var(--gold));
  box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 8px 18px -6px rgba(185,143,55,0.65);
  transition: transform .12s ease, box-shadow .16s ease;
}
.sample-cta:hover { transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset, 0 12px 26px -8px rgba(185,143,55,0.85); }

/* how to play */
.how-text { line-height: 1.65; color: var(--ink-soft); }
.how-text p { margin-bottom: 13px; }
.how-text strong { color: var(--ink); }

/* install modal */
.install-lead { text-align: center; color: var(--ink-soft); line-height: 1.6;
  margin-bottom: 18px; font-size: 0.98rem; }
.btn-install {
  display: block; margin: 0 auto 20px; color: #fff; font-size: 1rem; padding: 13px 30px;
  background: linear-gradient(180deg, #7c7ff5, var(--indigo) 55%, #5457e6);
  box-shadow: 0 8px 18px -8px rgba(99,102,241,0.6);
}
.btn-install:hover { transform: translateY(-1px); }
.install-steps {
  background: linear-gradient(180deg, #fbfbff, var(--clue-bg));
  border: 1px solid var(--clue-edge); border-radius: 14px;
  padding: 18px 20px 18px; margin-top: 14px;
}
.install-os {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--indigo-ink); margin-bottom: 10px;
}
.install-steps ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 9px; }
.install-steps li { line-height: 1.5; color: var(--ink); font-size: 0.95rem; }
.install-steps strong { color: var(--ink); font-weight: 700; }
.install-steps .ic {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 5px; margin: 0 1px;
  border: 1px solid var(--clue-edge); border-radius: 6px; background: #fff;
  font-size: 0.85rem; vertical-align: middle; color: var(--indigo-ink);
}
.drawer-install { color: var(--gold-3); }
.drawer-coffee { color: var(--gold-3); text-decoration: none; }

/* subtle "buy me a coffee" footer link on the game card */
.coffee-link {
  display: block; margin: 16px auto 0; text-align: center; text-decoration: none;
  font-size: 0.82rem; font-weight: 600; color: var(--gold);
  opacity: 0.85; transition: opacity .15s ease, color .15s ease;
}
.coffee-link:hover { opacity: 1; color: var(--gold-2); text-decoration: underline; }

.hidden { display: none !important; }

/* toast */
.toast {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%);
  background: rgba(18,16,40,0.94); color: #fff;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: 13px 24px; border-radius: 26px;
  font-weight: 600; font-size: 0.95rem; z-index: 50;
  border: 1px solid rgba(165,180,252,0.24);
  box-shadow: 0 12px 30px -8px rgba(0,0,0,0.5);
  animation: clueIn .28s ease;
}

/* scrollbars */
.suggestions::-webkit-scrollbar, .modal-overlay::-webkit-scrollbar { width: 10px; }
.suggestions::-webkit-scrollbar-thumb, .modal-overlay::-webkit-scrollbar-thumb {
  background: rgba(139,92,246,0.35); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }

/* focus visibility */
:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 600px) {
  main { padding: 28px 12px 56px; }
  .card { padding: 32px 22px 30px; }
  .card-title { font-size: 1.7rem; }
  .clue { font-size: 0.98rem; padding: 16px 18px 16px 44px; }
  .archive-grid { grid-template-columns: repeat(2, 1fr); }
  .input-row { flex-wrap: wrap; }
  .autocomplete-wrap { flex-basis: 100%; }
  .btn-submit, .btn-skip { flex: 1; }
  .modal { padding: 44px 22px 30px; }
  .stat-value { font-size: 1.7rem; }
}
