/* Turbo Tap Masters — wiki. Sits on top of home.css (tokens, .page, .nav, .foot, .stores).
   Pages are generated by scripts/wiki; bump WIKI_CSS_VERSION in scripts/wiki/html.ts when this file changes. */

.wiki { --accent: var(--gold); padding-top: 116px; }
.wiki__inner { max-width: 1080px; }
.wiki a { text-underline-offset: 3px; }

/* ── section tabs: the only wiki navigation a phone gets (.nav__links hides under 760px) ── */
.wiki-tabs { display: flex; gap: 8px; overflow-x: auto; margin: 0 calc(var(--pad) * -1) 28px; padding: 2px var(--pad) 6px; scrollbar-width: none; }
.wiki-tabs::-webkit-scrollbar { display: none; }
.wiki-tabs a {
  flex: none; min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg-2);
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px;
}
.wiki-tabs a:hover { border-color: var(--gold); color: var(--gold-hi); }
.wiki-tabs a[aria-current] { background: var(--gold); border-color: var(--gold); color: #221503; }

/* ── head: art plate + name, lead, facts ── */
.wiki-head { display: grid; gap: 28px; }
.wiki-head--art { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); align-items: start; }
.wiki-head h1 { font-size: clamp(38px, 5.4vw, 64px); }
.wiki-plate {
  position: relative; aspect-ratio: 1; border-radius: 28px; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background:
    radial-gradient(circle at 50% 58%, color-mix(in srgb, var(--accent) 46%, transparent) 0%, transparent 62%),
    linear-gradient(160deg, var(--bg-2), var(--bg-3));
  box-shadow: 0 24px 60px -28px color-mix(in srgb, var(--accent) 70%, transparent);
}
.wiki-plate img { width: 100%; height: 100%; object-fit: contain; padding: 7%; filter: drop-shadow(0 18px 16px rgba(0, 0, 0, 0.55)); }
.wiki-plate--scene img { object-fit: cover; padding: 0; filter: none; }
@media (max-width: 760px) {
  .wiki { padding-top: 88px; }
  .wiki-head--art { grid-template-columns: 1fr; }
  .wiki-plate { max-width: 300px; margin-inline: auto; width: 100%; }
}

.wiki-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 24px; }
.wiki-facts div { padding: 12px 14px; border-radius: 14px; background: var(--bg-2); border: 1px solid rgba(255, 255, 255, 0.07); }
.wiki-facts dt { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.wiki-facts dd { margin-top: 4px; font-size: 20px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.wiki-facts dd .st { display: block; margin-left: 0; font-size: 17px; line-height: 1.35; }
.wiki-facts dd small { font-size: 14px; font-weight: 600; color: var(--muted); }

.wiki-lore { margin-top: 40px; padding: 22px 26px; border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); background: var(--bg-2); border-radius: 16px; font-size: 19px; font-style: italic; color: var(--ink); }
.wiki .wiki-lore p { margin-top: 0; color: inherit; }
.wiki .wiki-note { color: var(--muted); font-size: 15px; }

/* ── tables: real <table>, scrolls inside its own box on a phone ── */
.wiki-table { margin-top: 20px; overflow-x: auto; border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 18px; background: var(--bg-3); }
.wiki-table table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.wiki-table th { text-align: left; padding: 14px 16px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 700; white-space: nowrap; border-bottom: 1px solid var(--line); }
.wiki-table td { padding: 11px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); vertical-align: middle; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wiki-table--wrap td { white-space: normal; }
.wiki-table tbody tr:last-child td { border-bottom: 0; }
.wiki-table tbody tr:hover td { background: rgba(255, 255, 255, 0.03); }
.wiki-table td:first-child { font-weight: 700; color: var(--ink); white-space: nowrap; }
.wiki-table a { color: var(--gold-hi); text-decoration: none; }
.wiki-table a:hover { text-decoration: underline; }
.wiki-who { display: inline-flex; align-items: center; gap: 12px; }
.wiki-who img { width: 48px; height: 48px; object-fit: contain; flex: none; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.5)); }
.wiki-dim { color: var(--muted); }

/* ── rarity and stats: the game's own colours ── */
.r { font-weight: 700; }
.r--common { color: #cbd5e1; }
.r--rare { color: #4ade80; }
.r--epic { color: #c084fc; }
.r--legendary { color: #fb923c; }
.st { font-weight: 700; white-space: nowrap; }
.st--atk { color: #fb923c; }
.st--def { color: #c084fc; }
.st--crit { color: #f472b6; }
.st--exp { color: #4ade80; }
.st--coins { color: #facc15; }
.st + .st { margin-left: 10px; }

/* ── loot: one tile per item ── */
.wiki-loot { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 18px; }
.wiki .wiki-loot { padding-left: 0; }
.wiki .wiki-loot li { margin-top: 0; }
.wiki-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; background: var(--bg-2); border: 1px solid rgba(255, 255, 255, 0.07); height: 100%; }
.wiki-item__art { flex: none; width: 64px; height: 64px; border-radius: 14px; display: grid; place-items: center; background: radial-gradient(circle, color-mix(in srgb, var(--glow, #cbd5e1) 38%, transparent), transparent 70%); }
.wiki-item__art img { width: 54px; height: 54px; object-fit: contain; }
.wiki-item--rare { --glow: #22c55e; }
.wiki-item--epic { --glow: #a855f7; }
.wiki-item--legendary { --glow: #f97316; }
.wiki-item strong { display: block; color: var(--ink); line-height: 1.25; }
.wiki-item span.wiki-item__stats { display: block; margin-top: 4px; font-size: 14px; }
.wiki-item__slot { display: block; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }

/* ── cards: hub tiles, biome and section grids ── */
.wiki-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-top: 22px; }
.wiki-grid--sections { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.wiki .wiki-grid { padding-left: 0; }
.wiki .wiki-grid li { margin-top: 0; }
.wiki-card { display: flex; flex-direction: column; height: 100%; border-radius: 20px; overflow: hidden; background: var(--bg-2); border: 1px solid rgba(255, 255, 255, 0.08); color: var(--ink); text-decoration: none; transition: transform 0.15s ease, border-color 0.15s ease; }
a.wiki-card:hover { transform: translateY(-3px); border-color: var(--card-accent, var(--gold)); color: var(--ink); }
.wiki-card__art { aspect-ratio: 16 / 10; background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--card-accent, var(--gold)) 40%, transparent), transparent 68%), var(--bg-3); }
.wiki-card__art img { width: 100%; height: 100%; object-fit: cover; }
.wiki-card__art--sprite img { object-fit: contain; padding: 8%; filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.5)); }
.wiki-card__text { padding: 14px 16px 16px; }
.wiki-card__text strong { display: block; font-family: var(--display); font-weight: 400; font-size: 22px; line-height: 1.1; }
.wiki-card__text span { display: block; margin-top: 6px; color: var(--muted); font-size: 14.5px; line-height: 1.4; }

/* ── index of single pages on the wiki home ── */
.wiki-index { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 18px; }
.wiki .wiki-index { padding-left: 0; }
.wiki .wiki-index li { margin-top: 0; }
.wiki-index a { display: block; height: 100%; padding: 14px 16px; border-radius: 16px; background: var(--bg-2); border: 1px solid rgba(255, 255, 255, 0.08); color: var(--ink); text-decoration: none; }
.wiki-index a:hover { border-color: var(--gold); }
.wiki-index strong { display: block; font-family: var(--display); font-weight: 400; font-size: 20px; }
.wiki-index span { display: block; margin-top: 4px; color: var(--muted); font-size: 14.5px; line-height: 1.4; }

/* ── monsters of a biome: small sprites in a row ── */
.wiki-roster { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin-top: 18px; }
.wiki .wiki-roster { padding-left: 0; }
.wiki .wiki-roster li { margin-top: 0; padding: 12px 8px 10px; border-radius: 16px; background: var(--bg-2); border: 1px solid rgba(255, 255, 255, 0.07); text-align: center; font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.25; }
.wiki-roster img { width: 72px; height: 72px; object-fit: contain; margin: 0 auto 6px; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.5)); }
.wiki-roster a { color: inherit; text-decoration: none; }
.wiki-roster a:hover { color: var(--gold-hi); }

.wiki-roster--masters { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
.wiki-roster--masters img { width: 96px; height: 96px; }
.wiki-roster small { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 600; }

/* ── previous / next ── */
.wiki-prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; }
.wiki-prevnext a { display: block; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg-2); color: var(--ink); text-decoration: none; }
.wiki-prevnext a:hover { border-color: var(--gold); }
.wiki-prevnext small { display: block; color: var(--muted); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; }
.wiki-prevnext strong { display: block; margin-top: 2px; font-family: var(--display); font-weight: 400; font-size: 22px; }
.wiki-prevnext .is-next { text-align: right; grid-column: 2; }

/* ── FAQ ── */
.wiki-faq details { margin-top: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-3); }
.wiki-faq summary { cursor: pointer; list-style: none; padding: 18px 52px 18px 22px; position: relative; font-weight: 700; font-size: 17px; min-height: 44px; }
.wiki-faq summary::-webkit-details-marker { display: none; }
.wiki-faq summary::after { content: ""; position: absolute; right: 22px; top: 24px; width: 10px; height: 10px; border-right: 2.5px solid var(--gold); border-bottom: 2.5px solid var(--gold); transform: rotate(45deg); transition: transform 0.15s ease; }
.wiki-faq details[open] summary::after { transform: rotate(-135deg); top: 28px; }
.wiki .wiki-faq details p { margin-top: 0; padding: 0 22px 20px; color: var(--muted); font-size: 16px; }

.wiki .page__updated { margin-top: 48px; }
