/* MUST Poker —— 印铁四色：薄荷绿打底、翠绿台面、墨绿描边、蛋黄只给“轮到你”和主按钮、朱红只给全下和危险。
 * 没有渐变、发光、毛玻璃；层次靠描边和双线边框。 */

@font-face { font-family: "HuangYou"; src: url("/fonts/huangyou.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Sofia SSC"; src: url("/fonts/sofia.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }

:root {
  /* 老一点的浏览器不认 oklch，先给 sRGB；新的在下面覆盖 */
  --ink: #0c392b;
  --ink-2: #355c4d;
  --line: rgba(12, 57, 43, 0.22);
  --mint-0: #e9f8f1;
  --mint-1: #d3f0e3;
  --mint-2: #bae4d3;
  --mint-3: #9ad2bc;
  --jade: #258264;
  --jade-deep: #12674e;
  --yolk: #facc47;
  --yolk-2: #efb727;
  --yolk-0: #fdeec1;
  --red: #ca3328;
  --red-2: #b02018;
  --red-0: #ffdfd9;
  --paper: #fafefc;

  --display: "HuangYou", "PingFang SC", "Microsoft YaHei", sans-serif;
  --text: "Sofia SSC", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --r-s: 8px;
  --r-m: 12px;
  --r-l: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: 16px;
  color-scheme: light;
}

@supports (color: oklch(0.5 0.1 168)) {
  :root {
    --ink: oklch(0.31 0.055 168);
    --ink-2: oklch(0.44 0.05 168);
    --line: oklch(0.31 0.055 168 / 0.22);
    --mint-0: oklch(0.965 0.018 168);
    --mint-1: oklch(0.93 0.034 168);
    --mint-2: oklch(0.885 0.05 168);
    --mint-3: oklch(0.82 0.066 168);
    --jade: oklch(0.545 0.098 167);
    --jade-deep: oklch(0.46 0.088 167);
    --yolk: oklch(0.862 0.153 89);
    --yolk-2: oklch(0.81 0.157 85);
    --yolk-0: oklch(0.95 0.06 92);
    --red: oklch(0.555 0.19 29);
    --red-2: oklch(0.49 0.18 29);
    --red-0: oklch(0.93 0.04 29);
    --paper: oklch(0.993 0.004 165);
  }
}

* { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100%; background: var(--mint-2); color: var(--ink);
  font: 400 15px/1.5 var(--text); font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1, h2, h3 { font-weight: 700; line-height: 1.25; text-wrap: balance; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
::selection { background: var(--ink); color: var(--yolk); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
* { scrollbar-color: var(--jade-deep) transparent; scrollbar-width: thin; }
svg { display: block; }

.icon { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.suit { width: 1em; height: 1em; fill: currentColor; }
.chip { width: 1.15em; height: 1.15em; flex: none; }
.lid { width: 56px; height: 56px; flex: none; }
.n { font-weight: 700; }
.muted { color: var(--ink-2); }
.disp, h1 { font-synthesis: none; }
.disp { font-family: var(--display); font-weight: 400; letter-spacing: 0.01em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- 按钮：全站一种形状 ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 18px;
  border: 2px solid var(--ink); border-radius: var(--r-m); background: var(--paper); color: var(--ink);
  font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s, transform 0.1s; touch-action: manipulation; user-select: none;
}
@media (hover: hover) { .btn:hover { background: var(--mint-1); } }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-busy="true"] { background: transparent; border-color: var(--line); color: var(--ink-2); cursor: not-allowed; transform: none; }
.btn.main { background: var(--yolk); }
@media (hover: hover) { .btn.main:hover { background: var(--yolk-2); } }
.btn.main[disabled] { background: var(--mint-1); }
.btn.danger { background: var(--red); color: var(--paper); }
@media (hover: hover) { .btn.danger:hover { background: var(--red-2); } }
.btn.small { min-height: 34px; padding: 5px 12px; font-size: 14px; border-radius: 10px; }
.btn.wide { width: 100%; }
.btn.plain { border-color: transparent; background: transparent; padding-inline: 10px; }
@media (hover: hover) { .btn.plain:hover { background: oklch(0.31 0.055 168 / 0.08); } }
.iconbtn { width: 40px; min-height: 40px; padding: 0; flex: none; }

/* ---- 输入框 ---- */
.field { display: grid; gap: 6px; }
.field > span, .label { font-weight: 700; font-size: 14px; }
.input {
  width: 100%; min-height: 44px; padding: 8px 12px; border: 2px solid var(--ink); border-radius: var(--r-m);
  background: var(--paper); font-size: 16px; caret-color: var(--red);
}
.input::placeholder { color: var(--ink-2); opacity: 1; }
.input:focus { outline: 3px solid var(--ink); outline-offset: 1px; }
.input[aria-invalid="true"] { border-color: var(--red); }
.err { color: var(--red-2); font-weight: 700; font-size: 14px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 2px solid var(--ink); border-radius: var(--r-m); overflow: hidden; background: var(--paper); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg span { display: grid; place-items: center; min-height: 38px; font-weight: 700; border-left: 1px solid var(--line); }
.seg label:first-child span { border-left: 0; }
.seg input:checked + span { background: var(--ink); color: var(--yolk); }
.seg input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: -3px; }

/* ---- 罐身：双线边框的面板 ---- */
.tin { position: relative; background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r-l); padding: 5px; }
.tin::before { content: ""; position: absolute; inset: 4px; border: 1px solid var(--mint-3); border-radius: 12px; pointer-events: none; }
.tin > * { overflow: hidden; }                            /* 行线、高亮底都停在内线以内 */
.tin > :first-child { border-radius: 11px 11px 0 0; }
.tin > :last-child { border-radius: 0 0 11px 11px; }
.tin > :only-child { border-radius: 11px; }
.tin > .in { padding: 16px 18px 18px; overflow: visible; }
.tin h2 { font-size: 18px; }
.tin h2 + .kv, .tin h2 + .handrank { margin-top: 14px; }

/* ---- 外壳 ---- */
#app { min-height: 100dvh; display: flex; flex-direction: column; }
.bar { background: var(--ink); color: var(--mint-1); position: sticky; top: 0; z-index: 20; }
.bar > div { max-width: 1216px; margin: 0 auto; padding: 8px var(--gutter); display: flex; align-items: center; gap: 18px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--yolk); font: 400 26px/1 var(--display); white-space: nowrap; }
.brandmark { width: 36px; height: 36px; flex: none; }
.bar :focus-visible { outline-color: var(--yolk); }
.nav { display: flex; gap: 4px; margin-left: 10px; }
.nav a { display: flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px; text-decoration: none; font-weight: 600; color: var(--mint-2); }
@media (hover: hover) { .nav a:hover { background: oklch(1 0 0 / 0.1); color: var(--paper); } }
.nav a[aria-current] { background: var(--mint-2); color: var(--ink); }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who b { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .n { color: var(--yolk); display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.bar .lat { color: var(--mint-2); }
.bar .btn { background: transparent; border-color: oklch(1 0 0 / 0.35); color: var(--mint-1); }
@media (hover: hover) { .bar .btn:hover { background: oklch(1 0 0 / 0.12); } }
.page { flex: 1; width: 100%; max-width: 1216px; margin: 0 auto; padding: 26px var(--gutter) 40px; }
.page > h1 { font: 400 34px/1.1 var(--display); margin-bottom: 18px; }
.tabs { display: none; }
.strip { background: var(--red); color: var(--paper); padding: 8px var(--gutter); text-align: center; font-weight: 700; position: sticky; top: 0; z-index: 40; }
.strip .btn { margin-left: 10px; background: transparent; border-color: var(--paper); color: var(--paper); }
.foot { padding: 14px var(--gutter) 18px; text-align: center; font-size: 13px; color: var(--ink-2); }
.foot a { color: var(--ink); }

/* 跑马灯 */
.ticker { background: var(--mint-1); border-top: 2px solid var(--ink); position: sticky; bottom: 0; z-index: 10; overflow: hidden; }
.ticker > div { max-width: 1216px; margin: 0 auto; padding: 8px var(--gutter); display: flex; gap: 12px; align-items: center; min-height: 40px; }
.ticker b { flex: none; font-weight: 800; background: var(--ink); color: var(--mint-0); border-radius: 6px; padding: 1px 8px; font-size: 13px; }
.ticker span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticker .in { animation: tick-in 0.5s var(--ease); }
@keyframes tick-in { from { transform: translateY(100%); } }

/* ---- 登录 ---- */
.login { flex: 1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); min-height: 0; }
.login-art { background: var(--jade); color: var(--paper); border-right: 2px solid var(--ink); padding: clamp(24px, 4vw, 60px); display: grid; place-content: center; overflow: hidden; }
.login-hero { display: flex; align-items: center; gap: clamp(18px, 2.6vw, 40px); }
.login-hero .brandmark { width: clamp(132px, 17vw, 264px); height: auto; }
.login-art h1 { font: 400 clamp(48px, 6.8vw, 108px)/0.95 var(--display); color: var(--yolk); letter-spacing: 0; }
.login-side { padding: clamp(20px, 4vw, 56px) clamp(16px, 4vw, 64px); display: flex; flex-direction: column; justify-content: center; gap: 26px; max-width: 620px; width: 100%; }
.login-form { display: grid; gap: 16px; }
.login-form h2 { font-size: 22px; }
.pw { position: relative; }
.pw .iconbtn { position: absolute; right: 4px; top: 4px; min-height: 36px; width: 38px; border-color: transparent; background: transparent; }
.pw .input { padding-right: 50px; }
.notice { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--yolk-0); border: 2px solid var(--ink); border-radius: var(--r-m); padding: 10px 14px; font-weight: 600; }
.notice .btn { margin-left: auto; }
.notice .icon { width: 20px; height: 20px; }

/* ---- 大厅 ---- */
.lobby { display: grid; grid-template-columns: minmax(0, 1fr) 348px; gap: 22px; align-items: start; }
.lobby-head { display: flex; align-items: center; gap: 10px 14px; margin-bottom: 14px; flex-wrap: wrap; }
.lobby-head h1 { font: 400 34px/1.1 var(--display); }
.roomjoin { margin-left: auto; display: grid; grid-template-columns: auto 8.4em auto; align-items: center; gap: 0 8px; }
.roomjoin label { font-weight: 700; font-size: 14px; white-space: nowrap; }
.roomjoin .input { width: 100%; min-height: 42px; font-weight: 700; letter-spacing: 0.04em; }
.roomjoin .err { grid-column: 2 / -1; padding-top: 5px; max-width: 19em; line-height: 1.35; }
.roomjoin .err:empty { display: none; }
.roomjoin .input::placeholder { font-weight: 400; letter-spacing: 0; }
.roomjoin .btn { min-width: 5.6em; padding-inline: 12px; }
.rows li { display: grid; grid-template-columns: 60px minmax(0, 1.2fr) minmax(90px, 0.6fr) minmax(0, 0.85fr) 92px; gap: 14px; align-items: center; padding: 13px 18px; border-top: 1px solid var(--line); }
.rows li:first-child { border-top: 0; }
.rows .lid { width: 60px; height: 60px; }
.rows .meta { display: contents; }
.rows .disp { font-size: 25px; line-height: 1.15; display: block; }
.rows small { font-size: 13px; color: var(--ink-2); display: block; }
.dots { display: flex; gap: 4px; align-items: center; }
.dots i { width: 12px; height: 12px; border: 2px solid var(--ink); border-radius: 50%; }
.dots i.on { background: var(--ink); }
.dots .n { margin-left: 5px; white-space: nowrap; }
.state { font-weight: 700; }
.state.playing { color: var(--jade-deep); }
.rows .btn { justify-self: end; width: 100%; padding-inline: 8px; }
.blank { padding: 34px 24px 38px; display: grid; justify-items: center; gap: 12px; text-align: center; }
.blank .lid { width: 92px; height: 92px; }
.blank p { max-width: 30em; }
.side { display: grid; gap: 18px; }
.newtable { display: grid; gap: 11px; }
.newtable .or { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 13px; }
.newtable .or::before, .newtable .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.skeleton { height: 60px; border-radius: 10px; background: var(--mint-1); margin: 14px 22px; }

/* 网络成分表：照着食品标签的样子 */
.facts { font-size: 14px; }
.facts h2 { font: 400 24px/1 var(--display); padding-bottom: 8px; border-bottom: 8px solid var(--ink); }
.facts dl { display: grid; }
.facts dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1px solid var(--ink); }
.facts dl > div:first-child { border-top: 0; }
.facts dl > div.thick { border-top-width: 4px; }
.facts dt { font-weight: 500; }
.facts dt small { color: var(--ink-2); font-size: 12px; display: block; line-height: 1.3; }
.facts dd { font-weight: 800; text-align: right; white-space: nowrap; }
.facts .btn { margin-top: 12px; }
.facts dt .icon { display: inline-block; width: 15px; height: 15px; vertical-align: -2px; margin: 0 5px; }
.facts .bad { color: var(--red-2); }

/* 聊天 */
.chatbox { display: flex; flex-direction: column; min-height: 0; }
.chatlog { flex: 1; overflow-y: auto; min-height: 96px; max-height: 240px; margin-top: 8px; display: flex; flex-direction: column; gap: 5px; padding-right: 4px; overscroll-behavior: contain; }
.chatlog p { line-height: 1.4; }
.chatlog b { margin-right: 6px; }
.chatlog b.me { color: var(--jade-deep); }
.chatlog .empty { color: var(--ink-2); }
.chatform { display: flex; gap: 8px; margin-top: 10px; }
.chatform .input { min-height: 40px; min-width: 0; }
.chatform .btn { min-height: 40px; padding-inline: 14px; }

/* ---- 等待室 ---- */
.room { display: grid; grid-template-columns: minmax(0, 1fr) 348px; gap: 22px; align-items: start; }
.room-top { display: flex; align-items: center; gap: 24px; padding: 26px 26px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.room-top .lid { width: 176px; height: 176px; view-transition-name: lid; }
.room-top h1 { font: 400 52px/1 var(--display); }
.room-top p { margin-top: 8px; }
/* 房间号：像罐底印的批号。点复制，或者念给同学听 */
.roomcode { margin-left: auto; display: grid; grid-template-columns: auto auto; align-items: center; gap: 2px 14px; padding: 12px 14px 12px 18px; border: 2px solid var(--ink); border-radius: var(--r-m); background: var(--mint-0); }
.roomcode .label { grid-column: 1 / -1; color: var(--ink-2); }
.roomcode .roomno { font-size: 34px; line-height: 1.1; font-weight: 800; letter-spacing: 0.02em; white-space: nowrap; user-select: all; }
.seats6 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 22px 26px; }
.seatcell { display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 8px 10px 8px 16px; border: 2px solid var(--ink); border-radius: var(--r-m); background: var(--mint-0); }
.seatcell.empty { border-style: dashed; border-color: var(--ink-2); background: transparent; color: var(--ink-2); }
.seatcell.me { background: var(--yolk-0); }
.seatcell b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.seatcell .tag { margin-left: auto; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; padding: 1px 8px; border: 1.5px solid currentColor; border-radius: 99px; white-space: nowrap; }
.room-foot { display: flex; gap: 12px; padding: 0 26px 26px; flex-wrap: wrap; align-items: center; }
.room-foot .grow { flex: 1; }
.botpick { display: flex; gap: 6px; margin-left: auto; }

/* ---- 排行、我的、帮助 ---- */
.table { width: 100%; border-collapse: collapse; }
.table th { white-space: nowrap; }
.table th { text-align: left; font-size: 13px; color: var(--ink-2); font-weight: 600; padding: 10px 18px; }
.table td { padding: 11px 18px; border-top: 1px solid var(--line); }
.table .r { text-align: right; }
.table tr.me td { background: var(--yolk-0); font-weight: 700; }
.table .no, .table tr.me .no { font: 400 22px/1 var(--display); font-synthesis: none; width: 3em; min-width: 3em; }
.hands { display: grid; gap: 0; }
.hands details { border-top: 1px solid var(--line); }
.hands summary { padding: 11px 18px; cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.hands summary::-webkit-details-marker { display: none; }
.hands summary .icon { transition: transform 0.2s var(--ease); }
.hands details[open] summary .icon { transform: rotate(180deg); }
.hands pre { margin: 0; padding: 0 18px 16px; font: 400 14px/1.65 var(--text); white-space: pre-wrap; }
.stack { display: grid; gap: 20px; }
.helpgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.prose { display: grid; gap: 10px; max-width: 68ch; }
.prose h2 { margin-top: 8px; }
.prose li { padding-left: 1.2em; position: relative; }
.prose li::before { content: ""; position: absolute; left: 2px; top: 0.27em; width: 7px; height: 7px; border: 2px solid var(--ink); border-radius: 50%; }
.handrank { display: grid; gap: 10px; }
.handrank li { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: center; }
.handrank .cards { display: flex; gap: 4px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
kbd { font: 700 13px/1 var(--text); border: 1.5px solid var(--ink); border-radius: 6px; padding: 3px 8px; background: var(--paper); display: inline-block; }

/* ---- 名次 ---- */
.result { max-width: 720px; margin: 0 auto; }
.result-top { padding: 34px 26px 22px; text-align: center; display: grid; justify-items: center; gap: 12px; }
.result-top .lid { width: 188px; height: 188px; animation: lid-drop 0.7s var(--ease); }
@keyframes lid-drop { from { transform: translateY(-46px) rotate(-24deg); opacity: 0; } }
.result-top h1 { font: 400 clamp(38px, 6vw, 58px)/1.05 var(--display); }
.result-foot { display: flex; gap: 12px; justify-content: center; padding: 22px 26px 28px; flex-wrap: wrap; }

/* ---- 提示、对话框 ---- */
.toasts { position: fixed; left: 50%; top: 76px; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); border: 2px solid var(--paper); border-radius: var(--r-m); padding: 10px 18px; font-weight: 600; box-shadow: 0 6px 20px oklch(0.31 0.055 168 / 0.28); animation: toast-in 0.25s var(--ease); }
.toast.warn { background: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }
dialog.ask { border: 2px solid var(--ink); outline: 1px solid var(--mint-3); outline-offset: -7px; border-radius: var(--r-l); background: var(--paper); color: var(--ink); padding: 28px; max-width: min(440px, calc(100vw - 32px)); box-shadow: 0 18px 50px oklch(0.31 0.055 168 / 0.35); }
dialog.ask::backdrop { background: oklch(0.31 0.055 168 / 0.5); }
dialog.ask h2 { font-size: 21px; }
dialog.ask p { margin-top: 8px; }
dialog.ask .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
.splash { flex: 1; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 40px; text-align: center; }
.splash .lid { width: 110px; height: 110px; }
.handshead { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.login-form small { line-height: 1.4; }
.factsbox { position: relative; }
.factsbox > .btn { position: absolute; right: 18px; top: 10px; margin: 0; }
.mefacts { max-width: 460px; }
