/* Odyssey Fighters — arcade shell styling.
 * The play area is a 16:9 box letterboxed into the viewport; every UI size is expressed in
 * container-query units (cqw) of that box so menus scale exactly with the game canvas. */
:root {
  --ink: #140a06;
  --wine: #2a0c1c;
  --night: #0c0612;
  --gold: #e8c56a;
  --gold-hi: #fff1c4;
  --bronze: #b8893f;
  --aegean: #1f5f8f;
  --blood: #d8322a;
  --text: #f6ecd8;
  --muted: #bda98a;
  --serif: "Cinzel", "Trajan Pro", "Palatino Linotype", Palatino, Georgia, serif;
  --display: "Cinzel Decorative", "Cinzel", "Trajan Pro", Georgia, serif;
  --sans: "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #050307; color: var(--text); overflow: hidden; }
body { font-family: var(--serif); -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; }
#stage-wrap { position: fixed; inset: 0; display: grid; place-items: center; background:
  radial-gradient(ellipse at 50% 40%, #1c0b1a 0%, #070409 70%); }
#app {
  position: relative;
  width: min(100vw, 177.78vh);
  height: min(56.25vw, 100vh);
  container-type: size;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(232, 197, 106, 0.25), 0 30px 80px rgba(0, 0, 0, 0.8);
  background: #000;
}
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: auto; }
.ui { position: absolute; inset: 0; font-size: 1.6cqw; pointer-events: none; }
.ui > * { pointer-events: auto; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; }
kbd {
  display: inline-block; min-width: 1.9em; padding: 0.1em 0.45em; margin: 0 0.12em;
  border-radius: 0.35em; border: 1px solid rgba(232, 197, 106, 0.6); border-bottom-width: 3px;
  background: linear-gradient(#3a2618, #1d120c); color: var(--gold-hi); font-family: var(--sans);
  font-size: 0.85em; font-weight: 700; text-align: center; line-height: 1.4;
}
button { font: inherit; color: inherit; }

/* ------------------------------ menus ------------------------------ */
.menu { display: flex; flex-direction: column; gap: 0.35cqw; }
.mi {
  all: unset; cursor: pointer; position: relative; display: flex; align-items: baseline; gap: 1cqw;
  padding: 0.55cqw 2.2cqw 0.55cqw 2.6cqw; font-family: var(--serif); font-weight: 700; letter-spacing: 0.12em;
  font-size: 1.9cqw; text-transform: uppercase; color: var(--muted);
  clip-path: polygon(0 0, 100% 0, calc(100% - 1.2cqw) 100%, 0 100%);
  transition: color 0.12s, background 0.12s, transform 0.12s;
}
.mi small { font-size: 0.55em; letter-spacing: 0.06em; text-transform: none; color: rgba(246, 236, 216, 0.55); font-weight: 500; margin-left: auto; }
.mi .mi-v { margin-left: auto; color: var(--gold-hi); letter-spacing: 0.04em; }
.mi.on { color: var(--ink); background: linear-gradient(90deg, var(--gold-hi), var(--gold) 60%, rgba(232, 197, 106, 0.1)); transform: translateX(0.8cqw); }
.mi.on small { color: rgba(20, 10, 6, 0.7); }
.mi.on .mi-v { color: var(--ink); }
.mi.on::before { content: "\25B8"; position: absolute; left: 0.8cqw; }

/* ------------------------------ title ------------------------------ */
.title { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; pointer-events: auto; }
.logo { margin-top: 5cqw; text-align: center; filter: drop-shadow(0 0.6cqw 0.8cqw rgba(0, 0, 0, 0.8)); }
.logo-greek { font-family: var(--serif); letter-spacing: 0.9em; color: var(--gold); font-size: 1.4cqw; margin-left: 0.9em; opacity: 0.9; }
.logo h1 { margin: 0.4cqw 0 0; font-family: var(--display); font-weight: 900; line-height: 0.92; }
.logo h1 span { display: block; font-size: 7.8cqw; letter-spacing: 0.06em;
  background: linear-gradient(180deg, #fffbe8 0%, #ffe08a 38%, #c8862a 62%, #6a3a10 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 0.12cqw rgba(30, 10, 0, 0.9); }
.logo h1 .l2 { font-size: 5.6cqw; letter-spacing: 0.3em; margin-left: 0.3em;
  background: linear-gradient(180deg, #ffffff 0%, #9fd6ff 40%, #2a6fb0 70%, #0c2a52 100%);
  -webkit-background-clip: text; background-clip: text; }
.logo-sub { margin-top: 1cqw; font-style: italic; color: var(--gold-hi); font-size: 1.5cqw; letter-spacing: 0.12em; }
.press { margin-top: 7cqw; font-size: 2.6cqw; letter-spacing: 0.4em; font-weight: 900; color: var(--gold-hi); cursor: pointer;
  text-shadow: 0 0 1.2cqw rgba(255, 200, 80, 0.8), 0 0.2cqw 0 #000; animation: blink 1.1s steps(2) infinite; text-align: center; }
.press small { display: block; font-size: 0.42em; letter-spacing: 0.3em; color: var(--muted); animation: none; margin-top: 0.4cqw; }
@keyframes blink { 50% { opacity: 0.25; } }
.title-menu { display: none; margin-top: 2.2cqw; width: 42cqw; }
.title.started .press { display: none; }
.title.started .title-menu { display: block; animation: rise 0.35s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(1.5cqw); } }
.foot { position: absolute; bottom: 1.2cqw; font-size: 0.95cqw; letter-spacing: 0.1em; color: rgba(246, 236, 216, 0.55); text-align: center; padding: 0 2cqw; }

/* ------------------------------ panels / options ------------------------------ */
.panel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 52cqw; padding: 2.2cqw 2.6cqw;
  background: linear-gradient(180deg, rgba(30, 12, 24, 0.92), rgba(12, 6, 14, 0.94)); border: 0.15cqw solid var(--gold);
  box-shadow: 0 0 0 0.35cqw rgba(0, 0, 0, 0.6), 0 2cqw 4cqw rgba(0, 0, 0, 0.7); }
.panel h2, .pause h2, .controls h2 { margin: 0 0 0.6cqw; font-family: var(--display); color: var(--gold-hi); font-size: 3cqw; letter-spacing: 0.12em; text-align: center; }
.panel .hint { text-align: center; color: var(--muted); font-size: 1.05cqw; margin: 0 0 1.4cqw; }

/* ------------------------------ character select ------------------------------ */
.select { position: absolute; inset: 0; display: grid; grid-template-rows: 6cqw 1fr 9.6cqw 3cqw; padding: 0 1.6cqw; }
.sel-head { display: flex; align-items: center; justify-content: center; gap: 2cqw; }
.sel-title { font-family: var(--display); font-weight: 900; font-size: 3.2cqw; letter-spacing: 0.14em; color: var(--gold-hi); text-shadow: 0 0.3cqw 0 #000, 0 0 1.5cqw rgba(255, 190, 80, 0.5); }
.sel-mode { font-size: 1.1cqw; letter-spacing: 0.3em; padding: 0.3cqw 0.9cqw; border: 1px solid var(--gold); color: var(--gold); }
.sel-main { display: grid; grid-template-columns: 27cqw 1fr 27cqw; gap: 1.4cqw; min-height: 0; }
.side { position: relative; display: flex; flex-direction: column; min-height: 0; }
.side .big { flex: 1; width: 100%; min-height: 0; }
.side .info { position: absolute; left: 0; right: 0; bottom: 3.2cqw; padding: 0.8cqw 1cqw; background: linear-gradient(0deg, rgba(8, 4, 12, 0.92), rgba(8, 4, 12, 0.3)); }
.s2 .info { text-align: right; }
.info .who { font-size: 1cqw; letter-spacing: 0.3em; color: var(--muted); }
.info .who b { color: #7fe8a0; margin-left: 0.6em; }
.info .nm { font-family: var(--display); font-size: 2.8cqw; font-weight: 900; line-height: 1.05; text-shadow: 0 0.2cqw 0 #000; }
.info .ttl { font-style: italic; font-size: 1.1cqw; color: var(--gold-hi); }
.info .sty { font-size: 0.95cqw; color: var(--muted); margin: 0.3cqw 0 0.5cqw; font-family: var(--sans); }
.stats { display: grid; gap: 0.25cqw; }
.st { display: grid; grid-template-columns: 7cqw 1fr; align-items: center; font-size: 0.85cqw; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); }
.s2 .st { grid-template-columns: 1fr 7cqw; }
.s2 .st span { order: 2; }
.st i { height: 0.6cqw; background: rgba(255, 255, 255, 0.1); position: relative; }
.st i::after { content: ""; position: absolute; inset: 0; right: calc((1 - var(--v)) * 100%); background: linear-gradient(90deg, var(--c), #fff); }
.s2 .st i::after { right: 0; left: calc((1 - var(--v)) * 100%); background: linear-gradient(270deg, var(--c), #fff); }
.ml-btn { all: unset; cursor: pointer; align-self: stretch; text-align: center; margin-top: 0.4cqw; padding: 0.45cqw; font-size: 1cqw; letter-spacing: 0.25em; text-transform: uppercase; border: 1px solid rgba(232, 197, 106, 0.6); color: var(--gold); background: rgba(10, 5, 10, 0.6); }
.ml-btn:hover { background: var(--gold); color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 1fr; gap: 0.7cqw; align-content: center; padding: 1cqw 0; }
.cell { position: relative; aspect-ratio: 1 / 1.05; cursor: pointer; border: 0.15cqw solid rgba(232, 197, 106, 0.35);
  background: linear-gradient(160deg, var(--c2), #0c0610); overflow: hidden; transition: transform 0.1s; }
.cell canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.cell .nm { position: absolute; left: 0; right: 0; bottom: 0; padding: 0.25cqw; font-size: 0.95cqw; font-weight: 700; letter-spacing: 0.08em; text-align: center; background: linear-gradient(0deg, rgba(0, 0, 0, 0.85), transparent); }
.cell i { position: absolute; top: 0.3cqw; font-style: normal; font-weight: 900; font-size: 0.95cqw; padding: 0.1cqw 0.4cqw; display: none; font-family: var(--sans); }
.cell .k1 { left: 0.3cqw; background: #e8322a; color: #fff; }
.cell .k2 { right: 0.3cqw; background: #2f7fe0; color: #fff; }
.cell.p1 { border-color: #ff5a4a; transform: scale(1.04); z-index: 1; }
.cell.p2 { border-color: #4aa0ff; transform: scale(1.04); z-index: 1; }
.cell.p1.p2 { border-image: linear-gradient(90deg, #ff5a4a, #4aa0ff) 1; }
.cell.p1 .k1, .cell.p2 .k2 { display: block; }
.cell.lock1 .k1, .cell.lock2 .k2 { animation: blink 0.4s steps(2) 3; }
.cell.lock1::after, .cell.lock2::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 1.5cqw rgba(255, 240, 180, 0.7); }
.sel-stage { display: grid; grid-template-rows: 2cqw 1fr; opacity: 0.55; transition: opacity 0.2s; }
.sel-stage.active, .sel-stage:hover { opacity: 1; }
.sel-stage.auto .st-row { filter: grayscale(0.4) brightness(0.8); }
.st-label { font-size: 1.1cqw; letter-spacing: 0.1em; color: var(--gold); text-align: center; }
.st-label small { color: var(--muted); font-style: italic; margin-left: 0.6em; }
.st-row { display: flex; justify-content: center; gap: 0.8cqw; }
.st-card { position: relative; width: 12.5cqw; cursor: pointer; border: 0.15cqw solid rgba(255, 255, 255, 0.15); overflow: hidden; background: #000; }
.st-card .st-thumb, .st-card canvas { width: 100%; height: 100%; display: block; }
.st-card .st-thumb { aspect-ratio: 16 / 9; }
.st-card span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 0.75cqw; padding: 0.2cqw; text-align: center; background: rgba(0, 0, 0, 0.7); }
.st-card.on { border-color: var(--c); box-shadow: 0 0 1cqw var(--c); }
.sel-foot { display: flex; align-items: center; justify-content: center; font-size: 1cqw; color: var(--muted); font-family: var(--sans); gap: 0.4em; }
.sel-foot b { color: var(--gold-hi); }

/* ------------------------------ VS ------------------------------ */
.vs { position: absolute; inset: 0; pointer-events: none; }
.vs-mark { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%) rotate(-8deg); font-family: var(--display); font-weight: 900; font-size: 11cqw;
  color: #fff4d6; -webkit-text-stroke: 0.3cqw #3a1200; text-shadow: 0 0 3cqw rgba(255, 150, 40, 0.9); animation: slam 0.5s cubic-bezier(.2, 1.6, .5, 1) both 0.25s; }
@keyframes slam { from { transform: translate(-50%, -50%) rotate(-8deg) scale(3.5); opacity: 0; } }
.vs-n { position: absolute; top: 4cqw; display: flex; flex-direction: column; animation: slidein 0.4s ease-out both; }
.vs-n b { font-family: var(--display); font-size: 4.2cqw; font-weight: 900; color: #fff; text-shadow: 0 0.3cqw 0 #000, 0 0 2cqw var(--c); }
.vs-n small { font-style: italic; color: var(--gold-hi); font-size: 1.3cqw; }
.n1 { left: 3cqw; }
.n2 { right: 3cqw; text-align: right; align-items: flex-end; animation-name: slidein2; }
@keyframes slidein { from { transform: translateX(-30cqw); } }
@keyframes slidein2 { from { transform: translateX(30cqw); } }
.vs-stage { position: absolute; bottom: 2cqw; left: 0; right: 0; text-align: center; font-size: 1.5cqw; letter-spacing: 0.3em; color: var(--gold-hi); text-shadow: 0 0.2cqw 0 #000; }
.vs-battle { position: absolute; top: 58%; left: 0; right: 0; text-align: center; font-size: 1.6cqw; letter-spacing: 0.35em; color: #fff; text-shadow: 0 0.2cqw 0 #000; }

/* ------------------------------ pause / modal ------------------------------ */
.pause { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(6, 3, 10, 0.72); backdrop-filter: blur(2px); }
.pause .menu { width: 38cqw; }
.modal { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(4, 2, 8, 0.78); font-size: 1.25cqw; }
.modal-card { width: 88cqw; max-height: 48cqw; display: flex; flex-direction: column; background: linear-gradient(180deg, #1e0c18, #0d0710); border: 0.15cqw solid var(--gold); box-shadow: 0 2cqw 5cqw rgba(0, 0, 0, 0.8); overflow: hidden; }
.modal-hint { margin-top: 0.6cqw; font-size: 0.95cqw; color: var(--muted); font-family: var(--sans); }
.moves { display: flex; flex-direction: column; min-height: 0; height: 48cqw; }
.mv-tabs { display: flex; flex-wrap: wrap; gap: 0.3cqw; padding: 0.6cqw; border-bottom: 1px solid rgba(232, 197, 106, 0.3); }
.mv-tab { all: unset; cursor: pointer; padding: 0.35cqw 0.9cqw; font-size: 1cqw; font-weight: 700; letter-spacing: 0.08em; border: 1px solid rgba(255, 255, 255, 0.15); border-bottom: 0.25cqw solid var(--c); }
.mv-tab.on { background: var(--c); color: #0b0507; }
.mv-body { overflow-y: auto; padding: 1cqw 1.6cqw 1.6cqw; min-height: 0; flex: 1; scrollbar-color: var(--bronze) transparent; }
.ml-head { display: flex; align-items: baseline; gap: 1.2cqw; flex-wrap: wrap; border-bottom: 0.2cqw solid var(--c); padding-bottom: 0.4cqw; }
.ml-name { font-family: var(--display); font-weight: 900; font-size: 2.6cqw; color: var(--c); text-shadow: 0 0.15cqw 0 #000; }
.ml-title { font-style: italic; color: var(--gold-hi); }
.ml-style { font-family: var(--sans); font-size: 0.95cqw; color: var(--muted); margin-left: auto; }
.ml-legend { margin: 0.6cqw 0 0.2cqw; font-family: var(--sans); font-size: 0.95cqw; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4em; }
.ml-legend .kc { color: var(--gold-hi); margin-right: 0.8em; }
.ml-p { color: var(--muted); margin-left: auto; }
.ml-note { font-family: var(--sans); font-size: 0.9cqw; color: var(--muted); margin: 0.3cqw 0 0.4cqw; }
.moves h3, .controls h3 { margin: 1cqw 0 0.4cqw; font-size: 1.2cqw; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.moves h3 small { letter-spacing: 0.05em; text-transform: none; color: var(--muted); font-weight: 400; }
table.ml { width: 100%; border-collapse: collapse; font-size: 1.05cqw; }
table.ml td { padding: 0.35cqw 0.6cqw; border-bottom: 1px solid rgba(255, 255, 255, 0.07); vertical-align: middle; }
table.ml td.nm { font-weight: 700; width: 24%; color: var(--text); }
table.ml td.cm { width: 30%; white-space: nowrap; font-family: var(--sans); }
table.ml td.ds { color: var(--muted); font-family: var(--sans); font-size: 0.92em; }
table.ml.norm td.cm { white-space: normal; font-family: var(--serif); }
.mot { font-family: var(--sans); font-weight: 900; color: #ffe08a; letter-spacing: 0.08em; font-size: 1.15em; }
.btn { display: inline-block; min-width: 2.2em; padding: 0 0.35em; border-radius: 1em; font-family: var(--sans); font-weight: 900; font-size: 0.85em; text-align: center; color: #fff; line-height: 1.5; }
.b-LP, .b-P { background: #c0392b; }
.b-HP { background: #7d1d14; }
.b-LK, .b-K { background: #2b6cb0; }
.b-HK { background: #1a3d6b; }
.b-P { background: linear-gradient(90deg, #c0392b 50%, #7d1d14 50%); }
.b-K { background: linear-gradient(90deg, #2b6cb0 50%, #1a3d6b 50%); }
.tag { font-style: normal; font-family: var(--sans); font-size: 0.7em; font-weight: 900; padding: 0.05em 0.4em; border-radius: 0.2em; margin-left: 0.3em; vertical-align: middle; }
.tag.low { background: #2b6cb0; }
.tag.ovh { background: #b0622b; }
.tag.kd { background: #6b2bb0; }
.tag.air { background: #2b8a6b; }
.controls { padding: 1.4cqw 2cqw 2cqw; overflow-y: auto; max-height: 48cqw; }
.ctl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2cqw; }
.ctl-card { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(232, 197, 106, 0.25); padding: 0.8cqw 1cqw; }
.ctl-card h3 { margin-top: 0; font-size: 1.05cqw; }
.ctl-note { font-family: var(--sans); font-size: 0.85cqw; color: var(--muted); margin: 0 0 0.5cqw; }
table.ctl { width: 100%; font-size: 1cqw; border-collapse: collapse; font-family: var(--sans); }
table.ctl td { padding: 0.25cqw 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
table.ctl td:last-child { text-align: right; }
.ctl-rules { margin-top: 1cqw; font-family: var(--sans); font-size: 1.05cqw; line-height: 1.55; color: var(--text); }
.ctl-rules p { margin: 0.4cqw 0; }
.ctl-rules b { color: var(--gold-hi); }

/* ------------------------------ result / continue / ending ------------------------------ */
.result { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 6cqw; }
.res-head { font-family: var(--display); font-weight: 900; font-size: 6.4cqw; letter-spacing: 0.08em; color: #fff4d6; -webkit-text-stroke: 0.2cqw #2a0e00; text-shadow: 0 0 2.4cqw var(--c), 0 0.4cqw 0 #000; animation: slam 0.5s cubic-bezier(.2, 1.6, .5, 1) both; }
.res-card { display: flex; align-items: center; gap: 1.6cqw; margin-top: 1.6cqw; padding: 1.2cqw 1.8cqw; max-width: 70cqw; background: rgba(10, 5, 12, 0.82); border-left: 0.4cqw solid var(--gold); }
.res-bust { width: 10cqw; height: 10cqw; flex: none; }
.res-name { font-family: var(--display); font-size: 2.2cqw; font-weight: 900; }
.res-card blockquote { margin: 0.4cqw 0 0; font-style: italic; font-size: 1.5cqw; color: var(--gold-hi); }
.res-menu { margin-top: 1.6cqw; width: 34cqw; }
.continue { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; }
.cont-q { font-family: var(--display); font-size: 6cqw; font-weight: 900; color: var(--gold-hi); text-shadow: 0 0 2cqw rgba(255, 120, 40, 0.8), 0 0.3cqw 0 #000; }
.cont-q.over { color: #ff5a4a; }
.cont-n { font-family: var(--sans); font-size: 14cqw; font-weight: 900; color: #fff; text-shadow: 0 0 3cqw rgba(255, 60, 40, 0.8); line-height: 1; }
.cont-h { font-family: var(--sans); font-size: 1.1cqw; color: var(--muted); }
.ending { position: absolute; right: 4cqw; top: 8cqw; width: 50cqw; padding: 2cqw 2.4cqw; background: rgba(10, 5, 12, 0.8); border-top: 0.3cqw solid var(--gold); border-bottom: 0.3cqw solid var(--gold); }
.end-head { font-size: 1.3cqw; letter-spacing: 0.35em; color: var(--gold); text-transform: uppercase; }
.end-name { font-family: var(--display); font-size: 4.4cqw; font-weight: 900; text-shadow: 0 0.3cqw 0 #000; }
.ending p { font-size: 1.55cqw; line-height: 1.6; font-style: italic; }
.end-thanks { margin-top: 1.4cqw; font-size: 1.1cqw; letter-spacing: 0.25em; color: var(--muted); animation: blink 1.2s steps(2) infinite; }

/* narrow portrait screens: keep the 16:9 box readable and hint to rotate */
@media (orientation: portrait) and (max-width: 700px) {
  #stage-wrap::after { content: "Rotate your device for the full arcade view"; position: absolute; bottom: 12vh; left: 16px; right: 16px; text-align: center; font-size: 14px; color: var(--muted); }
}
@media (prefers-reduced-motion: reduce) {
  .press, .end-thanks { animation: none; }
}
