:root { --cream: #f6efdd; --paper: #fffaf0; --ink: #1c2b2a; --sun: #f2b632; --teal: #25776d; --red: #cf3a20; --red-deep: #8f2410; --edge: #cfc3a4; --go: #4fe08a; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; background: var(--cream); color: var(--ink); font-family: Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", "Hiragino Sans", "Noto Sans", system-ui, sans-serif; line-height: 1.5; }
h1, h2, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
h1:focus, h2:focus { outline: none; }
header, main, footer { width: 100%; max-width: 480px; margin-inline: auto; padding-inline: 20px; }
header { display: flex; align-items: center; justify-content: space-between; padding-block: 14px; }
.logo { font-weight: 900; font-size: 15px; letter-spacing: .14em; text-decoration: none; padding-block: 8px; }
.lang { position: relative; font-size: 14px; }
.lang summary { cursor: pointer; padding: 10px 4px; }
.lang div { position: absolute; right: 0; top: 100%; z-index: 2; background: var(--paper); border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; }
.lang div a { display: block; padding: 11px 18px; text-decoration: none; white-space: nowrap; }
.lang div a:hover { background: var(--sun); }
main { flex: 1; display: flex; flex-direction: column; }
footer { padding-block: 22px; font-size: 13px; }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
footer a { padding-block: 6px; }
.btn { display: block; width: 100%; padding: 15px 12px; border: 0; border-radius: 8px; background: var(--red); color: #fff; font-weight: 800; font-size: 18px; box-shadow: 0 5px 0 var(--red-deep); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--red-deep); }
.btn.dark { background: var(--ink); box-shadow: 0 5px 0 #000; }
.btn.plain { background: none; color: var(--ink); box-shadow: none; border: 2px solid var(--ink); }

.hero h1 { font-size: clamp(38px, 11.5vw, 52px); line-height: 1.05; font-weight: 900; letter-spacing: -.035em; margin: 14px 0 12px; text-wrap: balance; word-break: keep-all; }
.hero p { font-size: 17px; }
.parade { position: relative; flex: 1; min-height: 330px; max-height: 460px; margin: 32px -20px 0; background: var(--teal); }
.parade::before { content: ""; position: absolute; left: 0; right: 0; top: -13px; height: 14px; background: radial-gradient(circle at 12px 14px, var(--teal) 12px, transparent 12.5px) 0 0 / 24px 14px; }
.parade img { position: absolute; inset: 0; width: 100%; height: 100%; padding: 10px 12px; object-fit: contain; }
#start { margin-top: 24px; }

body[data-mode="play"] footer, body[data-mode="play"] header { display: none; }
body[data-mode="play"] main { min-height: 100dvh; padding-block: 20px; }
.step { font-size: 14px; font-weight: 700; text-align: center; }
.dots { display: flex; gap: 7px; justify-content: center; margin: 10px 0 8vh; }
.dots i { width: 26px; height: 8px; border-radius: 4px; background: var(--edge); }
.dots i.on { background: var(--teal); }
main > h2 { font-size: 40px; line-height: 1.1; font-weight: 900; letter-spacing: -.03em; text-align: center; }
.how { font-size: 19px; text-align: center; margin: 14px auto 0; max-width: 20em; word-break: keep-all; text-wrap: balance; }
.lineup { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 10px 2%; margin: auto 0; padding-block: 24px; }
.lineup img { width: 17%; height: auto; }
.stage { flex: 1; display: flex; flex-direction: column; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pad, .grid, .arrows, .panel { position: relative; }
.pad, .panel { overflow: hidden; }
.pad { flex: 1; width: 100%; border: 0; border-radius: 20px; background: var(--ink); color: #fff; font-size: 46px; font-weight: 900; font-variant-numeric: tabular-nums; }
.pad[data-state="early"] { background: var(--red); }
.pad[data-state="done"] { background: var(--sun); color: var(--ink); }
.pad.clock { font-size: 84px; }
.bar { height: 10px; border-radius: 5px; background: var(--edge); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--red); transform-origin: left; }
.board { flex: 1; display: grid; align-content: center; }
.grid { display: grid; grid-template-columns: repeat(var(--size), 1fr); gap: 8px; width: 100%; max-width: min(100%, 62dvh); margin-inline: auto; }
.cell { aspect-ratio: 1; border: 0; border-radius: 10px; background: var(--paper); box-shadow: inset 0 0 0 2px var(--edge); padding: 0; }
.cell.hit { background: var(--teal); box-shadow: none; }
.cell.miss { box-shadow: inset 0 0 0 6px var(--red); }
.count { text-align: center; font-size: 40px; font-weight: 900; }
.arrows { flex: 1; }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.side { height: 30dvh; border: 0; border-radius: 20px; background: var(--sun); display: grid; place-items: center; }
.side i { width: 60px; height: 60px; background: var(--ink); clip-path: polygon(0 0, 100% 50%, 0 100%, 26% 50%); }
.side.left i { transform: scaleX(-1); }
.side:active { background: #d99e1d; }
.panels { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: center; }
.panel { aspect-ratio: 3 / 5; border: 0; border-radius: 20px; background: var(--paper); box-shadow: inset 0 0 0 3px var(--edge); padding: 0; }
.panel.ok { box-shadow: inset 0 0 0 8px var(--teal); }
.panel.no { box-shadow: inset 0 0 0 8px var(--red); }

.result { display: flex; flex-direction: column; gap: 18px; }
.ticket { background: var(--paper); border-radius: 14px; overflow: hidden; box-shadow: 0 3px 0 var(--edge); }
.ticket .top { position: relative; background: var(--sun); padding: 16px 20px 18px; }
.ticket .top small { font-weight: 800; letter-spacing: .08em; font-size: 13px; }
/* Number and hexagon shrink together on narrow phones so "/1000" never runs into the hexagon. */
.ticket h1 { font-size: clamp(56px, 18vw, 80px); line-height: 1; font-weight: 900; letter-spacing: -.05em; }
.ticket h1 span { font-size: 16px; font-weight: 800; letter-spacing: 0; margin-left: 4px; }
.ticket .top svg { position: absolute; right: 16px; top: 12px; width: clamp(90px, 28vw, 120px); height: clamp(90px, 28vw, 120px); }
.ring { fill: none; stroke: var(--ink); stroke-opacity: .28; }
.value { fill: var(--red); fill-opacity: .88; }
.persona { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: center; padding: 16px 20px; }
.persona p:first-of-type { display: grid; gap: 2px; }
.persona small { font-size: 13px; font-weight: 800; }
.headline { font-size: 25px; line-height: 1.2; font-weight: 900; letter-spacing: -.02em; text-wrap: balance; }
.quips { grid-column: 1 / -1; display: grid; gap: 4px; font-size: 16px; line-height: 1.45; font-weight: 700; }
.fact { grid-column: 1 / -1; padding: 12px 14px; border-radius: 10px; background: var(--cream); font-size: 15px; line-height: 1.5; }
.fact small { display: block; color: var(--teal); }
/* Korean breaks between words; Japanese has no spaces and must keep breaking between characters. */
:lang(ko) .persona { word-break: keep-all; }
.cut { position: relative; border-top: 4px dotted var(--edge); }
.cut::before, .cut::after { content: ""; position: absolute; top: -14px; width: 24px; height: 24px; border-radius: 50%; background: var(--cream); }
.cut::before { left: -12px; }
.cut::after { right: -12px; }
.animals { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; padding: 18px 18px 20px; }
.animals li { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; column-gap: 6px; align-content: center; }
.animals img { grid-row: 1 / 3; width: 42px; height: 42px; }
.animals span { display: contents; }
.animals small { grid-area: 1 / 2; align-self: end; font-size: 12px; line-height: 1.2; }
.animals em { grid-area: 1 / 3; align-self: end; font-style: normal; font-weight: 900; font-size: 17px; line-height: 1.2; color: var(--red); font-variant-numeric: tabular-nums; }
.animals b { grid-area: 2 / 2 / 3 / 4; font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.ticket .world { background: var(--teal); color: #fff; font-weight: 700; padding: 13px 20px; display: flex; flex-wrap: wrap; gap: 2px 18px; min-height: 50px; }
.share .main, .join .main { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.join { display: flex; flex-direction: column; gap: 12px; }
.btn.sun { background: var(--sun); color: var(--ink); box-shadow: 0 5px 0 #b98410; }
.nick { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 14px; background: var(--paper); border-radius: 14px; box-shadow: 0 3px 0 var(--edge); }
.nick label { font-weight: 800; }
.nick input { width: 100%; padding: 13px 12px; font: inherit; font-size: 18px; border: 2px solid var(--ink); border-radius: 8px; background: #fff; color: inherit; }
.nick .hint { font-size: 14px; }
.nick .status { margin: 4px 0 0; }
.btn:disabled { opacity: .55; cursor: default; }
.join h2 { font-size: 25px; line-height: 1.2; font-weight: 900; overflow-wrap: anywhere; }
.join .btn { display: grid; place-items: center; text-align: center; text-decoration: none; line-height: 1.25; }
.places { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 12px; }
.places li { background: var(--paper); border-radius: 14px; padding: 13px 15px; box-shadow: 0 3px 0 var(--edge); }
.places small { font-size: 13px; font-weight: 700; }
.places p { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 8px; align-items: baseline; }
.places b { font-size: 19px; font-weight: 900; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.chip { border: 2px solid var(--ink); border-radius: 999px; background: none; padding: 9px 16px; font-size: 15px; font-weight: 700; text-decoration: none; line-height: 1.3; }
.chip:hover { background: var(--sun); }
.status { min-height: 1.5em; margin-top: 12px; font-weight: 700; }
.preview img { width: 100%; height: auto; border-radius: 10px; }
.preview input { width: 100%; padding: 12px; font: inherit; border: 2px solid var(--ink); border-radius: 8px; background: var(--paper); }
.best { font-weight: 700; text-align: center; }
.fun, .credits { font-size: 13px; }
.duel h2 { font-size: 30px; line-height: 1.15; font-weight: 900; letter-spacing: -.02em; }
.duel table { width: 100%; border-collapse: collapse; margin-block: 12px; font-variant-numeric: tabular-nums; }
.duel th { text-align: left; font-weight: 700; }
.duel td, .duel tr:first-child th { text-align: center; }
.duel td, .duel th { padding: 7px 8px; border-bottom: 2px solid var(--edge); }
.duel .up td:nth-child(2), .duel .down td:nth-child(3) { font-weight: 900; color: var(--teal); }
.duel .total td, .duel .total th { font-weight: 900; border: 0; }

.page { gap: 16px; }
:lang(ko) :is(.page, .guide) { word-break: keep-all; }
.page h1 { font-size: 36px; line-height: 1.1; font-weight: 900; letter-spacing: -.03em; }
.page h2, .guide h2 { font-size: 19px; line-height: 1.3; letter-spacing: -.01em; text-align: start; }
.page > h2 { margin-top: 12px; }
.page section > p { margin-top: 4px; }
.page .btn { text-align: center; text-decoration: none; margin-block: 6px; }
.guide { display: grid; gap: 12px; width: 100%; max-width: 480px; margin-inline: auto; padding: 34px 20px 0; }
body:not([data-mode="home"]) .guide { display: none; }
/* The header (69px) and footer (76px) used to share the first screen with it; keep its size now that the guide follows. */
body[data-mode="home"] #app { min-height: calc(100dvh - 145px); }
.guide ol, .page > ol { list-style: decimal; padding-inline-start: 1.4em; display: grid; gap: 6px; }
.tips { list-style: disc; padding-inline-start: 1.2em; display: grid; gap: 6px; }
.games { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.games a { display: flex; align-items: center; gap: 8px; height: 100%; padding: 8px; border: 2px solid var(--ink); border-radius: 8px; background: var(--paper); font-size: 15px; font-weight: 700; line-height: 1.25; text-decoration: none; }
.games a:hover { background: var(--sun); }
.tiers { display: grid; gap: 16px; }
.tiers li { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: start; font-size: 15px; }
.tiers .name { display: flex; justify-content: space-between; gap: 8px; }
.tiers span { flex: none; font-variant-numeric: tabular-nums; }
.ability { display: flex; gap: 14px; align-items: center; }
.langs { display: flex; flex-wrap: wrap; gap: 14px; font-size: 18px; }
.rank { counter-reset: rank; margin-top: 12px; }
.rank li { counter-increment: rank; display: grid; grid-template-columns: 2.2em 1fr auto; column-gap: 8px; padding: 11px 6px; border-bottom: 2px solid var(--edge); align-items: baseline; }
.rank li::before { content: counter(rank); font-weight: 900; }
.rank small { grid-column: 2 / -1; }
.rank .mine { background: var(--sun); }
.rank b { overflow-wrap: anywhere; }
.rank i { font-style: normal; font-weight: 400; font-size: 13px; }
.rank .points { font-weight: 900; font-variant-numeric: tabular-nums; }
.switch { display: flex; gap: 4px; padding: 4px; margin-bottom: 10px; border: 2px solid var(--ink); border-radius: 10px; }
.switch a { flex: 1; padding: 10px 6px; border-radius: 6px; text-align: center; font-weight: 800; line-height: 1.25; text-decoration: none; }
.switch a:hover { background: var(--edge); }
.switch [aria-current] { background: var(--ink); color: var(--cream); }
.board-list { min-height: 200px; padding-top: 10px; }
.linkish { border: 0; background: none; padding: 12px 0; text-decoration: underline; font-size: 14px; }
.ad { margin-block: 150px 0; min-height: 280px; }
.ad ins { display: block; min-height: 250px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
