/* styles.css — all page styles: game view, controls, pages, lobby, match overlay */
body{margin:0;min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;background:radial-gradient(ellipse at 50% 40%,#2a2046,#0b0912 70%);color:#fff;font-family:system-ui,sans-serif}
#c{width:min(100vw,96vh);aspect-ratio:4/3;border-radius:12px;display:block}
#hud{font-size:17px;line-height:1.4;min-height:1.4em;text-align:center;white-space:pre-line;padding:max(8px,env(safe-area-inset-top)) 8px 0} /* a set line height: an emoji (🎉 GET!) must not make the line taller */
#ctl{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;padding:0 8px 8px}
button{font-size:18px;padding:14px 22px;border:0;border-radius:999px;font-weight:700;touch-action:none;user-select:none;-webkit-user-select:none;cursor:pointer;background:#463a6b;color:#fff}
#b1,#b2{background:#ffc21a;color:#222;font-size:22px;padding:16px 34px;min-height:44px;box-shadow:0 5px 0 #b07f00}
#b2{background:#2a9dff;color:#fff;box-shadow:0 5px 0 #145a9e}
#b1:active,#b2:active{transform:translateY(3px);box-shadow:none}
button:disabled,button[aria-disabled=true]{opacity:.35;cursor:default}
#tip{font-size:13px;opacity:.7;padding-bottom:8px}
#ctl2{display:flex;flex-wrap:wrap;gap:inherit;justify-content:center} #ctl2 button{font-size:15px;padding:10px 14px;min-height:44px} /* secondary buttons: smaller; they wrap as one group under ① ② (never one button alone) */
#ctl2 #snd{min-width:44px;padding-left:0;padding-right:0} /* the mute toggle: an icon, at least 44 px square */
@media (orientation:portrait) and (max-width:600px){
  body{justify-content:flex-start;gap:4px;height:100dvh;min-height:0;overflow:hidden}
  #ctl{padding-bottom:0} #tip{padding-bottom:max(4px,env(safe-area-inset-bottom))} /* every pixel to the view: with 登入 the whole cabinet just fits */
  #hud{font-size:15px}
  #c{width:100vw;aspect-ratio:auto;flex:1;min-height:0;border-radius:0}
  #ctl{gap:8px} button{font-size:16px;padding:12px 18px} #b1,#b2{font-size:19px;padding:14px 24px}
  #ctl2 button{font-size:14px;padding:6px 10px} #ctl .long,#ctl .k{display:none} #ctl{gap:8px 7px} #acct{max-width:5em}
  #ctl2:has(>#acct:not([hidden])){display:grid;grid-template-columns:repeat(4,auto);justify-content:center} /* seven do not fit one row: 4 + 3, not 6 + 1 */
}
@media (orientation:landscape) and (max-height:500px){ /* phone on its side: view on the left, buttons in a column on the right */
  body{display:grid;grid-template:auto 1fr/1fr auto;height:100dvh;min-height:0;overflow:hidden;gap:6px;align-items:stretch}
  #hud{grid-column:1/3;font-size:14px;padding-top:max(4px,env(safe-area-inset-top))}
  #c{width:100%;height:100%;aspect-ratio:auto;min-height:0;border-radius:0}
  #ctl{flex-direction:column;flex-wrap:nowrap;justify-content:center;padding:0 max(8px,env(safe-area-inset-right)) 8px 0}
  button{font-size:14px;padding:10px 14px} #b1,#b2{font-size:16px;padding:12px 16px}
  #ctl2{display:grid;grid-template-columns:1fr 1fr;gap:6px} #ctl2 button{font-size:13px;padding:6px 4px} #ctl .long,#ctl .k{display:none} #ctl2 #acct{max-width:none;grid-column:1/-1;contain:inline-size} /* the account on a row of its own: no odd button left over; a long name is cut, it does not widen the column */
  #tip{display:none}
}
@media (orientation:landscape) and (min-height:501px){ /* desktop or tablet: the view takes the whole height (room for the whole cabinet), buttons in a column on its right */
  body{display:grid;grid-template:auto 1fr auto/1fr auto;height:100dvh;min-height:0;overflow:hidden;gap:8px 16px;align-items:stretch;padding:0 16px;box-sizing:border-box}
  #hud{grid-column:1/3}
  #c{width:100%;height:100%;aspect-ratio:auto;min-height:0;max-width:133dvh;justify-self:center} /* at most 4:3: a wider canvas only adds hall */
  #ctl{flex-direction:column;flex-wrap:nowrap;justify-content:center;padding:0}
  #ctl2{display:grid;grid-template-columns:1fr 1fr} #ctl2 #acct{max-width:none;grid-column:1/-1;contain:inline-size} /* the account on a row of its own: no odd button left over; a long name is cut, it does not widen the column */
  #tip{grid-column:1/3;text-align:center}
}
#colN{display:inline-block;min-width:1.2em;padding:0 .25em;border-radius:999px;background:#ffc21a;color:#222;font-size:.85em}
#seeCol{position:absolute;transform:translateY(-100%);font-size:14px;padding:7px 12px;min-height:44px;background:#ffc21a;color:#222;touch-action:manipulation;box-shadow:0 3px 0 #b07f00}
.page{width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;background:#161127;color:#fff;box-sizing:border-box;overflow:hidden}
.page[open]{display:flex;flex-direction:column}
.page::backdrop{background:#000}
.page button{font-size:15px;padding:9px 16px;min-height:44px;touch-action:manipulation}
.page header{display:flex;align-items:center;gap:10px;padding:max(10px,env(safe-area-inset-top)) 14px 8px}
.page h2{margin:0;font-size:19px;flex:1}
.page .body{flex:1;min-height:0;overflow:auto;padding:4px 14px 14px}
.page footer{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:8px 14px max(10px,env(safe-area-inset-bottom));font-size:14px}
#ver{margin-left:auto;font-size:12px;opacity:.5} /* product version; scripts/check-version.mjs keeps it equal to package.json */
.why{margin:0 14px 6px;padding:8px 12px;border-radius:10px;background:#3a2a10;color:#ffd98a;font-size:14px}
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,330px),1fr));gap:12px;max-width:900px;margin:0 auto}
.card{display:flex;gap:12px;background:#221a3a;border:2px solid #3b2f63;border-radius:14px;padding:10px;align-items:center}
.card.cur{border-color:#ffc21a}
.pv{display:block;aspect-ratio:4/3;border-radius:8px;background-color:#0e0b18;background-size:cover;background-position:center}
.card .pv{width:132px;flex:none;border-radius:10px}
.card h3{margin:0 0 3px;font-size:16px} .card p{margin:2px 0;font-size:13px;line-height:1.35;opacity:.9}
.card .tag{display:inline-block;margin-left:6px;padding:1px 8px;border-radius:999px;background:#ffc21a;color:#222;font-size:12px;vertical-align:2px}
.card button{margin-top:6px}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px}
.grid button{content-visibility:auto;contain-intrinsic-size:auto 220px;display:flex;flex-direction:column;align-items:stretch;gap:3px;padding:8px;border-radius:12px;background:#221a3a;border:2px solid #3b2f63;font-size:13px;font-weight:600;text-align:left}
:focus-visible{outline:3px solid #ffc21a;outline-offset:2px} /* keyboard focus: one ring that shows on every background (the default thin blue one hardly does on purple) */
.grid .st{font-size:12px;color:#ffd98a}
#ub{background:#120d22}
#ub #c{position:absolute;inset:0;width:100%;height:100%;aspect-ratio:auto;border-radius:0;touch-action:none} /* the game canvas, lent to the unboxing page */
#ubTop{position:relative;display:flex;align-items:center;gap:10px;padding:max(10px,env(safe-area-inset-top)) 14px 8px;pointer-events:none}
#ubTop b{flex:1;font-size:17px;text-shadow:0 1px 3px #000} #ubTop button{pointer-events:auto}
#ubHint{position:absolute;left:0;right:0;bottom:max(14px,env(safe-area-inset-bottom));margin:0;text-align:center;font-size:14px;opacity:.85;pointer-events:none;text-shadow:0 1px 3px #000}
[hidden]{display:none!important}
#lobby,.box{background:#1d1830;color:#fff;border:1px solid #5b4d8f;border-radius:14px;padding:12px 16px;width:min(92vw,480px);max-height:calc(100dvh - 20px);box-sizing:border-box;overflow:auto}
#lobby::backdrop,.box::backdrop{background:#000a}
#lobby h2,.box h2{margin:0 0 4px;font-size:18px}
#lobby p,#lobby li,#lobby label,.box p{font-size:14px;line-height:1.4;margin:4px 0}
#lobby ol{padding-left:1.3em;margin:4px 0}
#lobby>label{display:block;min-height:44px} #stun{width:22px;height:22px;margin:0 6px 0 0;vertical-align:-5px} /* the STUN row: a 44 px target */
#lobby textarea{width:100%;box-sizing:border-box;height:5.4em;font:12px/1.3 ui-monospace,monospace;background:#0e0b18;color:#cfe;border:1px solid #5b4d8f;border-radius:8px;resize:none;word-break:break-all}
#lobby button,#mo button,.box button{font-size:15px;padding:9px 16px;min-height:44px;touch-action:manipulation}
.box{width:min(92vw,400px)} .box .tiny{font-size:12px;opacity:.75}
.box .field{display:flex;align-items:center;gap:10px;margin:8px 0} .box .field label{font-size:15px;width:3em}
.box input{flex:1;min-width:0;font:16px system-ui,sans-serif;padding:10px;min-height:44px;box-sizing:border-box;background:#0e0b18;color:#fff;border:1px solid #5b4d8f;border-radius:8px}
#acMsg{color:#ff9a9a;font-weight:700;min-height:1.2em}
#acct{max-width:8em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap} #acct.in{background:#2e6b4a}
.page .where{margin:0 14px 6px;font-size:13px;opacity:.85}
#lobby [aria-pressed=true]{background:#ffc21a;color:#222}
#lobby .tiny{font-size:12px;opacity:.75}
.row{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:6px 0}
#lbStatus{font-weight:700;min-height:1.4em} #lbStatus.err{color:#ff9a9a}
#lobby .code{font:700 22px/1.2 ui-monospace,monospace;letter-spacing:.18em;width:7.2em;text-align:center;text-transform:uppercase;background:#0e0b18;color:#cfe;border:1px solid #5b4d8f;border-radius:8px;padding:6px 8px;box-sizing:border-box}
#lobby .link{background:none;text-decoration:underline;font-weight:600;padding:9px 6px;opacity:.9}
#lobby .why{margin:6px 0}
.lab,#oppv{position:absolute;pointer-events:none;font-size:13px;font-weight:700}
.lab{background:#000a;padding:3px 8px;border-radius:8px}
#oppv{border:2px solid #ffffff88;border-radius:6px;box-sizing:border-box}
#oppv span{position:absolute;left:4px;top:4px;right:4px;background:#000a;padding:2px 6px;border-radius:6px;font-size:12px} /* wraps in the narrow phone inset: spend and GET stay readable */
#mo{position:absolute;transform:translate(-50%,-50%);background:#1d1830ee;border:1px solid #5b4d8f;border-radius:14px;padding:12px 16px;text-align:center;width:max-content;max-width:min(80vw,340px)}
#moMsg{white-space:pre-line;font-size:16px;line-height:1.5} #mo.big #moMsg{font-size:64px;font-weight:900;line-height:1.1}
#mo .row{justify-content:center}
@media (max-height:500px){ /* phone on its side: lobby steps side by side so it fits without scrolling */
  #lobby{width:min(96vw,760px);padding:8px 14px} #lobby ol{display:grid;grid-template-columns:1fr 1fr;gap:4px 16px} #lobby h2{display:none}
  #lobby textarea{height:3.2em}
}
