/* Mecha Matsuri pages (/games/mechamatsuri/).
   The game's own look: a purple neon night, chunky pills and cards with thick ink outlines and a hard
   drop shadow, yellow "MECHA" over cyan "MATSURI". Colours come from the game's Theme.swift and
   GAME_DESIGN.md. Independent of css/styles.css. */

@font-face { font-family: "Lilita One"; font-weight: 400; font-display: swap; src: url("/assets/fonts/LilitaOne-400-latin.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-weight: 400 600; font-display: swap; src: url("/assets/fonts/Fredoka-400-600-latin.woff2") format("woff2"); }

:root {
  --ink: #1b1030;
  --night: #24145a;
  --plum: #34245e;
  --plum-2: #3f2d72;
  --text: #f4f0ff;
  --dim: #c9bdf2;
  --line: rgba(230, 222, 255, 0.22);
  --yellow: #ffd84a;
  --pink: #ff3b8a;
  --cyan: #34f5ff;
  --purple: #9b6bff;
  --orange: #ff6a2a;
  --display: "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Fredoka", ui-rounded, system-ui, -apple-system, sans-serif;
  --shadow: 0 6px 0 var(--ink);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body { margin: 0; color: var(--text); font: 400 17px/1.55 var(--body);
  background-color: var(--ink);
  background-image: radial-gradient(1200px 600px at 80% -10%, #3a1d7a 0%, transparent 60%),
                    linear-gradient(180deg, var(--night) 0%, var(--ink) 900px);
  background-repeat: no-repeat; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cyan); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--display); font-weight: 400; text-wrap: balance; margin: 0; letter-spacing: 0.01em; }
h1 { font-size: clamp(2.6rem, 7vw, 4.4rem); line-height: 0.95; }
h2 { font-size: clamp(1.7rem, 4vw, 2.2rem); line-height: 1.05; }
h3 { font-size: 1.35rem; line-height: 1.15; }
p { margin: 0; max-width: 68ch; }
.eyebrow { font: 600 0.8rem/1.3 var(--body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan); }
.dim { color: var(--dim); }
.lede { font-size: 1.15rem; color: var(--dim); }
.jp { font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif; font-weight: 700; }

/* Logo lockup, as on the title screen */
.logo { display: grid; line-height: 0.9; transform: rotate(-3deg); transform-origin: left center; width: max-content; max-width: 100%;
  text-shadow: 0 5px 0 var(--ink), 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 -3px 0 var(--ink); }
.logo span:first-child { color: var(--yellow); }
.logo span:last-child { color: var(--cyan); }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--yellow); color: var(--ink); padding: 8px 12px; z-index: 20; border-radius: 10px; }
.skip:focus { left: 16px; }

/* Top bar */
.bar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--ink) 86%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 2px solid var(--plum); }
.bar-in { max-width: 1120px; margin: 0 auto; padding: 10px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; margin-right: auto; }
.brand img { width: 36px; height: 36px; border-radius: 9px; border: 2px solid var(--ink); }
.brand span { font: 400 1.3rem/1 var(--display); }
.brand b { font-weight: 400; color: var(--yellow); }
.brand i { font-style: normal; color: var(--cyan); }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs a, .tabs button { font: 600 0.95rem/1 var(--body); color: var(--dim); background: transparent; border: 2px solid var(--plum-2);
  padding: 9px 14px; border-radius: 999px; cursor: pointer; text-decoration: none; }
.tabs a:hover, .tabs button:hover { color: var(--text); border-color: var(--purple); }
.tabs [aria-current="page"], .tabs [aria-pressed="true"] { color: var(--ink); background: var(--yellow); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }

/* Page column */
.wrap { max-width: 1120px; margin: 0 auto; padding: 40px 20px 80px; display: grid; gap: 72px; }
.wrap > * { min-width: 0; }
section { display: grid; gap: 18px; }
.head { display: grid; gap: 10px; }

/* Chunky cards */
.card { position: relative; padding: 20px; background: var(--plum); border: 3px solid var(--ink); border-radius: 22px; box-shadow: var(--shadow); }
.card.hot { background: color-mix(in srgb, var(--pink) 16%, var(--plum)); }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 40px; align-items: center; }
.hero-text { display: grid; gap: 18px; align-content: start; }
.hero-icon { width: 88px; height: 88px; border-radius: 22px; border: 3px solid var(--ink); box-shadow: var(--shadow); }
.season { justify-self: start; font: 600 0.78rem/1 var(--body); letter-spacing: 0.14em; color: var(--ink); background: var(--cyan);
  border: 2px solid var(--ink); border-radius: 999px; padding: 7px 12px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.facts div { border: 2px solid var(--ink); padding: 10px 14px; background: var(--plum); border-radius: 14px; }
.facts dt { font: 600 0.72rem/1.2 var(--body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.facts dd { margin: 4px 0 0; font-weight: 600; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 8px; font: 400 1.1rem/1 var(--display); letter-spacing: 0.02em;
  padding: 13px 20px; border-radius: 999px; border: 3px solid var(--ink); color: var(--ink); background: var(--yellow); text-decoration: none; box-shadow: 0 5px 0 var(--ink); }
.btn:hover { transform: translateY(1px); box-shadow: 0 4px 0 var(--ink); }
.btn.ghost { color: var(--text); background: var(--plum-2); }
.soon { display: inline-flex; align-items: center; gap: 10px; }
.soon img { opacity: 0.6; }
.soon span { font: 600 0.75rem/1.3 var(--body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }

/* Arena viewer */
.viewer { display: grid; gap: 14px; }
.screen { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border: 3px solid var(--ink); border-radius: 22px; background: var(--plum); box-shadow: 0 8px 0 var(--ink); }
.screen img { width: 100%; height: 100%; object-fit: cover; }
.screen .tag { position: absolute; top: 12px; left: 12px; font: 600 0.75rem/1 var(--body); letter-spacing: 0.12em; padding: 7px 11px;
  background: var(--ink); border-radius: 999px; color: var(--yellow); text-transform: uppercase; }

/* Banner */
.banner { border: 3px solid var(--ink); border-radius: 22px; overflow: hidden; box-shadow: 0 8px 0 var(--ink); }
.banner img { width: 100%; }

/* Callout */
.callout { display: grid; grid-template-columns: auto 1fr; gap: 16px 18px; align-items: start; }
.callout svg { color: var(--yellow); flex: none; }
.callout .body { display: grid; gap: 8px; }
.callout .cta { margin-top: 6px; }

/* Grids */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.grid .card { display: grid; gap: 6px; align-content: start; }
.grid .n { font: 600 0.78rem/1 var(--body); color: var(--cyan); letter-spacing: 0.1em; text-transform: uppercase; }
.grid p { font-size: 0.98rem; color: var(--dim); }

/* Roster */
/* 4, 2 or 1 across, so the four frames never leave one card on a row of its own. */
.roster { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1040px) { .roster { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .roster { grid-template-columns: minmax(0, 1fr); } }
.frame { display: grid; gap: 10px; align-content: start; border-top: 10px solid var(--c, var(--purple)); }
.frame-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.frame h3 { font-size: 1.7rem; }
.frame .kanji { font-size: 2rem; line-height: 1; color: var(--c); opacity: 0.95; }
.frame .role { font: 600 0.78rem/1.3 var(--body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--cyan); }
.frame .pilot { font-size: 0.95rem; color: var(--dim); }
.frame .pilot b { color: var(--text); font-weight: 600; }
.stats { display: grid; gap: 5px; margin: 2px 0 0; }
.stats div { display: grid; grid-template-columns: 4.6rem 1fr; align-items: center; gap: 8px; }
.stats dt { font: 600 0.72rem/1 var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.stats dd { margin: 0; display: flex; gap: 4px; }
.stats dd i { flex: 1; height: 10px; border-radius: 4px; background: #3a1838; border: 1.5px solid var(--ink); }
.stats dd i.on { background: var(--yellow); }
.move { font-size: 0.95rem; color: var(--dim); }
.move b { color: var(--text); font-weight: 600; }
.free-pill { justify-self: start; font: 600 0.72rem/1 var(--body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink);
  background: var(--yellow); border: 2px solid var(--ink); border-radius: 999px; padding: 5px 9px; }

/* Arena cards */
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 20px; }
figure { margin: 0; display: grid; gap: 10px; min-width: 0; align-content: start; }
figure img { width: 100%; border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow); }
figcaption { font-size: 0.95rem; color: var(--dim); display: grid; gap: 2px; }
figcaption b { color: var(--text); font: 400 1.2rem/1.2 var(--display); }
figcaption .t { font: 600 0.72rem/1.3 var(--body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--t, var(--cyan)); }

/* Tables */
.tablewrap { overflow-x: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; font: 400 0.95rem/1.4 var(--body); }
th, td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 2px solid var(--ink); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
thead th { color: var(--dim); font: 600 0.74rem/1.3 var(--body); text-transform: uppercase; letter-spacing: 0.1em; white-space: nowrap; }
tbody th { font-weight: 600; white-space: nowrap; }
th .note, td .note { display: block; color: var(--dim); font-size: 0.85rem; font-weight: 400; white-space: normal; }
.wide table { min-width: 760px; }
kbd { display: inline-block; padding: 2px 8px; margin: 1px 2px 1px 0; border: 2px solid var(--ink); border-bottom-width: 4px; border-radius: 8px;
  background: var(--plum-2); font: 600 0.82rem/1.4 var(--body); white-space: nowrap; color: var(--text); }
.keyset { white-space: nowrap; }
.muted-cell { color: var(--dim); font-style: italic; }

/* Lists */
ul.check { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
/* The marker is positioned, not a grid column, so items that mix <strong> with plain text flow as one line. */
ul.check li { position: relative; padding-left: 28px; }
ul.check li::before { content: ""; position: absolute; left: 0; top: 8px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--cyan); }
ul.check.ok li::before { border-color: var(--ink); background: var(--yellow); }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 20px; }
.two > .card { display: grid; gap: 14px; align-content: start; }

/* FAQ */
.faq { display: grid; gap: 12px; }
.faq details { border: 3px solid var(--ink); background: var(--plum); border-radius: 18px; box-shadow: 0 4px 0 var(--ink); }
.faq summary { cursor: pointer; padding: 15px 48px 15px 18px; font-weight: 600; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font: 400 1.5rem/1 var(--display); color: var(--yellow); }
.faq details[open] summary::after { content: "−"; }
.faq .a { padding: 0 18px 18px; display: grid; gap: 10px; color: var(--dim); }
.faq .a p, .faq .a li { color: var(--dim); }
.faq .a ul, .faq .a ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }

/* Long-form text (privacy) */
.prose { display: grid; gap: 14px; max-width: 72ch; }
.prose h2 { margin-top: 18px; }
.prose ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.prose li, .prose p { color: var(--dim); }
.prose strong { color: var(--text); font-weight: 600; }

/* Footer */
footer { border-top: 2px solid var(--plum); }
.foot { max-width: 1120px; margin: 0 auto; padding: 22px 20px 40px; display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between;
  font: 400 0.88rem/1.5 var(--body); color: var(--dim); }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.foot a { color: var(--dim); }
.foot a:hover { color: var(--text); }

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .wrap { padding-top: 28px; gap: 56px; }
}
/* The control map becomes one card per action on narrow screens. */
@media (max-width: 760px) {
  .wide table { min-width: 0; }
  .wide thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .wide tbody, .wide tr, .wide tbody th, .wide td { display: block; }
  .wide tr { padding: 14px 16px; border-bottom: 2px solid var(--ink); }
  .wide tbody tr:last-child { border-bottom: 0; }
  .wide tbody th { padding: 0 0 8px; border: 0; font: 400 1.25rem/1.15 var(--display); }
  .wide tbody th .note { font: 400 0.85rem/1.4 var(--body); margin-top: 2px; }
  .wide td { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 10px; padding: 5px 0; border: 0; }
  .wide td::before { content: attr(data-label); font: 600 0.72rem/1.9 var(--body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); font-style: normal; }
}

@media (max-width: 520px) {
  .bar-in { padding: 10px 16px; }
  .wrap { padding-inline: 16px; }
  .foot { padding-inline: 16px; }
  .tabs a { padding: 8px 11px; font-size: 0.9rem; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .callout { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .btn:hover { transform: none; }
}
