/* 保留游戏卡池的布局和立绘；可见文字只用于操作、记录和人数。 */
:root {
  --paper: #f5f2eb;
  --ink: #101522;
  --pool-a: #e2c184;
  --pool-b: #91cdd8;
  --surface: #182131;
  --line: #303a4b;
  --muted: #a0aaba;
  --danger: #eda89c;
  --font-text: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --font-num: "Bahnschrift", "Cascadia Mono", sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); }
body { color: var(--paper); font-family: var(--font-text); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button { color: inherit; font: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 2px solid var(--pool-a); outline-offset: 4px; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { cursor: not-allowed; }

.lobby {
  --accent: var(--pool-a);
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) minmax(380px, 42%);
  gap: 24px;
  height: 100svh;
  min-height: 420px;
  padding: 30px;
  overflow: hidden;
  background: radial-gradient(ellipse at 37% 43%, #2c3b51 0, #192435 38%, var(--ink) 75%);
}
.lobby[data-pool="b"] { --accent: var(--pool-b); }
.lobby::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: .4;
  background-image: radial-gradient(1px 1px at 24px 57px, var(--paper) 90%, transparent), radial-gradient(1px 1px at 187px 150px, var(--pool-a) 90%, transparent);
  background-size: 281px 249px, 359px 327px;
  pointer-events: none;
}

/* 左侧卡池。未解锁的池可预览，但不能抽取。 */
.pool-nav { display: flex; flex-direction: column; gap: 18px; align-self: center; padding-bottom: 90px; min-width: 0; }
.pool-tab { position: relative; isolation: isolate; display: flex; align-items: flex-end; min-height: 130px; overflow: hidden; padding: 17px; border: 1px solid var(--line); border-radius: 3px 17px 3px 3px; background: var(--surface); text-align: left; }
.pool-tab::after { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(0deg, var(--ink), rgba(16, 21, 34, .15) 100%); }
.pool-tab img { position: absolute; z-index: -2; width: 195px; height: 195px; object-fit: contain; top: -35px; right: -28px; opacity: .55; transition: opacity .25s; }
.pool-tab > span { font-size: 17px; font-weight: 600; letter-spacing: .03em; }
.pool-tab:hover { border-color: var(--muted); }
.pool-tab.is-active { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 18px rgba(226, 193, 132, .07); }
.pool-tab.is-active img { opacity: 1; }
.pool-tab.is-active::before { content: ''; position: absolute; right: 14px; bottom: 24px; width: 4px; height: 4px; background: var(--accent); transform: rotate(45deg); }
.pool-lock { position: absolute; top: 12px; right: 12px; width: 15px; height: 15px; fill: none; stroke: var(--paper); stroke-width: 1.5; stroke-linecap: round; opacity: .75; }

/* 中间只有角色立绘和抽取按钮，不加标题、标语、步骤等文案。 */
.pool-scene { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.pool-art { position: absolute; z-index: -1; inset: -20px -65px 80px -65px; pointer-events: none; }
.pool-art__image { position: absolute; top: 48%; left: 50%; width: 120%; height: 106%; object-fit: contain; opacity: 0; transform: translate(-50%, -50%) scale(.97); transition: opacity .4s, transform .6s var(--ease-out); filter: drop-shadow(0 14px 24px rgba(0, 0, 0, .25)); }
.pool-art__image.is-visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#art-b { width: 113%; height: 105%; }
.pool-art__orbit { position: absolute; top: 49%; left: 50%; width: 85%; aspect-ratio: 1; max-width: 640px; border: 1px solid rgba(226, 193, 132, .18); border-radius: 50%; transform: translate(-50%, -50%) rotate(-24deg); }
.pool-art__orbit::before { content: ''; position: absolute; inset: 15px; border: 1px solid rgba(226, 193, 132, .06); border-radius: 50%; }
.pool-art__orbit::after { content: ''; position: absolute; top: 50%; left: -3px; width: 5px; height: 5px; transform: rotate(45deg); background: var(--accent); box-shadow: 0 0 15px var(--accent); }
.controls { display: flex; flex-direction: column; align-items: center; gap: 15px; width: 100%; padding: 18px 0 3px; }
.draw-button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 24px; width: min(100%, 320px); min-height: 66px; padding: 17px 28px; border: 1px solid var(--accent); border-radius: 3px 20px 3px 3px; color: var(--ink); background: linear-gradient(115deg, var(--paper), var(--accent)); box-shadow: 0 5px 30px rgba(226, 193, 132, .1); }
.draw-button::after { content: ''; position: absolute; inset: 4px; border: 1px solid rgba(16, 21, 34, .18); border-radius: 0 14px 0 0; pointer-events: none; }
.draw-button__mark { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.1; }
#draw-label { font-size: 23px; font-weight: 700; letter-spacing: .1em; white-space: nowrap; }
#draw-sub { font-size: 13px; white-space: nowrap; opacity: .75; }
.draw-button:hover:not(:disabled) { filter: brightness(1.09); }
.draw-button:disabled { background: var(--surface); color: var(--muted); border-color: var(--line); box-shadow: none; }
.draw-button:disabled::after { border-color: var(--line); }
.controls__secondary { display: flex; align-items: center; justify-content: center; gap: 30px; }
.control-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 40px; padding: 9px 8px; border: 1px solid transparent; border-radius: 3px; background: transparent; font-size: 13px; color: var(--muted); }
.control-button:hover { color: var(--paper); }
#anim-state { color: var(--accent); font-size: 11px; }
#anim[aria-pressed="false"] #anim-state { color: var(--muted); }
#reset.is-armed { color: var(--danger); border-color: var(--danger); }

/* 记录占据宽侧栏，姓名远大于界面其他文字。 */
.history { display: flex; flex-direction: column; min-width: 0; min-height: 0; border: 1px solid var(--line); border-top-color: rgba(226, 193, 132, .45); border-radius: 3px; background: rgba(12, 18, 30, .85); box-shadow: 0 10px 35px rgba(0, 0, 0, .12); }
.history__heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: 0 0 auto; margin: 0 20px; padding: 23px 2px; border-bottom: 1px solid var(--line); }
.history__heading h1 { margin: 0; font-size: 15px; font-weight: 500; letter-spacing: .06em; }
.history__heading > span { color: var(--muted); font: 13px / 1 var(--font-num); }
.board { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.wall { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-content: start; }
.cell { container-type: inline-size; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px; min-width: 0; min-height: 136px; padding: 24px 10px; border: 1px solid var(--line); border-radius: 3px; background: rgba(27, 36, 52, .7); text-align: center; }
.cell__index { position: absolute; top: 9px; left: 11px; color: var(--muted); font: 13px / 1 var(--font-num); letter-spacing: .08em; }
.cell__name { max-width: 100%; font-size: clamp(26px, 18cqw, 42px); font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; text-wrap: pretty; }
.cell__title { color: var(--pool-a); font-size: 14px; line-height: 1.5; letter-spacing: .08em; overflow-wrap: anywhere; }
.cell.is-latest { border-color: var(--pool-a); background: rgba(226, 193, 132, .1); }
.cell--b.is-latest { border-color: var(--pool-b); background: rgba(145, 205, 216, .1); }
.cell.is-arriving { animation: cell-land 350ms var(--ease-out) both; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@keyframes cell-land { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (min-width: 1800px) {
  .lobby { grid-template-columns: 180px minmax(0, 1fr) minmax(580px, 40%); gap: 34px; padding: 40px; }
  .pool-tab { min-height: 156px; padding: 21px; }
  .pool-tab img { width: 235px; height: 235px; }
  .pool-tab > span { font-size: 20px; }
  .cell { min-height: 158px; }
}
@media (max-width: 1150px) {
  .lobby { grid-template-columns: 114px minmax(0, 1fr) minmax(342px, 42%); gap: 18px; padding: 22px; }
  .pool-tab { min-height: 116px; padding: 13px; }
  .pool-tab > span { font-size: 15px; }
  .pool-tab img { right: -47px; }
  .pool-tab.is-active::before { right: 10px; bottom: 20px; }
  .history__heading { margin-inline: 14px; padding-block: 19px; }
  .board { padding: 14px; }
  .wall { gap: 10px; }
  .cell { padding-inline: 8px; min-height: 126px; }
  .cell__title { font-size: 12px; }
  .draw-button { gap: 15px; padding-inline: 16px; }
  #draw-label { font-size: 21px; }
  .pool-art { left: -60px; right: -50px; }
}
@media (min-width: 641px) and (max-width: 900px) {
  .lobby { grid-template-columns: minmax(0, 1fr) minmax(300px, 46%); grid-template-rows: 80px minmax(0, 1fr); gap: 18px; }
  .pool-nav { grid-area: 1 / 1; flex-direction: row; align-self: stretch; padding: 0; gap: 10px; }
  .pool-tab { flex: 1; min-width: 0; min-height: 0; padding: 12px; }
  .pool-tab img { width: 156px; height: 156px; top: -47px; right: -26px; }
  .pool-tab.is-active::before { bottom: 18px; }
  .pool-lock { top: 7px; right: 9px; width: 13px; height: 13px; }
  .pool-scene { grid-area: 2 / 1; }
  .history { grid-area: 1 / 2 / 3 / 3; }
  .pool-art { inset: -20px -36px 86px; }
  .pool-art__image { width: 128%; }
  .cell { min-height: 119px; }
  .cell__name { font-size: clamp(25px, 19cqw, 34px); }
}
@media (max-width: 640px) {
  .lobby { height: auto; min-height: 100svh; grid-template-columns: minmax(0, 1fr); grid-template-rows: 74px 318px minmax(270px, 1fr); gap: 16px; padding: 18px 14px; }
  .pool-nav { flex-direction: row; align-self: stretch; gap: 12px; padding: 0; }
  .pool-tab { flex: 1; min-width: 0; min-height: 0; padding: 13px 16px; }
  .pool-tab > span { font-size: 17px; }
  .pool-tab img { width: 172px; height: 172px; right: -11px; top: -49px; }
  .pool-tab.is-active::before { bottom: 22px; right: 14px; }
  .pool-lock { top: 9px; right: 11px; width: 13px; height: 13px; }
  .pool-art { inset: -23px -14px 48px; }
  .pool-art__image { height: 119%; width: 100%; top: 44%; }
  #art-b { height: 123%; width: 100%; top: 44%; }
  .pool-art__orbit { width: 72%; top: 41%; }
  .controls { gap: 5px; padding: 0; }
  .draw-button { min-height: 55px; width: 240px; gap: 23px; padding: 13px 20px; }
  .draw-button__mark { width: 23px; height: 23px; }
  #draw-label { font-size: 21px; }
  #draw-sub { font-size: 12px; }
  .control-button { min-height: 36px; font-size: 12px; }
  .history { height: max(270px, calc(100svh - 460px)); max-height: 540px; }
  .history__heading { margin-inline: 14px; padding-block: 17px; }
  .history__heading h1 { font-size: 14px; }
  .board { padding: 12px; }
  .cell { padding: 21px 7px; min-height: 115px; }
  .cell__name { font-size: clamp(26px, 20cqw, 38px); }
  .cell__title { font-size: 12px; }
}
@media (max-width: 360px) {
  .lobby { padding-inline: 10px; }
  .board { padding: 9px; }
  .wall { gap: 8px; }
  .cell { padding-inline: 5px; }
  .cell__name { font-size: 25px; }
}
@media (min-width: 641px) and (max-height: 560px) {
  .lobby { padding: 16px; gap: 14px; }
  .pool-nav { padding-bottom: 0; }
  .pool-tab { min-height: 90px; }
  .pool-art { bottom: 74px; }
  .controls { gap: 2px; padding: 0; }
  .draw-button { min-height: 54px; }
  .history__heading { padding-block: 16px; }
  .cell { min-height: 105px; padding-block: 17px; }
}
@media (min-width: 641px) and (max-width: 900px) and (max-height: 560px) {
  .pool-nav { padding: 0; }
  .pool-tab { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) { .cell.is-arriving { animation: none; } .pool-tab img, .pool-art__image { transition: none; } }
.anim-off .cell.is-arriving { animation: none; }
.anim-off .pool-art__image { transition: none; }
