/* 다빈치코드 — 밝은 회색 테마
   색은 전부 아래 변수로 모아두었다. 팔레트만 갈아끼우면 테마가 바뀐다. */
:root {
  --display:"Gowun Batang","Nanum Myeongjo",Georgia,serif;

  --bg:#eceef1;
  --panel:#fbfcfd;
  --panel2:#f3f5f8;
  --line:#d3d8e0;
  --line-2:#e4e8ee;
  --ink:#1e232b;
  --dim:#59616d;
  --faint:#8a94a2;
  --accent:#2f4f7a;
  --accent-soft:#e3eaf4;
  --accent-ink:#f7fafd;

  /* 검정 타일 — 흑연 */
  --tb-bg:#2b3038;
  --tb-top:#3c434e;
  --tb-fg:#eef1f5;
  --tb-line:#1a1e24;
  --tb-edge:#12151acc;

  /* 흰 타일 — 차가운 상아 */
  --tw-bg:#fdfdfe;
  --tw-top:#ffffff;
  --tw-bg2:#e8edf3;
  --tw-fg:#1e232b;
  --tw-line:#c2cad6;
  --tw-edge:#98a3b2cc;

  --miss-bg:#f0dedd;
  --miss-fg:#8e4139;
  --hit:#3d6b52;
  --miss:#a8443a;

  --shadow-lift: 0 5px 12px rgba(30,40,55,.16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* hidden 속성은 브라우저 기본 규칙(display:none)으로 동작하는데,
   클래스에 display 가 선언돼 있으면 특이도에 밀려 무시된다.
   실제로 .chat 이 display:flex 라서 채팅창이 안 닫혔다. */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-y: auto; user-select: none;
}

/* ---------- 공통 화면 ---------- */
.screen { min-height: 100%; display: flex; justify-content: center; padding: 26px 18px 40px; }
.screen.hidden, .hidden { display: none !important; }
.wrap { width: 100%; max-width: 430px; }

h1 { font-family: var(--display); font-size: 22px; letter-spacing: .2em; font-weight: 700; margin-bottom: 8px; }
h2 { font-size: 12px; letter-spacing: .12em; color: var(--dim); font-weight: 700; margin-bottom: 10px; }
h2.sub { text-align: center; }
.tag { font-size: 12.5px; line-height: 1.8; color: var(--dim); margin-bottom: 20px; }
.fine { font-size: 11px; line-height: 1.7; color: var(--faint); margin-top: 8px; }
.dim { color: var(--dim); }

.block {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 15px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(30,40,55,.05);
}
.row { display: flex; gap: 8px; align-items: flex-end; }
.grow { flex: 1; }

.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 10.5px; letter-spacing: .1em; color: var(--faint); margin-bottom: 5px; }
input, select {
  width: 100%; font: inherit; font-size: 14px; padding: 10px 12px;
  color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.code-in { text-transform: uppercase; letter-spacing: .34em; text-align: center; font-weight: 700; }

button {
  font: inherit; font-size: 13.5px; font-weight: 700; padding: 11px 16px;
  border-radius: 9px; cursor: pointer; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(30,40,55,.07);
}
button:hover:not(:disabled) { background: var(--panel2); border-color: #b9c2ce; }
button:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
button:disabled { opacity: .4; cursor: default; box-shadow: none; }
button.primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  width: 100%; margin-bottom: 8px; box-shadow: 0 2px 6px rgba(47,79,122,.30);
}
button.primary:hover:not(:disabled) { background: #24405f; border-color: #24405f; }
button.ghost { background: none; border-color: transparent; color: var(--faint); width: 100%; margin-top: 6px; box-shadow: none; }
button.ghost:hover { background: rgba(30,40,55,.05); }

/* ---------- 대기실 ---------- */
.code {
  font-size: 42px; font-weight: 800; letter-spacing: .28em;
  text-align: center; color: var(--accent); margin: 4px 0; text-indent: .28em;
}
.seats { margin: 18px 0 14px; }
.seat {
  display: flex; align-items: center; gap: 9px; padding: 11px 13px; margin-bottom: 7px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px; font-size: 13px;
}
.seat .pill { font-size: 10px; padding: 2px 8px; border-radius: 20px; background: var(--panel2); color: var(--dim); font-weight: 600; }
.seat .pill.host { background: var(--accent-soft); color: var(--accent); }

/* ---------- 상단 바 ---------- */
.turndot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none;
  animation: blip 1.3s ease-in-out infinite;
}
@keyframes blip { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.8); } }
.turnwho { font-size: 15px; font-weight: 800; }
.turnwho.mineturn { color: var(--accent); }
#turnInfo { display: flex; align-items: center; gap: 8px; }

.bar {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; font-size: 13px; font-weight: 600;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 5;
}
.bar .spacer { flex: 1; }
.toggle { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--dim); cursor: pointer; font-weight: 400; }
.toggle input { width: auto; }

#game { display: block; padding: 0 0 30px; }
#panel, .log { max-width: 620px; margin: 0 auto; padding: 0 14px; }

/* ---------- 네 방향 자리 ---------- */
/* 윗부분은 예측 알림 자리로 항상 비워둔다. 알림이 떠도 판이 움직이지 않는다. */
.table {
  max-width: 900px; margin: 0 auto; padding: 86px 14px 0;
  display: grid; gap: 10px;
  grid-template-columns: minmax(0,1fr) minmax(0,1.5fr) minmax(0,1fr);
  grid-template-areas: "top top top" "left center right" "me me me";
}
.cell.top { grid-area: top; } .cell.left { grid-area: left; }
.cell.right { grid-area: right; } .cell.center { grid-area: center; }
.cell.me { grid-area: me; }
.cell:empty { display: none; }
@media (max-width: 640px) {
  .table { grid-template-columns: 1fr; grid-template-areas: "top" "left" "right" "center" "me"; }
}

.player {
  padding: 11px; border-radius: 12px; height: 100%;
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(30,40,55,.06);
}
.player.turn {
  border-color: var(--accent); background: #f4f8fd;
  box-shadow: 0 0 0 4px var(--accent-soft), 0 4px 14px rgba(47,79,122,.16);
}
.player:not(.turn):not(.mine) { opacity: .82; }
.turnbadge {
  font-size: 10px; font-weight: 800; letter-spacing: .06em;
  padding: 3px 8px; border-radius: 20px;
  background: var(--accent); color: var(--accent-ink);
}
.player.out { opacity: .45; }
.player.mine { padding: 15px; background: var(--panel); }
.phead { display: flex; align-items: center; gap: 7px; font-size: 12.5px; margin-bottom: 10px; flex-wrap: wrap; }
.phead .who { font-weight: 700; }
.phead .meta { font-size: 10.5px; color: var(--faint); font-weight: 500; }
.phead .meta.ok { color: var(--hit); font-weight: 700; }

/* 정리 중인 사람의 색 구성 — 배치는 감추되 무엇을 몇 장 가졌는지는 보여준다 */
.mix { display: inline-flex; gap: 3px; align-items: center; }
.mix span {
  font-size: 10px; font-weight: 800; line-height: 1;
  min-width: 17px; text-align: center; padding: 3px 4px; border-radius: 4px;
  font-variant-numeric: tabular-nums;
}
.mix .mixb { background: var(--tb-bg); color: var(--tb-fg); }
.mix .mixw { background: var(--tw-bg); color: var(--tw-fg); border: 1px solid var(--tw-line); }

.hand { display: flex; gap: 7px; flex-wrap: wrap; align-items: flex-start; justify-content: center; }
.mine .hand { gap: 10px; }
.tilewrap { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; }

/* ---------- 타일 ----------
   숨긴 패는 세워져 있고, 맞은 패는 눕혀진다. 실제 게임과 같다. */
.tile {
  --tilew: 46px; --tileh: 64px;
  width: var(--tilew); height: var(--tileh);
  border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums;
  border: 1px solid transparent; position: relative;
  transition: transform .14s ease, box-shadow .14s ease;
}
.tile.big { --tilew: 60px; --tileh: 84px; font-size: 28px; border-radius: 10px; }

/* 세워진 상태: 아래에 두께가 보이고 바닥에 그림자가 진다 */
.tile.b {
  background: linear-gradient(168deg, var(--tb-top) 0%, var(--tb-bg) 55%);
  color: var(--tb-fg); border-color: var(--tb-line);
  box-shadow: 0 4px 0 var(--tb-edge), var(--shadow-lift);
}
.tile.w {
  background: linear-gradient(168deg, var(--tw-top) 0%, var(--tw-bg2) 100%);
  color: var(--tw-fg); border-color: var(--tw-line);
  box-shadow: 0 4px 0 var(--tw-edge), var(--shadow-lift);
}
.tile::before {
  content: ''; position: absolute; left: 6px; right: 6px; top: 3px; height: 34%;
  border-radius: 6px 6px 40% 40%; background: linear-gradient(180deg, rgba(255,255,255,.30), transparent);
  pointer-events: none;
}
.tile.b::before { background: linear-gradient(180deg, rgba(255,255,255,.16), transparent); }

/* 아직 색조차 모르는 패 (시작 정리 중인 남의 패) */
.tile.unknown {
  background: repeating-linear-gradient(135deg, #d9cfba 0 6px, #cfc4ac 6px 12px);
  color: #8b7f68; border-color: #bdb098;
  box-shadow: 0 4px 0 #a2967e80, var(--shadow-lift);
}
.tile.unknown::before { content: none; }
.tile.unknown.down::after { content: '·'; color: rgba(90,80,62,.5); font-size: 22px; }

.tile.down { color: transparent; }
.tile.down::after {
  content: '?'; position: absolute; font-size: 19px; font-weight: 700;
  color: currentColor; opacity: 1;
}
.tile.b.down::after { color: rgba(245,240,230,.5); }
.tile.w.down::after { color: rgba(47,42,35,.36); }
.tile.big.down::after { font-size: 24px; }

/* 눕혀진 상태: 두께가 사라지고 안으로 눌린다 */
.tile.up {
  transform: translateY(6px) rotate(-3.5deg) scale(.9);
  box-shadow: inset 0 2px 5px rgba(30,40,55,.30);
  border-color: rgba(30,40,55,.30);
  filter: saturate(.75);
}
.tile.up::before { content: none; }
.tile.up::after {
  content: ''; position: absolute; inset: auto 0 -1px 0; height: 3px;
  border-radius: 0 0 8px 8px; background: var(--miss);
  opacity: .85;
}
.tile.w.up { background: #ece2cf; }
.tile.b.up { background: #332e27; }

/* 내 손패에서 나만 보는 숫자 */
.tile.own { border-style: dashed; border-color: var(--accent); }
.tile.own::after { content: none; }

.tile.joker { font-size: 34px; font-weight: 900; line-height: 1; letter-spacing: 0; }
.tile.big.joker { font-size: 44px; }

.tile.pick { cursor: pointer; }
/* 손가락으로 만지는 기기에서는 :hover 가 탭 뒤에도 남아 타일이 들린 채로 굳는다.
   마우스가 있는 기기에서만 들어 올린다. */
@media (hover: hover) {
  .tile.pick:hover { transform: translateY(-5px); box-shadow: 0 4px 0 var(--tb-edge), 0 12px 20px rgba(30,40,55,.24); }
  .tile.w.pick:hover { box-shadow: 0 4px 0 var(--tw-edge), 0 12px 20px rgba(30,40,55,.24); }
}
.tile.sel { outline: 3px solid var(--accent); outline-offset: 3px; }
.tile.arranging {
  outline: 3px solid var(--accent); outline-offset: 3px;
  box-shadow: 0 4px 0 var(--tw-edge), 0 10px 18px rgba(47,79,122,.32);
  animation: bob 1.5s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.tile.drawn { box-shadow: 0 4px 0 var(--tb-edge), 0 0 0 3px var(--accent), var(--shadow-lift); }
.tile.w.drawn { box-shadow: 0 4px 0 var(--tw-edge), 0 0 0 3px var(--accent), var(--shadow-lift); }

/* 작은 수 -> 큰 수 */
.dir { display: flex; align-items: center; gap: 6px; margin-top: 9px; font-size: 9.5px; color: var(--faint); letter-spacing: .08em; }
.dir .line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), #a89a80); }
.mine .dir { font-size: 10.5px; }

/* ---------- 연출 ---------- */
@keyframes smash {
  0%   { transform: none; }
  12%  { transform: translateY(-12px) scale(1.14); }
  30%  { transform: translateX(-5px) rotate(-9deg); }
  48%  { transform: translateX(5px) rotate(11deg); }
  100% { transform: translateY(6px) rotate(-3.5deg) scale(.9); }
}
.tile.smash { animation: smash .7s cubic-bezier(.3,1.3,.5,1); z-index: 3; }
.tile.smash::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: 1;
  background-image:
    linear-gradient(115deg, transparent 46%, rgba(184,69,47,.95) 47%, transparent 49%),
    linear-gradient(58deg, transparent 58%, rgba(184,69,47,.8) 59%, transparent 61%);
}
@keyframes shakeit {
  0%,100% { transform: none; }
  18% { transform: translateX(-6px) rotate(-4deg); }
  38% { transform: translateX(6px) rotate(4deg); }
  58% { transform: translateX(-4px) rotate(-2deg); }
  78% { transform: translateX(4px) rotate(1deg); }
}
.tile.shake { animation: shakeit .5s ease-in-out; }

@keyframes insertdrop {
  0%   { width: 0; opacity: 0; transform: translateY(-56px) rotate(-10deg); }
  45%  { width: var(--tilew); opacity: 1; transform: translateY(-16px) rotate(-4deg); }
  72%  { transform: translateY(5px) rotate(1deg); }
  100% { width: var(--tilew); transform: none; }
}
.tile.inserted { animation: insertdrop .62s cubic-bezier(.25,1.1,.4,1); z-index: 2; }

.hitflag {
  position: fixed; left: 50%; top: 46%; transform: translate(-50%,-50%);
  font-size: 86px; font-weight: 900; letter-spacing: .14em; z-index: 25;
  pointer-events: none; white-space: nowrap;
  animation: pop 1.15s cubic-bezier(.2,1.4,.4,1) forwards;
}
.hitflag.hit  { color: var(--hit);  text-shadow: 0 8px 34px rgba(79,122,58,.45), 0 2px 0 rgba(255,255,255,.6); }
.hitflag.miss { color: var(--miss); text-shadow: 0 8px 34px rgba(184,69,47,.45), 0 2px 0 rgba(255,255,255,.6); }
@media (max-width: 560px) { .hitflag { font-size: 58px; } }
@keyframes pop {
  0%   { opacity: 0; transform: translate(-50%,-50%) scale(.4); }
  16%  { opacity: 1; transform: translate(-50%,-50%) scale(1.22); }
  30%  { transform: translate(-50%,-50%) scale(1); }
  72%  { opacity: 1; transform: translate(-50%,-50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%,-64%) scale(1.06); }
}

/* ---------- 바닥 ---------- */
.floor { text-align: center; }
.floor h3 { font-size: 10.5px; letter-spacing: .1em; color: var(--dim); font-weight: 700; margin-bottom: 10px; }
.floor .pile { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.floor .pile + .pile { margin-top: 7px; }
.floor .pile .tile { --tilew: 30px; --tileh: 42px; font-size: 13px; border-radius: 6px; }
.floor .pile .tile.joker { font-size: 22px; }
.floor .pile .tile::after { font-size: 13px; }
.floor.can .pile .tile { cursor: pointer; }
@media (hover: hover) { .floor.can .pile .tile:hover { transform: translateY(-6px); } }
.drawn-box { margin-top: 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.drawn-box span { font-size: 10.5px; color: var(--dim); letter-spacing: .08em; font-weight: 600; }

/* ---------- 놓을 자리 ---------- */
.slots { display: flex; gap: 6px; justify-content: center; align-items: flex-start; margin-top: 4px; flex-wrap: wrap; }   /* 폰에서 줄이 화면 밖으로 밀리지 않게 */
.slot {
  width: 16px; height: 64px; border-radius: 6px; flex: none; cursor: pointer;
  border: 1px dashed #cbbfa6; background: rgba(47,79,122,.06);
  transition: background .12s, border-color .12s;
}
.slot.big { height: 84px; width: 20px; }
.slot.ok { border-color: var(--accent); background: var(--accent-soft); }
@media (hover: hover) { .slot:hover { background: rgba(47,79,122,.30); border-color: var(--accent); } }

/* ---------- 액션 패널 ---------- */
#panel { margin-top: 14px; }
.pnl {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 15px;
  box-shadow: 0 1px 2px rgba(30,40,55,.06);
}
.pnl .ask { font-size: 12.5px; color: var(--dim); margin-bottom: 12px; line-height: 1.6; }
.pnl .ask b { color: var(--ink); }
.nums { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.nums button { padding: 13px 0; font-size: 16px; }
.nums button.jk { grid-column: span 2; font-size: 13.5px; }
.nums button.off { opacity: .28; }
.acts { display: flex; gap: 8px; }
.acts button { flex: 1; }
.waiting { font-size: 12.5px; color: var(--faint); text-align: center; padding: 18px; }

.log { margin-top: 16px; font-size: 11px; line-height: 1.9; color: var(--faint); }
.log div:last-child { color: var(--ink); font-weight: 600; }

/* ---------- 결과 / 알림 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 24px; background: rgba(241,235,222,.95);
}
.overlay .card { max-width: 360px; width: 100%; text-align: center; margin: auto 0; }
.big { font-size: 28px; font-weight: 900; letter-spacing: .1em; margin-bottom: 10px; }
.sub { font-size: 13px; line-height: 1.9; color: var(--dim); margin-bottom: 18px; }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 600;
  padding: 11px 17px; border-radius: 9px; z-index: 30;
  opacity: 0; pointer-events: none; transition: opacity .2s;
  max-width: 90vw; text-align: center; box-shadow: 0 6px 18px rgba(30,40,55,.27);
}
.toast.on { opacity: 1; }

.guard {
  position: fixed; inset: 0; z-index: 9; background: var(--bg);
  display: none; align-items: center; justify-content: center;
  padding: 32px; text-align: center; font-size: 13px; line-height: 1.9; color: var(--dim);
}

/* 만든 사람 */
.sig {
  position: fixed; right: 9px; bottom: 7px; z-index: 1;
  font-size: 9px; letter-spacing: .1em; color: var(--faint);
  opacity: .4; pointer-events: none; user-select: none;
}

/* ---------- 예측 알림 ----------
   그 순간에만 크게 보이고 사라진다. 기록으로 남지 않으니 기억해야 한다.
   상단 가로 띠라서 상대 패를 가리지 않는다. */
.announce {
  position: fixed; left: 50%; top: 52px; transform: translateX(-50%) translateY(-12px);
  z-index: 24; pointer-events: none;
  display: flex; align-items: center; gap: 15px;
  padding: 8px 12px 8px 20px; border-radius: 999px; max-width: 94vw;
  background: #ffffff; border: 2px solid var(--line);
  box-shadow: 0 10px 30px rgba(30,40,55,.30);
  opacity: 0; transition: opacity .16s ease, transform .16s ease;
}
.announce.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.announce.hit { border-color: var(--hit); box-shadow: 0 10px 30px rgba(47,125,58,.32); }
.announce.miss { border-color: var(--miss); box-shadow: 0 10px 30px rgba(184,69,47,.32); }

.a-who { font-size: 14px; font-weight: 700; color: var(--dim); white-space: nowrap; }
.announce .tile { --tilew: 36px; --tileh: 50px; font-size: 18px; }
.announce .tile.joker { font-size: 28px; }
.a-label {
  font-size: 25px; font-weight: 900; letter-spacing: .04em; color: var(--ink);
  white-space: nowrap; padding-right: 8px;
}
.announce.hit .a-label { color: var(--hit); }
.announce.miss .a-label { color: var(--miss); }

@media (max-width: 560px) {
  .a-who { font-size: 12px; white-space: normal; }
  .a-label { font-size: 20px; }
  .announce { gap: 10px; padding: 8px 10px 8px 14px; }
}

/* ---------- 타이틀 ---------- */
.hero { text-align: center; padding-top: 4vh; }

.hero-tiles {
  display: flex; justify-content: center; align-items: flex-end;
  margin-bottom: 30px; padding-top: clamp(28px, 12vh, 130px);   /* 화면을 조금 아래로 */
  perspective: 700px;
}
/* 타일 다섯 장이 미끄러져 들어와 정렬되고(--i 순서), 한 장씩 뒤집히며 글자가 드러난다.
   등장은 translate, 뒤집기는 rotate(개별 속성), 둥둥은 transform — 셋이 서로 안 겹친다 */
.hero-tiles .tile {
  --d: calc(var(--i) * .14s);
  --flip: calc(1.05s + var(--i) * .3s);
  --tilew: 76px; --tileh: 106px; font-size: 34px;   /* 타일이 곧 표제라 크게 */
  margin: 0 -1px;
  transform: rotate(var(--r)) translateY(0);
  animation: tileIn .6s cubic-bezier(.2,.8,.25,1.08) var(--d) backwards,
             flip .62s cubic-bezier(.45,.05,.25,1) var(--flip) both,
             heroFloat 3.4s ease-in-out calc(var(--flip) + .8s) infinite;
}
@keyframes tileIn { from { opacity: 0; translate: 120px 8px; } 70% { translate: -4px 0; } }
/* 진짜 3D 뒤집기 — 0→180° 를 끊김 없이 돌고, 앞면(?)은 뒷면이 되는 순간 숨고
   글자는 미리 180° 돌려 둬서 다 돌았을 때 바로 읽힌다 */
@keyframes flip { to { rotate: y 180deg; } }
.hero-tiles .tile { transform-style: preserve-3d; will-change: transform, rotate; }
.hero-tiles .tile.down::after { backface-visibility: hidden; }
.hero-tiles .tile .face {
  display: inline-block; rotate: y 180deg; backface-visibility: hidden;
  font-family: var(--display); font-weight: 700;   /* 표제와 같은 명조 */
}
.hero-tiles .tile.b .face { color: var(--tb-fg); }
.hero-tiles .tile.w .face { color: var(--tw-fg); }
@media (prefers-reduced-motion: reduce) {
  .hero-tiles .tile { animation: none; }
  .hero-tiles .tile.down::after { display: none; }
  .hero-tiles .tile { rotate: y 180deg; }
}

/* 표제 글자는 타일이 쓴다 — h1 은 스크린리더용으로만 남긴다 */
.hero-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hero-rule {
  width: 54px; height: 3px; border-radius: 2px; margin: 0 auto 16px;
  background: linear-gradient(90deg, var(--accent), #7d93b3);
}
.hero-tag { font-size: 13px; line-height: 1.95; color: var(--dim); margin-bottom: 30px; }
.hero .primary { font-size: 15px; padding: 14px 16px; }

/* ---------- 가이드 ---------- */
.gtext { font-size: 12.5px; line-height: 1.95; color: var(--dim); }
.gtext b { color: var(--ink); font-weight: 700; }
.glist { margin: 10px 0 10px 16px; }
.glist li { font-size: 12.5px; line-height: 1.95; color: var(--dim); }
.glist b { color: var(--ink); font-weight: 700; }
.gtiles { display: flex; gap: 7px; justify-content: center; margin: 14px 0 4px; }
.gtiles .tile { --tilew: 40px; --tileh: 56px; font-size: 19px; }
.gtiles .tile.joker { font-size: 30px; }
.block .dir { margin-top: 10px; }

/* 저작권 고지 — 타이틀 아래, 자세히 봐야 보일 만큼만 */
.legal{margin:26px auto 0;max-width:36em;font-size:10.5px;line-height:1.75;color:var(--faint);opacity:.7;text-align:center;word-break:keep-all}

/* ════════════════ 상판 ════════════════
   판이 밝은 회색 위에 그냥 얹혀 있었다. 결이 있는 상판 위로 옮긴다.
   검정 타일과 흰 타일이 모두 또렷하도록 중간 밝기로 잡았다. */
#game {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  background:
    radial-gradient(130% 62% at 50% -8%, rgba(255,255,255,.9), transparent 60%),
    linear-gradient(180deg, #eef0f4 0%, #e7eaef 48%, #e1e4ea 100%);
}
.table {
  position: relative;
  flex: 1 0 auto;
  max-width: min(900px, calc(100% - 16px));
  margin-top: 10px; margin-bottom: 16px;
  border-radius: 20px;
  /* 리넨 결 — 두 방향으로 아주 옅게 */
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.5) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(0deg,  rgba(30,40,55,.026) 0 1px, transparent 1px 4px),
    radial-gradient(125% 85% at 50% 0%, #f4f6f9, #e6e9ef 68%, #dfe3e9);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.95),
    inset 0 0 0 1px rgba(211,216,224,.85),
    inset 0 -20px 44px -26px rgba(30,40,55,.34),
    0 12px 34px -20px rgba(30,40,55,.42);
}
@media (max-width: 640px) { .table { border-radius: 14px; } }

/* ── 상황 띠 ──
   위쪽 여백은 예측 알림이 뜨는 자리다. 알림이 없는 동안에는
   "지금 무슨 일이 벌어지는가"를 대신 보여 준다. 비워 두면 미완성으로 보인다. */
.nowband {
  position: absolute; left: 14px; right: 14px; top: 20px; height: 46px;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  font-size: 13px; font-weight: 700; color: var(--dim);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.8), rgba(255,255,255,.32));
  border: 1px solid rgba(211,216,224,.8);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95);
  transition: opacity .18s ease;
  padding: 0 16px; text-align: center;
}
.nowband.mine {
  color: var(--accent);
  border-color: rgba(47,79,122,.32);
  background: linear-gradient(180deg, #f6faff, #e9f1fa);
}
/* 알림이 뜨는 동안에는 뒤로 물러난다 — 두 개가 겹쳐 읽히지 않게 */
.nowband.behind { opacity: 0; }
.nb-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: currentColor; opacity: .5;
  animation: blip 1.4s ease-in-out infinite;
}
.nowband.mine .nb-dot { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .nb-dot { animation: none; } }
@media (max-width: 560px) { .nowband { font-size: 12px; height: 42px; } }

/* ════════════════ 자리 명패 ════════════════
   흰 카드가 아니라, 상판에 놓인 명패로 보이게. 이름줄 아래에 새김선을 둔다. */
.player {
  background: linear-gradient(180deg, #ffffff, #f6f8fb);
  border-color: #cfd6e0;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,1),
    0 2px 5px -2px rgba(30,40,55,.16),
    0 12px 24px -20px rgba(30,40,55,.55);
}
.phead {
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(47,79,122,.13);
}
.phead .who { font-family: var(--display); font-size: 14.5px; }

/* 차례인 자리에는 등이 켜진다 */
.player.turn {
  background:
    radial-gradient(130% 90% at 50% -30%, rgba(47,79,122,.12), transparent 62%),
    linear-gradient(180deg, #f8fbff, #edf3fb);
  animation: seatlamp 2.9s ease-in-out infinite;
}
@keyframes seatlamp {
  0%, 100% { box-shadow: inset 0 1px 0 #fff, 0 0 0 4px var(--accent-soft), 0 6px 16px -8px rgba(47,79,122,.34); }
  50%      { box-shadow: inset 0 1px 0 #fff, 0 0 0 5px var(--accent-soft), 0 10px 26px -8px rgba(47,79,122,.48); }
}
@media (prefers-reduced-motion: reduce) { .player.turn { animation: none; } }

/* 내 자리는 조금 더 두껍게 — 판에서 내가 어디인지 한눈에 */
.player.mine {
  border-color: #c4ccd8;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,1),
    0 3px 8px -3px rgba(30,40,55,.2),
    0 16px 30px -22px rgba(30,40,55,.6);
}

/* 탈락한 자리는 불이 꺼진다 */
.player.out { filter: grayscale(.6); }

/* 작음 → 큼 눈금을 새김선처럼 */
.dir .line {
  background: linear-gradient(90deg, transparent, rgba(47,79,122,.28) 12%, rgba(47,79,122,.28) 88%, transparent);
  box-shadow: 0 1px 0 rgba(255,255,255,.9);
}

/* ════════════════ 바닥 ════════════════
   낱장이 격자처럼 늘어서서 줄이 어정쩡하게 넘어갔다.
   실제로 펼쳐 놓은 것처럼 겹쳐서 한 줄에 담고, 얕은 트레이 위에 얹는다. */
.floor {
  padding: 13px 10px 11px;
  border-radius: 14px;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(30,40,55,.055), rgba(30,40,55,.02));
  box-shadow:
    inset 0 2px 7px rgba(30,40,55,.11),
    inset 0 0 0 1px rgba(30,40,55,.05),
    0 1px 0 rgba(255,255,255,.8);
}
.floor h3 { color: var(--dim); }

.floor .pile {
  flex-wrap: nowrap;
  gap: 0;
  padding: 3px 0 5px;
}
.floor .pile .tile { margin-left: -7px; }
.floor .pile .tile:first-child { margin-left: 0; }
/* 손으로 펼친 것처럼 조금씩 어긋나게 — rotate 는 hover 의 transform 과 겹치지 않는다 */
.floor .pile .tile:nth-child(3n)   { rotate: -1.6deg; }
.floor .pile .tile:nth-child(3n+1) { rotate:  1.3deg; }
.floor .pile .tile:nth-child(4n)   { rotate:  2.1deg; }
@media (hover: hover) { .floor.can .pile .tile:hover { rotate: 0deg; z-index: 2; } }

/* 집은 타일은 트레이 밖으로 한 단 올라온다 */
.drawn-box {
  padding: 11px 14px 12px; margin-left: auto; margin-right: auto;
  border-radius: 12px; width: max-content;
  background: linear-gradient(180deg, #ffffff, #f4f7fb);
  box-shadow: inset 0 1px 0 #fff, 0 3px 10px -4px rgba(30,40,55,.28);
}

/* ════════════════ 타이틀 — 아래 빈 공간 정리 ════════════════
   내용이 위로 몰리고 아래가 텅 비어 미완성으로 보였다.
   본문은 화면 가운데에 두고, 고지는 바닥에 붙인다. */
#title { padding-bottom: 0; }
#title .wrap {
  min-height: calc(100dvh - 66px);
  display: flex; flex-direction: column;
  padding-bottom: 18px;
}
.hero { padding-top: 0; display: flex; flex-direction: column; flex: 1; }
.hero-tiles { padding-top: 0; margin-top: auto; margin-bottom: 26px; }
.hero .primary { margin-bottom: 6px; }
.hero .ghost { margin-bottom: 0; }
.legal { margin-top: auto; padding-top: 30px; }
/* 위아래 자동 여백이 공간을 반씩 나눠 본문이 가운데 오게 한다 */
.hero .ghost { margin-bottom: 0; }

/* 상황 띠 — 이름과 상태를 나눈다.
   한 사람의 차례가 이어지는 동안 이름은 그대로 있고 뒤쪽 말만 바뀐다. */
.nb-who { font-weight: 800; }
.nb-who:not(:empty) + .nb-what:not(:empty)::before {
  content: '·'; margin: 0 7px; opacity: .45; font-weight: 400;
}
.nb-what { font-weight: 600; opacity: .82; }
.nowband.mine .nb-what { opacity: 1; }

/* ════════════════ 넓은 화면에서 판을 꽉 차게 ════════════════
   상판이 내용 폭만큼만 줄어들어 좌우가 휑했다. 폭을 채우고 위아래로도 넉넉히. */
.table { width: 100%; max-width: min(1020px, calc(100% - 24px)); }

/* 아직 패가 없는 자리도 명패 높이를 지킨다 — 접히면 판이 들쭉날쭉해 보인다 */
.hand:empty { min-height: calc(var(--tileh, 60px) + 4px); }
.mine .hand:empty { min-height: calc(var(--tileh, 84px) + 6px); }

/* 판 바깥은 은은한 조명 아래 — 평평한 회색이 아니라 */
#game {
  background:
    radial-gradient(120% 58% at 50% -6%, rgba(255,255,255,.95), transparent 58%),
    radial-gradient(80% 50% at 50% 108%, rgba(47,79,122,.08), transparent 70%),
    linear-gradient(180deg, #eef0f4 0%, #e7eaef 48%, #e1e4ea 100%);
}

/* 손패가 놓이는 홈 — 명패 안쪽이 휑하게 넓어 타일이 허공에 뜬 것처럼 보였다.
   바닥 트레이와 같은 결로 홈을 파서, 자리마다 "패를 놓는 자리"가 되게 한다. */
.player .hand {
  position: relative;
  padding: 10px 8px 11px;
  border-radius: 11px;
  background: radial-gradient(120% 100% at 50% 0%, rgba(30,40,55,.05), rgba(30,40,55,.018));
  box-shadow:
    inset 0 2px 6px rgba(30,40,55,.09),
    inset 0 0 0 1px rgba(30,40,55,.045),
    0 1px 0 rgba(255,255,255,.85);
  min-height: calc(var(--tileh, 60px) + 22px);
}
.mine .hand { min-height: calc(var(--tileh, 84px) + 24px); }
/* 홈 안에서는 타일이 조금 더 떠 보이게 */
.player .hand .tile { z-index: 1; }

/* ---------------- 채팅 ----------------
   같은 방 사람끼리 하는 잡담. 판을 가리지 않도록 구석에 접어 두고 열었을 때만 자리를 차지한다. */
.chat-btn {
  position: fixed; right: 16px; bottom: 16px; z-index: 45;
  width: 48px; height: 48px; border-radius: 50%; padding: 0;
  font-size: 20px; line-height: 1; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  box-shadow: 0 10px 24px -10px rgba(30,40,55,.45);
}
.chat-n {
  position: absolute; top: -3px; right: -3px;
  min-width: 18px; height: 18px; border-radius: 999px; padding: 0 5px;
  font-size: 11px; font-weight: 800; line-height: 18px;
  background: var(--miss); color: #fff;
}
.chat-n.pop { animation: chatPop .5s cubic-bezier(.3,1.7,.5,1); }
@keyframes chatPop { from { transform: scale(.3); } }
/* 접힌 채팅에 새 말이 오면 버튼 옆에 잠깐 띄우는 말풍선. 누르면 채팅이 열린다. */
.chat-peek {
  position: fixed; right: 74px; bottom: 21px; z-index: 45;
  max-width: min(260px, calc(100vw - 96px));
  padding: 8px 12px; border-radius: 13px 13px 4px 13px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  box-shadow: 0 12px 26px -12px rgba(30,40,55,.45);
  font-size: 13px; line-height: 1.45; cursor: pointer; word-break: break-word;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  animation: chatPeekIn .2s ease-out; transition: opacity .25s, transform .25s;
}
.chat-peek b { color: var(--faint); font-weight: 700; margin-right: 6px; }
.chat-peek.bye { opacity: 0; transform: translateX(6px); }
@keyframes chatPeekIn { from { opacity: 0; transform: translateX(8px); } }
/* 폰에서는 아래에 두면 손패·조작 판 위를 덮는다. 채팅창이 열리는 위쪽 자리에 띄운다. */
@media (max-width: 560px) {
  .chat-peek { top: 56px; bottom: auto; left: 12px; right: 12px; max-width: none; border-radius: 13px; animation-name: chatPeekDown; }
  .chat-peek.bye { transform: translateY(-6px); }
}
@keyframes chatPeekDown { from { opacity: 0; transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .chat-peek, .chat-n.pop { animation: none; transition: none; } }
.chat {
  position: fixed; right: 16px; bottom: 16px; z-index: 46;
  width: min(320px, calc(100vw - 32px)); height: min(380px, 60vh);
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 14px; background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 22px 50px -18px rgba(30,40,55,.4);
}
.chat-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px;
}
.chat-sub { color: var(--faint); font-size: 11.5px; }
.chat-x {
  margin-left: auto; border: 0; background: none; cursor: pointer;
  color: var(--faint); font-size: 15px; line-height: 1; padding: 2px 4px; width: auto; margin-bottom: 0;
}
.chat-log { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.chat-msg { font-size: 13px; line-height: 1.5; color: var(--ink); word-break: break-word; margin: 0; }
.chat-msg b { color: var(--faint); font-weight: 700; margin-right: 5px; }
.chat-msg.mine b { color: var(--accent); }
.chat-log:empty::before { content: '아직 아무 말도 없습니다'; color: var(--faint); font-size: 12px; opacity: .75; }
.chat-in { display: flex; gap: 6px; padding: 9px 10px; border-top: 1px solid var(--line); }
.chat-in input { flex: 1; min-width: 0; font-size: 13px; padding: 8px 10px; margin: 0; }
.chat-in button { width: auto; margin: 0; padding: 8px 12px; font-size: 13px; }
/* 좁은 화면에서 아래에 두면 조작 판을 덮는다. 위로 올린다. */
@media (max-width: 560px) {
  .chat { top: 56px; bottom: auto; height: min(46vh, 330px); left: 12px; right: 12px; width: auto; }
}

/* 예측을 띄워 두는 동안 — 판은 이전 상태이고 진짜 상태는 이미 넘어가 있다.
   이때 누르면 옛 화면 기준으로 명령이 나가 거부되므로, 눌리지 않게 막는다.
   커서까지 바꿔서 "지금은 기다리는 중"이 손끝에도 전해지게 한다. */
body.holding .table,
body.holding #panel { pointer-events: none; }
body.holding .tile.pick,
body.holding .slot { cursor: default; }

/* ---------- 세로 줄이기 ----------
   1280x800 에서 스크롤 없이 한 화면에 들어오도록 각 덩어리를 깎는다. */
.player { padding: 9px; }
.player.mine { padding: 12px; }
.phead { margin-bottom: 7px; }
.hand { gap: 6px; }
.cell:not(.me) .tile { --tilew: 42px; --tileh: 58px; font-size: 20px; }
.cell:not(.me) .tile.joker { font-size: 30px; }
.cell:not(.me) .tile.down::after { font-size: 17px; }

/* 작음/큼 표시는 남기되 납작하게 */
.dir { margin-top: 5px; font-size: 8.5px; }
.mine .dir { font-size: 9.5px; margin-top: 7px; }

.floor h3 { margin-bottom: 7px; }
.floor .pile { gap: 5px; }
.floor .pile .tile { --tilew: 26px; --tileh: 36px; font-size: 12px; }
.floor .pile .tile.joker { font-size: 19px; }
.floor .pile .tile::after { font-size: 12px; }
.drawn-box { margin-top: 9px; gap: 4px; }

/* ---------- 내 패: 살아 있는 것과 죽은 것 ----------
   내 손패에서 아직 안 들킨 패와 이미 까인 패가 한눈에 갈라져야 한다. */
.mine .tile.own {
  border-style: solid; border-color: var(--accent);
  box-shadow: 0 4px 0 var(--tb-edge), 0 0 0 2px var(--accent-soft), var(--shadow-lift);
}
.mine .tile.w.own { box-shadow: 0 4px 0 var(--tw-edge), 0 0 0 2px var(--accent-soft), var(--shadow-lift); }
.mine .tile.up {
  filter: grayscale(.85) saturate(.3) brightness(.94);
  opacity: .62;
}

/* ---------- 시작 알림 ---------- */
.hitflag.go { color: var(--accent); text-shadow: 0 8px 34px rgba(42,111,224,.4), 0 2px 0 rgba(255,255,255,.6); }

/* ---------- 시작 손패 고르기를 눈에 띄게 ---------- */
.floor.can h3 { color: var(--accent); font-size: 12px; }
.floor.can .pile .tile { box-shadow: 0 4px 0 var(--tb-edge), 0 0 0 2px var(--accent-soft), var(--shadow-lift); }
.floor.can .pile .tile.w { box-shadow: 0 4px 0 var(--tw-edge), 0 0 0 2px var(--accent-soft), var(--shadow-lift); }

/* ════════════════ 가운데 안내판 ════════════════
   지금 무슨 단계인지 · 누가 무엇을 하는지 · 내가 무엇을 하면 되는지.
   판 한가운데, 바닥 바로 위에 둔다. 눈이 머무는 자리에 할 일과 버튼이 함께 있게. */
.stage {
  margin: 0 auto 9px; padding: 9px 14px 11px; max-width: 460px;
  text-align: center; border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f5f7fa);
  border: 1px solid #cfd6e0;
  box-shadow: inset 0 1px 0 #fff, 0 6px 16px -10px rgba(30,40,55,.4);
}
.stage.mine {
  border-color: var(--accent);
  background: linear-gradient(180deg, #f8fbff, #eaf1fa);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 8px 20px -10px rgba(47,79,122,.5);
}
.stage.fresh { animation: stagepop .42s cubic-bezier(.2,1.3,.4,1); }
@keyframes stagepop { 0% { transform: scale(.94); opacity: .4; } 100% { transform: none; opacity: 1; } }

.st-steps { display: flex; justify-content: center; align-items: center; gap: 5px; margin-bottom: 5px; flex-wrap: wrap; }
.st-step {
  font-size: 10.5px; font-weight: 700; color: var(--faint);
  padding: 2px 8px; border-radius: 999px; letter-spacing: .02em;
}
.st-step.past { color: var(--dim); opacity: .7; }
.st-step.past::before { content: '✓ '; }
.st-step.now { background: var(--accent); color: var(--accent-ink); }
.st-arrow { font-size: 11px; color: var(--faint); opacity: .7; }
.st-title { font-size: 17px; font-weight: 800; color: var(--ink); line-height: 1.35; }
.stage.mine .st-title { color: var(--accent); }
.st-text { font-size: 12.5px; color: var(--dim); line-height: 1.55; margin-top: 2px; word-break: keep-all; }
.st-acts { display: flex; gap: 8px; justify-content: center; margin-top: 9px; }
.st-acts > button { flex: 1; max-width: 200px; margin: 0; padding: 9px 12px; }
.st-acts > button.primary { width: auto; }
.st-acts.grid { display: block; margin-top: 8px; }
.st-acts .nums { gap: 5px; }
.st-acts .nums button { padding: 8px 0; font-size: 15px; margin: 0; }
.st-acts .nums button.jk { font-size: 13px; }

/* ════════════════ 위쪽 띠: 시계방향 차례 순서 ════════════════ */
.nb-seq { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; overflow: hidden; min-width: 0; }
.nb-plain { font-weight: 700; }
.nb-chip {
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
  font-size: 12.5px; font-weight: 700; color: var(--dim);
  background: rgba(255,255,255,.75); border: 1px solid var(--line);
}
.nb-chip.me { color: var(--ink); }
.nb-chip.now { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 8px -2px rgba(47,79,122,.5); }
.nb-chip.out { text-decoration: line-through; opacity: .45; }
.nb-arrow { color: var(--faint); font-size: 12px; }
.nb-cw { color: var(--faint); font-size: 11px; font-weight: 600; margin-left: 4px; white-space: nowrap; }
@media (max-width: 560px) {
  .nb-chip { padding: 2px 7px; font-size: 11.5px; }
  .nb-cw { display: none; }
}

/* 선공 표시 · 순서 패 숫자 */
.firstpill {
  font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}
.opick {
  font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 6px;
  background: #1f3657; color: #fff; font-variant-numeric: tabular-nums;
}
.opick.best { background: #b8862b; }

/* ════════════════ 순서 패 ════════════════
   게임 타일과 헷갈리지 않게 남색 뒷면으로. 뽑힌 패는 한 단 올라오고 이름이 붙는다. */
.ogrid {
  display: grid; grid-template-columns: repeat(6, auto);
  justify-content: center; gap: 6px 9px; padding: 3px 0 2px;
}
.ocell { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 40px; }
.otile {
  width: 34px; height: 46px; border-radius: 7px; position: relative;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 900; font-variant-numeric: tabular-nums;
  background: linear-gradient(160deg, #3f5f8c, #24406a 60%, #1c3456);
  border: 1px solid #16294a; color: transparent;
  box-shadow: 0 3px 0 #0f1e36aa, 0 5px 10px rgba(30,40,55,.2);
  transition: transform .15s ease, opacity .2s ease;
}
.otile:not(.open)::after { content: '?'; color: rgba(255,255,255,.45); font-size: 16px; font-weight: 700; }
.otile.open { background: linear-gradient(170deg, #ffffff, #e9eef5); color: #1f3657; border-color: #b9c4d3; box-shadow: 0 3px 0 #98a3b2aa, 0 5px 10px rgba(30,40,55,.18); }
.otile.taken { transform: translateY(-4px); }
.otile.minepick { outline: 2px solid var(--accent); outline-offset: 2px; }
.otile.best { outline: 3px solid #d4a23c; outline-offset: 2px; color: #7a5410; box-shadow: 0 3px 0 #98a3b2aa, 0 0 18px rgba(212,162,60,.7); }
.otile.pick { cursor: pointer; }
@media (hover: hover) { .otile.pick:hover { transform: translateY(-6px); box-shadow: 0 3px 0 #0f1e36aa, 0 12px 18px rgba(30,40,55,.3); } }
.oboard.can .otile.pick { box-shadow: 0 3px 0 #0f1e36aa, 0 0 0 2px var(--accent-soft), 0 5px 10px rgba(30,40,55,.2); }
.oboard.done .otile:not(.taken) { opacity: .28; }
.otag { font-size: 10px; font-weight: 700; color: var(--dim); height: 13px; line-height: 13px; white-space: nowrap; }
.otile.lift { animation: olift .42s cubic-bezier(.2,1.4,.4,1); }
@keyframes olift { 0% { transform: translateY(0) scale(1); } 45% { transform: translateY(-12px) scale(1.1); } 100% { transform: translateY(-4px); } }
.otile.flip { animation: oflip .55s ease; }
@keyframes oflip { 0% { transform: translateY(-4px) rotateY(90deg); } 100% { transform: translateY(-4px) rotateY(0); } }

/* ════════════════ 가운데 큰 안내 ════════════════
   단계가 넘어가는 순간(선후공 정하기 시작, 선공 결정)에만 잠깐 뜬다. 클릭은 통과한다. */
.banner {
  position: fixed; left: 50%; top: 44%; z-index: 26; pointer-events: none;
  transform: translate(-50%, -50%); opacity: 0; visibility: hidden;
  min-width: min(360px, 88vw); max-width: 92vw; padding: 18px 30px 17px; text-align: center;
  border-radius: 18px; background: rgba(255,255,255,.97);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft), 0 24px 60px -14px rgba(30,40,55,.5);
}
.banner.on { visibility: visible; animation: bannerIn 1.9s cubic-bezier(.2,1.2,.4,1) forwards; }
@keyframes bannerIn {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.8); }
  14%  { opacity: 1; transform: translate(-50%, -50%) scale(1.04); }
  24%  { transform: translate(-50%, -50%) scale(1); }
  82%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -58%) scale(.98); }
}
.bn-title { font-size: 30px; font-weight: 900; letter-spacing: .06em; color: var(--accent); }
.bn-sub { font-size: 13px; color: var(--dim); margin-top: 6px; font-weight: 600; word-break: keep-all; }
@media (max-width: 560px) { .bn-title { font-size: 24px; } }
@media (prefers-reduced-motion: reduce) { .stage.fresh, .otile.lift, .otile.flip { animation: none; } }

/* ---------- 한 화면에 담기 (가운데 안내판을 넣은 뒤) ----------
   아래 조작판을 없애고 숫자판을 가운데로 옮겼다. 위쪽 띠와 여백도 조금씩 줄인다. */
#panel { display: none; }
#game { padding-bottom: 8px; }
.table { padding-top: 62px; margin-bottom: 8px; }
.nowband { top: 12px; height: 40px; }
.announce { top: 48px; padding-top: 6px; padding-bottom: 6px; }
.announce .tile { --tilew: 32px; --tileh: 44px; font-size: 17px; }
.stage { padding: 7px 12px 9px; margin-bottom: 8px; }
.st-steps { margin-bottom: 3px; }
.st-step { font-size: 10px; padding: 1px 7px; }
.st-acts { margin-top: 7px; }

/* 가져온 패는 바닥 옆에 — 아래로 쌓으면 가운데 줄이 길어진다 */
.floorbody { display: flex; align-items: center; justify-content: center; gap: 12px; }
.piles { min-width: 0; }
.floorbody .drawn-box { margin: 0; flex: none; padding: 8px 11px 9px; }
.st-text:empty { display: none; }
