/* Tisch: grüne Wolldecke, wie beim Hwatu zu Hause. Karten: weiße Vorderseite, rote Rückseite. */
:root {
  --felt: #2f4a3c;
  --felt-dark: #243a2f;
  --felt-line: rgba(255, 255, 255, 0.09);
  --paper: #fffdf6;
  --ink: #1d1a17;
  --chalk: #eef0e6;
  --muted: #b8c4b6;
  --red: #a5122b;
  --gold: #e9b52f;
  --hint: #ff2d95;
  --radius: 6px;
  --gap: 6px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--chalk);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background-color: var(--felt);
  background-image:
    repeating-linear-gradient(45deg, var(--felt-line) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.08) 0 1px, transparent 1px 5px);
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top));
  background: var(--felt-dark); font-size: 14px;
}
.brand { font-family: Georgia, 'Times New Roman', serif; font-size: 18px; letter-spacing: 0.02em; }
.score-line { flex: 1; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) { .brand { display: none; } .topbar { font-size: 13px; gap: 8px; } }
.hint-toggle { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.rules-link { color: var(--chalk); }

main { max-width: 900px; margin: 0 auto; padding: 8px 8px 16px; display: flex; flex-direction: column; gap: 8px; }

/* Karten */
.card { display: block; width: 100%; aspect-ratio: 60 / 92; padding: 0; border: 0; background: none; border-radius: var(--radius); }
.card-svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.45)); }
button.card { cursor: pointer; transition: transform 0.12s; }
button.card:disabled { cursor: default; }
button.card.dim { opacity: 0.55; }
/* Karten, die etwas treffen: kräftiges Magenta, gut sichtbar auf grünem Filz und hellen Karten */
button.card.hint {
  transform: translateY(-7px);
  border-radius: 7px;
  box-shadow: 0 0 0 3px var(--hint), 0 0 14px 3px var(--hint);
  animation: hint-pulse 1.1s ease-in-out infinite alternate;
}
@keyframes hint-pulse {
  from { box-shadow: 0 0 0 3px var(--hint), 0 0 8px 1px var(--hint); }
  to { box-shadow: 0 0 0 3px var(--hint), 0 0 18px 5px var(--hint); }
}
/* Bodenkarten, zu denen ich eine passende Handkarte habe: gleicher Rahmen wie die Handkarte */
.stack .card.hint-floor {
  position: relative;
  z-index: 2;
  border-radius: 7px;
  box-shadow: 0 0 0 3px var(--hint), 0 0 14px 3px var(--hint);
  animation: hint-pulse 1.1s ease-in-out infinite alternate;
}
/* gerade gelandete Karte und getroffener Stapel */
.stack.hit .card { box-shadow: 0 0 0 2px #fff, 0 0 12px 3px rgba(255, 255, 255, 0.8); border-radius: 6px; }
.card.landed { position: relative; z-index: 3; }
@media (prefers-reduced-motion: reduce) {
  button.card { transition: none; }
  button.card.hint, .stack .card.hint-floor { animation: none; }
}

/* Bereiche */
.status { text-align: center; font-weight: 600; min-height: 1.4em; }
.status.mine { color: var(--gold); }

.opponent, .mine-captured { display: flex; flex-direction: column; gap: 4px; }
.row-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted); }
.row-head strong { color: var(--chalk); font-size: 15px; }
.backs { display: flex; }
.backs .card { width: 18px; margin-right: -6px; }

/* Kartengrößen: gesammelte Karten (--cap), Tisch (--floor), Hand (höchstens --hand) */
:root { --cap: 30px; --cap-compact: 25px; --floor: 54px; --hand: 80px; }
@media (min-width: 700px) { :root { --cap: 42px; --cap-compact: 34px; --floor: 80px; --hand: 74px; } }
.opponent.compact { --cap: var(--cap-compact); }

/* Spreu hat die meisten Karten und bekommt am meisten Platz */
.captured { display: grid; grid-template-columns: 0.8fr 1fr 1fr 1.6fr; gap: 6px; }
.group { background: rgba(0, 0, 0, 0.16); border-radius: var(--radius); padding: 4px; min-width: 0; }
.group-head { font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; }
.group-head b { color: var(--chalk); font-weight: 600; }
/* Karten stehen nebeneinander; wird es eng, schieben sie sich von selbst übereinander (die neueste bleibt ganz sichtbar) */
.group-cards { display: flex; flex-wrap: nowrap; padding-top: 2px; min-height: calc(var(--cap) * 92 / 60 + 2px); }
.group-cards .card { flex: 0 1 var(--cap); min-width: 0; width: auto; height: calc(var(--cap) * 92 / 60); aspect-ratio: auto; margin: 0 1px 0 0; }
.group-cards .card:last-child { flex-shrink: 0; }
.group-cards .card .card-svg { width: var(--cap); height: 100%; }

.table { display: grid; grid-template-columns: 1fr calc(var(--floor) + 14px); gap: 8px; align-items: start; }
.floor { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(var(--floor) * 1.35), 1fr)); gap: 10px 6px; min-height: calc(var(--floor) * 92 / 60 * 2 + 10px); align-content: start; }
/* Querformat: wenig Höhe, darum nur eine Reihe Platz freihalten */
@media (orientation: landscape) and (max-height: 900px) { .floor { min-height: calc(var(--floor) * 92 / 60 + 6px); } }
/* drei oder mehr Karten eines Monats (Ppeok) brauchen zwei Plätze */
.stack.wide { grid-column: span 2; }
/* breite Tablets im Querformat: die Breite nutzen */
@media (min-width: 1100px) { main { max-width: 1180px; } }
.stack { position: relative; display: flex; }
.stack .card { width: var(--floor); }
.stack .card + .card { margin-left: calc(var(--floor) * -0.68); }
.stack .badge { position: absolute; top: -6px; left: -2px; z-index: 2; }
.badge { background: var(--red); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 8px; }
.pile { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.pile .card { width: var(--floor); }
.inflight { display: flex; gap: 6px; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); }
.inflight .card { width: 40px; }

.hand { display: grid; grid-template-columns: repeat(5, minmax(0, var(--hand))); justify-content: center; gap: 6px; padding-top: 6px; }
@media (min-width: 700px) {
  .hand { grid-template-columns: repeat(10, minmax(0, var(--hand))); }
}

.extras { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.btn {
  border: 0; border-radius: 22px; padding: 10px 16px; min-height: 44px;
  background: var(--paper); color: var(--ink); font-weight: 600; cursor: pointer;
}
.btn.primary { background: var(--gold); }
.btn.danger { background: var(--red); color: #fff; }
.btn.quiet { background: rgba(255, 255, 255, 0.14); color: var(--chalk); font-size: 13px; font-weight: 500; min-height: 36px; padding: 6px 12px; }

/* Overlays */
.overlay {
  position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px;
  background: rgba(10, 20, 15, 0.62);
}
.sheet {
  width: min(420px, 100%); background: var(--paper); color: var(--ink);
  border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.sheet h2 { margin: 0; font-family: Georgia, 'Times New Roman', serif; font-size: 24px; }
.sheet p { margin: 0; line-height: 1.45; }
.choices { display: flex; gap: 14px; justify-content: center; align-items: end; }
.choices .card { width: 92px; }
.choices .played { width: 64px; opacity: 0.85; }
.gostop { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gostop .btn { font-size: 20px; min-height: 56px; border-radius: 10px; }
.gostop small { display: block; font-size: 12px; color: #555; margin-top: 4px; line-height: 1.35; }
.settle { width: 100%; border-collapse: collapse; font-size: 15px; }
.settle td { padding: 4px 0; border-bottom: 1px solid #e6dfcf; }
.settle td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.settle tr.total td { font-weight: 700; border-bottom: 0; font-size: 18px; }
.reveal { display: flex; gap: 6px; justify-content: center; }
.reveal .card { width: 54px; }

.center-msg { text-align: center; padding: 40px 16px; }
.center-msg h1 { font-family: Georgia, 'Times New Roman', serif; font-size: 28px; margin: 0 0 8px; }
.center-msg p { color: var(--muted); line-height: 1.5; }

.toasts { position: fixed; left: 0; right: 0; bottom: max(16px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 20; }
.toast { background: var(--paper); color: var(--ink); padding: 8px 14px; border-radius: 18px; font-weight: 600; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); max-width: 92vw; }
.report {
  background: rgba(0, 0, 0, 0.28); border-left: 4px solid var(--gold); border-radius: var(--radius);
  padding: 6px 10px; font-size: 14px; line-height: 1.4;
}
.report p { margin: 2px 0; }
.chances { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 13px; padding-top: 4px; }
.chances h3 { margin: 0 0 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.chances ul { margin: 0; padding-left: 16px; }
.chances li { margin-bottom: 2px; }
.chances li.scored { color: var(--gold); font-weight: 600; }
.chances .none { margin: 0; color: var(--muted); }
@media (max-width: 480px) { .chances { grid-template-columns: 1fr; } }
.banner { background: var(--red); color: #fff; text-align: center; padding: 6px; font-size: 14px; }

/* ---------- Szenen eines Zuges ---------- */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 30; perspective: 600px; }
.ghost { position: absolute; will-change: left, top, width, transform; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); }
.ghost .card-svg { width: 100%; height: 100%; filter: none; }
.ring { position: absolute; width: 90px; height: 90px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 0 18px #fff; }
.caption {
  position: absolute; white-space: nowrap; font-family: Georgia, 'Times New Roman', serif; font-weight: 700;
  font-size: 26px; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55), 0 0 12px rgba(0, 0, 0, 0.6);
}
.caption.good { color: #ffe066; }
.stack.placeholder .card { visibility: hidden; width: var(--floor); }
button.card.picked { transform: translateY(-18px) scale(1.06); }

/* ---------- Solo, Optionen, Schütteln ---------- */
.waiting-actions { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 18px; }
.btn.big { font-size: 18px; padding: 14px 22px; }
.option { display: flex; gap: 8px; align-items: center; font-size: 15px; }
.sheet .option { color: var(--ink); }
.btn.shake { background: #fff; color: var(--red); border: 3px solid var(--red); font-weight: 700; }
.shake-reveal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(10, 20, 15, 0.55); }
.shake-reveal .sheet { border: 4px solid var(--red); text-align: center; }

/* während einer Szene keine Statuszeile unter den Einblendungen */
body.scene .status { visibility: hidden; }

/* ---------- Go-Stop zu dritt ---------- */
.opponent .row-head .backs { flex: 1; display: flex; padding: 0 8px; }
.opponent.turn { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: var(--radius); }
.opponent.compact .group { padding: 2px 4px; }
.opponent.compact .backs .card { width: 14px; margin-right: -5px; }
.chances.three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 480px) { .chances.three { grid-template-columns: 1fr; } }
.game-type { border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 10px; padding: 8px 14px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.game-type legend { padding: 0 6px; color: var(--muted); }
.here { margin: 0; color: var(--muted); }
.settle tr.pay small { display: block; color: #6b6355; font-size: 12px; }

.sheet h3.special { margin: 0; color: var(--red); font-family: Georgia, 'Times New Roman', serif; font-size: 20px; }

/* ---------- Effekte ---------- */
.fx-item { position: absolute; pointer-events: none; }
.fx-item svg { width: 100%; height: 100%; display: block; overflow: visible; }
.fx-item.poop, .fx-item.lips { filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45)); }
.fx-flash { position: fixed; inset: 0; background: radial-gradient(circle, #fff8d8 0%, rgba(255, 190, 60, 0.6) 40%, rgba(255, 120, 0, 0) 75%); pointer-events: none; }

/* Schütteln: großer Monat und wackelnde Karten */
.shake-month { display: flex; align-items: baseline; justify-content: center; gap: 10px; }
.shake-month .num { font-family: Georgia, 'Times New Roman', serif; font-size: 72px; font-weight: 700; line-height: 1; color: var(--red); }
.shake-month .lbl { font-size: 20px; font-weight: 700; }
.reveal.shaking .card { animation: card-shake 0.18s ease-in-out infinite alternate; }
.reveal.shaking .card:nth-child(2) { animation-delay: 0.06s; }
.reveal.shaking .card:nth-child(3) { animation-delay: 0.12s; }
.shake-reveal .reveal .card { width: 72px; }
@keyframes card-shake { from { transform: rotate(-9deg) translateY(2px); } to { transform: rotate(9deg) translateY(-3px); } }

/* ---------- Tablet-App: Startbildschirm und Code ---------- */
body.in-lobby {
  height: 100dvh; overflow: hidden; display: flex; flex-direction: column;
  background-color: #1e3329;
  background-image:
    radial-gradient(circle at 50% 24%, rgba(233, 181, 47, .09), transparent 56%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .02) 0 1px, transparent 1px 6px);
}
body.in-lobby #app { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
body.in-lobby #hints-label, body.in-lobby #speed-label, body.in-lobby #score-line, body.in-lobby #rules-link { display: none; }
@media (max-width: 480px) { body.in-lobby .brand { display: inline; } }
.lobby-hub { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 10px 16px; width: 100%; max-width: 660px; max-height: 100%; text-align: center; }
.lobby-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.lobby-emblem { width: 132px; height: 132px; border-radius: 50%; border: 2.5px solid rgba(233, 181, 47, .82); box-shadow: 0 8px 28px rgba(0, 0, 0, .48), 0 0 18px rgba(233, 181, 47, .22); overflow: hidden; background: #16251d; cursor: pointer; }
.emblem-svg { width: 100%; height: 100%; display: block; }
.emblem-bird .bird-body { animation: bird-hover 1.5s ease-in-out infinite alternate; }
.emblem-bird .wing-l { transform-origin: -2px 0; animation: wing-flap-l 1.35s ease-in-out infinite alternate; }
.emblem-bird .wing-r { transform-origin: 2px 0; animation: wing-flap-r 1.35s ease-in-out infinite alternate; }
.emblem-bird.b1 .bird-body, .emblem-bird.b1 .wing-l, .emblem-bird.b1 .wing-r { animation-delay: 0s; }
.emblem-bird.b2 .bird-body, .emblem-bird.b2 .wing-l, .emblem-bird.b2 .wing-r { animation-delay: 0.35s; }
.emblem-bird.b3 .bird-body, .emblem-bird.b3 .wing-l, .emblem-bird.b3 .wing-r { animation-delay: 0.7s; }
.lobby-emblem:hover .emblem-bird .wing-l, .lobby-emblem:hover .emblem-bird .wing-r,
.lobby-emblem:active .emblem-bird .wing-l, .lobby-emblem:active .emblem-bird .wing-r { animation-duration: 0.65s; }
@keyframes bird-hover { from { transform: translateY(-2px); } to { transform: translateY(2px); } }
@keyframes wing-flap-l { from { transform: scaleY(1) rotate(0deg); } to { transform: scaleY(0.35) rotate(-14deg); } }
@keyframes wing-flap-r { from { transform: scaleY(1) rotate(0deg); } to { transform: scaleY(0.35) rotate(14deg); } }
.lobby-badge { display: inline-block; padding: 3px 12px; border-radius: 20px; background: rgba(242, 194, 60, .12); border: 1px solid rgba(242, 194, 60, .38); color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .6px; }
.lobby-hero h1 { margin: 0; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(30px, 5vw, 40px); color: #f5d061; letter-spacing: 2px; text-shadow: 0 2px 10px rgba(0, 0, 0, .45); }
.fan-cards { display: flex; justify-content: center; align-items: flex-end; height: 112px; margin: 2px 0 4px; }
.fan-card { width: 64px; height: 94px; border-radius: 7px; border: 2px solid #9b2226; background: #fffdf6; box-shadow: 0 8px 20px rgba(0, 0, 0, .45); overflow: hidden; margin: 0 -11px; transition: transform .2s ease; cursor: default; }
.fan-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fan-card.c1 { transform: rotate(-16deg) translateY(12px); z-index: 1; }
.fan-card.c2 { transform: rotate(-8deg) translateY(3px); z-index: 2; }
.fan-card.c3 { transform: rotate(0deg) translateY(0); z-index: 3; }
.fan-card.c4 { transform: rotate(8deg) translateY(3px); z-index: 4; }
.fan-card.c5 { transform: rotate(16deg) translateY(12px); z-index: 5; }
.fan-card:hover { transform: translateY(-10px) scale(1.07); z-index: 7; }
.hub-tabs { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(0, 0, 0, .32); border: 1px solid rgba(255, 255, 255, .14); gap: 4px; }
.hub-tab { border: 0; border-radius: 999px; padding: 9px 26px; font-size: 14.5px; font-weight: 700; color: var(--muted); background: transparent; cursor: pointer; transition: background .18s, color .18s; }
.hub-tab.active { background: linear-gradient(180deg, #f5cc58 0%, #d4961a 100%); color: #241804; box-shadow: 0 3px 12px rgba(0, 0, 0, .3); }
.hub-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; width: 100%; max-width: 580px; }
.panel-card { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; height: 104px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid rgba(255, 255, 255, .2); color: var(--chalk); cursor: pointer; overflow: hidden; box-shadow: 0 8px 22px rgba(0, 0, 0, .32); transition: transform .14s ease, border-color .14s ease; }
.panel-card:hover { transform: translateY(-2px); border-color: rgba(242, 194, 60, .65); }
.panel-card strong { font-size: 17px; font-weight: 700; position: relative; z-index: 1; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-card span { font-size: 12px; color: rgba(255, 255, 255, .78); position: relative; z-index: 1; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-summary { min-height: 28px; display: flex; align-items: center; justify-content: center; }
.panel-card.orchid { background: linear-gradient(135deg, rgba(64, 54, 88, .92) 0%, rgba(40, 34, 58, .95) 100%); border-color: rgba(182, 158, 224, .42); }
.panel-card.orchid::after, .panel-card.chrys::after { content: ''; position: absolute; inset: 0; opacity: .16; background-size: cover; background-position: center; pointer-events: none; }
.panel-card.orchid::after { background-image: url('assets/cards/m05-cho.webp'); }
.panel-card.chrys { background: linear-gradient(135deg, rgba(84, 40, 36, .92) 0%, rgba(54, 24, 22, .95) 100%); border-color: rgba(224, 132, 118, .42); }
.panel-card.chrys::after { background-image: url('assets/cards/m09-yeol.webp'); }
.panel-card.host-action { background: linear-gradient(180deg, #d8432e 0%, #a5122b 100%); border-color: rgba(255, 210, 140, .55); }
.panel-card.join-card { background: rgba(0, 0, 0, .28); cursor: default; gap: 8px; }
.panel-card.join-card:hover { transform: none; border-color: rgba(255, 255, 255, .2); }
.join-bar { display: flex; width: 100%; border-radius: 9px; overflow: hidden; border: 1.5px solid rgba(255, 255, 255, .28); background: rgba(0, 0, 0, .38); }
.join-bar input { width: 92px; flex: 1; min-width: 0; font-size: 17px; text-align: center; letter-spacing: 2px; border: 0; background: transparent; color: var(--chalk); padding: 7px 6px; font-family: Georgia, serif; }
.join-bar input::placeholder { font-size: 12.5px; letter-spacing: 0; color: rgba(255, 255, 255, .5); font-family: system-ui, sans-serif; }
.join-bar input:focus { outline: none; }
.join-bar .btn { border-radius: 0; border: 0; padding: 7px 14px; font-size: 13.5px; }
.lobby-hub .error { color: #ffb4b4; font-weight: 600; margin: 0; font-size: 12.5px; }
.lobby-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 18px; }
.util-btn { border: 0; background: transparent; color: var(--chalk); font-size: 13px; font-weight: 600; padding: 4px 8px; cursor: pointer; opacity: .88; }
.util-btn:hover { opacity: 1; color: var(--gold); }
.lobby-hub .app-version { margin: 0; font-size: 11px; opacity: .65; }
@media (max-width: 639px) {
  .lobby-hub { gap: 9px; padding: 6px 12px; }
  .lobby-emblem { width: 88px; height: 88px; }
  .lobby-badge { font-size: 10px; padding: 2px 9px; }
  .lobby-hero h1 { font-size: 28px; }
  .fan-cards { height: 82px; margin: 0; }
  .fan-card { width: 50px; height: 74px; margin: 0 -8px; }
  .hub-tab { padding: 7px 18px; font-size: 13px; }
  .hub-panel { gap: 8px; }
  .panel-card { height: 84px; padding: 8px; border-radius: 12px; }
  .panel-card strong { font-size: 14.5px; }
  .panel-card span { font-size: 11px; }
  .hub-summary { min-height: 24px; }
  .join-bar input { font-size: 14px; padding: 6px 4px; }
  .join-bar .btn { padding: 6px 10px; font-size: 12.5px; }
  .util-btn { font-size: 12px; }
}
.host-code { display: inline-flex; flex-direction: column; align-items: center; background: var(--paper); color: var(--ink); border-radius: 12px; padding: 12px 22px; margin: 6px auto 0; }
.host-code span { font-size: 13px; color: #6b6355; }
.host-code b { font-family: Georgia, serif; font-size: 48px; letter-spacing: 8px; line-height: 1.1; }
.host-code small { font-size: 12px; color: #6b6355; }
.host-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.host-code .invite-btn { font-size: 13px; padding: 8px 14px; border-radius: 8px; background: #fff; color: var(--ink); border: 1.5px solid #c7bda8; font-weight: 600; cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.host-code .invite-btn.primary-invite { background: #2f4a3c; color: #fff; border-color: #2f4a3c; }
.qr-sheet { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.qr-box { border-radius: 10px; background: #fff; padding: 10px; line-height: 0; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.qr-url { margin: 0; padding: 6px 10px; border-radius: 8px; background: rgba(0, 0, 0, .06); font-family: monospace; font-size: 12px; word-break: break-all; color: #3d372c; max-width: 100%; }
.qr-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.qr-actions .btn.secondary { background: #e8e2d3; color: var(--ink); border-color: #c7bda8; }
.leave-btn { border: 0; background: rgba(255, 255, 255, 0.14); color: var(--chalk); border-radius: 14px; padding: 4px 10px; font-size: 13px; }

.three-hint { max-width: 380px; margin: 0; font-size: 14px; color: var(--gold); }

/* 4 Spieler: verdeckter Tisch beim Lichter-Verkauf, Aussetzen */
.hidden-floor { position: relative; }
.hidden-floor .floor-note { grid-column: 1 / -1; margin: 4px 0 0; text-align: center; font-size: 0.85rem; opacity: 0.8; }
.sitout { margin: 4px auto; padding: 6px 10px; max-width: 640px; border-radius: 8px; background: rgba(255, 214, 102, 0.18); text-align: center; font-size: 0.9rem; }
.sitting-out { text-align: center; }
.sitting-out .reveal .card { width: 48px; }
.sale-reveal .sheet { border-color: #d4a017; }
.reveal .card.dim { opacity: 0.35; }
.sale-line { font-weight: 600; }
.lang-select { border: 0; border-radius: 14px; padding: 3px 6px; font-size: 13px; background: rgba(255, 255, 255, 0.14); color: var(--chalk); }
.lang-select option { color: #222; }

/* ---------- Besondere Karten: Lichter glänzen, Godori-Vögel leuchten und hüpfen ---------- */
.card-svg.k-gwang { filter: drop-shadow(0 0 2.5px rgba(255, 208, 70, 0.95)) drop-shadow(0 0 7px rgba(255, 186, 40, 0.6)); }
.card-svg.k-bird { filter: drop-shadow(0 0 2.5px rgba(130, 215, 255, 0.95)) drop-shadow(0 0 7px rgba(80, 175, 255, 0.55)); }
.card-svg .shine { animation: card-shine 4.5s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes card-shine { 0%, 62% { transform: translateX(-20px); } 100% { transform: translateX(95px); } }
.card-svg .bird { transform-box: fill-box; transform-origin: 50% 70%; animation: bird-hop 3.2s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes bird-hop {
  0%, 70%, 100% { transform: translateY(0) rotate(0deg); }
  76% { transform: translateY(-3px) rotate(-7deg); }
  82% { transform: translateY(0) rotate(4deg); }
  88% { transform: translateY(-1.5px) rotate(-3deg); }
  94% { transform: translateY(0) rotate(0deg); }
}

.app-version { margin: 18px 0 0; font-size: 12px; color: var(--muted); opacity: 0.8; }

/* ---------- 규칙 & 48장 화투 도감 모달 ---------- */
.guide-sheet { width: min(94vw, 760px); max-height: 88vh; display: flex; flex-direction: column; padding: 16px 18px; text-align: left; }
.guide-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.guide-head h2 { margin: 0; font-size: 20px; }
.guide-close { border: 0; background: rgba(0, 0, 0, .08); color: var(--ink); width: 32px; height: 32px; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; }
.guide-tabs { display: flex; gap: 8px; border-bottom: 1.5px solid #dfd7c5; padding-bottom: 10px; margin-bottom: 12px; }
.guide-tab { flex: 1; border: 1.5px solid #c7bda8; background: #fff; color: var(--ink); border-radius: 10px; padding: 8px 12px; font-weight: 600; font-size: 14px; cursor: pointer; }
.guide-tab.active { background: #2f4a3c; color: #fff; border-color: #2f4a3c; }
.guide-body { overflow-y: auto; padding-right: 4px; flex: 1; }
.guide-box { background: #f3ecda; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
.guide-box h3, .guide-rules h3 { margin: 12px 0 6px; font-size: 15px; }
.guide-box h3 { margin-top: 0; }
.guide-box p { margin: 0; font-size: 14px; line-height: 1.5; }
.rules-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-bottom: 10px; }
.rules-table th, .rules-table td { text-align: left; padding: 7px 6px; border-bottom: 1px solid #e6decb; vertical-align: top; }
.rules-table th { width: 34%; font-weight: 600; color: #3d372c; }
.guide-ext { margin: 14px 0 4px; text-align: center; }
.guide-ext a { color: #a5122b; font-weight: 600; font-size: 14px; text-decoration: none; }
.guide-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.guide-filter { border: 1px solid #c7bda8; background: #fff; color: var(--ink); border-radius: 16px; padding: 5px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.guide-filter.active { background: #b8861b; color: #fff; border-color: #b8861b; }
.enc-month { margin-bottom: 16px; }
.enc-month h3 { margin: 0 0 8px; font-size: 14px; color: #2f4a3c; border-bottom: 1px solid #e6decb; padding-bottom: 4px; }
.enc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 520px) { .enc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.enc-card { background: #f8f4e8; border: 1px solid #e3dccb; border-radius: 10px; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.enc-art { width: 68px; }
.enc-art .card-svg { width: 100%; height: auto; display: block; }
.enc-title { font-size: 11.5px; font-weight: 700; color: #2b2419; text-align: center; line-height: 1.25; }
.enc-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.enc-badge { font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 6px; background: #e6dfd0; color: #3d372c; }
.enc-badge.gold { background: #f2c23c; color: #3a2900; }
.enc-badge.bird { background: #2c6e91; color: #fff; }
.enc-badge.yeol { background: #3d6a4b; color: #fff; }
.enc-badge.tti { background: #8c5a3c; color: #fff; }
.enc-badge.special { background: #6b3fa0; color: #fff; }
.enc-badge.rib-hong { background: #c8202b; color: #fff; }
.enc-badge.rib-cheong { background: #1f4c9e; color: #fff; }
.enc-badge.rib-cho { background: #2e8b3e; color: #fff; }

/* ---------- 인게임 실시간 학습 힌트 패널 ---------- */
.assist-panel { margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: rgba(0, 0, 0, .24); border: 1px solid rgba(242, 194, 60, .3); display: flex; flex-direction: column; gap: 6px; }
.assist-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.assist-badge { font-size: 12.5px; font-weight: 700; color: #3a2900; background: var(--gold); padding: 3px 9px; border-radius: 12px; }
.assist-tip { font-size: 13px; color: var(--muted); min-height: 18px; }
.assist-tip.active { color: #ffe78a; font-weight: 600; }

/* ---------- 1월 송학 오프닝(스플래시) 화면 ---------- */
.splash-screen { position: fixed; inset: 0; z-index: 900; display: none; align-items: center; justify-content: center; padding: 14px; background: radial-gradient(circle at 50% 40%, #1b211a 0%, #121611 100%); overflow: hidden; text-align: center; transition: opacity .42s ease, transform .42s ease; }
.splash-screen.splash-active { display: flex; }
.splash-screen.fade-out { opacity: 0; transform: scale(1.03); pointer-events: none; }
.splash-frame { position: relative; width: min(92vw, 540px); height: min(92vh, 820px); display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 26px 20px 22px; border-radius: 10px; background: #efe6cf; border: 1px solid rgba(212, 175, 55, .55); box-shadow: 0 22px 60px rgba(0, 0, 0, .72), inset 0 0 0 6px rgba(212, 175, 55, .16); overflow: hidden; }
.splash-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; opacity: .94; pointer-events: none; }
.splash-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 42%, rgba(255, 250, 236, .12) 0%, rgba(235, 224, 196, .28) 65%, rgba(35, 24, 10, .38) 100%), linear-gradient(180deg, rgba(255, 248, 232, .16) 0%, transparent 32%, rgba(244, 234, 206, .74) 80%, rgba(236, 224, 192, .92) 100%); }
.splash-top, .splash-center, .splash-bottom { position: relative; z-index: 2; }
.splash-badge { display: inline-block; padding: 6px 15px; border-radius: 22px; background: rgba(48, 34, 14, .84); border: 1px solid rgba(233, 181, 47, .78); color: #f7e4a8; font-family: 'Gowun Batang', Georgia, serif; font-size: 11.5px; font-weight: 700; letter-spacing: .6px; box-shadow: 0 3px 10px rgba(0, 0, 0, .28); }
.splash-title { margin: 0; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(54px, 11vw, 82px); font-weight: 700; letter-spacing: 3px; color: #f5cc58; -webkit-text-stroke: 1.5px #23180c; text-shadow: 0 3px 0 #3a2610, 0 6px 14px rgba(0, 0, 0, .65); }
.splash-ko { margin: 2px 0 0; font-family: 'East Sea Dokdo', 'Gowun Batang', serif; font-size: clamp(34px, 7vw, 48px); font-weight: 400; letter-spacing: 4px; color: #23180c; text-shadow: 0 1px 6px rgba(255, 248, 230, .9); line-height: 1.1; }
.splash-bottom { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 100%; max-width: 280px; }
.splash-btn { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 34px; border: 1.5px solid rgba(168, 120, 28, .65); border-radius: 14px; background: rgba(247, 238, 212, .58); color: #1d1408; cursor: pointer; box-shadow: 0 4px 16px rgba(0, 0, 0, .18), inset 0 0 0 2px rgba(212, 175, 55, .22); backdrop-filter: blur(3px); transition: transform .12s ease, background .15s ease; }
.splash-btn:hover { background: rgba(247, 238, 212, .85); }
.splash-btn:active { transform: scale(.97); }
.splash-btn-en { font-family: Georgia, serif; font-size: 12.5px; font-weight: 700; letter-spacing: 3px; color: #5a4218; }
.splash-btn-main { font-family: 'East Sea Dokdo', 'Gowun Batang', serif; font-size: 40px; font-weight: 400; letter-spacing: 2px; line-height: 1; color: #1d1408; }
.splash-tap { margin: 3px 0 0; font-family: Georgia, 'Gowun Batang', serif; font-size: 12.5px; font-weight: 700; color: #4a3a1e; letter-spacing: .5px; }
.splash-seal { display: inline-flex; align-items: center; gap: 7px; margin-top: 2px; font-family: Georgia, 'Gowun Batang', serif; font-size: 10.5px; font-weight: 700; letter-spacing: 1px; color: #4a3a1e; }
.splash-bottom .app-version { margin-top: 2px; font-family: Georgia, serif; color: #5a4a2e; opacity: .9; }
.seal-stamp { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 4px; background: #a5122b; color: #fff7e8; font-family: serif; font-size: 12px; font-weight: 700; border: 1px solid rgba(255, 255, 255, .35); }

/* ---------- 상단 퀵 언어 스위처 & 16개 복수 언어 온보딩 모달 ---------- */
.lang-switcher { display: inline-flex; align-items: center; gap: 3px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); border-radius: 16px; padding: 2px 6px; }
.quick-lang-btn { border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; padding: 2px 5px; border-radius: 10px; cursor: pointer; }
.quick-lang-btn.active { background: var(--gold); color: #241804; }
.quick-lang-cur { font-size: 12px; font-weight: 700; color: var(--gold); padding: 0 3px; }
.lang-sep { color: rgba(255, 255, 255, .35); font-size: 11px; }
.lang-globe-btn { border: 0; background: transparent; color: var(--chalk); font-size: 14px; line-height: 1; padding: 2px 3px; cursor: pointer; }
.lang-overlay { position: fixed; inset: 0; z-index: 950; display: flex; align-items: center; justify-content: center; padding: 14px; background: rgba(12, 22, 16, .68); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.lang-sheet { width: min(94vw, 440px); max-height: 92dvh; display: flex; flex-direction: column; gap: 10px; padding: 18px 16px; border-radius: 16px; background: linear-gradient(180deg, #21372b 0%, #17271f 100%); border: 1.5px solid rgba(233, 181, 47, .6); box-shadow: 0 18px 48px rgba(0, 0, 0, .6); color: var(--chalk); text-align: center; }
.lang-head { display: flex; align-items: center; justify-content: center; position: relative; }
.lang-head h2 { margin: 0; font-size: 16.5px; color: var(--gold); font-family: Georgia, serif; }
.lang-close { position: absolute; right: 0; top: 50%; transform: translateY(-50%); border: 0; background: rgba(255, 255, 255, .12); color: var(--chalk); width: 28px; height: 28px; border-radius: 50%; font-size: 18px; line-height: 1; cursor: pointer; }
.lang-hint { margin: 0; font-size: 12px; color: var(--muted); }
.lang-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; overflow-y: auto; }
.lang-chip { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(0, 0, 0, .25); color: var(--chalk); font-size: 13px; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s; }
.lang-chip .chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-chip .chip-mark { font-size: 11px; font-weight: 700; opacity: .7; flex-shrink: 0; }
.lang-chip.primary { border-color: var(--gold); background: rgba(233, 181, 47, .22); color: #fff4c2; }
.lang-chip.primary .chip-mark { color: var(--gold); opacity: 1; font-size: 13px; }
.lang-chip.secondary { border-color: rgba(130, 210, 155, .6); background: rgba(70, 140, 95, .24); }
.lang-chip.secondary .chip-mark { color: #9be7b4; opacity: 1; }
.lang-confirm { width: 100%; padding: 12px; font-size: 15px; border-radius: 12px; }

/* ---------- 점수 알림 ---------- */
.score-fx { position: fixed; left: 0; right: 0; top: 24%; z-index: 35; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; animation: score-in 0.35s ease-out; }
.score-fx.out { opacity: 0; transition: opacity 0.5s; }
.score-fx-row { display: flex; align-items: center; gap: 10px; background: rgba(20, 30, 24, 0.92); border: 2px solid var(--gold); border-radius: 14px; padding: 6px 12px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); }
.score-fx-text { font-weight: 700; font-size: 17px; color: #fff; white-space: nowrap; }
.score-fx-text em { color: var(--gold); font-style: normal; font-size: 20px; margin-left: 2px; }
.score-fx-cards { display: flex; gap: 2px; }
.score-fx-cards .card { width: 30px; }
@keyframes score-in { from { transform: translateY(14px) scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 스크롤 없는 게임 화면: 화면 높이/너비에 맞춰 카드 크기를 계산 ---------- */
body.in-game { --top: 40px; }
body.in-game main { height: calc(100dvh - var(--top)); min-height: 0; padding: 4px 6px max(6px, env(safe-area-inset-bottom)); gap: 4px; overflow: hidden; }
body.in-game {
  --cap: clamp(15px, min(5.4vw, 3.1dvh), 48px);
  --cap-compact: clamp(13px, min(4.4vw, 2.5dvh), 32px);
    --hand: clamp(38px, min(16.5vw, 8.6dvh), 100px);
}
body.in-game .status { min-height: 1.2em; font-size: 14px; line-height: 1.2; }
body.in-game .row-head { font-size: 12px; }
body.in-game .row-head strong { font-size: 14px; }
body.in-game .group { padding: 2px 3px; }
body.in-game .group-head { font-size: 10px; }
body.in-game .captured { gap: 4px; }
body.in-game .table { flex: 1 1 auto; min-height: 0; overflow: hidden; }
body.in-game .floor { min-height: 0; max-height: 100%; overflow-y: auto; gap: 8px 8px; grid-template-columns: repeat(auto-fill, minmax(calc(var(--floor) * 1.5), 1fr)); justify-items: center; align-content: center; scrollbar-width: none; }
body.in-game .table { align-items: center; }
body.in-game .stack .card + .card { margin-left: calc(var(--floor) * -0.5); }
body.in-game .pile .card { width: var(--floor); }
body.in-game .pile { font-size: 11px; }
body.in-game .hand { gap: 4px; padding-top: 2px; margin-top: auto; }
body.in-game .inflight { font-size: 11px; }
body.in-game .inflight .card { width: 28px; }
body.in-game .report { padding: 3px 8px; font-size: 12px; line-height: 1.25; max-height: 2.6em; overflow: hidden; }
body.in-game .report p { margin: 0; }
body.in-game .extras .btn { min-height: 34px; padding: 4px 12px; font-size: 13px; }
/* 설명 영역: 한 줄짜리 작은 띠로 줄인다 */
body.in-game .chances { gap: 4px 8px; font-size: 11px; padding-top: 0; max-height: 4.6em; overflow: hidden; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
body.in-game .chances h3 { font-size: 11px; margin: 0; display: inline; }
body.in-game .chances ul { display: inline; padding: 0; list-style: none; }
body.in-game .chances li { display: inline; margin-right: 8px; }
body.in-game .chances li:not(:last-child)::after { content: ' ·'; opacity: 0.5; }
body.in-game .chances .none { display: inline; }
body.in-game .assist-panel { font-size: 11px; max-height: 3em; overflow: hidden; }
/* 가로 화면: 손패는 한 줄 */
@media (orientation: landscape) and (max-height: 600px) {
  body.in-game .hand { grid-template-columns: repeat(10, minmax(0, var(--hand))); }
  body.in-game { --hand: clamp(30px, min(8vw, 14dvh), 70px); --floor: clamp(30px, min(7vw, 12dvh), 70px); --cap: clamp(13px, min(3.4vw, 5.5dvh), 34px); }
}

.lobby-options { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; margin-top: 10px; font-size: 14px; }

/* ---------- 규칙 설정 탭 ---------- */
.rule-settings p { margin: 0 0 8px; font-size: 13px; color: #555; }
.rule-bulk { display: flex; gap: 6px; margin-bottom: 8px; }
.rule-group { margin-bottom: 10px; }
.rule-group h3 { margin: 8px 0 4px; font-size: 14px; }
.rule-row { display: flex; align-items: flex-start; gap: 10px; padding: 7px 4px; border-bottom: 1px solid rgba(0, 0, 0, 0.08); cursor: pointer; }
.rule-row input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.rule-row b { display: block; font-size: 14px; }
.rule-row small { display: block; color: #666; font-size: 12px; }

/* ---------- 수련 모드 ---------- */
.lobby-actions .btn.big small { display: block; font-size: 12px; font-weight: 400; opacity: 0.8; margin-top: 2px; }
.profile-chip { align-self: center; }
.training-sheet { width: min(92vw, 460px); text-align: left; max-height: 88vh; overflow-y: auto; }
.training-input { width: 100%; font: inherit; font-size: 18px; padding: 10px 12px; border-radius: 10px; border: 2px solid rgba(0, 0, 0, 0.25); margin: 6px 0 12px; }
.train-score { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; }
.train-score strong { font-size: 28px; color: var(--red); }
.train-bar { height: 10px; border-radius: 6px; background: rgba(0, 0, 0, 0.12); overflow: hidden; margin: 6px 0; }
.train-bar i { display: block; height: 100%; background: var(--gold); }
.train-next { margin: 0 0 8px; font-size: 13px; color: #555; }
.train-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; margin-bottom: 4px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.badge-tile { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 10px; background: rgba(0, 0, 0, 0.07); opacity: 0.6; text-align: center; }
.badge-tile.got { background: linear-gradient(#fff3c4, #f3d77a); opacity: 1; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); }
.badge-icon { font-size: 28px; line-height: 1.1; }
.badge-tile b { font-size: 13px; }
.badge-tile small { font-size: 11px; color: #555; }

/* ---------- 덱 입체감, 바닥 크기(손패보다 크지 않게), 옆 점수판, 이름 ---------- */
body.in-game .table { --floor: calc(var(--hand) * var(--ff, 1)); }
.pile-stack { position: relative; width: var(--floor); aspect-ratio: 60 / 92; margin-bottom: 8px; }
.pile-stack .card { position: relative; z-index: 2; width: 100%; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); }
.pile-layer { position: absolute; inset: 0; z-index: 1; border-radius: var(--radius); background: linear-gradient(#8c0f25, #6e0a1c); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.14); }
.pile .card { width: 100%; }
.player-name { color: var(--gold); font-size: 17px !important; background: rgba(233, 181, 47, 0.16); border: 1px solid rgba(233, 181, 47, 0.55); border-radius: 12px; padding: 1px 9px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
#side-score { position: fixed; right: 2px; top: 56px; bottom: 10px; width: 22px; z-index: 6; display: flex; flex-direction: column; justify-content: space-between; align-items: center; gap: 6px; pointer-events: none; }
#side-score[hidden] { display: none; }
.side-col { writing-mode: vertical-rl; background: rgba(0, 0, 0, 0.38); color: var(--chalk); font-size: 11px; font-weight: 600; padding: 6px 2px; border-radius: 9px; letter-spacing: 0.02em; max-height: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-total { color: var(--gold); background: rgba(60, 40, 0, 0.5); margin-top: auto; }
body.in-game main { padding-right: 28px; }
@media (min-width: 700px) { #side-score { right: max(4px, calc((100vw - 1180px) / 2 - 30px)); width: 28px; } .side-col { font-size: 13px; padding: 8px 4px; } }

/* 덱이 비면 카드가 보이지 않는다(자리는 유지) */
.pile-stack.empty .card, .pile-stack.empty .pile-layer { visibility: hidden; }

/* ---------- 돋보기 ---------- */
.captured, .captured .card { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; touch-action: none; }
.captured .card svg, .captured .card img { pointer-events: none; -webkit-user-drag: none; }
.lens { position: fixed; z-index: 60; border-radius: 50%; pointer-events: none; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 45%, #2f4a3c 0%, #1d3328 100%);
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(0, 0, 0, 0.35), inset 0 0 22px rgba(0, 0, 0, 0.55);
  animation: lens-in 0.14s ease-out; }
.lens-card { width: 53%; aspect-ratio: 60 / 92; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.55)); }
.lens-card .card-svg { width: 100%; height: 100%; display: block; }
/* 유리 느낌: 가장자리는 어둡게 휘어 보이고, 위쪽에 빛이 반사된다 */
.lens-glass { position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(ellipse 70% 38% at 38% 14%, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0) 70%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0) 58%, rgba(0, 0, 0, 0.5) 100%); }
@keyframes lens-in { from { transform: scale(0.8); opacity: 0; } to { transform: none; opacity: 1; } }

/* 실제 확대 돋보기 */
.loupe { display: block; }
.loupe-inner { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; will-change: transform; }
.loupe-inner .captured { margin: 0; }
.loupe-inner .card { visibility: visible; }
