/* Mobile first. Base styles target phones; larger screens get a wider column. */

:root {
  --bg: #060b17;
  --bg-2: #0b1426;
  --panel: rgba(13, 24, 44, .78);
  --panel-solid: #0d182c;
  --line: rgba(200, 170, 110, .22);
  --line-soft: rgba(255, 255, 255, .08);
  --text: #f3ead7;
  --muted: #9d9789;
  --gold: #c8aa6e;
  --gold-2: #f0d48a;
  --gold-3: #785a28;
  --teal: #0ac8b9;
  --blue: #3b82f6;
  --red: #e84057;
  --good: #34c77b;
  --radius: 14px;
  --tap: 46px;
  --head: "Cinzel", "Trajan Pro", "Palatino Linotype", Georgia, serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}

/* Subtle hex grid + glow behind every page. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(10, 200, 185, .18), transparent 55%),
    radial-gradient(ellipse at 100% 100%, rgba(200, 170, 110, .12), transparent 50%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='98' viewBox='0 0 56 98'%3E%3Cpath d='M28 0l28 16v32L28 64 0 48V16zM28 64v34' fill='none' stroke='%23c8aa6e' stroke-opacity='.06'/%3E%3C/svg%3E"),
    var(--bg);
}

.backdrop {
  position: fixed;
  inset: -40px;
  z-index: -1;
  background-size: cover;
  background-position: center 20%;
  filter: blur(18px) saturate(1.2);
  opacity: .28;
  transition: background-image .6s ease;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
}

a { color: var(--gold-2); }
h1, h2 { margin: 0 0 .5rem; line-height: 1.2; overflow-wrap: anywhere; hyphens: auto; text-wrap: balance; }
h1 { font-family: var(--head); font-size: 2rem; }
h2 { font-family: var(--head); font-size: 1rem; color: var(--gold); text-transform: uppercase; letter-spacing: .1em; }
.muted { color: var(--muted); }
.eyebrow { margin: 0; color: var(--teal); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .18em; }

/* ---------- Shell ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  /* Flags left, site name centered, puzzle number right. */
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: .6rem;
  padding: .7rem 16px;
  padding-top: max(.7rem, env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(6, 11, 23, .96), rgba(6, 11, 23, .82));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.langs { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.flag {
  display: block;
  width: 26px;
  height: 18px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 4px;
  overflow: hidden;
  background: none;
  cursor: pointer;
  opacity: .55;
  filter: saturate(.7);
  transition: opacity .15s, transform .15s, filter .15s;
}
.flag svg { display: block; width: 100%; height: 100%; }
.flag:hover { opacity: .9; transform: translateY(-1px); }
.flag.active { opacity: 1; filter: none; border-color: var(--gold-2); box-shadow: 0 0 8px rgba(240, 212, 138, .6); }
.topbar .langs { grid-column: 1; justify-self: start; }
.topbar .brand { grid-column: 2; justify-self: center; }
.topbar-right { grid-column: 3; justify-self: end; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 0; }
.topbar .puzzle-tag { white-space: nowrap; }
.today { font-size: .72rem; font-weight: 600; letter-spacing: .04em; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

@media (max-width: 440px) {
  .brand-mark { display: none; }
  .brand { font-size: .85rem; letter-spacing: .08em; }
  .langs { gap: 3px; }
  .flag { width: 20px; height: 14px; }
  .puzzle-tag { padding: .2rem .5rem; font-size: .75rem; }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--head);
  font-weight: 700;
  letter-spacing: .12em;
  text-decoration: none;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fff3d0, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-mark {
  width: 18px;
  height: 18px;
  transform: rotate(45deg);
  border: 2px solid var(--gold);
  box-shadow: 0 0 10px rgba(240, 212, 138, .5), inset 0 0 6px rgba(10, 200, 185, .7);
}

.puzzle-tag {
  padding: .25rem .7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold-2);
  font-size: .85rem;
  font-weight: 700;
  background: rgba(200, 170, 110, .08);
}
/* The game name and puzzle number are not shown in the top bar (only the date). */
.puzzle-tag { display: none !important; }

.page { width: 100%; max-width: 640px; margin: 0 auto; padding: 16px; flex: 1; }
.loading { text-align: center; padding: 3rem 0; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 18px 16px;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: .78rem;
  color: var(--muted);
  background: rgba(6, 11, 23, .85);
}
.site-footer nav { display: flex; justify-content: center; gap: 1.25rem; margin-bottom: .5rem; }
.disclaimer { max-width: 560px; margin: 0 auto; }

/* ---------- Buttons ---------- */

button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }

/* Visible keyboard focus everywhere. */
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.primary {
  position: relative;
  display: block;
  width: 100%;
  min-height: var(--tap);
  margin-top: .5rem;
  padding: .85rem 1rem;
  border: 2px solid transparent;
  border-radius: 10px;
  background:
    linear-gradient(180deg, #1c5c6b, #0d3442) padding-box,
    linear-gradient(180deg, var(--gold-2), var(--gold-3)) border-box;
  color: #f7f1e1;
  font-family: var(--head);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 22px rgba(10, 200, 185, .25);
  transition: transform .12s, box-shadow .2s;
}
.primary:hover { box-shadow: 0 0 30px rgba(10, 200, 185, .45); }
.primary:active { transform: translateY(1px) scale(.99); }

/* ---------- Hub ---------- */

.hero { text-align: center; padding: 2rem 0 1.5rem; }
.hero h1 {
  font-size: clamp(2rem, 9vw, 3.2rem);
  letter-spacing: .08em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fff6dc 10%, var(--gold) 60%, var(--gold-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 18px rgba(200, 170, 110, .35));
}
.hero p { max-width: 420px; margin: .25rem auto 0; }

.hero-strip {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 1.25rem auto 0;
  max-width: 420px;
}
.hero-strip span {
  flex: 1;
  aspect-ratio: 3 / 5;
  border-radius: 10px;
  border: 1px solid var(--line);
  background-size: cover;
  background-position: center 15%;
  box-shadow: 0 10px 25px rgba(0, 0, 0, .5);
  animation: rise .7s both;
  animation-delay: calc(var(--i) * 80ms);
}
.hero-strip span:nth-child(odd) { transform: translateY(10px); }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }

.card {
  position: relative;
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: 1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
}
.card.live {
  border: 1px solid transparent;
  background:
    linear-gradient(120deg, rgba(13, 52, 66, .95), rgba(13, 24, 44, .95)) padding-box,
    linear-gradient(120deg, var(--gold-2), var(--gold-3), var(--teal)) border-box;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 0 24px rgba(10, 200, 185, .15);
  transition: transform .15s, box-shadow .2s;
}
.card.live:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0, 0, 0, .5), 0 0 34px rgba(10, 200, 185, .3); }
.card.soon { opacity: .5; filter: grayscale(.4); }
.card-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 12px;
  font-size: 1.6rem;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
}
.card-body { display: flex; flex-direction: column; gap: .2rem; flex: 1; font-size: .9rem; }
.card-body strong { font-family: var(--head); font-size: 1.1rem; letter-spacing: .04em; }
.badge {
  flex-shrink: 0;
  padding: .3rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: .72rem;
  color: var(--muted);
  white-space: nowrap;
}
.badge.play {
  border-color: var(--gold);
  color: #10141d;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ---------- Draft: header ---------- */

.round-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.progress { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.progress li {
  width: 22px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .12);
}
.progress li.done { background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.progress li.now { background: var(--teal); box-shadow: 0 0 10px var(--teal); animation: blink 1.4s infinite; }

.howto {
  margin: 0 0 1rem;
  padding: .75rem .9rem;
  border-left: 3px solid var(--teal);
  border-radius: 0 10px 10px 0;
  background: rgba(10, 200, 185, .07);
  font-size: .88rem;
  color: #cfd8dc;
}

/* ---------- Draft: teams ---------- */

.team-title { font-size: .78rem; margin-bottom: .45rem; }
.team-enemy .team-title { color: #ff8a9a; }
.team-mine .team-title { color: var(--gold-2); }

.team-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }

.slot {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  min-width: 0;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(180deg, #12203a, #0a1322);
  border: 1px solid var(--line-soft);
  text-align: center;
  isolation: isolate;
}
.slot.enemy { border-color: rgba(232, 64, 87, .55); box-shadow: 0 0 14px rgba(232, 64, 87, .15); }
.slot.mine.filled { border-color: var(--gold); box-shadow: 0 0 14px rgba(200, 170, 110, .25); }
.slot.mine.empty { border-style: dashed; border-color: rgba(200, 170, 110, .35); }

.slot .pic, .option .pic { position: absolute; inset: 0; z-index: -1; }
.pic img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; display: block; }
.pic .initials {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-family: var(--head);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold-2);
  background: radial-gradient(circle, #23395e, #0b1426);
}

.slot-shade, .option-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, transparent 45%, rgba(4, 8, 18, .92) 100%);
}

.slot-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: -1;
  color: rgba(200, 170, 110, .45);
}
.slot-empty .role-icon svg { width: 28px; height: 28px; }

.slot-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 4px 3px 5px;
}
.slot-role { font-size: .58rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.slot.enemy .slot-role { color: #ff9aa8; }
.slot.mine.filled .slot-role { color: var(--gold); }
.slot-name {
  max-width: 100%;
  font-size: .68rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.slot-hint { font-size: .58rem; font-weight: 800; color: var(--gold-2); text-transform: uppercase; letter-spacing: .04em; }

.slot.placeable {
  cursor: pointer;
  border: 1px solid var(--gold-2);
  border-style: solid;
  background: linear-gradient(180deg, rgba(200, 170, 110, .25), rgba(10, 19, 34, .9));
  animation: glow 1.3s ease-in-out infinite;
}
.slot.placeable.main-role {
  border-color: var(--good);
  background: linear-gradient(180deg, rgba(52, 199, 123, .3), rgba(10, 19, 34, .9));
  animation-name: glow-good;
}
.slot.placeable.main-role .slot-hint { color: #8ff0bb; }
.slot.placeable:active { transform: scale(.96); }
.slot.pop { animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); }

.offrole {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #d9822b;
  color: #1a1206;
  font-size: .7rem;
  font-weight: 900;
}

.vs {
  position: relative;
  display: flex;
  justify-content: center;
  margin: .55rem 0 .35rem;
}
.vs::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), rgba(232, 64, 87, .5), var(--line), transparent);
}
.vs span {
  position: relative;
  padding: .1rem .7rem;
  font-family: var(--head);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .2em;
  color: var(--gold-2);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
}

/* ---------- Draft: options ---------- */

.round {
  margin-top: 1.1rem;
  padding: 1rem .75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  scroll-margin-top: 70px;
}
.round-title { text-align: center; color: var(--gold-2); font-size: .95rem; margin-bottom: .8rem; }

.options { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.options.spinning { pointer-events: none; }

/* Slot machine reel shown over each option while it "rolls". */
.reel {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  background: #0a1322;
  box-shadow: inset 0 14px 18px -10px rgba(0, 0, 0, .9), inset 0 -14px 18px -10px rgba(0, 0, 0, .9);
}
.reel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(240, 212, 138, .8), transparent);
  box-shadow: 0 0 10px rgba(240, 212, 138, .8);
}
.reel-strip { display: flex; flex-direction: column; height: 100%; will-change: transform; }
.reel-item { flex: 0 0 100%; display: block; height: 100%; }
.reel-item img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; display: block; }
.option.landed { animation: land .45s ease-out; }

.option {
  position: relative;
  width: calc((100% - 16px) / 3 * .88);
  aspect-ratio: 3 / 4.3;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  isolation: isolate;
  background: #0a1322;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .45);
  transition: transform .18s, box-shadow .2s, border-color .2s;
}
.option:hover { transform: translateY(-3px); border-color: var(--gold); }
.option .pic img { transition: transform .4s; }
.option:hover .pic img { transform: scale(1.06); }
.option.selected {
  transform: translateY(-4px);
  border: 2px solid var(--gold-2);
  box-shadow: 0 0 0 2px rgba(240, 212, 138, .25), 0 0 26px rgba(240, 212, 138, .45), 0 12px 26px rgba(0, 0, 0, .5);
}

.option-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px;
}
.option-name {
  font-family: var(--head);
  font-weight: 700;
  font-size: .82rem;
  line-height: 1.1;
  text-shadow: 0 1px 6px #000;
}
.option-roles { display: flex; flex-wrap: wrap; gap: 2px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(10, 200, 185, .16);
  border: 1px solid rgba(10, 200, 185, .35);
  color: #bff5ef;
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.role-icon { display: inline-flex; }
.role-icon svg { width: 11px; height: 11px; fill: currentColor; }

.stats-line { display: flex; flex-wrap: wrap; gap: 3px; font-size: .58rem; font-weight: 700; }
.stats-line > span { padding: 1px 4px; border-radius: 5px; background: rgba(0, 0, 0, .55); color: #ddd; }
.dmg-physical { color: #ffb36b !important; }
.dmg-magic { color: #8cc3ff !important; }
.dmg-mixed { color: #d4b3ff !important; }
.pips { display: inline-block; width: 18px; height: 5px; margin-left: 3px; vertical-align: middle; border-radius: 3px;
  background: linear-gradient(90deg, var(--teal) var(--p), rgba(255,255,255,.2) var(--p)); }
.pips.p0 { --p: 0%; } .pips.p1 { --p: 33%; } .pips.p2 { --p: 66%; } .pips.p3 { --p: 100%; }
.curve-early { color: #ffd36b !important; }
.curve-late { color: #b6a2ff !important; }

.check {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #10141d;
  font-weight: 900;
  box-shadow: 0 0 12px rgba(240, 212, 138, .8);
  animation: pop .3s;
}

/* ---------- Result ---------- */

.result { text-align: center; padding: .5rem 0 1rem; }

.ring { position: relative; width: 200px; height: 200px; margin: .5rem auto; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); filter: drop-shadow(0 0 14px rgba(240, 212, 138, .35)); }
.ring-bg { fill: rgba(6, 11, 23, .7); stroke: rgba(255, 255, 255, .08); stroke-width: 10; }
.ring-fg { fill: none; stroke: url(#ringGrad); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1.2s cubic-bezier(.2, .8, .2, 1); }
.ring-label { position: absolute; inset: 0; display: flex; align-items: baseline; justify-content: center; padding-top: 68px; }
.ring-num {
  font-family: var(--head);
  font-size: 3.6rem;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(180deg, #fff6dc, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.ring-label small { color: var(--muted); font-size: 1rem; margin-left: 2px; }

.summary { font-family: var(--head); font-size: 1.1rem; margin: .4rem 0 .6rem; color: var(--gold-2); }

.grades { display: flex; justify-content: center; gap: 8px; }
.grade {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line-soft);
  font-size: 1.3rem;
  animation: flip .5s both;
  animation-delay: calc(400ms + var(--i) * 120ms);
}

.share { text-align: center; margin-bottom: 1.25rem; }
.share-status { min-height: 1.2em; margin: .5rem 0 0; color: var(--teal); font-weight: 600; }
.share-preview {
  display: none;
  text-align: left;
  white-space: pre-wrap;
  user-select: all;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .75rem;
}
.share-preview.visible { display: block; }

.stat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: .9rem; }
.tile {
  display: flex;
  flex-direction: column;
  padding: .6rem .3rem;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
}
.tile strong { font-family: var(--head); font-size: 1.4rem; color: var(--gold-2); }
.tile span { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.next { margin: .9rem 0 0; color: var(--muted); }
.countdown { font-variant-numeric: tabular-nums; color: var(--gold-2); font-size: 1.25rem; font-family: var(--head); }

.versus {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: .5rem .75rem;
  margin-bottom: 1.25rem;
}
.versus-head {
  display: flex;
  justify-content: space-between;
  font-family: var(--head);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: .3rem 0 .5rem;
}
.versus-head span:first-child { color: var(--gold-2); }
.versus-head span:last-child { color: #ff8a9a; }
.versus-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .5rem;
  padding: .4rem 0;
  border-top: 1px solid var(--line-soft);
}
.versus-row .side { display: flex; align-items: center; gap: .5rem; min-width: 0; font-size: .85rem; font-weight: 600; }
.versus-row .side.foe { justify-content: flex-end; text-align: right; }
.versus-row .pic-icon { position: relative; width: 40px; height: 40px; flex-shrink: 0; border-radius: 8px; overflow: hidden; }
.versus-row .me .pic-icon { border: 1px solid var(--gold); }
.versus-row .foe .pic-icon { border: 1px solid var(--red); }
.versus-row .name { display: flex; flex-direction: column; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.versus-row .off { font-style: normal; font-size: .62rem; color: #f0a35b; text-transform: uppercase; }
.vrole { color: var(--muted); }
.vrole svg { width: 16px; height: 16px; }

.breakdown { margin-bottom: 1rem; }
.bar-row {
  position: relative;
  margin: 0 -8px .35rem;
  padding: 6px 8px;
  border-radius: 10px;
  cursor: help;
  outline: none;
  transition: background .15s;
}
.bar-row:hover, .bar-row:focus { background: rgba(255, 255, 255, .04); }
.info {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  margin-left: 6px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: .62rem;
  font-weight: 800;
  font-style: italic;
  vertical-align: 1px;
}

/* Explanation pop-up: on hover (mouse) or focus (tap on phones). */
.explain {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: calc(100% - 4px);
  z-index: 20;
  padding: .7rem .85rem;
  border-radius: 10px;
  border: 1px solid var(--gold);
  background: rgba(8, 16, 32, .97);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .6), 0 0 18px rgba(200, 170, 110, .2);
  font-size: .82rem;
  line-height: 1.4;
  color: #e7dfcc;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .15s, transform .15s, visibility .15s;
  pointer-events: none;
}
.explain strong { display: block; margin-bottom: .2rem; color: var(--gold-2); font-family: var(--head); letter-spacing: .04em; }
.explain::after {
  content: "";
  position: absolute;
  left: 24px;
  top: 100%;
  border: 7px solid transparent;
  border-top-color: var(--gold);
}
.bar-row:hover .explain, .bar-row:focus .explain, .bar-row:focus-within .explain {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.bar-label { display: flex; justify-content: space-between; font-size: .9rem; font-weight: 600; }
.bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .07); overflow: hidden; margin: .3rem 0; }
.bar span {
  display: block;
  height: 100%;
  width: var(--w);
  border-radius: 4px;
  background: linear-gradient(90deg, var(--teal), var(--gold-2));
  box-shadow: 0 0 10px rgba(10, 200, 185, .5);
  animation: grow 1s both;
  animation-delay: calc(300ms + var(--i) * 90ms);
}
.bar-detail { margin: 0; font-size: .78rem; }

/* ---------- Match simulation ---------- */

.match {
  --win: var(--gold-2);
  --win-2: var(--gold);
  --delay: calc(var(--n) * 380ms + 250ms);
  position: relative;
  margin: .25rem 0 1.5rem;
  padding: 1.25rem .9rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(240, 212, 138, .16), transparent 60%),
    var(--panel);
  overflow: hidden;
}
.match.is-loss {
  --win: #ff6b7d;
  --win-2: #b3263a;
  border-color: rgba(232, 64, 87, .4);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(232, 64, 87, .2), transparent 60%),
    var(--panel);
}

.banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  animation: banner-in .7s cubic-bezier(.2, 1.4, .4, 1) both;
  animation-delay: var(--delay);
}
.banner-word {
  position: relative;
  font-family: var(--head);
  font-size: clamp(2.2rem, 11vw, 3.4rem);
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fffbe9 0%, var(--win) 45%, var(--win-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--win) 55%, transparent));
}
.banner-wing {
  position: relative;
  flex: 1;
  max-width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--win));
}
.banner-wing:last-child { background: linear-gradient(270deg, transparent, var(--win)); }
.banner-wing::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  border: 2px solid var(--win);
  background: var(--bg);
}
.banner-wing:first-child::after { right: -2px; }
.banner-wing:last-child::after { left: -2px; }

.scoreline {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: .6rem;
  margin: .6rem 0 .9rem;
  font-family: var(--head);
  font-variant-numeric: tabular-nums;
  animation: rise .5s both;
  animation-delay: calc(var(--delay) + 250ms);
}
.scoreline .ally, .scoreline .enemy { font-size: 1.8rem; font-weight: 700; }
.scoreline .dash { color: var(--muted); }
.scoreline .clock { margin-left: .4rem; padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.ally { color: #6fb6ff; }
.enemy { color: #ff7f8f; }

.mstats {
  display: grid;
  gap: 2px;
  margin-bottom: .9rem;
  animation: rise .5s both;
  animation-delay: calc(var(--delay) + 400ms);
}
.mstat { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .5rem; padding: .3rem .2rem; border-top: 1px solid var(--line-soft); font-size: .9rem; }
.mstat.head { border-top: 0; font-family: var(--head); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.mstat .mv { font-weight: 700; font-variant-numeric: tabular-nums; }
.mstat > :first-child { text-align: left; }
.mstat > :last-child { text-align: right; }
.mstat .ml { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; text-align: center; }

.lanes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-bottom: .9rem; animation: rise .5s both; animation-delay: calc(var(--delay) + 550ms); }
.lane {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: .4rem .1rem;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .03);
  font-size: .62rem;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 0;
}
.lane .role-icon svg { width: 14px; height: 14px; }
.lane em { font-style: normal; font-weight: 800; letter-spacing: .04em; }
.lane-won { border-color: rgba(52, 199, 123, .5); background: rgba(52, 199, 123, .1); }
.lane-won em { color: #6fe3a6; }
.lane-lost { border-color: rgba(232, 64, 87, .5); background: rgba(232, 64, 87, .1); }
.lane-lost em { color: #ff8a9a; }

.recap summary {
  cursor: pointer;
  font-family: var(--head);
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .4rem;
}
.timeline { list-style: none; margin: 0; padding: 0 0 0 .2rem; display: grid; gap: 4px; }
.ev {
  display: grid;
  grid-template-columns: 3.1rem 1.4rem 1fr;
  align-items: center;
  gap: .3rem;
  padding: .35rem .5rem;
  border-radius: 8px;
  border-left: 3px solid #4d9cff;
  background: rgba(77, 156, 255, .08);
  font-size: .84rem;
  animation: ev-in .35s both;
  animation-delay: calc(var(--i) * 380ms);
}
.ev-enemy { border-left-color: var(--red); background: rgba(232, 64, 87, .08); }
.ev-nexus { font-weight: 700; }
.ev-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .78rem; }
.ev-text { min-width: 0; }

@keyframes banner-in {
  0% { opacity: 0; transform: scale(1.6); filter: blur(6px); }
  100% { opacity: 1; transform: none; filter: none; }
}
@keyframes ev-in { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }

/* ---------- Guess games (ability, blur) ---------- */

.progress li.miss { background: var(--red); }

.clue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
  margin-bottom: 1rem;
  padding: 1.25rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.ability-frame {
  position: relative;
  width: 128px;
  height: 128px;
  padding: 6px;
  border-radius: 14px;
  background: linear-gradient(160deg, var(--gold-2), var(--gold-3));
  box-shadow: 0 0 30px rgba(240, 212, 138, .35), 0 12px 30px rgba(0, 0, 0, .55);
}
.ability-frame img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 9px;
  object-fit: cover;
  transition: filter .6s;
}
.ability-frame.gray img { filter: grayscale(1) contrast(1.1); }
.ability-name { margin: 0; font-family: var(--head); color: var(--gold-2); text-align: center; }

.hints { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 100%; }
.hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding: .5rem .3rem;
  border-radius: 10px;
  border: 1px solid rgba(10, 200, 185, .4);
  background: rgba(10, 200, 185, .08);
  font-size: .8rem;
  text-align: center;
  animation: pop .35s;
}
.hint strong { color: #bff5ef; overflow-wrap: anywhere; }
.hint-label { font-size: .62rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.hint.locked { border-style: dashed; border-color: var(--line-soft); background: none; color: var(--muted); font-size: .72rem; animation: none; justify-content: center; }

.blur-frame {
  position: relative;
  width: min(100%, 240px);
  aspect-ratio: 308 / 560;
  max-width: 100%;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--gold);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .55);
  background: #0a1322;
}
.blur-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.12);
  transition: filter .8s ease, transform .8s ease;
}
.blur-frame img.clear { transform: none; }
.blur-level { margin: 0; font-size: .82rem; text-align: center; }
.blur-badge { position: absolute; top: 8px; left: 8px; z-index: 2; padding: 2px 10px; border-radius: 999px; background: rgba(6, 11, 23, .8); border: 1px solid var(--line); color: var(--gold-2); font-size: .72rem; font-weight: 700; }

.guess-box { position: relative; margin-bottom: .75rem; }
#guess-input {
  width: 100%;
  min-height: var(--tap);
  padding: .75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--gold);
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}
#guess-input:focus { outline: none; box-shadow: 0 0 0 3px rgba(240, 212, 138, .3); }
.suggestions { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; }
.suggestion {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  padding: .4rem .6rem;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: var(--panel);
  text-align: left;
  cursor: pointer;
}
.suggestion:hover, .suggestion:focus { border-color: var(--gold); outline: none; }
.pic-icon { position: relative; display: inline-block; width: 34px; height: 34px; flex-shrink: 0; border-radius: 6px; overflow: hidden; }
.pic-icon img { width: 100%; height: 100%; display: block; }

.guesses { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.guess {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .4rem .6rem;
  border-radius: 10px;
  border: 1px solid rgba(232, 64, 87, .45);
  background: rgba(232, 64, 87, .08);
  font-weight: 600;
}
.guess.right { border-color: rgba(52, 199, 123, .6); background: rgba(52, 199, 123, .12); }
.guess-name { flex: 1; min-width: 0; }
.guess-mark { font-weight: 900; color: #ff8a9a; }
.guess.right .guess-mark { color: #6fe3a6; }
.guess.shake { animation: shake .4s; }

.guess-result {
  margin-bottom: 1rem;
  padding: 1.1rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--gold);
  background: radial-gradient(ellipse at 50% 0%, rgba(240, 212, 138, .16), transparent 60%), var(--panel);
  text-align: center;
}
.guess-result.is-loss { border-color: rgba(232, 64, 87, .5); background: radial-gradient(ellipse at 50% 0%, rgba(232, 64, 87, .18), transparent 60%), var(--panel); }
.result-word {
  margin: 0 0 .75rem;
  font-family: var(--head);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fffbe9, var(--gold-2) 50%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: banner-in .6s cubic-bezier(.2, 1.4, .4, 1) both;
}
.is-loss .result-word { background: linear-gradient(180deg, #ffe3e7, #ff6b7d 50%, #b3263a); -webkit-background-clip: text; background-clip: text; }
.reveal { display: flex; align-items: center; justify-content: center; gap: .9rem; margin-bottom: .75rem; text-align: left; }
.reveal p { margin: 0; }
.reveal-icon { width: 64px; height: 64px; border-radius: 12px; border: 2px solid var(--gold); }
.reveal-name { font-family: var(--head); font-size: 1.4rem; color: var(--gold-2); }

@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- Hub: today's outcome on each card ---------- */

.card.played > .card-icon,
.card.played > .card-body,
.card.played > .badge { filter: blur(1px) saturate(.75); opacity: .85; }
.card-veil { position: absolute; inset: 0; pointer-events: none; }
.card.won { border-color: transparent; background: linear-gradient(120deg, rgba(20, 70, 45, .95), rgba(13, 24, 44, .95)) padding-box, linear-gradient(120deg, #6fe3a6, #1f7a4c) border-box; }
.card.lost { border-color: transparent; background: linear-gradient(120deg, rgba(80, 20, 30, .95), rgba(13, 24, 44, .95)) padding-box, linear-gradient(120deg, #ff8a9a, #8c1f2e) border-box; }
.card.won .card-veil { background: rgba(52, 199, 123, .14); }
.card.lost .card-veil { background: rgba(232, 64, 87, .14); }
.card-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  font-size: 1.7rem;
  font-weight: 900;
  color: #fff;
  animation: pop .45s cubic-bezier(.2, 1.6, .4, 1);
}
.card.won .card-mark { background: radial-gradient(circle, #3fd68a, #1f8a54); box-shadow: 0 0 22px rgba(52, 199, 123, .8); }
.card.lost .card-mark { background: radial-gradient(circle, #ff5d72, #a3182c); box-shadow: 0 0 22px rgba(232, 64, 87, .8); }
.card-streak {
  position: absolute;
  top: 8px;
  right: 10px;
  padding: .15rem .55rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffb347, #ff5e1a);
  color: #2a0d00;
  font-weight: 900;
  font-size: .85rem;
  box-shadow: 0 0 14px rgba(255, 120, 40, .7);
  animation: flicker 1.6s ease-in-out infinite;
}
@keyframes flicker { 0%, 100% { box-shadow: 0 0 10px rgba(255, 120, 40, .6); } 50% { box-shadow: 0 0 20px rgba(255, 160, 60, .95); } }

/* ---------- Bingo ---------- */

.lives { display: flex; gap: 3px; font-size: 1.05rem; }
.heart { color: #ff5d72; text-shadow: 0 0 8px rgba(255, 93, 114, .6); }
.heart.lost { opacity: .5; text-shadow: none; }

.bingo-current {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: .8rem;
  margin-bottom: .6rem;
  padding: .7rem;
  border-radius: var(--radius);
  border: 1px solid var(--gold);
  background: radial-gradient(ellipse at 0% 50%, rgba(240, 212, 138, .14), transparent 60%), var(--panel);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .45);
  animation: deal .4s cubic-bezier(.2, 1.2, .4, 1);
}
.bingo-art { position: relative; display: block; width: 64px; aspect-ratio: 3 / 4.2; border-radius: 10px; overflow: hidden; border: 1px solid var(--gold-2); }
.bingo-art .pic { position: absolute; inset: 0; }
.bingo-who { min-width: 0; }
.bingo-who p { margin: 0; }
.bingo-name { font-family: var(--head); font-size: 1.2rem; font-weight: 700; color: var(--gold-2); line-height: 1.15; overflow-wrap: anywhere; }
.bingo-ask { font-size: .82rem; }
.skip {
  min-height: 40px;
  padding: .45rem .6rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .72rem;
  cursor: pointer;
}
.skip:hover { border-color: var(--gold); }

.bingo-feedback { margin: 0 0 .6rem; padding: .45rem .7rem; border-radius: 8px; font-size: .86rem; font-weight: 600; animation: rise .3s both; }
.fb-right { background: rgba(52, 199, 123, .12); color: #8ff0bb; }
.fb-wrong { background: rgba(232, 64, 87, .12); color: #ff9aa8; }
.fb-skip { background: rgba(255, 255, 255, .05); color: var(--muted); }

.bingo-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  aspect-ratio: 1;
  min-width: 0;
  padding: 6px 4px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, #142540, #0b1426);
  color: var(--text);
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}
button.cell { cursor: pointer; transition: transform .12s, border-color .15s, box-shadow .15s; }
button.cell:hover { border-color: var(--gold); box-shadow: 0 0 14px rgba(240, 212, 138, .35); }
button.cell:active { transform: scale(.96); }
.cell-group { font-size: .58rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); }
.cell-value { font-family: var(--head); font-weight: 700; font-size: .92rem; line-height: 1.15; color: var(--gold-2); overflow-wrap: anywhere; }
.cell-pic { position: absolute; inset: 0; z-index: -2; }
.cell-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cell-shade { position: absolute; inset: 0; z-index: -1; }
.cell.filled { border-color: #3fd68a; box-shadow: 0 0 14px rgba(52, 199, 123, .35); }
.cell.filled .cell-shade { background: linear-gradient(180deg, rgba(6, 30, 18, .55), rgba(6, 30, 18, .92)); }
.cell.filled .cell-group { color: #8ff0bb; }
.cell-name { font-size: .7rem; font-weight: 700; color: #fff; }
.cell.flash-right { animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); }
.cell.flash-wrong { animation: shake .4s; border-color: var(--red); box-shadow: 0 0 16px rgba(232, 64, 87, .6); }

@keyframes deal { from { opacity: 0; transform: scale(.94) rotate(1deg); } to { opacity: 1; transform: none; } }

/* ---------- How to play, home banner, stats, share image ---------- */

.help-btn {
  width: 20px;
  height: 20px;
  margin-left: 4px;
  font-size: .75rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: rgba(200, 170, 110, .1);
  color: var(--gold-2);
  font-weight: 900;
  cursor: pointer;
}

.howto-dialog {
  width: min(92vw, 460px);
  padding: 1.4rem 1.3rem 1.2rem;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  background: radial-gradient(ellipse at 50% 0%, rgba(10, 200, 185, .16), transparent 60%), var(--panel-solid);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .7);
}
.howto-dialog::backdrop { background: rgba(3, 6, 14, .75); backdrop-filter: blur(3px); }
.howto-dialog h2 { color: var(--gold-2); font-size: 1.3rem; }
.howto-dialog p { line-height: 1.55; color: #ddd6c6; }
.howto-dialog[open] { animation: pop .3s; }

.day-banner {
  display: grid;
  justify-items: center;
  gap: .25rem;
  margin: 0 0 1.4rem;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  text-align: center;
}
.day-banner p { margin: 0; }
.day-banner.all-done { border-color: var(--gold); background: radial-gradient(ellipse at 50% 0%, rgba(240, 212, 138, .18), transparent 65%), var(--panel); }
.day-score { font-size: 1.5rem; letter-spacing: .1em; }
.day-wins { font-family: var(--head); color: var(--gold-2); font-size: 1.05rem; }
.day-next { color: var(--muted); }
.banner-links { display: flex; gap: 1.2rem; justify-content: center; margin: .35rem 0 0; }
.stats-link { margin-top: .35rem; font-size: .85rem; font-weight: 700; text-decoration: none; }

.stats-page h1 { color: var(--gold-2); }
.stat-card {
  display: grid;
  gap: .6rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
}
.stat-card h2 { margin: 0; }
.stat-card .stat-tiles { grid-template-columns: repeat(4, 1fr); margin: 0; }
.stat-card .badge { justify-self: start; text-decoration: none; }
.stat-avg, .days-legend { margin: 0; font-size: .8rem; }
.days { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; }
.day { aspect-ratio: 1; border-radius: 4px; background: rgba(255, 255, 255, .06); font-size: .55rem; font-weight: 800; display: grid; place-items: center; color: #08130d; }
.day-won { background: #34c77b; }
.day-lost { background: #e84057; color: #2a0710; }

.secondary {
  display: block;
  width: 100%;
  min-height: var(--tap);
  margin-top: .5rem;
  padding: .7rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold-2);
  font-weight: 700;
  cursor: pointer;
}
.secondary:hover { background: rgba(200, 170, 110, .1); }
.share-image-out img { display: block; width: 100%; max-width: 360px; margin: .75rem auto .3rem; border-radius: 10px; border: 1px solid var(--line); }
.reveal-skin { color: var(--muted); font-size: .85rem; }

.howto-bar { width: 100%; max-width: 640px; margin: 0 auto; padding: 10px 16px 0; display: flex; justify-content: center; }
.howto-open {
  padding: .35rem .9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(10, 200, 185, .08);
  color: #bff5ef;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
}
.howto-open:hover { border-color: var(--teal); }
.howto-bar + .page { padding-top: 10px; }

.bingo-actions { display: grid; gap: 6px; width: 104px; }
.bingo-actions button { width: 100%; white-space: normal; line-height: 1.15; }
.hint-btn {
  min-height: 36px;
  padding: .35rem .7rem;
  border-radius: 10px;
  border: 1px solid rgba(240, 212, 138, .5);
  background: rgba(240, 212, 138, .1);
  color: var(--gold-2);
  font-weight: 800;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  cursor: pointer;
}
.hint-btn:disabled { opacity: .35; cursor: default; }
.cell.hinted { border-color: var(--gold-2); box-shadow: 0 0 0 2px var(--gold-2) inset, 0 0 18px rgba(240, 212, 138, .7); animation: glow 1.2s ease-in-out infinite; }
.fb-hint { background: rgba(240, 212, 138, .12); color: var(--gold-2); }

.not-found { text-align: center; padding-top: 3rem; }
.not-found-code { margin: 0; font-family: var(--head); font-size: 5rem; color: var(--gold-2); line-height: 1; }
.not-found .badge { text-decoration: none; display: inline-block; margin-top: 1rem; }

/* ---------- Connections ---------- */

.conn-hint { margin: 0; font-size: .8rem; text-align: right; }
.conn-solved { display: grid; gap: 6px; margin-bottom: 8px; }
.conn-bar {
  display: grid;
  gap: 2px;
  padding: .6rem .8rem;
  border-radius: 12px;
  text-align: center;
  color: #10141d;
  animation: pop .4s cubic-bezier(.2, 1.4, .4, 1);
}
.conn-bar strong { font-family: var(--head); font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; }
.conn-bar span { font-size: .8rem; font-weight: 600; }
.conn-bar.tier-0 { background: #e3b341; }
.conn-bar.tier-1 { background: #3fae5a; }
.conn-bar.tier-2 { background: #4f8fd6; }
.conn-bar.tier-3 { background: #9b6ad6; }
.conn-bar.missed { opacity: .55; }

.conn-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.conn-grid.shake { animation: shake .4s; }
.conn-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 7px 3px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, #142540, #0b1426);
  color: var(--text);
  cursor: pointer;
  transition: transform .12s, border-color .15s, background .15s;
}
.conn-tile .pic-icon { width: 44px; height: 44px; border-radius: 8px; }
.conn-tile span { font-size: .68rem; font-weight: 700; line-height: 1.15; max-width: 100%; overflow-wrap: anywhere; text-align: center; }
.conn-tile.selected { border-color: var(--gold-2); background: linear-gradient(160deg, #4a3d1a, #2a2412); transform: translateY(-2px); box-shadow: 0 0 14px rgba(240, 212, 138, .45); }
.conn-tile:active { transform: scale(.96); }

.conn-controls { margin-top: .6rem; }
.conn-mistakes { margin: 0; text-align: center; color: var(--muted); font-size: .85rem; }
.conn-mistakes .dot { display: inline-block; width: 10px; height: 10px; margin: 0 2px; border-radius: 50%; background: var(--gold-2); vertical-align: middle; }
.conn-mistakes .dot.used { background: rgba(255, 255, 255, .15); }
.conn-msg { min-height: 1.3em; margin: .35rem 0; text-align: center; color: #ff9aa8; font-weight: 600; font-size: .9rem; }
.conn-buttons { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 6px; }
.conn-buttons button { margin-top: 0; min-height: 44px; padding: .5rem; font-size: .8rem; }
.conn-buttons .primary:disabled { opacity: .45; }
.conn-history { display: grid; justify-content: center; gap: 2px; margin: .5rem 0; font-size: 1.2rem; letter-spacing: .1em; }

/* ---------- Classic ---------- */

.cl-table-wrap { overflow-x: auto; margin: .6rem -4px 0; padding: 0 4px 6px; -webkit-overflow-scrolling: touch; }
.cl-table { display: grid; gap: 4px; min-width: 560px; }
.cl-row { display: grid; grid-template-columns: 74px repeat(7, minmax(0, 1fr)); gap: 4px; }
.cl-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  padding: 4px 3px;
  border-radius: 8px;
  font-size: .66rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
  color: #fff;
}
.cl-head .cl-cell { min-height: 0; padding: 2px; background: none; color: var(--muted); font-size: .6rem; text-transform: uppercase; letter-spacing: .04em; }
.cl-champ { position: sticky; left: 0; z-index: 1; background: var(--panel-solid); border: 1px solid var(--line-soft); }
.cl-head .cl-champ { background: var(--bg); }
.cl-champ .pic-icon { width: 30px; height: 30px; }
.cl-name { font-size: .6rem; }
.st-right { background: #2f9e5e; }
.st-partial { background: #c9932b; }
.st-wrong { background: #b5323f; }
.cl-arrow { font-size: .8rem; line-height: 1; }
.cl-empty .cl-cell:not(.cl-champ) { background: rgba(255, 255, 255, .04); border: 1px dashed var(--line); color: var(--muted); font-size: 1rem; }
.cl-q { font-family: var(--head); font-size: 1.2rem; color: var(--gold-2); }
.cl-head .cl-cell { color: var(--gold); }

/* Phones: all 7 traits fit on screen, no sideways scrolling. */
@media (max-width: 520px) {
  .cl-table { min-width: 0; gap: 3px; }
  .cl-row { grid-template-columns: 36px repeat(7, minmax(0, 1fr)); gap: 3px; }
  .cl-cell { min-height: 46px; padding: 3px 1px; font-size: .56rem; border-radius: 6px; hyphens: auto; }
  .cl-head .cl-cell { font-size: .5rem; letter-spacing: 0; }
  .cl-champ { padding: 2px; }
  .cl-champ .pic-icon { width: 30px; height: 30px; }
  .cl-name { display: none; }
  .cl-head .cl-champ { font-size: 0; }
  .cl-head .cl-champ::after { content: '🔎'; font-size: .8rem; }
}
.cl-row.new .cl-cell:not(.cl-champ) { animation: flip .45s both; animation-delay: calc(var(--i) * 120ms); }
.cl-legend { margin: .4rem 0 0; font-size: .72rem; text-align: center; }
.cl-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 3px 0 6px; vertical-align: -1px; }

/* ---------- Archive, yesterday's answer ---------- */

.archive-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: .7rem;
  padding: .55rem .8rem;
  border-radius: 10px;
  border: 1px dashed var(--gold);
  background: rgba(200, 170, 110, .08);
  font-size: .82rem;
}
.archive-banner a { font-weight: 700; }
.yesterday { margin: 1rem 0 0; text-align: center; color: var(--muted); font-size: .85rem; }
.yesterday strong { color: var(--gold-2); }

.archive-page h1 { color: var(--gold-2); }
.arch-game { margin-bottom: 1rem; padding: .9rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); }
.arch-game h2 { margin-bottom: .6rem; }
.arch-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.arch-day {
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: .4rem .2rem;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: var(--bg-2);
  color: var(--text);
  text-decoration: none;
  font-size: .72rem;
}
.arch-day strong { font-family: var(--head); font-size: .95rem; color: var(--gold-2); }
.arch-day:hover { border-color: var(--gold); }
.arch-day.won { border-color: rgba(52, 199, 123, .6); }
.arch-day.lost { border-color: rgba(232, 64, 87, .6); }
.arch-day.today { border-color: var(--teal); }

/* ---------- Draft: best possible team ---------- */

.best-team { margin-bottom: 1.25rem; padding: .9rem; border-radius: var(--radius); border: 1px solid var(--teal); background: rgba(10, 200, 185, .06); }
.best-team h2 { color: #bff5ef; }
.best-compare { display: flex; justify-content: center; gap: 1.2rem; margin: .2rem 0 .7rem; font-family: var(--head); }
.best-compare strong { font-size: 1.5rem; color: var(--gold-2); }
.best-compare span { display: grid; justify-items: center; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.best-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.best-pick { display: grid; justify-items: center; gap: 2px; font-size: .62rem; text-align: center; min-width: 0; }
.best-pick .pic-icon { width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--teal); }
.best-pick b { font-size: .66rem; overflow-wrap: anywhere; }
.best-pick em { font-style: normal; color: var(--muted); text-transform: uppercase; }
.best-pick.same .pic-icon { border-color: var(--good); box-shadow: 0 0 8px rgba(52, 199, 123, .6); }

/* ---------- Draft: clearer layout ---------- */

.team-enemy .team-grid { gap: 4px; }
.enemy-slot {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 0;
  padding: 5px 2px;
  border-radius: 10px;
  border: 1px solid rgba(232, 64, 87, .45);
  background: rgba(232, 64, 87, .06);
  text-align: center;
}
.enemy-slot .pic-icon { position: relative; width: 38px; height: 38px; border-radius: 8px; overflow: hidden; }
.enemy-slot .slot-role { color: #ff9aa8; }
.enemy-slot .slot-name { font-size: .64rem; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-mine .slot { aspect-ratio: 3 / 3.6; }
.vs { margin: .35rem 0 .2rem; }

.option-icons { display: flex; gap: 4px; color: #bff5ef; }
.option-icons .role-icon svg { width: 14px; height: 14px; filter: drop-shadow(0 1px 2px #000); }
.option-name { font-size: .88rem; }

.pick-info {
  display: grid;
  gap: .4rem;
  margin-top: .7rem;
  padding: .6rem .7rem;
  border-radius: 10px;
  border: 1px solid var(--gold);
  background: rgba(200, 170, 110, .08);
  animation: rise .25s both;
}
.pick-info strong { font-family: var(--head); color: var(--gold-2); }
.pick-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.pick-chips .chip { font-size: .68rem; background: rgba(0, 0, 0, .35); border-color: var(--line); color: var(--text); }
.pick-hint { margin: .6rem 0 0; text-align: center; font-size: .78rem; }

.hero-score { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: .4rem; }
.hero-score .ring { width: 118px; height: 118px; margin: 0; flex-shrink: 0; }
.hero-score .ring-label { padding-top: 40px; }
.hero-score .ring-num { font-size: 2.2rem; }
.hero-score .ring-label small { font-size: .75rem; }
.hero-text { min-width: 0; text-align: left; }
.hero-text .summary { font-size: .95rem; margin: .2rem 0 .5rem; }
.hero-text .grades { justify-content: flex-start; gap: 5px; }
.hero-text .grade { width: 30px; height: 30px; font-size: 1rem; }
.match.hero { margin-bottom: 1rem; }

.share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: start; }
.share-row .primary, .share-row .secondary { margin-top: 0; min-height: 48px; font-size: .82rem; }
.share-row .share-image { display: contents; }
.share-row .share-image-out { grid-column: 1 / -1; }

.accs { display: grid; gap: 8px; margin: 1rem 0; }
.acc { border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.acc summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .6rem;
  padding: .8rem .9rem;
  cursor: pointer;
  list-style: none;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "▾"; color: var(--gold); transition: transform .2s; }
.acc[open] summary::after { transform: rotate(180deg); }
.acc-title { font-family: var(--head); font-size: .9rem; letter-spacing: .05em; text-transform: uppercase; color: var(--gold-2); }
.acc-meta { margin-left: auto; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.acc-body { padding: 0 .9rem .9rem; }
.acc-body .versus, .acc-body .best-team, .acc-body .breakdown { margin: 0; border: 0; padding: 0; background: none; }
.acc-body .ev { animation: none; }

/* Long words (German, Portuguese) must wrap instead of widening the page. */
.card-body { min-width: 0; overflow-wrap: anywhere; }
.stat-tiles, .stat-card .stat-tiles { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.tile { min-width: 0; }
.tile span { overflow-wrap: anywhere; hyphens: auto; }

/* ---------- Prose (privacy) ---------- */

.prose h1 { color: var(--gold-2); }
.prose h2 { margin-top: 1.5rem; }
.prose p { color: #ddd3c0; }

/* ---------- Animations ---------- */

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(.8); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 6px rgba(240, 212, 138, .3); } 50% { box-shadow: 0 0 18px rgba(240, 212, 138, .8); } }
@keyframes glow-good { 0%, 100% { box-shadow: 0 0 6px rgba(52, 199, 123, .3); } 50% { box-shadow: 0 0 18px rgba(52, 199, 123, .85); } }
@keyframes blink { 50% { opacity: .45; } }
@keyframes flip { from { opacity: 0; transform: rotateX(90deg); } to { opacity: 1; transform: none; } }
@keyframes grow { from { width: 0; } }
@keyframes land { 0% { box-shadow: 0 0 0 0 rgba(240, 212, 138, .9); } 100% { box-shadow: 0 0 0 14px rgba(240, 212, 138, 0), 0 8px 20px rgba(0, 0, 0, .45); } }

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

/* ---------- Larger screens ---------- */

@media (min-width: 600px) {
  .page { padding: 24px; }
  .team-grid { gap: 10px; }
  .slot-name { font-size: .8rem; }
  .slot-role { font-size: .66rem; }
  .option { width: calc((100% - 32px) / 5); }
  .option-name { font-size: .9rem; }
  .round { padding: 1.25rem; }
}
