/* Generated by scripts/build-silver-base.mjs. */
@layer legacy {
/* styles.css */
:root {
  color-scheme: dark;
  --game-scale: 1;
  --game-width: 420px;
  --game-height: 880px;
  --ink: #f6f2e7;
  --muted: #a9c4bf;
  --felt: #104342;
  --felt-deep: #071e22;
  --panel: rgba(5, 35, 39, 0.9);
  --gold: #f0d48e;
  --red: #c74e46;
  --green: #208878;
  --paper: #f3ecd7;
  --black: #14201e;
}

* { box-sizing: border-box; }

html, body { margin: 0; width: 100%; height: 100%; min-height: 100%; background: #061619; }

body {
  min-width: 0;
  overflow: hidden;
  overscroll-behavior: none;
  font-family: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 0%, rgba(38, 126, 116, .22), transparent 34rem),
    linear-gradient(145deg, #061619, #09292c 55%, #041215);
}

button { font: inherit; touch-action: manipulation; }
.visually-hidden { position: absolute ; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.preview-shell {
  width: 100%;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  display: grid;
  grid-template-columns: max-content minmax(260px, 390px);
  gap: clamp(26px, 5vw, 76px);
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
}

.phone-frame {
  width: var(--game-width);
  height: var(--game-height);
  min-width: 0;
  min-height: 0;
}

.phone {
  position: relative;
  width: 420px;
  height: 880px;
  overflow: hidden;
  border: 1px solid rgba(240, 212, 142, .25);
  border-radius: 32px;
  background:
    repeating-linear-gradient(-8deg, transparent 0 44px, rgba(255,255,255,.022) 44px 46px),
    var(--felt);
  box-shadow: 0 35px 90px rgba(0,0,0,.52), inset 0 0 0 7px rgba(2,21,23,.72);
  padding: 14px 18px 10px;
  display: grid;
  grid-template-rows: 52px 126px minmax(240px, 1fr) 130px 116px;
  gap: 8px;
  transform: scale(var(--game-scale));
  transform-origin: top left;
}

.app-bar, .name-row, .player-head, .zone-title { display: flex; align-items: center; justify-content: space-between; }
h1, h2, p { margin: 0; }
h1 { font-size: 22px; letter-spacing: -.04em; }
.eyebrow { color: var(--gold); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.wallet { text-align: right; display: grid; gap: 3px; }
.wallet strong { font-size: 13px; }
.wallet span { font-size: 9px; color: #8bd0c3; }
.wallet i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #58c5a9; box-shadow: 0 0 9px #58c5a9; }

.main-menu-screen { position: absolute; inset: 0; z-index: 38; padding: 82px 34px 24px; display: flex; flex-direction: column; align-items: center; background: radial-gradient(circle at 50% 18%, #175b57 0, #0b3436 42%, #06191c 100%); text-align: center; }
.main-menu-screen.hidden { display: none; }
.main-menu-screen h2 { margin-top: 8px; font-size: 38px; letter-spacing: -.06em; }
.main-subtitle { margin-top: 5px; color: var(--muted); font-size: 12px; }
.main-card-fan { position: relative; width: 228px; height: 188px; margin-top: 24px; }
.main-card-fan img { position: absolute; top: 18px; left: 78px; width: 72px; height: 108px; object-fit: contain; filter: drop-shadow(0 12px 12px rgba(0,0,0,.38)); }
.main-card-fan img:first-child { transform: translate(-58px,18px) rotate(-11deg); }
.main-card-fan img:nth-child(2) { z-index: 2; transform: translateY(-2px); }
.main-card-fan img:last-child { transform: translate(58px,18px) rotate(11deg); }
.main-profile { width: 100%; min-height: 70px; padding: 13px 17px; display: grid; grid-template-columns: 1fr 1fr; text-align: left; }
.main-profile strong { color: var(--gold); font-size: 15px; }
.main-profile span { text-align: right; font-size: 12px; }
.main-profile small { grid-column: 1 / -1; margin-top: 8px; color: #8bd0c3; text-align: center; font-size: 9px; }
.main-actions { width: 100%; margin-top: 20px; display: grid; gap: 10px; }
.main-actions button { width: 100%; min-height: 62px; border: 0; border-radius: 16px; color: white; font-size: 17px; font-weight: 900; cursor: pointer; box-shadow: 0 8px 18px rgba(0,0,0,.26); }
.main-actions button small { display: block; margin-top: 3px; color: #d5e6e2; font-size: 9px; }
.online-button { background: #215b7e; }
.rules-button { min-height: 50px ; background: #4f4a44; font-size: 13px ; }
.main-legal { margin-top: auto; color: #729d96; font-size: 8px; }
.rules-guide-dialog { max-height: 82%; padding: 22px 18px; text-align: left; overflow-y: auto; }
#rulesGuide { z-index: 45; }
.rule-book-grid { margin-top: 18px; display: grid; gap: 9px; }
.rule-book-grid section { padding: 11px; border-radius: 12px; background: rgba(255,255,255,.05); }
.rule-book-grid strong { color: var(--gold); font-size: 12px; }
.rule-book-grid p { margin-top: 5px; font-size: 10px; }

.panel { border: 1px solid rgba(255,255,255,.08); background: var(--panel); border-radius: 17px; }
.opponent { position: relative; padding: 10px 14px; display: grid; grid-template-columns: 42px 1fr; gap: 10px; overflow: hidden; }
.avatar { width: 40px; height: 40px; border-radius: 13px; background: #ead08b; color: #183330; display: grid; place-items: center; font-weight: 900; }
.opponent-copy { min-width: 0; }
.name-row { gap: 8px; }
.name-row strong { font-size: 14px; }
.name-row span { color: var(--gold); font-size: 12px; }
.opponent-name-button { display: flex; align-items: center; gap: 5px; min-width: 0; padding: 0; border: 0; background: transparent; color: white; cursor: pointer; }
.opponent-name-button strong { white-space: nowrap; }
.opponent-name-button small { padding: 2px 5px; border: 1px solid rgba(240,212,142,.24); border-radius: 999px; color: var(--gold); font-size: 8px; font-weight: 800; }
.opponent-name-button:hover small, .opponent-name-button:focus-visible small { background: rgba(240,212,142,.13); }
.opponent-name-button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 5px; }
.opponent-copy p { max-width: 176px; margin-top: 5px; color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opponent-copy p.fallback { color: #ffd08b; }
.opponent-hand { position: absolute; right: 10px; top: 47px; width: 116px; height: 38px; }
.mini-back { position: absolute; width: 24px; height: 36px; border-radius: 4px; background: url("assets/hwatu/card_back_crimson_v2.png") center / contain no-repeat; box-shadow: -2px 0 4px rgba(0,0,0,.25); }

.table-zone { position: relative; min-height: 0; padding: 0 5px; }
.zone-title { height: 24px; color: var(--muted); font-size: 11px; font-weight: 750; }
.field { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding-right: 54px; align-content: start; }
.field.dense { grid-template-columns: repeat(6, 1fr); gap: 6px; }
.field.dense .game-card { border-radius: 6px; }
.field-drop-slot { visibility: hidden; box-shadow: none; pointer-events: none; }
.deck { position: absolute; right: 3px; bottom: 3px; display: grid; justify-items: center; gap: 2px; transform: scale(.72); transform-origin: bottom right; }
.deck span { font-size: 11px; color: var(--muted); }

.game-card {
  position: relative;
  aspect-ratio: 2 / 3;
  min-width: 0;
  padding: 0;
  border-radius: 8px;
  border: 0;
  background: transparent;
  box-shadow: 0 3px 8px rgba(0,0,0,.28);
  display: block;
  cursor: default;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  appearance: none;
  -webkit-appearance: none;
}

.card-art { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; user-select: none; }

button.game-card { cursor: pointer; }
button.game-card:hover, button.game-card:focus-visible { transform: translateY(-7px); outline: none; box-shadow: 0 9px 18px rgba(0,0,0,.38), 0 0 0 3px var(--gold); }
.game-card.match-choice { animation: choicePulse 1s infinite alternate; cursor: pointer; }
.card-back { width: 48px; height: 72px; border-radius: 7px; background: url("assets/hwatu/card_back_crimson_v2.png") center / contain no-repeat; box-shadow: 0 4px 9px rgba(0,0,0,.28); }

.player { position: relative; padding: 10px 14px; }
.player-head > div { display: flex; align-items: baseline; gap: 10px; }
.me { font-size: 17px; font-weight: 900; }
.player-head strong { color: var(--gold); font-size: 14px; }
.player-head > span { font-size: 10px; color: var(--muted); }
.player > p { margin-top: 5px; font-size: 9px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.capture-strip {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  cursor: pointer;
  appearance: none;
}

.opponent-strip { position: absolute; left: 66px; right: 132px; bottom: 5px; height: 70px; }
.player-strip { margin-top: 7px; width: 100%; height: 86px; }
.capture-pile {
  position: relative;
  min-width: 0;
  height: 100%;
  border: 0;
  border-radius: 8px;
  background: rgba(255,255,255,.055);
  overflow: hidden;
  box-shadow: none;
}
.capture-pile.kind-bright { background: rgba(240,212,142,.09); }
.capture-pile.kind-animal { background: rgba(79,142,118,.11); }
.capture-pile.kind-ribbon { background: rgba(196,78,70,.09); }
.capture-mini-card { position: absolute; top: 2px; width: 46px; height: 69px; object-fit: contain; filter: none; }
.player-strip .capture-mini-card { width: 54px; height: 81px; }
.capture-empty-slot { display: none; }
.capture-strip:hover .capture-pile, .capture-strip:focus-visible .capture-pile { background-color: rgba(240,212,142,.11); }
.capture-strip:focus-visible { outline: none; }

.flight-layer { position: absolute; inset: 0; z-index: 24; pointer-events: none; overflow: hidden; }
.opening-deal-flight { position: absolute; z-index: 3; filter: drop-shadow(0 10px 10px rgba(0,0,0,.44)); will-change: transform, opacity; }
.opening-deal-flight .game-card, .opening-deal-back { width: 100%; height: 100%; }
.opening-deal-back { border-radius: 8px; background: url("assets/hwatu/card_back_crimson_v2.png") center / contain no-repeat; box-shadow: 0 4px 10px rgba(0,0,0,.34); }
.flying-stack { position: absolute; width: 62px; height: 93px; filter: drop-shadow(0 12px 12px rgba(0,0,0,.42)); isolation: isolate; will-change: transform; }
.flying-stack .game-card { width: 100%; height: 100%; }
.flying-stack .capture-flight-card { position: absolute; width: 100%; height: 100%; will-change: transform; }
.flying-stack .capture-flight-card[data-capture-layer="top"] { filter: drop-shadow(0 5px 5px rgba(0,0,0,.38)); }
.flying-stack.draw-flight { width: 72px; height: 108px; perspective: 700px; }
.flight-flip-card { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; will-change: transform; }
.flight-face { position: absolute ; inset: 0; width: 100% ; height: 100% ; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flight-front { transform: rotateY(180deg); }
.flight-back { border-radius: 8px; background: url("assets/hwatu/card_back_crimson_v2.png") center / contain no-repeat; box-shadow: 0 8px 18px rgba(0,0,0,.42); }
.phone.animating .capture-strip, .phone.animating .hand { pointer-events: none; }
.phone.impact .table-zone { animation: tableImpact .17s cubic-bezier(.22,.9,.3,1); }

.event-callout { position: absolute; inset: 0; z-index: 29; display: grid; place-items: center; padding: 34px; pointer-events: none; overflow: hidden; }
.event-callout.hidden { display: none; }
.event-callout-card {
  position: relative;
  width: 100%;
  min-height: 144px;
  border: 4px solid #f6c746;
  border-radius: 24px;
  background: #14685b;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 14px 0 #071e22;
  transform-origin: center;
  animation: eventBurst .82s cubic-bezier(.16,.86,.24,1) both;
}
.event-callout-card::before, .event-callout-card::after {
  content: "";
  position: absolute;
  top: 27px;
  width: 72px;
  height: 70px;
  border-top: 5px solid #f6c746;
  border-bottom: 5px solid #f6c746;
}
.event-callout-card::before { left: -82px; transform: skewY(12deg); }
.event-callout-card::after { right: -82px; transform: skewY(-12deg); }
.event-callout.is-opponent .event-callout-card { border-color: #ee5b4b; background: #802b2a; }
.event-callout.is-opponent .event-callout-card::before, .event-callout.is-opponent .event-callout-card::after { border-color: #ee5b4b; }
.event-callout-card span { color: #f6c746; font-size: 9px; font-weight: 950; letter-spacing: .16em; }
.event-callout.is-opponent .event-callout-card span { color: #ffd0c9; }
.event-callout-card strong { margin-top: 7px; font-size: 42px; line-height: 1; letter-spacing: -.06em; text-shadow: 0 4px 0 #083d36; }
.event-callout.is-opponent .event-callout-card strong { text-shadow: 0 4px 0 #491615; }
.event-callout-card small { margin-top: 12px; font-size: 12px; font-weight: 850; }

.hand { position: relative; height: 132px; }
.hand .game-card { position: absolute; top: 2px; width: 74px; height: 111px; }
.hand .game-card:nth-child(even) { top: 7px; }
.hand .game-card.pending-hand-card { transform: scale(1.2); transform-origin: center bottom; z-index: 20; }

.overlay { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(0,12,14,.68); backdrop-filter: blur(5px); padding: 26px; }
.hidden { display: none; }
.dialog { width: 100%; border-radius: 24px; border: 1px solid rgba(240,212,142,.25); background: #071f23; padding: 26px 22px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.55); }
.dialog-kicker { color: var(--gold); font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.dialog h2 { margin-top: 8px; font-size: 26px; }
.dialog p { margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.capture-dialog { padding: 20px 16px 18px; text-align: left; max-height: 82%; overflow: auto; }
.capture-dialog-head { display: flex; justify-content: space-between; align-items: flex-start; }
.capture-dialog h2 { margin-top: 4px; font-size: 22px; }
.capture-dialog > p { margin-top: 5px; }
.close-button { width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.14); border-radius: 11px; background: rgba(255,255,255,.07); color: white; font-size: 24px; line-height: 1; cursor: pointer; }
.opponent-setup-dialog { padding: 21px 18px 18px; text-align: left; }
.opponent-setup-dialog h2 { margin-top: 4px; font-size: 24px; }
.setup-section { margin: 18px 0 0; padding: 0; border: 0; }
.setup-section legend { margin-bottom: 8px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.mode-grid, .difficulty-grid { display: grid; gap: 7px; }
.mode-grid { grid-template-columns: 1fr 1fr; }
.difficulty-grid { grid-template-columns: repeat(3, 1fr); }
.setup-option { position: relative; min-width: 0; cursor: pointer; }
.setup-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.setup-option > span { min-height: 58px; padding: 10px 8px; display: grid; place-content: center; text-align: center; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; background: rgba(255,255,255,.045); transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.setup-option strong { font-size: 12px; }
.setup-option small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.setup-option input:checked + span { border-color: var(--gold); background: rgba(240,212,142,.13); box-shadow: inset 0 0 0 1px rgba(240,212,142,.18); }
.setup-option input:focus-visible + span { outline: 2px solid white; outline-offset: 2px; }
.setup-option:hover > span { transform: translateY(-1px); }
.difficulty-option > span { min-height: 54px; }
.difficulty-help { min-height: 18px; margin-top: 13px ; color: #d9e7e3 ; text-align: center; }
.matchmaking-status { min-height: 34px; margin-top: 4px ; padding: 8px; border-radius: 10px; background: rgba(255,255,255,.04); text-align: center; font-size: 10px ; }
.matchmaking-status[data-tone="searching"] { color: var(--gold); animation: statusPulse .8s ease-in-out infinite alternate; }
.matchmaking-status[data-tone="fallback"] { color: #ffd08b; background: rgba(199,78,70,.12); }
.matchmaking-status[data-tone="connected"] { color: #8ee2cf; background: rgba(32,136,120,.14); }
.setup-start { min-height: 54px; margin-top: 10px; font-size: 15px; }
.setup-start:disabled { cursor: wait; opacity: .58; }
.capture-groups { margin-top: 15px; display: grid; gap: 9px; }
.capture-group { min-height: 92px; border-radius: 14px; padding: 9px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.07); }
.capture-group-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.capture-group-head strong { font-size: 11px; color: var(--gold); }
.capture-group-head span { font-size: 9px; color: var(--muted); }
.capture-card-row { display: flex; min-height: 61px; overflow-x: auto; padding: 1px 2px 4px; scrollbar-width: thin; }
.capture-card-row .game-card { width: 40px; min-width: 40px; height: 60px; margin-right: -12px; border-radius: 5px; box-shadow: 0 2px 5px rgba(0,0,0,.38); }
.capture-card-row .game-card:last-child { margin-right: 0; }
.capture-empty { color: #678b85; font-size: 10px; align-self: center; }
.decision-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.primary, .danger { min-height: 64px; border: 0; border-radius: 16px; color: white; font-weight: 900; font-size: 19px; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.28); }
.primary { background: var(--green); }
.danger { background: var(--red); }
.primary small, .danger small { display: block; margin-top: 3px; font-size: 9px; color: #d8e6e2; }
.wide { width: 100%; margin-top: 20px; }
.settlement { margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.settlement div { background: rgba(255,255,255,.055); border-radius: 10px; padding: 10px 4px; }
.settlement strong { display: block; color: var(--gold); font-size: 17px; }
.settlement span { font-size: 8px; color: var(--muted); }

#interstitialAd.interstitial-ad {
  z-index: 70;
  padding: 14px;
  background: #081c20;
  backdrop-filter: none;
}
.interstitial-ad-shell {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  padding: 14px;
  border: 2px solid #c79b3a;
  border-radius: 18px;
  background: #102f31;
  box-shadow: inset 0 0 0 4px #061719;
}
.interstitial-ad-head { display: flex; align-items: center; justify-content: space-between; }
.interstitial-ad-head span {
  color: #f0d48e;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
}
.interstitial-ad-head button {
  min-width: 58px;
  min-height: 38px;
  border: 1px solid #d6b15a;
  border-radius: 999px;
  color: #fff7dd;
  background: #432112;
  font-weight: 900;
  cursor: pointer;
}
.interstitial-ad-creative {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 16px;
  padding: 24px;
  border: 3px solid #dfbd68;
  border-radius: 16px;
  color: #fff8e3;
  background: linear-gradient(145deg, #6f1615, #2d0907 54%, #08463d 55%, #062a26);
  text-align: center;
}
.interstitial-ad-mark {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border: 2px solid #f1cf78;
  border-radius: 50%;
  color: #2b1308;
  background: #f0cc70;
  font-size: 22px;
  font-weight: 950;
}
.interstitial-ad-creative strong { font-size: clamp(27px, 8cqw, 38px); }
.interstitial-ad-creative p { max-width: 260px; margin: 0; color: #eee2c4; font-size: 12px; line-height: 1.6; }
.interstitial-ad-caption { margin: 0; color: #b8cec8; font-size: 10px; text-align: center; }

.build-note { align-self: center; }
.build-note h2 { margin-top: 13px; font-size: clamp(25px, 3vw, 38px); letter-spacing: -.05em; line-height: 1.18; }
.build-note ul { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 15px; }
.build-note li { color: #c6d8d4; font-size: 14px; display: flex; align-items: center; gap: 12px; }
.build-note li span { color: var(--gold); font-size: 10px; font-weight: 900; border: 1px solid rgba(240,212,142,.3); border-radius: 999px; padding: 5px 7px; }
.hint { margin-top: 28px; color: #7fa9a1; font-size: 12px; }

@keyframes choicePulse { from { box-shadow: 0 0 0 2px var(--gold), 0 4px 12px rgba(0,0,0,.3); } to { box-shadow: 0 0 0 5px #ff6a59, 0 7px 18px rgba(0,0,0,.45); } }
@keyframes tableImpact {
  0% { transform: translateY(0) scale(1); filter: brightness(1); }
  36% { transform: translateY(4px) scale(.992); filter: brightness(1.3); }
  68% { transform: translateY(-2px) scale(1.004); }
  100% { transform: translateY(0) scale(1); filter: brightness(1); }
}
@keyframes statusPulse { from { opacity: .64; } to { opacity: 1; } }
@keyframes eventBurst {
  0% { transform: translateX(-120%) skewX(-10deg) scale(.5); }
  18% { transform: translateX(0) skewX(2deg) scale(1.16); }
  34% { transform: skewX(-1deg) scale(.96); }
  50% { transform: skewX(0) scale(1.04); }
  68% { transform: scale(1); }
  100% { transform: translateY(-34px) scale(.94); }
}

@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  .preview-shell {
    grid-template-columns: 1fr;
    place-items: stretch;
    padding: 0;
  }
  .phone-frame { width: 100%; height: 100%; }
  .phone {
    width: 100%;
    height: 100%;
    padding:
      max(14px, env(safe-area-inset-top, 0px))
      max(18px, env(safe-area-inset-right, 0px))
      max(10px, env(safe-area-inset-bottom, 0px))
      max(18px, env(safe-area-inset-left, 0px));
    border-radius: 0;
    border: 0;
    box-shadow: none;
    transform: none;
  }
  .build-note { display: none; }
}

@media (max-width: 760px) and (max-height: 720px),
       (hover: none) and (pointer: coarse) and (max-height: 720px) {
  .phone {
    padding:
      max(10px, env(safe-area-inset-top, 0px))
      max(14px, env(safe-area-inset-right, 0px))
      max(8px, env(safe-area-inset-bottom, 0px))
      max(14px, env(safe-area-inset-left, 0px));
    grid-template-rows: 46px 110px minmax(0, 1fr) 108px 96px;
    gap: 6px;
  }
  .field { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .field.dense { grid-template-columns: repeat(6, 1fr); }
  .opponent { padding: 8px 12px; }
  .opponent-strip { left: 62px; right: 126px; bottom: 4px; height: 58px; }
  .capture-mini-card { width: 40px; height: 60px; }
  .player { padding: 7px 10px; }
  .player-strip { height: 68px; margin-top: 5px; }
  .player-strip .capture-mini-card { width: 43px; height: 64px; }
  .hand { height: 100%; }
  .hand .game-card { width: 62px; height: 93px; }
}

@media (max-width: 760px) and (max-height: 620px),
       (hover: none) and (pointer: coarse) and (max-height: 620px) {
  .phone {
    grid-template-rows: 40px 96px minmax(0, 1fr) 94px 82px;
    gap: 4px;
  }
  .opponent-strip { left: 58px; right: 112px; height: 48px; }
  .player-strip { height: 56px; }
  .capture-mini-card { width: 34px; height: 51px; }
  .player-strip .capture-mini-card { width: 37px; height: 55px; }
  .hand .game-card { width: 54px; height: 81px; }
}

@media (min-width: 761px) and (max-height: 620px) {
  .preview-shell {
    grid-template-columns: 1fr;
    place-items: center;
    padding: max(8px, env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px)) max(8px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
  }
  .build-note { display: none; }
}

/* 1.6.1 · 어르신 가독성 + 군용 모포 화투판 */
:root {
  --ink: #fffdf2;
  --muted: #e0e4cd;
  --felt: #3d4f32;
  --felt-deep: #172117;
  --panel: rgba(18, 31, 19, .96);
  --gold: #ffda73;
  --red: #c74234;
  --green: #607f42;
  --khaki: #c9b37a;
  --stitch: #9f3e33;
}

body {
  font-weight: 650;
  background:
    radial-gradient(circle at 22% 8%, rgba(126, 145, 82, .22), transparent 30rem),
    linear-gradient(145deg, #11180f, #283521 54%, #0c130b);
}

.phone {
  grid-template-rows: 64px 136px minmax(220px, 1fr) 138px 122px;
  gap: 8px;
  padding: 12px 15px 8px;
  border: 3px solid #776741;
  border-radius: 24px;
  background-color: var(--felt);
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,.022) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.028) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(-8deg, transparent 0 54px, rgba(201,179,122,.075) 54px 56px),
    radial-gradient(circle at 18% 10%, rgba(133,154,91,.24), transparent 48%);
  box-shadow:
    0 28px 80px rgba(0,0,0,.58),
    inset 0 0 0 5px #26331f,
    inset 0 0 0 7px rgba(220,196,132,.28);
}

.app-bar {
  min-width: 0;
  padding: 3px 6px 5px;
  border-bottom: 2px dashed rgba(255,218,115,.52);
}

h1 {
  margin-top: 1px;
  font-size: 27px;
  line-height: 1;
  letter-spacing: -.055em;
  text-shadow: 0 2px 0 rgba(0,0,0,.52);
}

.eyebrow {
  color: var(--gold);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .13em;
}

.wallet {
  min-width: 112px;
  padding: 6px 9px;
  gap: 2px;
  border: 2px solid rgba(201,179,122,.72);
  border-radius: 8px;
  background: #26331f;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07), 0 3px 0 rgba(0,0,0,.24);
}

.wallet strong { color: white; font-size: 16px; line-height: 1.1; }
.wallet span { color: #cce6bd; font-size: 11px; font-weight: 850; }
.wallet i { width: 8px; height: 8px; background: #8fd36c; box-shadow: 0 0 7px #8fd36c; }

.panel {
  border: 2px solid var(--khaki);
  border-radius: 13px;
  background:
    linear-gradient(100deg, rgba(255,255,255,.025), transparent 38%),
    var(--panel);
  box-shadow: 0 5px 0 rgba(16,22,13,.42), inset 0 0 0 2px rgba(255,255,255,.035);
}

.opponent {
  padding: 11px 12px;
  grid-template-columns: 50px 1fr;
  gap: 10px;
  border-left: 6px solid var(--stitch);
}

.avatar {
  width: 48px;
  height: 48px;
  border: 3px solid #fff0b8;
  border-radius: 50%;
  background: var(--gold);
  color: #172117;
  font-size: 20px;
  box-shadow: 0 3px 0 #806a31;
}

.name-row { gap: 7px; }
.name-row strong { font-size: 18px; }
.name-row span { color: var(--gold); font-size: 16px; font-weight: 950; white-space: nowrap; }
.opponent-name-button { min-height: 38px; gap: 6px; }
.opponent-name-button small {
  padding: 5px 7px;
  border: 2px solid var(--khaki);
  border-radius: 7px;
  color: #fff3bf;
  font-size: 11px;
  background: #3d4b2b;
}

.opponent-copy p {
  max-width: 205px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.opponent-hand { right: 10px; top: 62px; width: 126px; height: 44px; }
.mini-back { width: 28px; height: 42px; border-radius: 4px; box-shadow: -2px 1px 0 rgba(0,0,0,.48); }
.opponent-strip { left: 70px; right: 142px; bottom: 7px; height: 57px; }

.table-zone { padding: 0 4px; }
.zone-title {
  height: 28px;
  color: #fffce9;
  font-size: 15px;
  font-weight: 950;
  text-shadow: 0 2px 0 rgba(0,0,0,.48);
}
.zone-title span:last-child {
  padding: 3px 7px;
  border-radius: 6px;
  color: #1b2417;
  background: var(--gold);
  text-shadow: none;
}

.field { gap: 8px; padding-right: 50px; }
.game-card { border-radius: 7px; box-shadow: 0 4px 0 #161b12, 0 7px 12px rgba(0,0,0,.3); }
button.game-card:hover, button.game-card:focus-visible {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 8px 0 #161b12, 0 0 0 4px var(--gold);
}
.card-back { width: 52px; height: 78px; border: 2px solid #e3b44c; box-shadow: 0 4px 0 #171b12; }
.deck { right: 0; bottom: 4px; transform: none; }
.deck span { color: white; font-size: 14px; font-weight: 950; text-shadow: 0 2px #000; }

.capture-strip { gap: 5px; min-height: 44px; }
.capture-pile {
  border: 1px solid rgba(201,179,122,.42);
  border-radius: 7px;
  background: rgba(255,255,255,.075);
  box-shadow: inset 0 0 7px rgba(0,0,0,.25);
}
.capture-pile::after {
  position: absolute;
  right: 3px;
  bottom: 3px;
  z-index: 5;
  padding: 2px 4px;
  border-radius: 4px;
  color: #fff8d7;
  background: rgba(8,14,8,.82);
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
}
.capture-pile.kind-bright::after { content: "광"; }
.capture-pile.kind-animal::after { content: "열끗"; }
.capture-pile.kind-ribbon::after { content: "띠"; }
.capture-pile.kind-junk::after { content: "피"; }
.capture-pile.kind-bright { background: rgba(255,218,115,.15); }
.capture-pile.kind-animal { background: rgba(137,167,91,.17); }
.capture-pile.kind-ribbon { background: rgba(199,66,52,.17); }
.capture-pile.kind-junk { background: rgba(255,255,255,.085); }
.capture-mini-card { filter: drop-shadow(1px 2px 1px rgba(0,0,0,.42)); }

.player {
  padding: 10px 12px;
  border-left: 6px solid var(--gold);
}
.player-head > div { gap: 9px; }
.me { font-size: 22px; }
.player-head strong { color: var(--gold); font-size: 18px; }
.player-head > span { color: #fffce9; font-size: 13px; font-weight: 900; }
.player-strip { height: 88px; margin-top: 7px; }
.hand { --hand-card-width: 78px; height: 100%; }
.hand .game-card { width: var(--hand-card-width); height: calc(var(--hand-card-width) * 1.5); }

.main-menu-screen {
  padding: 72px 28px 22px;
  background-color: var(--felt);
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,.02) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.03) 0 1px, transparent 1px 5px),
    radial-gradient(circle at 50% 17%, #637949 0, #35462c 43%, #192218 100%);
  box-shadow: inset 0 0 0 8px #26331f, inset 0 0 0 10px rgba(201,179,122,.55);
}
.main-menu-screen::before {
  content: "추억의 모포 화투판";
  margin-bottom: 3px;
  padding: 5px 12px;
  border: 2px dashed #e6c76f;
  color: #fff0b6;
  background: rgba(33,45,26,.78);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
}
.main-menu-screen h2 { margin-top: 7px; color: #fffdf2; font-size: 42px; text-shadow: 0 4px 0 #1d2818; }
.main-subtitle { margin-top: 7px; color: #f5edcb; font-size: 16px; font-weight: 800; }
.main-card-fan { height: 178px; margin-top: 16px; }
.main-card-fan img { width: 78px; height: 117px; filter: drop-shadow(0 9px 0 rgba(20,25,15,.78)); }
.main-profile { min-height: 78px; padding: 14px 16px; }
.main-profile strong { color: var(--gold); font-size: 19px; }
.main-profile span { font-size: 16px; font-weight: 900; }
.main-profile small { color: #eef0d8; font-size: 12px; }
.main-actions { margin-top: 14px; gap: 9px; }
.main-actions button {
  min-height: 68px;
  border: 2px solid #f3d47a;
  border-radius: 10px;
  font-size: 21px;
  box-shadow: 0 5px 0 #182015;
}
.main-actions button small { margin-top: 3px; color: #fffbe8; font-size: 12px; }
.primary { background: #57783d; }
.online-button { background: #4d6654; }
.rules-button { min-height: 54px ; background: #6b4a35; font-size: 17px ; }
.main-legal { color: #d7dac4; font-size: 11px; }

.overlay { background: rgba(11,16,9,.82); backdrop-filter: blur(3px); padding: 18px; }
.dialog { border: 3px solid var(--khaki); border-radius: 14px; background: #1d291b; box-shadow: 0 8px 0 #0b1009; }
.dialog-kicker { font-size: 12px; }
.dialog h2 { font-size: 30px; }
.dialog p { font-size: 16px; line-height: 1.55; }
.close-button { width: 48px; height: 48px; border: 2px solid var(--khaki); border-radius: 8px; font-size: 32px; }
.setup-section legend { font-size: 14px; }
.setup-option > span { min-height: 70px; border: 2px solid rgba(255,255,255,.18); border-radius: 9px; }
.setup-option strong { font-size: 16px; }
.setup-option small { font-size: 12px; }
.difficulty-help, .matchmaking-status { font-size: 14px ; }
.setup-start { min-height: 62px; font-size: 19px; }
.rule-book-grid strong { font-size: 17px; }
.rule-book-grid p { font-size: 14px; }
.capture-group-head strong { font-size: 15px; }
.capture-group-head span, .capture-empty { font-size: 13px; }
.primary, .danger { border: 2px solid #f1d078; border-radius: 10px; font-size: 22px; }
.primary small, .danger small { font-size: 12px; }

.event-callout-card { border-radius: 12px; background: #526f39; box-shadow: 0 8px 0 #182015; }
.event-callout-card span { font-size: 12px; }

@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  .phone {
    padding:
      max(10px, env(safe-area-inset-top, 0px))
      max(12px, env(safe-area-inset-right, 0px))
      max(7px, env(safe-area-inset-bottom, 0px))
      max(12px, env(safe-area-inset-left, 0px));
    border: 0;
    border-radius: 0;
    box-shadow: inset 0 0 0 5px #26331f, inset 0 0 0 7px rgba(201,179,122,.28);
  }
}

@media (max-width: 760px) and (max-height: 720px),
       (hover: none) and (pointer: coarse) and (max-height: 720px) {
  .phone { grid-template-rows: 54px 112px minmax(0, 1fr) 112px 96px; gap: 6px; }
  h1 { font-size: 22px; }
  .wallet { min-width: 98px; padding: 4px 7px; }
  .wallet strong { font-size: 13px; }
  .wallet span { font-size: 9px; }
  .opponent { padding: 7px 9px; grid-template-columns: 43px 1fr; }
  .avatar { width: 40px; height: 40px; font-size: 17px; }
  .name-row strong { font-size: 15px; }
  .name-row span { font-size: 13px; }
  .opponent-copy p { font-size: 10px; }
  .opponent-hand { top: 53px; }
  .opponent-strip { left: 60px; right: 132px; height: 48px; }
  .zone-title { height: 24px; font-size: 13px; }
  .field { grid-template-columns: repeat(5, 1fr); }
  .player { padding: 7px 9px; }
  .me { font-size: 18px; }
  .player-head strong { font-size: 15px; }
  .player-strip { height: 66px; margin-top: 4px; }
  .hand { --hand-card-width: 62px; }
  .main-menu-screen { padding: 24px 24px 14px; }
  .main-menu-screen h2 { font-size: 34px; }
  .main-card-fan { height: 112px; margin-top: 8px; }
  .main-card-fan img { top: 4px; width: 60px; height: 90px; }
  .main-profile { min-height: 62px; padding: 9px 13px; }
  .main-actions { margin-top: 8px; gap: 6px; }
  .main-actions button { min-height: 54px; font-size: 18px; }
  .rules-button { min-height: 46px ; }
}

@media (max-width: 760px) and (max-height: 620px),
       (hover: none) and (pointer: coarse) and (max-height: 620px) {
  .phone { grid-template-rows: 48px 98px minmax(0, 1fr) 96px 84px; gap: 4px; }
  .app-bar { padding-top: 0; }
  .eyebrow { font-size: 9px; }
  h1 { font-size: 20px; }
  .opponent-name-button { min-height: 32px; }
  .opponent-hand { top: 45px; }
  .opponent-strip { left: 56px; right: 116px; height: 43px; bottom: 4px; }
  .capture-pile::after { font-size: 8px; }
  .zone-title { height: 21px; font-size: 12px; }
  .player-strip { height: 55px; }
  .hand { --hand-card-width: 54px; }
  .main-menu-screen::before { display: none; }
  .main-menu-screen h2 { font-size: 30px; }
  .main-subtitle { font-size: 13px; }
  .main-card-fan { height: 88px; }
  .main-card-fan img { width: 52px; height: 78px; }
  .main-actions button { min-height: 48px; font-size: 16px; }
  .main-actions button small { font-size: 10px; }
  .main-legal { font-size: 9px; }
}

/* Uploaded lacquered-wood lobby resource composition. */
.game-title-group { display: flex; align-items: center; gap: 8px; }
.game-home-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid #d7a84d;
  border-radius: 50%;
  color: #fff2bf;
  background: linear-gradient(#7c351d, #32140d);
  font-size: 19px;
  font-weight: 900;
  line-height: 28px;
  cursor: pointer;
  box-shadow: 0 3px 0 #120806;
}
.game-home-button:hover, .game-home-button:focus-visible { outline: 2px solid #fff2bf; outline-offset: 2px; transform: translateY(-1px); }

.main-menu-screen {
  inset: 0;
  z-index: 50;
  padding: 0 ;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, rgba(124,47,22,.35), transparent 55%),
    #140805;
  box-shadow: none;
}
.main-menu-screen::before { content: none ; display: none ; }
.main-menu-screen.hidden { display: none; }
.lobby-artboard {
  position: relative;
  width: 100%;
  aspect-ratio: 941 / 1672;
  max-height: 100%;
  overflow: hidden;
  filter: drop-shadow(0 14px 28px rgba(0,0,0,.58));
}
.lobby-artboard > img, .lobby-artboard img { display: block; user-select: none; -webkit-user-drag: none; }
.lobby-frame-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.lobby-floral-ornament {
  position: absolute;
  z-index: 2;
  left: 4%;
  top: 7.6%;
  width: 92%;
  height: 19%;
  object-fit: contain;
  pointer-events: none;
}
.lobby-title-plaque { position: absolute; z-index: 2; top: 2.6%; left: 6%; width: 88%; height: auto; }
.lobby-brand-line { position: absolute; z-index: 2; top: 12.4%; left: 17%; width: 66%; height: auto; }
.lobby-main-title { position: absolute; z-index: 3; top: 15.1%; left: 12.5%; width: 75%; height: auto; filter: drop-shadow(0 5px 2px rgba(0,0,0,.58)); }
.lobby-main-subtitle { position: absolute; z-index: 3; top: 25.6%; left: 18%; width: 64%; height: auto; }
.lobby-main-stamp { position: absolute; z-index: 4; top: 20.6%; right: 8.5%; width: 9.5%; height: auto; }

.lobby-hero-card {
  z-index: 5;
  object-fit: contain;
  transform-origin: 50% 92%;
  filter: drop-shadow(0 8px 5px rgba(0,0,0,.58));
  pointer-events: none;
}
.hero-plum { z-index: 6; }

.main-profile-frame { z-index: 4; object-fit: fill; pointer-events: none; }
.main-stat-coins, .main-stat-record {
  z-index: 5;
  display: flex;
  align-items: center;
  color: #fff4bd;
  font-family: Georgia, "Apple SD Gothic Neo", serif;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 3px 0 #34150c, 0 0 7px rgba(255,202,86,.25);
  white-space: nowrap;
}
.main-stat-record { justify-content: center; color: #fff; text-align: center; }
.fairness-copy { z-index: 5; object-fit: contain; pointer-events: none; }

.main-menu-screen .main-actions { position: absolute; z-index: 6; inset: 0; width: 100%; height: 100%; margin: 0; display: block; pointer-events: none; }
.main-menu-screen .lobby-menu-button {
  position: absolute;
  aspect-ratio: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  cursor: pointer;
  box-shadow: none;
  pointer-events: auto;
  transition: transform .16s ease, filter .16s ease;
}
.lobby-menu-board { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.lobby-menu-copy, .lobby-menu-decoration { z-index: 8; object-fit: contain; pointer-events: none; filter: drop-shadow(0 3px 2px rgba(0,0,0,.45)); }
.lobby-menu-decoration { z-index: 9; }
.main-menu-screen .lobby-menu-button:hover, .main-menu-screen .lobby-menu-button:focus-visible { transform: translateY(-2px) scale(1.012); filter: brightness(1.12); outline: none; }
.main-menu-screen .lobby-menu-button:focus-visible::after { content: ""; position: absolute; inset: 8%; z-index: 8; border: 3px solid #fff4bd; border-radius: 12px; pointer-events: none; }
.main-menu-screen .lobby-menu-button:active { transform: translateY(2px) scale(.992); }

.main-menu-screen .main-legal { position: absolute; z-index: 4; left: 18%; bottom: 2.5%; width: 64%; height: auto; margin: 0; }
.rules-guide-dialog { border-color: #d6a84d; background: linear-gradient(rgba(42,16,9,.96), rgba(18,9,6,.98)), url("assets/lobby/menu_brown.png") center / cover; }
#rulesGuide { z-index: 70; }
.rules-guide-dialog .rule-book-grid section { border: 1px solid rgba(222,177,83,.35); background: rgba(17,10,6,.74); }

.lobby-layout-reference { position: absolute; inset: 0; z-index: 40; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.lobby-layout-editor {
  position: fixed;
  z-index: 1000;
  top: 14px;
  right: 14px;
  width: min(292px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  overflow: auto;
  padding: 14px;
  border: 1px solid #e4bd68;
  border-radius: 14px;
  color: #fff8df;
  background: rgba(22,12,8,.96);
  box-shadow: 0 14px 40px rgba(0,0,0,.5);
  font: 12px/1.3 "Apple SD Gothic Neo", sans-serif;
}
.lobby-layout-editor strong, .lobby-layout-editor select, .lobby-layout-editor label { display: block; width: 100%; margin-bottom: 9px; }
.lobby-layout-editor select, .lobby-layout-editor button, .lobby-layout-editor textarea { box-sizing: border-box; width: 100%; color: inherit; background: #3a2115; border: 1px solid #8e6e3c; border-radius: 7px; }
.lobby-layout-editor select, .lobby-layout-editor button { min-height: 34px; padding: 6px 8px; }
.lobby-layout-editor label { display: grid; grid-template-columns: 42px 1fr 38px; align-items: center; gap: 6px; }
.lobby-layout-editor input { width: 100%; }
.lobby-layout-editor output { text-align: right; }
.lobby-layout-editor textarea { height: 230px; margin-top: 10px; padding: 8px; font: 10px/1.3 ui-monospace, monospace; }

@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  .lobby-artboard { width: min(100%, calc(100dvh * 941 / 1672)); }
}

/* 1.9.0 · 자개·금장 플레이 화면 모듈 */
.game-artboard {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: min(100%, calc(100dvh * 941 / 1672));
  max-height: 100%;
  overflow: hidden;
  transform: translate(-50%, -50%);
  background:
    linear-gradient(rgba(18, 6, 3, .18), rgba(18, 6, 3, .18)),
    repeating-linear-gradient(0deg, #2c0b04 0 2px, #491207 2px 5px, #210704 5px 8px);
  box-shadow: inset 0 0 0 2px rgba(216, 163, 66, .48);
}
.game-artboard.hidden { display: none; }
.game-ui-art { display: block; z-index: 1; object-fit: contain; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.game-ui-fill { object-fit: fill; }
.game-header-panel, .game-brand-art, .game-title-art, .game-settings-art, .game-security-art,
.game-title-floral-art,
.game-opponent-panel, .game-field-panel, .game-player-panel, .game-hand-panel,
.game-footer-ornament, .game-field-label, .game-player-label, .game-captured-label,
.game-opponent-settings { z-index: 1; }

.game-artboard .app-bar,
.game-artboard .opponent,
.game-artboard .opponent-copy,
.game-artboard .name-row,
.game-artboard .table-zone,
.game-artboard .player,
.game-artboard .player-head,
.game-artboard .player-head > div {
  position: static;
  display: contents;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.game-artboard .game-home-button {
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 226, 139, .78);
  border-radius: 50%;
  color: #fff0b6;
  background: linear-gradient(#7c3b17, #351308);
  box-shadow: inset 0 0 0 2px rgba(25, 8, 2, .55), 0 2px 5px rgba(0,0,0,.45);
  line-height: 1;
  cursor: pointer;
}
.game-artboard .game-home-button:hover,
.game-artboard .game-home-button:focus-visible { filter: brightness(1.2); outline: 2px solid #fff1b6; outline-offset: 1px; }

.game-artboard .game-settings-button {
  position: absolute;
  z-index: 5;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.game-artboard .game-settings-art { width: 100%; height: 100%; object-fit: contain; }
.game-artboard .simple-settings { display: none; }
.game-artboard .game-settings-button:hover .game-settings-art,
.game-artboard .game-settings-button:focus-visible .game-settings-art { filter: brightness(1.2); }
.game-artboard .game-settings-button:focus-visible { border-radius: 1cqw; outline: 2px solid #ffe79a; outline-offset: .35cqw; }

.game-title-floral-art {
  position: absolute;
  z-index: 2;
  left: 5%;
  top: .3%;
  width: 64%;
  height: 8.4%;
  object-fit: contain;
}
.game-brand-art, .game-title-art { z-index: 3; }

.game-artboard .wallet {
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  text-align: center;
}
.game-artboard .wallet strong {
  color: #fff2be;
  font-size: inherit;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -.055em;
  text-shadow: 0 .19cqw 0 #321006, 0 .35cqw .5cqw rgba(0,0,0,.7);
}
.game-artboard .game-security-art { z-index: 3; }

.game-artboard .avatar {
  z-index: 4;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  color: #190b05;
  background: none;
  box-shadow: none;
}
.game-artboard .avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.game-artboard .avatar span { position: relative; z-index: 2; padding-top: 7%; font-size: inherit; font-weight: 950; line-height: 1; }

.game-artboard .opponent-name-button {
  z-index: 5;
  display: flex;
  align-items: center;
  padding: 0;
  border: 0;
  color: #fffdf3;
  background: transparent;
  cursor: default;
}
.game-artboard .opponent-name-button strong {
  font-size: inherit;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -.045em;
  text-shadow: 0 .22cqw .24cqw rgba(0,0,0,.78);
  white-space: nowrap;
}
.game-artboard .game-opponent-settings { z-index: 4; }
.game-artboard .opponent-name-button:hover + .game-opponent-settings,
.game-artboard .opponent-name-button:focus-visible + .game-opponent-settings { filter: brightness(1.2); }
.game-artboard .opponent-name-button:focus-visible { border-radius: 1cqw; outline: 2px solid #ffe79a; outline-offset: .35cqw; }

.game-artboard #opponentScore,
.game-artboard #playerScore {
  z-index: 4;
  display: flex;
  align-items: center;
  color: #ffe5a0;
  font-size: inherit;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -.045em;
  text-shadow: 0 .22cqw .25cqw rgba(0,0,0,.75);
  white-space: nowrap;
}
.game-artboard #opponentScore { justify-content: flex-end; }
.game-artboard .opponent-copy > p {
  z-index: 4;
  display: flex;
  align-items: center;
  max-width: none;
  overflow: visible;
  color: #fff2c7;
  font-size: inherit;
  font-weight: 780;
  line-height: 1;
  text-overflow: clip;
  text-shadow: 0 .18cqw .2cqw rgba(0,0,0,.7);
  white-space: nowrap;
}
.game-artboard .opponent-copy > p.fallback { color: #ffd675; }

.game-artboard .capture-strip {
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .72cqw;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.game-artboard .capture-pile {
  height: 100%;
  border: 1px solid rgba(224, 180, 77, .55);
  border-radius: 1.05cqw;
  background: url("assets/game-ui/capture_slot_brown.png") center / 100% 100% no-repeat;
  box-shadow: inset 0 0 .65cqw rgba(0,0,0,.55);
  overflow: hidden;
}
.game-artboard .capture-pile.kind-bright,
.game-artboard .capture-pile.kind-animal { background-image: url("assets/game-ui/capture_slot_green.png"); }
.game-artboard .capture-mini-card { top: .3cqw; width: 8.2cqw; height: 12.3cqw; }
.game-artboard .player-strip .capture-mini-card { width: 10.4cqw; height: 15.6cqw; }
.game-artboard .opponent-hand { z-index: 4; overflow: visible; }
.game-artboard .mini-back { width: 7.15cqw; height: 10.72cqw; border-radius: .72cqw; background-image: url("assets/hwatu/card_back_crimson_v2.png"); }

.game-artboard .game-field-label,
.game-artboard .game-player-label,
.game-artboard .game-captured-label { z-index: 5; }
.game-artboard .zone-title {
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 0;
  border: .22cqw solid #d7a33c;
  border-radius: 1.6cqw;
  color: #fffdf1;
  background: url("assets/game-ui/label_plaque_right.png") center / 100% 100% no-repeat;
  font-size: inherit;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 .2cqw .25cqw rgba(0,0,0,.8);
}
.game-artboard .field {
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.65cqw 2.2cqw;
  padding: 0;
  align-content: start;
  overflow: visible;
}
.game-artboard .field.dense { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.05cqw; }
.game-artboard .field .game-card { width: 100%; height: auto; }
.game-artboard .deck {
  z-index: 5;
  display: block;
  padding: 0;
  transform: none;
}
.game-artboard .deck .game-deck-frame { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 .7cqw .8cqw rgba(0,0,0,.4)); }
.game-artboard .deck .card-back { display: none; }
.game-artboard .deck span {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translate(-50%, .2cqw);
  color: #fff5c9;
  font-size: inherit;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 .18cqw .2cqw #1e0904;
}

.game-artboard .player-strip { z-index: 4; }
.game-artboard .hand {
  z-index: 5;
  --hand-card-width: 14.78cqw;
  overflow: visible;
}
.game-artboard .hand .game-card {
  top: -1.2cqw;
  width: var(--hand-card-width);
  height: calc(var(--hand-card-width) * 1.5);
  filter: drop-shadow(0 .7cqw .55cqw rgba(0,0,0,.4));
}
.game-artboard .hand .game-card:nth-child(even) { top: -.35cqw; }
.game-artboard .hand .game-card.pending-hand-card { transform: translateY(-2.2cqw) scale(1.12); }
.game-artboard .game-footer-ornament { z-index: 2; }

.game-layout-reference { position: absolute; inset: 0; z-index: 40; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.game-layout-editor { position: fixed; z-index: 1000; top: 14px; right: 14px; width: min(292px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); overflow: auto; padding: 14px; border: 1px solid #e4bd68; border-radius: 14px; color: #fff8df; background: rgba(22,12,8,.96); box-shadow: 0 14px 40px rgba(0,0,0,.5); font: 12px/1.3 "Apple SD Gothic Neo", sans-serif; }
.game-layout-editor strong, .game-layout-editor select, .game-layout-editor label { display: block; width: 100%; margin-bottom: 9px; }
.game-layout-editor select, .game-layout-editor button, .game-layout-editor textarea { box-sizing: border-box; width: 100%; color: inherit; background: #3a2115; border: 1px solid #8e6e3c; border-radius: 7px; }
.game-layout-editor select, .game-layout-editor button { min-height: 34px; padding: 6px 8px; }
.game-layout-editor label { display: grid; grid-template-columns: 42px 1fr 38px; align-items: center; gap: 6px; }
.game-layout-editor input { width: 100%; }
.game-layout-editor output { text-align: right; }
.game-layout-editor textarea { height: 230px; margin-top: 10px; padding: 8px; font: 10px/1.3 ui-monospace, monospace; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto ;
    animation-duration: .01ms ;
    animation-iteration-count: 1 ;
    transition-duration: .01ms ;
  }
}

/* lobby-layout.generated.css */
/* Generated from assets/lobby/lobby-layout.json. Do not edit by hand. */
.lobby-artboard { aspect-ratio: 941 / 1672; container-type: inline-size; }
.lobby-frame-art { position: absolute; left: 3.18810%; top: 2.45215%; width: 93.62380%; height: 95.09569%; right: auto; bottom: auto; margin: 0; transform: none; }
.lobby-title-plaque { position: absolute; left: 22.74176%; top: 3.70813%; width: 54.51647%; height: 6.10048%; right: auto; bottom: auto; margin: 0; transform: none; }
.lobby-brand-line { position: absolute; left: 28.69288%; top: 9.44976%; width: 42.61424%; height: 1.61483%; right: auto; bottom: auto; margin: 0; transform: none; }
.lobby-main-title { position: absolute; left: 17.53454%; top: 12.38038%; width: 64.82465%; height: 10.22727%; right: auto; bottom: auto; margin: 0; }
.lobby-main-subtitle { position: absolute; left: 25.92986%; top: 22.36842%; width: 48.14028%; height: 2.99043%; right: auto; bottom: auto; margin: 0; transform: none; }
.lobby-main-stamp { position: absolute; left: 78.10840%; top: 19.07895%; width: 6.16366%; height: 3.64833%; right: auto; bottom: auto; margin: 0; transform: none; }
.hero-crane { position: absolute; left: 26.78002%; top: 28.94737%; width: 16.25930%; height: 14.71292%; right: auto; bottom: auto; margin: 0; transform: rotate(-13deg); }
.hero-plum { position: absolute; left: 41.87035%; top: 28.05024%; width: 16.25930%; height: 14.71292%; right: auto; bottom: auto; margin: 0; transform: none; }
.hero-moon { position: absolute; left: 56.96068%; top: 28.94737%; width: 16.25930%; height: 14.71292%; right: auto; bottom: auto; margin: 0; transform: rotate(13deg); }
.main-profile-frame { position: absolute; left: 4.46334%; top: 43.54067%; width: 91.07333%; height: 11.24402%; right: auto; bottom: auto; margin: 0; transform: none; }
.main-stat-coins { position: absolute; left: 17.00319%; top: 45.33493%; width: 31.88098%; height: 4.66507%; right: auto; bottom: auto; margin: 0; transform: none; font-size: 6.80128cqw; }
.main-stat-record { position: absolute; left: 62.16791%; top: 45.33493%; width: 23.37938%; height: 4.66507%; right: auto; bottom: auto; margin: 0; transform: none; font-size: 5.52604cqw; }
.fairness-copy { position: absolute; left: 22.74176%; top: 50.47847%; width: 54.51647%; height: 2.57177%; right: auto; bottom: auto; margin: 0; transform: none; }
.main-menu-screen .lobby-menu-solo { position: absolute; left: 4.78215%; top: 56.10048%; width: 90.43571%; height: 10.40670%; right: auto; bottom: auto; margin: 0; transform: none; }
.solo-title { position: absolute; left: 30.28693%; top: 57.53589%; width: 39.42614%; height: 5.26316%; right: auto; bottom: auto; margin: 0; transform: none; }
.solo-subtitle { position: absolute; left: 35.60043%; top: 62.79904%; width: 28.79915%; height: 2.69139%; right: auto; bottom: auto; margin: 0; transform: none; }
.solo-arrow { position: absolute; left: 81.40276%; top: 58.97129%; width: 8.18278%; height: 4.60526%; right: auto; bottom: auto; margin: 0; transform: none; }
.main-menu-screen .lobby-menu-online { position: absolute; left: 4.78215%; top: 67.76316%; width: 90.43571%; height: 10.40670%; right: auto; bottom: auto; margin: 0; transform: none; }
.online-title { position: absolute; left: 28.16153%; top: 69.19856%; width: 43.67694%; height: 5.26316%; right: auto; bottom: auto; margin: 0; transform: none; }
.online-subtitle { position: absolute; left: 35.60043%; top: 74.46172%; width: 28.79915%; height: 2.69139%; right: auto; bottom: auto; margin: 0; transform: none; }
.online-arrow { position: absolute; left: 81.40276%; top: 70.63397%; width: 8.18278%; height: 4.60526%; right: auto; bottom: auto; margin: 0; transform: none; }
.main-menu-screen .lobby-menu-rules { position: absolute; left: 4.99469%; top: 79.54545%; width: 90.01063%; height: 9.15072%; right: auto; bottom: auto; margin: 0; transform: none; }
.rules-book { position: absolute; left: 12.32731%; top: 81.81818%; width: 11.90223%; height: 4.54545%; right: auto; bottom: auto; margin: 0; transform: none; }
.rules-title { position: absolute; left: 29.54304%; top: 82.05742%; width: 42.93305%; height: 3.82775%; right: auto; bottom: auto; margin: 0; transform: none; }
.rules-arrow { position: absolute; left: 82.14665%; top: 81.81818%; width: 7.43889%; height: 4.18660%; right: auto; bottom: auto; margin: 0; transform: none; }
.main-menu-screen .main-legal { position: absolute; left: 26.56748%; top: 93.54067%; width: 46.86504%; height: 4.06699%; right: auto; bottom: auto; margin: 0; transform: none; }
@media (max-width: 760px), (hover: none) and (pointer: coarse) { .lobby-artboard { width: min(100%, calc(100dvh * 941 / 1672)); } }

/* game-layout.generated.css */
/* Generated from assets/game-ui/game-layout.json. Do not edit by hand. */
.game-artboard { aspect-ratio: 941 / 1672; container-type: inline-size; }
.game-header-panel { position: absolute; left: 0.00000%; top: 0.00000%; width: 100.00000%; height: 9.03110%; right: auto; bottom: auto; margin: 0; }
.game-home-button { position: absolute; left: 2.33794%; top: 4.90431%; width: 6.16366%; height: 3.22967%; right: auto; bottom: auto; margin: 0; font-size: 3.18810cqw; }
.game-brand-art { position: absolute; left: 9.24548%; top: 1.55502%; width: 29.96812%; height: 1.43541%; right: auto; bottom: auto; margin: 0; }
.game-title-art { position: absolute; left: 8.71413%; top: 3.40909%; width: 30.28693%; height: 4.18660%; right: auto; bottom: auto; margin: 0; }
.game-artboard .wallet { position: absolute; left: 72.15728%; top: 1.85407%; width: 20.51010%; height: 3.16986%; right: auto; bottom: auto; margin: 0; font-size: 3.93199cqw; }
.game-security-art { position: absolute; left: 80.23379%; top: 5.26316%; width: 13.07120%; height: 1.73445%; right: auto; bottom: auto; margin: 0; }
.game-opponent-panel { position: absolute; left: 1.91286%; top: 9.03110%; width: 96.17428%; height: 17.64354%; right: auto; bottom: auto; margin: 0; }
.game-artboard .avatar { position: absolute; left: 5.95112%; top: 10.40670%; width: 14.02763%; height: 7.17703%; right: auto; bottom: auto; margin: 0; font-size: 5.84485cqw; }
.game-artboard .opponent-name-button { position: absolute; left: 21.04145%; top: 10.82536%; width: 22.31668%; height: 2.51196%; right: auto; bottom: auto; margin: 0; font-size: 3.50691cqw; }
.game-settings-button { position: absolute; left: 64.18704%; top: 4.90431%; width: 14.98406%; height: 2.87081%; right: auto; bottom: auto; margin: 0; }
.game-artboard .opponent-copy > p { position: absolute; left: 21.04145%; top: 13.69617%; width: 35.60043%; height: 1.91388%; right: auto; bottom: auto; margin: 0; font-size: 2.55048cqw; }
.game-artboard #opponentScore { position: absolute; left: 79.06482%; top: 10.94498%; width: 15.72795%; height: 2.57177%; right: auto; bottom: auto; margin: 0; font-size: 3.18810cqw; }
.game-artboard .opponent-strip { position: absolute; left: 19.23486%; top: 16.86603%; width: 40.91392%; height: 7.89474%; right: auto; bottom: auto; margin: 0; }
.game-artboard .opponent-hand { position: absolute; left: 62.06164%; top: 16.86603%; width: 31.03082%; height: 7.89474%; right: auto; bottom: auto; margin: 0; }
.game-field-panel { position: absolute; left: 0.42508%; top: 26.97368%; width: 99.14984%; height: 40.72967%; right: auto; bottom: auto; margin: 0; }
.game-field-label { position: absolute; left: 2.76302%; top: 27.99043%; width: 19.02232%; height: 3.16986%; right: auto; bottom: auto; margin: 0; }
.game-artboard .zone-title { position: absolute; left: 79.59617%; top: 28.05024%; width: 17.64081%; height: 3.05024%; right: auto; bottom: auto; margin: 0; font-size: 2.65675cqw; }
.game-artboard .field { position: absolute; left: 13.60255%; top: 32.29665%; width: 71.94474%; height: 25.71770%; right: auto; bottom: auto; margin: 0; }
.game-artboard .deck { position: absolute; left: 86.82253%; top: 57.05742%; width: 8.28905%; height: 7.71531%; right: auto; bottom: auto; margin: 0; font-size: 2.55048cqw; }
.game-player-panel { position: absolute; left: 1.91286%; top: 67.82297%; width: 96.17428%; height: 15.13158%; right: auto; bottom: auto; margin: 0; }
.game-player-label { position: absolute; left: 5.63231%; top: 68.89952%; width: 8.60786%; height: 3.70813%; right: auto; bottom: auto; margin: 0; }
.game-artboard #playerScore { position: absolute; left: 16.25930%; top: 69.43780%; width: 21.78533%; height: 2.51196%; right: auto; bottom: auto; margin: 0; font-size: 3.18810cqw; }
.game-captured-label { position: absolute; left: 84.27205%; top: 68.95933%; width: 10.73326%; height: 3.40909%; right: auto; bottom: auto; margin: 0; }
.game-artboard .player-strip { position: absolute; left: 9.98937%; top: 72.96651%; width: 79.91498%; height: 8.31340%; right: auto; bottom: auto; margin: 0; }
.game-hand-panel { position: absolute; left: 0.00000%; top: 83.19378%; width: 100.00000%; height: 10.40670%; right: auto; bottom: auto; margin: 0; }
.game-artboard .hand { position: absolute; left: 7.65143%; top: 83.97129%; width: 84.69713%; height: 8.67225%; right: auto; bottom: auto; margin: 0; }
.game-footer-ornament { position: absolute; left: 41.33900%; top: 94.01914%; width: 17.32200%; height: 4.60526%; right: auto; bottom: auto; margin: 0; }
@media (max-width: 760px), (hover: none) and (pointer: coarse) { .game-artboard { width: min(100%, calc(100dvh * 941 / 1672)); } }

/* game-responsive.css */
/* 2.2.2 · 상품용 세로 전체화면 플레이 모듈
   장식 테두리는 9분할하고 중앙 면은 반복 타일을 사용한다.
   카드, 고정 장식, 동적 UI는 서로 겹치지 않는 전용 안전영역을 갖는다. */

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  scrollbar-width: none;
}

body::-webkit-scrollbar { display: none; }

.preview-shell {
  min-width: 0;
  min-height: 0;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  overflow: hidden;
}

.game-artboard:not(.debug-layout) {
  inset: 0;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  transform: none;
  display: grid;
  grid-template-rows: 10fr 20fr minmax(0, 39.5fr) 17fr 13.5fr;
  container-type: inline-size;
  isolation: isolate;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background-color: #280b05;
  background-image:
    linear-gradient(rgba(18, 6, 3, .24), rgba(18, 6, 3, .24)),
    url("assets/game-ui/wood_tile_premium.png");
  background-position: center;
  background-size: auto, clamp(240px, 70cqw, 360px);
  background-repeat: repeat;
}

.game-artboard:not(.debug-layout).hidden { display: none; }

.game-artboard:not(.debug-layout) > .app-bar,
.game-artboard:not(.debug-layout) > .opponent,
.game-artboard:not(.debug-layout) > .table-zone,
.game-artboard:not(.debug-layout) > .player,
.game-artboard:not(.debug-layout) > .hand {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border-style: solid;
  box-shadow: inset 0 0 1.8cqw rgba(0, 0, 0, .55);
  contain: layout paint style;
}

.game-artboard:not(.debug-layout) > .app-bar,
.game-artboard:not(.debug-layout) > .opponent,
.game-artboard:not(.debug-layout) > .player,
.game-artboard:not(.debug-layout) > .hand {
  background-color: #4a1309;
  background-image:
    linear-gradient(rgba(35, 7, 3, .22), rgba(35, 7, 3, .22)),
    url("assets/game-ui/wood_tile_premium.png");
  background-position: center;
  background-size: auto, clamp(230px, 66cqw, 340px);
  background-repeat: repeat;
}

.game-artboard:not(.debug-layout) > .app-bar {
  grid-row: 1;
  border-width: clamp(5px, 1.45cqw, 8px) clamp(16px, 4.8cqw, 24px);
  border-image: url("assets/game-ui/game_header_panel.png") 35 120 32 120 / 1 / 0 round;
}

.game-artboard:not(.debug-layout) > .opponent {
  grid-row: 2;
  border-width: clamp(7px, 2cqw, 11px) clamp(9px, 2.8cqw, 15px);
  border-image: url("assets/game-ui/game_opponent_panel.png") 42 58 45 58 / 1 / 0 round;
}

.game-artboard:not(.debug-layout) > .table-zone {
  grid-row: 3;
  background-color: #03442e;
  background-image:
    radial-gradient(circle at 50% 42%, rgba(26, 116, 79, .18), transparent 58%),
    linear-gradient(rgba(0, 35, 23, .16), rgba(0, 35, 23, .16)),
    url("assets/game-ui/felt_tile_premium.png");
  background-position: center;
  background-size: auto, auto, clamp(260px, 78cqw, 420px);
  background-repeat: no-repeat, no-repeat, repeat;
  border-width: clamp(9px, 2.9cqw, 16px) clamp(8px, 2.5cqw, 14px);
  border-image: url("assets/game-ui/game_field_panel.png") 112 155 108 155 / 1 / 0 round;
}

.game-artboard:not(.debug-layout) > .player {
  grid-row: 4;
  border-width: clamp(7px, 2cqw, 11px) clamp(9px, 2.8cqw, 15px);
  border-image: url("assets/game-ui/game_player_panel.png") 38 68 40 68 / 1 / 0 round;
}

.game-artboard:not(.debug-layout) > .hand {
  grid-row: 5;
  border-width: clamp(7px, 2cqw, 11px) clamp(10px, 3cqw, 16px);
  border-image: url("assets/game-ui/game_hand_panel.png") 38 74 42 74 / 1 / 0 round;
}

/* 전체 패널 이미지는 편집 기준 모드에서만 표시한다. 실게임은 위 9분할 테두리를 사용한다. */
.game-artboard:not(.debug-layout) > .app-bar > .game-header-panel,
.game-artboard:not(.debug-layout) > .opponent > .game-opponent-panel,
.game-artboard:not(.debug-layout) > .table-zone > .game-field-panel,
.game-artboard:not(.debug-layout) > .player > .game-player-panel,
.game-artboard:not(.debug-layout) > .game-hand-panel { display: none; }

.game-artboard:not(.debug-layout) .game-ui-art { object-fit: contain; }

/* 상단 모듈 */
.game-artboard:not(.debug-layout) .game-home-button {
  position: absolute;
  left: 3.2%;
  top: 24%;
  width: min(9.8cqw, 44px);
  height: min(9.8cqw, 44px);
  font-size: min(6.2cqw, 28px);
}
.game-artboard:not(.debug-layout) .game-brand-art {
  position: absolute;
  left: 15.4%;
  top: 10%;
  width: 40.5%;
  height: 19%;
}
.game-artboard:not(.debug-layout) .game-title-floral-art {
  position: absolute;
  z-index: 2;
  left: 10%;
  top: 1%;
  width: 56%;
  height: 96%;
  object-fit: contain;
}
.game-artboard:not(.debug-layout) .game-title-art {
  z-index: 3;
  position: absolute;
  left: 15.2%;
  top: 33%;
  width: 42.5%;
  height: 49%;
}
.game-artboard:not(.debug-layout) .game-settings-button {
  left: auto;
  right: 28.8%;
  top: 54%;
  width: 15%;
  height: 29%;
}
.game-artboard:not(.debug-layout) .wallet {
  position: absolute;
  left: auto;
  right: 6.2%;
  top: 16%;
  width: 25%;
  height: 31%;
  font-size: clamp(15px, 4.35cqw, 20px);
  white-space: nowrap;
}
.game-artboard:not(.debug-layout) .game-security-art {
  position: absolute;
  left: auto;
  right: 6.4%;
  top: 57%;
  width: 21.5%;
  height: 22%;
}

/* 상대 모듈 */
.game-artboard:not(.debug-layout) .opponent-copy,
.game-artboard:not(.debug-layout) .name-row,
.game-artboard:not(.debug-layout) .player-head,
.game-artboard:not(.debug-layout) .player-head > div {
  position: static;
  display: contents;
}
.game-artboard:not(.debug-layout) .avatar {
  position: absolute;
  left: 3.6%;
  top: 8%;
  width: 14.5%;
  height: 45%;
  font-size: clamp(24px, 7cqw, 33px);
}
.game-artboard:not(.debug-layout) .opponent-name-button {
  position: absolute;
  left: 19.8%;
  top: 7%;
  width: 26%;
  height: 28%;
  font-size: clamp(16px, 4.6cqw, 21px);
}
.game-artboard:not(.debug-layout) .game-opponent-settings {
  position: absolute;
  left: 43.8%;
  top: 10%;
  width: 11%;
  height: 20%;
}
.game-artboard:not(.debug-layout) #opponentScore {
  position: absolute;
  left: auto;
  right: 4.8%;
  top: 10%;
  width: 28%;
  height: 21%;
  font-size: clamp(14px, 4cqw, 19px);
}
.game-artboard:not(.debug-layout) .opponent-copy > p {
  position: absolute;
  left: 19.8%;
  top: 31%;
  width: 42%;
  height: 16%;
  font-size: clamp(11px, 3cqw, 14px);
}
.game-artboard:not(.debug-layout) .opponent-strip {
  position: absolute;
  left: 17.5%;
  top: 51%;
  width: 44%;
  height: 41%;
}
.game-artboard:not(.debug-layout) .opponent-hand {
  position: absolute;
  left: auto;
  right: 4.6%;
  top: 52%;
  width: 30.5%;
  height: 38%;
}
.game-artboard:not(.debug-layout) .mini-back {
  width: clamp(23px, 7.2cqw, 34px);
  height: clamp(34px, 10.8cqw, 51px);
}

/* 바닥 모듈 */
.game-artboard:not(.debug-layout) .game-field-label {
  position: absolute;
  left: 2.7%;
  top: 1.8%;
  width: 22%;
  height: 10.5%;
}
.game-artboard:not(.debug-layout) .zone-title {
  position: absolute;
  left: auto;
  right: 3.1%;
  top: 1.8%;
  width: 21.5%;
  height: 10.5%;
  border: 0;
  font-size: clamp(12px, 3.5cqw, 16px);
  background: url("assets/game-ui/label_plaque_right.png") center / contain no-repeat;
}
.game-artboard:not(.debug-layout) .zone-title > span,
.game-artboard:not(.debug-layout) .zone-title span:last-child {
  position: absolute;
  left: 34%;
  right: 6%;
  max-width: none;
  padding: 0;
  overflow: hidden;
  border-radius: 0;
  color: #fff8dc;
  background: transparent;
  text-align: center;
  text-overflow: ellipsis;
  text-shadow: 0 .2cqw .25cqw rgba(0, 0, 0, .88);
  white-space: nowrap;
}
.game-artboard:not(.debug-layout) .field {
  position: absolute;
  left: 9.2%;
  top: 15.5%;
  width: 75.5%;
  height: 78%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: max-content;
  place-content: center;
  gap: min(1.55cqw, 7px) min(1.85cqw, 9px);
  overflow: hidden;
}
.game-artboard:not(.debug-layout) .field.medium {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: min(1.3cqw, 6px);
}
.game-artboard:not(.debug-layout) .field.dense {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: min(1.05cqw, 5px);
}
.game-artboard:not(.debug-layout) .field.crowded {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: min(.82cqw, 4px);
}
.game-artboard:not(.debug-layout) .field .game-card {
  justify-self: center;
}
.game-artboard:not(.debug-layout) .deck {
  position: absolute;
  left: auto;
  right: 2.9%;
  top: auto;
  bottom: 8%;
  width: 9.8%;
  height: 21%;
  font-size: clamp(11px, 3.1cqw, 15px);
}
.game-artboard:not(.debug-layout) #deckBadge { display: none; }

/* 획득패 종류 라벨은 카드 위가 아니라 슬롯 하단의 전용 레일에 둔다. */
.game-artboard:not(.debug-layout) .capture-pile {
  padding-bottom: clamp(13px, 3.6cqw, 17px);
  border: 1px solid rgba(231, 188, 84, .72);
  background-color: rgba(36, 12, 7, .62);
  background-image:
    linear-gradient(rgba(18, 6, 3, .2), rgba(18, 6, 3, .2)),
    url("assets/game-ui/wood_tile_premium.png");
  background-position: center;
  background-size: auto, 180px;
  background-repeat: repeat;
}
.game-artboard:not(.debug-layout) .capture-pile.kind-bright,
.game-artboard:not(.debug-layout) .capture-pile.kind-animal {
  background-image:
    linear-gradient(rgba(0, 35, 23, .25), rgba(0, 35, 23, .25)),
    url("assets/game-ui/felt_tile_premium.png");
}
.game-artboard:not(.debug-layout) .capture-pile::after {
  right: 0;
  bottom: 0;
  left: 0;
  height: clamp(13px, 3.6cqw, 17px);
  padding: 0;
  display: grid;
  place-items: center;
  border-top: 1px solid rgba(231, 188, 84, .45);
  border-radius: 0;
  color: #fff4c9;
  background: rgba(19, 7, 4, .88);
  font-size: clamp(8px, 2.3cqw, 11px);
  letter-spacing: .02em;
}
.game-artboard:not(.debug-layout) .capture-mini-card,
.game-artboard:not(.debug-layout) .player-strip .capture-mini-card {
  top: 2px;
  max-height: calc(100% - clamp(16px, 4.2cqw, 20px));
  object-fit: contain;
}

/* 내 획득패 모듈 */
.game-artboard:not(.debug-layout) .game-player-label {
  position: absolute;
  left: 3.4%;
  top: 7%;
  width: 14%;
  height: 29%;
}
.game-artboard:not(.debug-layout) .game-captured-label {
  position: absolute;
  left: auto;
  right: 3.4%;
  top: 7%;
  width: 15%;
  height: 29%;
}
.game-artboard:not(.debug-layout) #playerScore {
  position: absolute;
  left: 18.5%;
  top: 7%;
  width: 31%;
  height: 29%;
  font-size: clamp(14px, 4cqw, 19px);
}
.game-artboard:not(.debug-layout) .player-strip {
  position: absolute;
  left: 8.5%;
  top: 41%;
  width: 83%;
  height: 51%;
}

/* 손패 모듈 */
.game-artboard:not(.debug-layout) > .hand {
  left: auto;
  top: auto;
  padding: 1.5% 4.5% 0;
  overflow: hidden;
}
.game-artboard:not(.debug-layout) .hand .game-card {
  top: 4%;
  max-height: 91%;
  z-index: 3;
}
.game-artboard:not(.debug-layout) .hand .game-card:nth-child(even) { top: 7%; }
.game-artboard:not(.debug-layout) .hand .game-card.pending-hand-card {
  z-index: 20;
  transform: translateY(-1.2cqw) scale(1.06);
}
.game-artboard:not(.debug-layout) .game-card,
.game-artboard:not(.debug-layout) .card-art,
.game-artboard:not(.debug-layout) .capture-mini-card {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.game-artboard:not(.debug-layout) button.game-card {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.game-artboard:not(.debug-layout) button.game-card:active {
  filter: brightness(1.12) drop-shadow(0 .7cqw .55cqw rgba(0, 0, 0, .4));
}
.game-artboard:not(.debug-layout) > .game-footer-ornament {
  display: none;
}

/* 일시적 안내 UI도 카드 테이블과 시각적으로 분리된 목재 카드로 표시한다. */
.game-artboard:not(.debug-layout) ~ .event-callout .event-callout-card,
.event-callout-card {
  border-color: #e4b955;
  border-radius: 16px;
  background:
    linear-gradient(rgba(34, 7, 3, .22), rgba(34, 7, 3, .22)),
    url("assets/game-ui/wood_tile_premium.png") center / 260px repeat;
  box-shadow: 0 10px 0 #1e0905, inset 0 0 0 2px rgba(255, 235, 174, .22);
}

/* 낮은 화면에서는 읽기 영역을 유지하고 바닥 영역이 우선 압축된다. */
@media (max-height: 720px) {
  .game-artboard:not(.debug-layout) {
    grid-template-rows: 9.5fr 20fr minmax(0, 39fr) 17fr 14.5fr;
  }
  .game-artboard:not(.debug-layout) .opponent-strip { top: 50%; height: 42%; }
  .game-artboard:not(.debug-layout) .opponent-hand { top: 51%; height: 39%; }
  .game-artboard:not(.debug-layout) .field { top: 15%; height: 79%; }
}

/* 넓고 긴 최신 기기에서는 콘텐츠 폭만 제한해 카드가 과도하게 커지지 않도록 한다. */
@media (min-width: 480px) {
  .game-artboard:not(.debug-layout) .field { left: 12%; width: 72%; }
  .game-artboard:not(.debug-layout) .opponent-strip { left: 20%; width: 39%; }
  .game-artboard:not(.debug-layout) .player-strip { left: 11%; width: 78%; }
}

/* lobby-responsive.css */
/* 2.7.0 · 단일 상하 프레임 + 전체 화면 배경
   프레임은 안전영역까지 채우고 조작 콘텐츠만 안전영역 안에 둔다. */

.main-menu-screen {
  padding: 0 ;
}

.lobby-artboard:not(.debug-layout) {
  --lobby-split-top-height: 59.024cqw;
  --lobby-split-bottom-height: 22.701cqw;
  --lobby-split-rail-offset: 0cqw;
  --lobby-split-rail-width: 5.675cqw;
  --lobby-split-felt-inset: 0cqw;
  width: 100% ;
  height: 100% ;
  max-width: none;
  max-height: none;
  aspect-ratio: auto ;
  container-type: size;
  background-color: #064733;
  background-image: url("assets/lobby/responsive/surface_felt_tile.png");
  background-position: center;
  background-size: 100% auto;
  background-repeat: repeat-y;
}

.lobby-artboard:not(.debug-layout) > img { object-fit: contain ; }

.lobby-artboard:not(.debug-layout) .lobby-frame-art,
.lobby-artboard:not(.debug-layout) .main-profile-frame { display: none ; }

.lobby-modular-frame {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

/* 881px 너비의 원본에서 상단 520px, 하단 200px은 한 장 그대로 쓴다.
   사이의 가변 높이는 모포(380×380)와 레일(50×260) 반복만으로 채운다. */
.lobby-split-cap,
.lobby-split-middle,
.lobby-split-felt,
.lobby-split-rail {
  position: absolute;
  display: block;
  pointer-events: none;
}

.lobby-split-cap {
  z-index: 2;
  left: 0;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 .45cqw .35cqw rgba(13, 2, 0, .42));
}

.lobby-split-cap-top { top: 0; }
.lobby-split-cap-bottom { bottom: 0; }

.lobby-split-middle {
  z-index: 1;
  top: calc(var(--lobby-split-top-height) - 2px);
  right: 0;
  bottom: calc(var(--lobby-split-bottom-height) - 2px);
  left: 0;
  overflow: hidden;
}

.lobby-split-felt {
  z-index: 0;
  inset: 0 var(--lobby-split-felt-inset);
  background-color: #064733;
  background-image: url("assets/lobby/responsive/surface_felt_tile.png");
  background-position: center top;
  background-size: 43.133cqw auto;
  background-repeat: repeat;
}

.lobby-split-rail {
  z-index: 1;
  top: 0;
  bottom: 0;
  width: var(--lobby-split-rail-width);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  filter: drop-shadow(0 0 .22cqw rgba(12, 2, 0, .5));
}

.lobby-split-rail-left { left: var(--lobby-split-rail-offset); }
.lobby-split-rail-right { right: var(--lobby-split-rail-offset); }

.lobby-split-rail-segment {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  margin-top: calc(-1 * var(--lobby-rail-overlap, 18px));
  object-fit: contain;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0,
    rgba(0, 0, 0, .2) calc(var(--lobby-rail-fade, 17px) * .24),
    rgba(0, 0, 0, .72) calc(var(--lobby-rail-fade, 17px) * .68),
    #000 var(--lobby-rail-fade, 17px),
    #000 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0,
    rgba(0, 0, 0, .2) calc(var(--lobby-rail-fade, 17px) * .24),
    rgba(0, 0, 0, .72) calc(var(--lobby-rail-fade, 17px) * .68),
    #000 var(--lobby-rail-fade, 17px),
    #000 100%
  );
}

.lobby-split-rail-segment:first-child {
  margin-top: 0;
  -webkit-mask-image: none;
  mask-image: none;
}

.lobby-surface,
.lobby-frame-fixed {
  position: absolute;
  display: block;
  pointer-events: none;
}

.lobby-surface {
  z-index: 0;
  left: 0;
  right: 0;
  background-color: #531307;
  background-image: url("assets/lobby/responsive/surface_wood_tile.png");
  background-position: center;
  background-size: 100% auto;
  background-repeat: repeat-y;
}
.lobby-surface-title { top: 0; height: min(30.7%, 59.024cqw); }
.lobby-surface-footer { bottom: 0; height: min(10.8%, 22.701cqw); }

/* 새 메인 프레임: 상·하 캡은 고정 비율, 좌·우는 고정 비율 조각을 중첩한다. */
.lobby-overlap-frame-cap,
.lobby-overlap-frame-corner {
  position: absolute;
  z-index: 3;
  display: block;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 .45cqw .35cqw rgba(13, 2, 0, .56));
}

.lobby-overlap-frame-cap {
  left: calc(var(--lobby-frame-corner-size) * .54);
  width: calc(100% - var(--lobby-frame-corner-size) * 1.08);
}

.lobby-overlap-frame-cap-top { top: 0; }
.lobby-overlap-frame-cap-bottom { bottom: 0; }
.lobby-overlap-frame-corner { width: var(--lobby-frame-corner-size); }
.lobby-overlap-frame-corner-tl { top: 0; left: 0; }
.lobby-overlap-frame-corner-tr { top: 0; right: 0; }
.lobby-overlap-frame-corner-bl { bottom: 0; left: 0; }
.lobby-overlap-frame-corner-br { right: 0; bottom: 0; }

.lobby-overlap-frame-side {
  position: absolute;
  z-index: 2;
  top: calc(var(--lobby-frame-cap-depth) - 7px);
  bottom: calc(var(--lobby-frame-cap-depth) - 7px);
  width: var(--lobby-frame-side-width);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: none;
}

.lobby-overlap-frame-side-left { left: 0; }
.lobby-overlap-frame-side-right { right: 0; }

.lobby-overlap-frame-side-segment {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  margin-top: calc(-1 * var(--lobby-frame-segment-overlap, 26px));
  object-fit: contain;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--lobby-frame-segment-fade, 24px), #000 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 var(--lobby-frame-segment-fade, 24px), #000 100%);
}

.lobby-overlap-frame-side-segment:first-child {
  margin-top: 0;
  -webkit-mask-image: none;
  mask-image: none;
}

.lobby-overlap-frame-side-right .lobby-overlap-frame-side-segment { transform: scaleX(-1); }

.lobby-frame-fixed {
  z-index: 3;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}
.corner-tl, .corner-tr, .corner-bl, .corner-br {
  width: clamp(44px, 14cqw, 82px);
  height: clamp(44px, 14cqw, 82px);
}
.corner-tl { top: 0; left: 0; background-image: url("assets/lobby/responsive/frame_corner_tl.png"); }
.corner-tr { top: 0; right: 0; background-image: url("assets/lobby/responsive/frame_corner_tr.png"); }
.corner-bl { bottom: 0; left: 0; background-image: url("assets/lobby/responsive/frame_corner_bl.png"); }
.corner-br { right: 0; bottom: 0; background-image: url("assets/lobby/responsive/frame_corner_br.png"); }
.crest-top {
  top: 0;
  left: 38%;
  width: 24%;
  height: clamp(45px, 14cqw, 82px);
  background-image: url("assets/lobby/responsive/frame_crest_top.png");
}
.crest-bottom {
  left: 38%;
  bottom: 0;
  width: 24%;
  height: clamp(52px, 17cqw, 100px);
  background-image: url("assets/lobby/responsive/frame_crest_bottom.png");
}
.hinge-left, .hinge-right {
  top: 22.6%;
  width: clamp(48px, 16cqw, 94px);
  height: clamp(64px, 22cqw, 128px);
}
.hinge-left { left: 0; background-image: url("assets/lobby/responsive/frame_hinge_left.png"); }
.hinge-right { right: 0; background-image: url("assets/lobby/responsive/frame_hinge_right.png"); }

.lobby-stats-frame {
  position: absolute;
  z-index: 4;
  left: 4.46334%;
  top: 43.54067%;
  width: 91.07333%;
  height: 11.24402%;
  border: 0;
  border-radius: clamp(8px, 2.6cqw, 16px);
  background-color: #591507;
  background-image: url("assets/lobby/responsive/surface_wood_tile.png");
  background-position: center;
  background-size: clamp(190px, 58cqw, 360px);
  background-repeat: repeat;
  pointer-events: none;
}
.lobby-stats-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/lobby/stats_panel.png") center / contain no-repeat;
}

.lobby-artboard:not(.debug-layout) .lobby-menu-button {
  min-height: 48px;
  border: 0;
  border-radius: clamp(8px, 2.6cqw, 16px);
  background-position: center;
  background-size: clamp(180px, 56cqw, 340px);
  background-repeat: repeat;
}
.lobby-artboard:not(.debug-layout) .lobby-menu-solo {
  background-color: #064723;
  background-image: url("assets/lobby/responsive/surface_felt_tile.png");
}
.lobby-artboard:not(.debug-layout) .lobby-menu-online {
  background-color: #64120d;
  background-image: linear-gradient(rgba(103, 0, 0, .52), rgba(103, 0, 0, .52)), url("assets/lobby/responsive/surface_wood_tile.png");
}
.lobby-artboard:not(.debug-layout) .lobby-menu-rules {
  background-color: #4a1c0c;
  background-image: linear-gradient(rgba(43, 18, 4, .48), rgba(43, 18, 4, .48)), url("assets/lobby/responsive/surface_wood_tile.png");
}

.lobby-artboard:not(.debug-layout) .lobby-menu-board {
  display: block ;
  object-fit: contain ;
}

/* 기준 이미지 조정 모드에서는 941×1672 원본 좌표를 그대로 사용한다. */
.lobby-artboard.debug-layout {
  width: min(100%, calc(100dvh * 941 / 1672));
  height: auto;
  aspect-ratio: 941 / 1672 ;
}
.lobby-artboard.debug-layout .lobby-modular-frame,
.lobby-artboard.debug-layout .lobby-stats-frame { display: none; }
.lobby-artboard.debug-layout .lobby-frame-art,
.lobby-artboard.debug-layout .main-profile-frame,
.lobby-artboard.debug-layout .lobby-menu-board { display: block; }

@media (max-height: 620px) and (orientation: portrait) {
  .lobby-frame-fixed.hinge-left,
  .lobby-frame-fixed.hinge-right { top: 21.7%; }
  .lobby-artboard:not(.debug-layout) .lobby-menu-button { border-radius: 8px; }
}

/* ui-overhaul.css */
/* 3.0.0 · 로비와 플레이 화면을 하나의 상품용 UI 시스템으로 정리하는 최종 레이어.
   래스터 장식은 contain, 패널은 9분할, 가변 면은 반복 텍스처만 사용한다. */

:root {
  --ui-gold-1: #fff2bd;
  --ui-gold-2: #dba744;
  --ui-gold-3: #7b3c10;
  --ui-wood-deep: #230704;
  --ui-wood: #571407;
  --ui-felt: #03452f;
  --ui-ink: #fff9e8;
  --ui-shadow: rgba(17, 3, 1, .72);
}

.phone {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── 메인 로비 ───────────────────────────────────────────── */
.lobby-artboard:not(.debug-layout)::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 36%, transparent 31%, rgba(5, 19, 13, .14) 72%, rgba(15, 3, 1, .34) 100%),
    linear-gradient(90deg, rgba(255, 216, 118, .055), transparent 8% 92%, rgba(255, 216, 118, .055));
}

.lobby-artboard:not(.debug-layout)::after {
  content: "";
  position: absolute;
  z-index: 12;
  inset: 0;
  border: 1px solid rgba(255, 226, 145, .26);
  box-shadow: inset 0 0 clamp(16px, 5cqw, 28px) rgba(18, 3, 1, .5);
  pointer-events: none;
}

.lobby-artboard:not(.debug-layout) {
  --lobby-frame-side-width: clamp(18px, 5.1cqw, 25px);
  --lobby-frame-corner-size: clamp(34px, 9.3cqw, 46px);
}

.lobby-artboard:not(.debug-layout) .lobby-title-plaque,
.lobby-artboard:not(.debug-layout) .lobby-brand-line,
.lobby-artboard:not(.debug-layout) .lobby-main-title,
.lobby-artboard:not(.debug-layout) .lobby-main-subtitle,
.lobby-artboard:not(.debug-layout) .lobby-main-stamp {
  filter: drop-shadow(0 .65cqw .45cqw rgba(19, 3, 1, .62));
}

.lobby-artboard:not(.debug-layout) .lobby-main-title {
  filter:
    drop-shadow(0 .7cqw .35cqw rgba(20, 3, 1, .82))
    saturate(1.08)
    contrast(1.03);
}

.lobby-artboard:not(.debug-layout) .lobby-hero-card {
  filter:
    drop-shadow(0 1.4cqw 1.15cqw rgba(12, 3, 1, .64))
    saturate(1.06);
}

.lobby-artboard:not(.debug-layout) .lobby-stats-frame {
  border-radius: clamp(10px, 2.8cqw, 16px);
  box-shadow:
    0 1.25cqw 1.5cqw rgba(20, 3, 1, .42),
    inset 0 0 0 1px rgba(255, 224, 128, .18);
}

.lobby-artboard:not(.debug-layout) .main-stat-coins,
.lobby-artboard:not(.debug-layout) .main-stat-record {
  font-variant-numeric: tabular-nums;
  text-shadow:
    0 .45cqw 0 #3a1106,
    0 0 1.1cqw rgba(255, 204, 81, .22);
}

.lobby-artboard:not(.debug-layout) .lobby-menu-button {
  isolation: isolate;
  filter: drop-shadow(0 1.25cqw 1.1cqw rgba(22, 3, 1, .48));
  transition: transform .16s ease, filter .16s ease;
}

.lobby-artboard:not(.debug-layout) .lobby-menu-button::before {
  content: "";
  position: absolute;
  z-index: 7;
  inset: 9% 5.8% 13%;
  border-radius: clamp(8px, 2.5cqw, 14px);
  background: linear-gradient(180deg, rgba(255, 245, 192, .09), transparent 48%, rgba(12, 2, 1, .1));
  box-shadow: inset 0 1px rgba(255, 245, 192, .2);
  pointer-events: none;
}

.lobby-artboard:not(.debug-layout) .lobby-menu-board {
  object-fit: contain ;
  filter: saturate(1.05) contrast(1.02);
}

.lobby-artboard:not(.debug-layout) .lobby-menu-copy {
  filter: drop-shadow(0 .48cqw .25cqw rgba(20, 4, 1, .82));
}

.lobby-artboard:not(.debug-layout) .lobby-menu-decoration {
  filter: drop-shadow(0 .55cqw .5cqw rgba(18, 3, 1, .66));
}

.lobby-artboard:not(.debug-layout) .lobby-menu-button:hover,
.lobby-artboard:not(.debug-layout) .lobby-menu-button:focus-visible {
  transform: translateY(-.55cqw) scale(1.008);
  filter: brightness(1.08) drop-shadow(0 1.5cqw 1.3cqw rgba(22, 3, 1, .55));
}

.lobby-artboard:not(.debug-layout) .lobby-menu-button:active {
  transform: translateY(.35cqw) scale(.995);
  filter: brightness(.98) drop-shadow(0 .55cqw .6cqw rgba(22, 3, 1, .42));
}

/* ── 플레이 화면: 정보 밀도, 턴 가시성, 터치 피드백 ───────── */
.game-artboard:not(.debug-layout) {
  grid-template-rows: 9.2fr 18.8fr minmax(0, 42.2fr) 16.4fr 13.4fr;
  background-image:
    linear-gradient(rgba(20, 5, 2, .18), rgba(20, 5, 2, .26)),
    url("assets/game-ui/wood_tile_premium.png");
}

.game-artboard:not(.debug-layout) > .app-bar,
.game-artboard:not(.debug-layout) > .opponent,
.game-artboard:not(.debug-layout) > .table-zone,
.game-artboard:not(.debug-layout) > .player,
.game-artboard:not(.debug-layout) > .hand {
  box-shadow:
    inset 0 0 1.8cqw rgba(0, 0, 0, .5),
    0 .45cqw .7cqw rgba(20, 3, 1, .32);
}

.game-artboard:not(.debug-layout) > .app-bar {
  border-width: clamp(5px, 1.35cqw, 7px) clamp(14px, 4.2cqw, 22px);
}

.game-artboard:not(.debug-layout) > .opponent,
.game-artboard:not(.debug-layout) > .player {
  border-width: clamp(7px, 1.8cqw, 10px) clamp(8px, 2.5cqw, 13px);
}

.game-artboard:not(.debug-layout) > .table-zone {
  border-width: clamp(8px, 2.5cqw, 14px) clamp(7px, 2.2cqw, 12px);
  background-image:
    radial-gradient(ellipse at 50% 48%, rgba(58, 155, 101, .2), transparent 60%),
    linear-gradient(rgba(0, 35, 23, .12), rgba(0, 25, 17, .2)),
    url("assets/game-ui/felt_tile_premium.png");
}

.game-artboard:not(.debug-layout) > .hand {
  border-width: clamp(7px, 1.9cqw, 10px) clamp(9px, 2.7cqw, 14px);
  background-image:
    linear-gradient(180deg, rgba(20, 4, 2, .08), rgba(13, 2, 1, .4)),
    url("assets/game-ui/wood_tile_premium.png");
}

.game-artboard:not(.debug-layout) .game-home-button {
  left: 3.4%;
  top: 21%;
  border-color: rgba(255, 224, 128, .9);
  background: linear-gradient(145deg, #8b431a, #391006 72%);
  box-shadow:
    inset 0 0 0 2px rgba(28, 6, 2, .58),
    0 .55cqw .8cqw rgba(15, 2, 1, .58);
}

.game-artboard:not(.debug-layout) .game-brand-art { left: 16%; top: 9%; width: 38%; height: 18%; }
.game-artboard:not(.debug-layout) .game-title-floral-art { left: 10%; top: 0; width: 55%; height: 98%; opacity: .86; }
.game-artboard:not(.debug-layout) .game-title-art { left: 15%; top: 33%; width: 43%; height: 47%; }

.game-artboard:not(.debug-layout) .wallet {
  right: 4.8%;
  top: 13%;
  width: 25.5%;
  height: 36%;
  border: 1px solid rgba(227, 176, 72, .44);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(20, 7, 4, .78), rgba(59, 16, 7, .52));
  box-shadow: inset 0 1px rgba(255, 235, 167, .1), 0 .45cqw .65cqw rgba(17, 3, 1, .4);
}

.game-artboard:not(.debug-layout) .wallet strong {
  color: var(--ui-gold-1);
  font-variant-numeric: tabular-nums;
}

.game-artboard:not(.debug-layout) .game-security-art { right: 6%; top: 58%; width: 21%; height: 20%; }

.game-artboard:not(.debug-layout) .avatar { left: 4%; top: 7%; width: 14%; height: 46%; }
.game-artboard:not(.debug-layout) .opponent-name-button { left: 19.5%; top: 6%; width: 25%; height: 29%; }
.game-artboard:not(.debug-layout) .game-opponent-settings { left: 43%; top: 9%; width: 10.5%; height: 21%; }
.game-artboard:not(.debug-layout) #opponentScore {
  right: 4.5%;
  top: 8%;
  width: 29%;
  height: 24%;
  padding-right: 1%;
  font-variant-numeric: tabular-nums;
}
.game-artboard:not(.debug-layout) .opponent-copy > p { left: 19.5%; top: 31%; width: 46%; height: 17%; }
.game-artboard:not(.debug-layout) .opponent-strip { left: 17%; top: 51%; width: 45%; height: 41%; }
.game-artboard:not(.debug-layout) .opponent-hand { right: 4.2%; top: 51%; width: 31%; height: 39%; }

.game-artboard:not(.debug-layout) .game-field-label,
.game-artboard:not(.debug-layout) .zone-title {
  top: 2.1%;
  height: 9.8%;
  filter: drop-shadow(0 .45cqw .5cqw rgba(13, 2, 1, .45));
}

.game-artboard:not(.debug-layout) .game-field-label { left: 2.7%; width: 22%; }
.game-artboard:not(.debug-layout) .zone-title { right: 2.8%; width: 22%; }

.game-artboard:not(.debug-layout) .turn-status {
  position: absolute;
  z-index: 6;
  left: 32%;
  top: 2.25%;
  width: 36%;
  height: 9.4%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(5px, 1.5cqw, 8px);
  padding: 0 2.5%;
  border: 1px solid rgba(235, 188, 83, .6);
  border-radius: 999px;
  color: #fff6d5;
  background: linear-gradient(180deg, rgba(52, 19, 8, .92), rgba(22, 8, 4, .9));
  box-shadow: inset 0 1px rgba(255, 235, 170, .12), 0 .45cqw .65cqw rgba(12, 2, 1, .35);
  font-size: clamp(10px, 2.75cqw, 13px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.02em;
  white-space: nowrap;
  pointer-events: none;
}

.game-artboard:not(.debug-layout) .turn-status i {
  flex: 0 0 auto;
  width: clamp(6px, 1.65cqw, 8px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #63e0a2;
  box-shadow: 0 0 .9cqw rgba(80, 237, 159, .8);
}

.game-artboard:not(.debug-layout) .turn-status[data-tone="choice"] {
  border-color: #ffd66d;
  color: #fff8d7;
  background: linear-gradient(180deg, rgba(112, 58, 8, .95), rgba(49, 22, 3, .94));
}
.game-artboard:not(.debug-layout) .turn-status[data-tone="choice"] i { background: #ffd45f; box-shadow: 0 0 1cqw rgba(255, 196, 59, .9); }
.game-artboard:not(.debug-layout) .turn-status[data-tone="opponent"] i,
.game-artboard:not(.debug-layout) .turn-status[data-tone="busy"] i { background: #e9855d; box-shadow: 0 0 .9cqw rgba(233, 106, 78, .75); }
.game-artboard:not(.debug-layout) .turn-status[data-tone="finished"] i { background: #cdb474; box-shadow: none; }

.game-artboard:not(.debug-layout) .field {
  left: 8%;
  top: 14.3%;
  width: 77%;
  height: 80.5%;
  gap: min(1.35cqw, 6px) min(1.65cqw, 8px);
}

.game-artboard:not(.debug-layout) .field.medium { gap: min(1.15cqw, 5px); }
.game-artboard:not(.debug-layout) .field.dense { gap: min(.95cqw, 4px); }
.game-artboard:not(.debug-layout) .field.crowded { gap: min(.72cqw, 3px); }
.game-artboard:not(.debug-layout) .deck { right: 2.4%; bottom: 7%; width: 9.5%; height: 20%; }

.game-artboard:not(.debug-layout) .game-card {
  border-radius: clamp(5px, 1.35cqw, 7px);
  filter: drop-shadow(0 .55cqw .5cqw rgba(13, 3, 1, .42));
}

.game-artboard:not(.debug-layout) button.game-card {
  transition: transform .14s ease, filter .14s ease;
}

.game-artboard:not(.debug-layout) button.game-card:focus-visible {
  outline: clamp(2px, .65cqw, 3px) solid #ffe27c;
  outline-offset: clamp(1px, .35cqw, 2px);
  filter: brightness(1.08) drop-shadow(0 1cqw .8cqw rgba(18, 4, 1, .58));
}

.game-artboard:not(.debug-layout) .game-card.match-choice {
  outline: clamp(2px, .7cqw, 3px) solid #ffe075;
  outline-offset: clamp(1px, .35cqw, 2px);
  filter: brightness(1.08) drop-shadow(0 0 1.2cqw rgba(255, 205, 71, .58));
}

.game-artboard:not(.debug-layout) .capture-pile {
  border-color: rgba(239, 198, 101, .62);
  border-radius: clamp(5px, 1.25cqw, 7px);
  box-shadow: inset 0 0 1.1cqw rgba(0, 0, 0, .52), 0 .35cqw .45cqw rgba(17, 3, 1, .26);
}

.game-artboard:not(.debug-layout) .capture-pile::after {
  color: #fff2c4;
  background: linear-gradient(180deg, rgba(35, 12, 5, .84), rgba(14, 4, 2, .94));
  font-weight: 900;
}

.game-artboard:not(.debug-layout) .game-player-label { left: 3.5%; top: 7%; width: 14%; height: 30%; }
.game-artboard:not(.debug-layout) .game-captured-label { right: 3.5%; top: 7%; width: 15%; height: 30%; }
.game-artboard:not(.debug-layout) #playerScore {
  left: 18.3%;
  top: 7%;
  width: 32%;
  height: 30%;
  font-variant-numeric: tabular-nums;
}
.game-artboard:not(.debug-layout) .player-strip { left: 8%; top: 41%; width: 84%; height: 51%; }

.game-artboard:not(.debug-layout) > .hand {
  padding: 1.25% 4.5% 0;
  box-shadow:
    inset 0 1.2cqw 2cqw rgba(9, 1, 0, .34),
    inset 0 1px rgba(255, 222, 132, .12);
}

.game-artboard:not(.debug-layout) .hand .game-card {
  top: 3%;
  max-height: 92%;
  filter: drop-shadow(0 .7cqw .55cqw rgba(8, 1, 0, .55));
}

.game-artboard:not(.debug-layout) .hand .game-card:nth-child(even) { top: 5.5%; }
.game-artboard:not(.debug-layout) .hand .game-card.pending-hand-card {
  transform: translateY(-1.5cqw) scale(1.055);
  filter: brightness(1.08) drop-shadow(0 1cqw .75cqw rgba(8, 1, 0, .62));
}

/* 오버레이는 게임판과 같은 목재·금장 계열로 통일한다. */
.overlay {
  background: rgba(11, 5, 3, .78);
  backdrop-filter: blur(5px) saturate(.8);
}

.dialog {
  border: 2px solid #d9a94c;
  border-radius: 18px;
  background:
    linear-gradient(rgba(41, 13, 7, .93), rgba(18, 7, 4, .97)),
    url("assets/game-ui/wood_tile_premium.png") center / 240px repeat;
  box-shadow:
    0 12px 0 #1a0503,
    0 24px 56px rgba(0, 0, 0, .56),
    inset 0 0 0 2px rgba(255, 235, 173, .1);
}

.setup-option > span,
.rule-book-grid section {
  border-color: rgba(231, 188, 91, .35);
  background: rgba(18, 7, 4, .68);
}

.setup-option input:checked + span {
  border-color: #efc866;
  background: linear-gradient(180deg, rgba(108, 63, 22, .72), rgba(52, 24, 8, .76));
  box-shadow: inset 0 0 0 1px rgba(255, 237, 176, .16), 0 .5cqw 1cqw rgba(0, 0, 0, .22);
}

.primary {
  border-color: #efc55f;
  color: #fff8df;
  background: linear-gradient(180deg, #267451, #0b432e);
  box-shadow: 0 6px 0 #06291c, 0 12px 24px rgba(0, 0, 0, .34);
}

@media (max-height: 720px) {
  .game-artboard:not(.debug-layout) {
    grid-template-rows: 9fr 18.5fr minmax(0, 41fr) 16.5fr 15fr;
  }
  .game-artboard:not(.debug-layout) .turn-status { font-size: clamp(9px, 2.55cqw, 12px); }
  .game-artboard:not(.debug-layout) .field { top: 14%; height: 81%; }
}

@media (prefers-reduced-motion: reduce) {
  .lobby-menu-button,
  .game-card,
  .turn-status i { transition: none ; animation: none ; }
}

/* simple-ui.css */
/* 4.25.0 · 결과창 내부 패자→중앙 슬롯→승자 정산 연출 */

:root {
  --simple-bg: #0d1512;
  --simple-surface: #171c19;
  --simple-surface-2: #201b17;
  --simple-felt: #083b2d;
  --simple-line: rgba(242, 222, 169, .18);
  --simple-line-strong: rgba(242, 222, 169, .34);
  --simple-text: #fffaf0;
  --simple-muted: #c8c1af;
  --simple-accent: #e0bd6a;
  --simple-green: #176044;
  --simple-red: #78332d;
}

/* 게임 화면은 앱처럼 동작한다: 선택·길게 누르기·브라우저 제스처를 노출하지 않는다. */
html,
body { overscroll-behavior: none; }

/* 예전 안내 배지와 안전영역 보정용 가상 요소가 다시 나타나지 않도록
   시각 속성까지 완전히 초기화한다. */
.main-menu-screen::before,
.main-menu-screen::after {
  content: none ;
  display: none ;
  width: 0 ;
  height: 0 ;
  margin: 0 ;
  padding: 0 ;
  border: 0 ;
  background: none ;
  transform: none ;
}

.phone {
  touch-action: pan-y;
  -webkit-touch-callout: none;
}

.phone,
.phone * {
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.phone img {
  -webkit-user-drag: none;
  user-drag: none;
}

/* ── 메인: 3분할 프레임 위에 핵심 정보만 단순하게 배치한다. ─ */
.lobby-artboard:not(.debug-layout) {
  /* 장식 프레임은 확대하지 않고 화면 밖으로만 밀어 투명 절단면을 숨긴다. */
  --lobby-top-frame-overscan: clamp(14px, 3.6cqw, 22px);
  --lobby-bottom-frame-overscan: clamp(16px, 4.2cqw, 26px);
  --lobby-frame-seam-guard: clamp(10px, 3.2cqw, 18px);
  z-index: 1;
  background-color: #064733;
  background-image: url("assets/lobby/responsive/surface_felt_tile.png");
  background-position: center top;
  background-size: 100% auto;
  background-repeat: repeat-y;
}

/* 모포와 좌우 레일은 기기 화면 전체 높이를 채운다. */
.lobby-artboard:not(.debug-layout) .lobby-modular-frame { z-index: 0; }

/* PNG 외곽의 반투명 픽셀 뒤로 모포가 비치지 않도록 같은 목재 질감을 받친다.
   보호층은 화면 가장자리 안쪽에만 머물러 실제 놀이판 영역에는 영향을 주지 않는다. */
.lobby-artboard:not(.debug-layout) .lobby-modular-frame::before,
.lobby-artboard:not(.debug-layout) .lobby-modular-frame::after {
  content: "";
  position: absolute;
  z-index: 3;
  right: 0;
  left: 0;
  height: var(--lobby-frame-seam-guard);
  background-color: #4a1208;
  background-image: url("assets/lobby/responsive/surface_wood_tile.png");
  background-position: center;
  background-size: 100% auto;
  background-repeat: repeat-y;
  pointer-events: none;
}

.lobby-artboard:not(.debug-layout) .lobby-modular-frame::before { top: 0; }
.lobby-artboard:not(.debug-layout) .lobby-modular-frame::after { bottom: 0; }
.lobby-artboard:not(.debug-layout) .lobby-split-cap { display: none; }
.lobby-artboard:not(.debug-layout) .lobby-split-middle {
  top: 0;
  bottom: 0;
}
.lobby-artboard:not(.debug-layout) .lobby-split-felt { inset: 0 var(--lobby-split-felt-inset); }
.lobby-artboard:not(.debug-layout) .lobby-split-rail {
  top: 0;
  bottom: 0;
}

.lobby-artboard:not(.debug-layout) .lobby-foreground-frame {
  position: absolute;
  z-index: 2;
  left: 50%;
  display: block;
  width: 100cqw;
  max-width: none;
  height: auto;
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: none;
  transform: translateX(-50%);
}

.lobby-artboard:not(.debug-layout) .lobby-foreground-frame-top {
  top: calc(-1 * var(--lobby-top-frame-overscan));
  width: 100cqw;
}
.lobby-artboard:not(.debug-layout) .lobby-foreground-frame-bottom {
  bottom: calc(-1 * var(--lobby-bottom-frame-overscan));
  width: 100cqw;
}
.lobby-artboard.debug-layout .lobby-foreground-frame { display: none; }

.lobby-artboard:not(.debug-layout)::before {
  z-index: 1;
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 30%, rgba(0, 0, 0, .12));
}

.lobby-artboard:not(.debug-layout)::after {
  z-index: 1;
  border-color: rgba(255, 255, 255, .06);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, .28);
}

.lobby-artboard:not(.debug-layout) .lobby-floral-ornament,
.lobby-artboard:not(.debug-layout) .lobby-title-plaque,
.lobby-artboard:not(.debug-layout) .lobby-brand-line,
.lobby-artboard:not(.debug-layout) .lobby-main-stamp,
.lobby-artboard:not(.debug-layout) .main-profile-frame,
.lobby-artboard:not(.debug-layout) .fairness-copy,
.lobby-artboard:not(.debug-layout) .lobby-menu-copy,
.lobby-artboard:not(.debug-layout) .lobby-menu-decoration,
.lobby-artboard:not(.debug-layout) .main-legal {
  display: none ;
}

.lobby-artboard:not(.debug-layout) .lobby-main-title {
  z-index: 3;
  left: 16cqw;
  top: 12.438cqw;
  width: 68cqw;
  height: 17.77cqw;
  object-fit: contain;
  filter: drop-shadow(0 5px 5px rgba(0, 0, 0, .32));
}

.lobby-artboard:not(.debug-layout) .lobby-main-subtitle {
  z-index: 3;
  left: 24%;
  top: 17.4%;
  width: 52%;
  height: 3.5%;
  object-fit: contain;
  opacity: .88;
  filter: none;
}

.lobby-artboard:not(.debug-layout) .lobby-hero-card {
  display: block ;
  position: absolute;
  width: 12.9%;
  height: 9.72%;
  margin-top: 10px;
  object-fit: contain;
  transform-origin: 50% 92%;
  filter: drop-shadow(0 9px 8px rgba(0, 0, 0, .42));
}

.lobby-artboard:not(.debug-layout) .hero-crane {
  z-index: 3;
  left: 37%;
  top: 26.7%;
  transform: rotate(-13deg);
}

.lobby-artboard:not(.debug-layout) .hero-plum {
  z-index: 5;
  left: 43.55%;
  top: 25.8%;
  height: 10.2%;
  transform: none;
}

.lobby-artboard:not(.debug-layout) .hero-moon {
  z-index: 3;
  left: 50.1%;
  top: 26.7%;
  transform: rotate(13deg);
}

.lobby-artboard:not(.debug-layout) .lobby-stats-frame {
  z-index: 3;
  left: 8%;
  top: 41%;
  width: 84%;
  height: 10.5%;
  border: 1px solid var(--simple-line);
  border-radius: clamp(13px, 3.8cqw, 20px);
  background: rgba(15, 20, 17, .88);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .2);
}

.lobby-artboard:not(.debug-layout) .lobby-stats-frame::after { content: none; }

.lobby-artboard:not(.debug-layout) .main-stat-coins,
.lobby-artboard:not(.debug-layout) .main-stat-record {
  top: 42.25%;
  height: 4.25%;
  color: var(--simple-text);
  font-family: Pretendard, "Apple SD Gothic Neo", sans-serif;
  font-size: clamp(23px, 7cqw, 34px);
  font-weight: 850;
  letter-spacing: -.045em;
  text-shadow: none;
}

.lobby-artboard:not(.debug-layout) .main-stat-coins { left: 12%; width: 40%; }
.lobby-artboard:not(.debug-layout) .main-stat-record {
  left: auto;
  right: 12%;
  width: 30%;
  justify-content: flex-end;
  color: #eee8dc;
  font-size: clamp(20px, 5.7cqw, 28px);
}

.simple-fairness {
  position: absolute;
  z-index: 4;
  left: 12%;
  top: 47.25%;
  width: 76%;
  margin: 0;
  color: var(--simple-muted);
  font-size: clamp(10px, 2.8cqw, 13px);
  font-weight: 650;
  text-align: left;
}

.main-account-button {
  position: absolute;
  z-index: 22;
  right: 12%;
  top: 46.55%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 31%;
  min-height: clamp(27px, 7cqw, 32px);
  padding: 4px 10px;
  overflow: hidden;
  border: 1px solid rgba(236, 214, 158, .32);
  border-radius: 999px;
  color: #f8edcc;
  background: rgba(8, 24, 18, .68);
  font-size: clamp(9px, 2.7cqw, 12px);
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
}

.main-account-button:hover,
.main-account-button:focus-visible {
  border-color: #e2c778;
  background: rgba(29, 63, 47, .88);
  outline: 2px solid rgba(255, 226, 154, .25);
  outline-offset: 1px;
}

.lobby-artboard:not(.debug-layout) .lobby-menu-button {
  left: 8%;
  width: 84%;
  height: 8.5%;
  min-height: 48px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter: drop-shadow(0 7px 7px rgba(0, 0, 0, .24));
}

.lobby-artboard:not(.debug-layout) .lobby-menu-button::before {
  content: none;
}

.lobby-artboard:not(.debug-layout) .lobby-menu-button::after {
  content: none;
}

.lobby-artboard:not(.debug-layout) .lobby-menu-solo { top: 55.6%; background: transparent; }
.lobby-artboard:not(.debug-layout) .lobby-menu-online { top: 67.2%; background: transparent; }
.lobby-artboard:not(.debug-layout) .lobby-menu-rules { top: 78.8%; background: transparent; }

.lobby-artboard:not(.debug-layout) .lobby-menu-board {
  display: block ;
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain ;
  filter: none;
  pointer-events: none;
}

.lobby-button-text,
.lobby-button-icon,
.lobby-button-arrow {
  position: absolute;
  z-index: 8;
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.lobby-button-text {
  left: 50%;
  top: 50%;
  width: 44.8%;
  height: 57.6%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .48));
}

.lobby-button-text-online { width: 48%; }
.lobby-button-text-rules {
  width: 46.4%;
  height: 38.4%;
}

.lobby-button-icon {
  left: 8.5%;
  top: 50%;
  width: 13%;
  height: 55%;
  transform: translateY(-50%);
}

.lobby-button-arrow {
  right: 7%;
  top: 50%;
  width: 8.5%;
  height: 52%;
  transform: translateY(-50%);
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .5));
}

.lobby-artboard:not(.debug-layout) .lobby-menu-button:hover,
.lobby-artboard:not(.debug-layout) .lobby-menu-button:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 12px 22px rgba(0, 0, 0, .26);
}

.lobby-artboard:not(.debug-layout) .lobby-menu-button:active {
  transform: translateY(1px);
  filter: brightness(.96);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .18);
}

.simple-legal {
  position: absolute;
  z-index: 21;
  left: 8%;
  bottom: 10.7%;
  width: 84%;
  margin: 0;
  color: rgba(255, 255, 255, .62);
  font-size: clamp(9px, 2.4cqw, 12px);
  font-weight: 560;
  line-height: 1.2;
  text-align: center;
  transform: translateY(20px);
}

.bankrupt-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  background: #a52e30;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}
.bankrupt-badge[hidden], .replacement-character[hidden] { display: none; }
#aiReplacement { z-index: 180; }
.ai-replacement-dialog { text-align: center; }
.replacement-character { width: 96px; height: 96px; object-fit: contain; margin: 12px auto; }
.ai-replacement-dialog button { margin-top: 12px; }

/* ── 플레이: 프레임 대신 선과 면, 카드를 가장 강한 요소로 둔다. ─ */
.game-artboard:not(.debug-layout) {
  background: var(--simple-bg);
}

.game-artboard:not(.debug-layout) > .app-bar,
.game-artboard:not(.debug-layout) > .opponent,
.game-artboard:not(.debug-layout) > .table-zone,
.game-artboard:not(.debug-layout) > .player,
.game-artboard:not(.debug-layout) > .hand {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.game-artboard:not(.debug-layout) > .app-bar,
.game-artboard:not(.debug-layout) > .opponent,
.game-artboard:not(.debug-layout) > .player,
.game-artboard:not(.debug-layout) > .hand {
  background: var(--simple-surface-2);
}

.game-artboard:not(.debug-layout) > .app-bar,
.game-artboard:not(.debug-layout) > .player {
  border-bottom: 1px solid var(--simple-line);
}

.game-artboard:not(.debug-layout) > .table-zone {
  background: var(--simple-felt);
}

.game-artboard:not(.debug-layout) .game-title-floral-art,
.game-artboard:not(.debug-layout) .game-brand-art,
.game-artboard:not(.debug-layout) .game-settings-art,
.game-artboard:not(.debug-layout) .game-security-art,
.game-artboard:not(.debug-layout) .game-opponent-settings,
.game-artboard:not(.debug-layout) .game-field-label,
.game-artboard:not(.debug-layout) .game-player-label,
.game-artboard:not(.debug-layout) .game-captured-label,
.game-artboard:not(.debug-layout) .avatar img {
  display: none;
}

.game-artboard:not(.debug-layout) .game-title-art {
  left: 4%;
  top: 8%;
  width: 21.5%;
  height: 34%;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .3));
}

.game-artboard:not(.debug-layout) .game-home-button {
  left: 4%;
  top: 55%;
  width: min(18cqw, 82px);
  height: 31%;
  padding: 0 9px;
  border: 1px solid var(--simple-line-strong);
  border-radius: 999px;
  color: var(--simple-text);
  background: rgba(255, 255, 255, .055);
  box-shadow: none;
  font-size: clamp(10px, 2.8cqw, 13px);
  font-weight: 800;
}

.game-artboard:not(.debug-layout) .wallet {
  right: 4%;
  top: 18%;
  width: 27%;
  height: 34%;
  border: 1px solid var(--simple-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .045);
  box-shadow: none;
}

.game-artboard:not(.debug-layout) .wallet strong {
  color: var(--simple-text);
  font-size: clamp(14px, 4.2cqw, 20px);
  text-shadow: none;
}

.simple-security {
  position: absolute;
  z-index: 4;
  right: 5%;
  top: 61%;
  display: flex;
  align-items: center;
  gap: clamp(4px, 1cqw, 6px);
  color: var(--simple-muted);
  font-size: clamp(9px, 2.5cqw, 12px);
  font-weight: 650;
}

.simple-security i {
  width: clamp(6px, 1.6cqw, 8px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #4dc68c;
}

.game-artboard:not(.debug-layout) .game-settings-button {
  right: 27%;
  top: 55%;
  width: 15%;
  height: 31%;
  border: 1px solid var(--simple-line-strong);
  border-radius: 999px;
  color: var(--simple-text);
  background: rgba(255, 255, 255, .055);
}

.game-artboard:not(.debug-layout) .game-settings-button:hover,
.game-artboard:not(.debug-layout) .game-settings-button:focus-visible {
  border-color: rgba(255, 232, 174, .72);
  background: rgba(255, 255, 255, .1);
}

.game-artboard:not(.debug-layout) .simple-settings {
  display: block;
  font-size: clamp(9px, 2.5cqw, 12px);
  font-weight: 750;
}

.game-artboard:not(.debug-layout) .avatar {
  left: 4.5%;
  top: 9%;
  width: 11%;
  height: auto;
  aspect-ratio: 1;
  border-radius: clamp(7px, 2cqw, 10px);
  color: #261a0f;
  background: #111713;
  font-size: clamp(20px, 5.7cqw, 28px);
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 232, 174, .7);
  cursor: pointer;
}

.game-artboard:not(.debug-layout) .avatar span { padding: 0; }

.game-artboard:not(.debug-layout) .opponent-name-button {
  left: 18%;
  top: 7%;
  width: 34%;
  height: 28%;
  color: var(--simple-text);
  font-size: clamp(15px, 4.3cqw, 20px);
}

.game-artboard:not(.debug-layout) .opponent-name-button::after {
  content: none;
  display: none;
}

.game-artboard:not(.debug-layout) #opponentScore,
.game-artboard:not(.debug-layout) #playerScore {
  color: var(--simple-text);
  text-shadow: none;
}

.game-artboard:not(.debug-layout) #opponentScore { right: 4.5%; top: 8%; }
.game-artboard:not(.debug-layout) .opponent-copy > p {
  left: 18%;
  top: 32%;
  color: var(--simple-muted);
  text-shadow: none;
}

.game-artboard:not(.debug-layout) .capture-pile {
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, .035);
  box-shadow: none;
}

.game-artboard:not(.debug-layout) .capture-pile.kind-bright,
.game-artboard:not(.debug-layout) .capture-pile.kind-animal { background: rgba(18, 84, 59, .42); }

.game-artboard:not(.debug-layout) .capture-pile::after {
  border: 0;
  color: rgba(255, 255, 255, .72);
  background: transparent;
  box-shadow: none;
  text-shadow: none;
}

/* 획득패는 좌우 빈 공간까지 사용해 각 패의 얼굴이 더 많이 드러나게 한다. */
.game-artboard:not(.debug-layout) .opponent-strip {
  left: 4%;
  width: 92%;
}

.game-artboard:not(.debug-layout) .player-strip {
  left: 4%;
  width: 92%;
}

/* 상대 손패 뒷면은 정보 줄 우측으로 옮겨 획득패와 영역을 공유하지 않는다. */
.game-artboard:not(.debug-layout) .opponent-hand {
  right: 4%;
  top: 29%;
  width: 31%;
  height: 19%;
}

.game-artboard:not(.debug-layout) .mini-back {
  width: clamp(18px, 5.2cqw, 25px);
  height: clamp(27px, 7.8cqw, 38px);
}

.game-artboard:not(.debug-layout) .capture-mini-card {
  transform-origin: 50% 92%;
}

.simple-player-label,
.simple-captured-label {
  position: absolute;
  z-index: 6;
  display: grid;
  place-items: center;
  color: var(--simple-text);
  font-weight: 800;
  line-height: 1;
}

/* 턴 문구·남은 더미 숫자·바닥 라벨은 패 공간을 위해 시각적으로 제거한다. */
.game-artboard:not(.debug-layout) .turn-status,
.game-artboard:not(.debug-layout) .zone-title,
.game-artboard:not(.debug-layout) .game-field-label {
  display: none ;
}

/* 녹색 영역의 상하 끝까지 사용하며 중앙 더미를 비운다. */
.game-artboard:not(.debug-layout) .field {
  left: 1.5%;
  top: 1.5%;
  width: 97%;
  height: 97%;
  display: block;
  overflow: visible;
}

.game-artboard:not(.debug-layout) .field .game-card {
  position: absolute;
  height: auto;
  margin: 0;
  transform-origin: center;
  transition: filter 100ms ease-out;
}

/* 두 장 중 하나를 고를 때 선택 패가 중앙 더미보다 항상 위에서 눌리도록 한다. */
.game-artboard:not(.debug-layout) .field.is-choosing {
  z-index: 16 ;
  transition: none ;
}

/* 더미는 바닥패와 같은 2:3 크기이고, 뒷면 세 장과 얕은 그림자로 두께를 표현한다. */
.game-artboard:not(.debug-layout) .table-zone .deck {
  z-index: 12;
  left: 50%;
  right: auto;
  top: 50%;
  bottom: auto;
  width: 16.192%;
  height: auto;
  aspect-ratio: 2 / 3;
  transform: translate(-50%, -50%);
  overflow: visible;
  isolation: isolate;
  box-sizing: border-box;
  border: 0;
  padding: 0;
  appearance: none;
  background: transparent;
  color: inherit;
  opacity: 1;
}

.game-artboard:not(.debug-layout) .table-zone .deck:disabled { cursor: default; }
.game-artboard:not(.debug-layout) .table-zone .deck.is-bomb-draw-available {
  cursor: pointer;
  filter: drop-shadow(0 0 7px rgba(255, 205, 82, .76));
}

.game-artboard:not(.debug-layout) .deck .bomb-draw-ring {
  position: absolute;
  inset: -8px;
  z-index: 3;
  display: none;
  transform: none;
  border: 2px solid #ffd764;
  border-radius: 11px;
  pointer-events: none;
  box-shadow:
    0 0 0 2px rgba(111, 63, 5, .9),
    0 0 9px 3px rgba(255, 208, 82, .82),
    inset 0 0 7px rgba(255, 245, 190, .7);
}

.game-artboard:not(.debug-layout) .deck.is-bomb-draw-available .bomb-draw-ring { display: block; }

.game-artboard:not(.debug-layout) .deck .bomb-draw-ring::before {
  content: "";
  position: absolute;
  inset: -5px;
  padding: 3px;
  border-radius: 14px;
  background: conic-gradient(from var(--choice-led-angle),
    #ff526c, #ffbd45, #fff477, #61ee9b, #4bdfff, #7885ff, #e66bff, #ff526c);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: choiceLedOrbit 2.4s linear infinite;
}

.game-artboard:not(.debug-layout) .deck .bomb-draw-ring::after {
  content: "";
  position: absolute;
  inset: 2px 4px 50%;
  border-radius: 7px 7px 50% 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.48), rgba(255,255,255,0));
  mix-blend-mode: screen;
}

.game-artboard:not(.debug-layout) .deck.is-bomb-draw-available .game-deck-frame {
  filter: brightness(1.09) saturate(1.08) drop-shadow(0 3px 3px rgba(0, 0, 0, .3));
}

.game-artboard:not(.debug-layout) .deck .bomb-draw-badge {
  position: absolute;
  left: 50%;
  top: auto;
  bottom: -27px;
  z-index: 5;
  display: block;
  width: max-content;
  min-width: 58px;
  padding: 5px 8px;
  transform: translateX(-50%);
  border: 1px solid #ffe7a0;
  border-radius: 999px;
  color: #fff8dd;
  background: linear-gradient(180deg, rgba(91, 52, 8, .96), rgba(42, 24, 6, .96));
  box-shadow: 0 2px 6px rgba(0,0,0,.45), 0 0 7px rgba(255, 209, 86, .55);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 1px 2px #241000;
}

.game-artboard:not(.debug-layout) .deck .bomb-draw-badge[hidden] { display: none; }

.game-artboard:not(.debug-layout) .field.medium ~ .deck,
.game-artboard:not(.debug-layout) .field.dense ~ .deck,
.game-artboard:not(.debug-layout) .field.crowded ~ .deck { width: 16.192%; }

.game-artboard:not(.debug-layout) .deck::before,
.game-artboard:not(.debug-layout) .deck::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  border-radius: clamp(4px, 1cqw, 6px);
  background: url("assets/hwatu/card_back_crimson_v2.png") center / contain no-repeat;
  pointer-events: none;
}

.game-artboard:not(.debug-layout) .deck::before {
  transform: translate(-5px, -5px) rotate(-1.2deg);
  box-shadow: 3px 7px 8px rgba(0, 0, 0, .28);
}

.game-artboard:not(.debug-layout) .deck::after {
  z-index: -1;
  transform: translate(-2.5px, -2.5px) rotate(-.5deg);
  box-shadow: 2px 4px 4px rgba(0, 0, 0, .2);
}

.game-artboard:not(.debug-layout) .deck .game-deck-frame {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .24));
}

/* 뒤집는 한 장이 더미 맨 위 패를 대신하므로 동일한 뒷면을 중복 출력하지 않는다. */
.game-artboard:not(.debug-layout) .deck.is-drawing .game-deck-frame { visibility: hidden; }

.game-artboard:not(.debug-layout) .game-card {
  border-radius: clamp(4px, 1cqw, 6px);
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .3));
}

.game-artboard:not(.debug-layout) .game-card.match-choice {
  z-index: 100 ;
  outline-color: #ffe49a;
  filter: brightness(1.06) drop-shadow(0 4px 5px rgba(0, 0, 0, .36));
}

.game-artboard:not(.debug-layout) .deck .game-deck-frame { filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .3)); }

.simple-player-label {
  left: 4%;
  top: 6%;
  width: clamp(36px, 10cqw, 48px);
  min-width: 0;
  height: auto;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 232, 174, .7);
  border-radius: clamp(7px, 2cqw, 10px);
  background: #111713;
  font-size: clamp(14px, 4cqw, 19px);
  cursor: pointer;
}

.game-artboard:not(.debug-layout) .opponent-identity {
  position: absolute;
  left: 18%;
  top: 4%;
  z-index: 11;
  display: flex;
  align-items: center;
  gap: clamp(5px, 1.4cqw, 8px);
  width: 58%;
  height: 21%;
  min-width: 0;
}

.game-artboard:not(.debug-layout) .opponent .opponent-identity .opponent-name-button {
  position: relative;
  inset: auto;
  flex: 0 1 auto;
  width: auto;
  max-width: 46%;
  height: 100%;
  min-width: 0;
}

.game-artboard:not(.debug-layout) .opponent .opponent-identity .opponent-name-button strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-artboard:not(.debug-layout) .player-identity {
  position: absolute;
  left: 16%;
  top: 4%;
  z-index: 11;
  display: flex;
  align-items: center;
  gap: clamp(5px, 1.4cqw, 8px);
  width: 58%;
  height: 21%;
  min-width: 0;
}

.player-identity-name {
  min-width: 0;
  max-width: 42%;
  overflow: hidden;
  color: var(--simple-text);
  font-size: clamp(11px, 3.15cqw, 15px);
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-artboard:not(.debug-layout) .player .player-wallet,
.game-artboard:not(.debug-layout) .opponent .opponent-wallet {
  position: relative;
  inset: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: auto;
  min-width: 0;
  height: clamp(24px, 7cqw, 32px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
  box-shadow: none;
}

.game-artboard:not(.debug-layout) .player .player-wallet i,
.game-artboard:not(.debug-layout) .opponent .opponent-wallet i {
  display: none;
}

.game-artboard:not(.debug-layout) .player .player-wallet strong,
.game-artboard:not(.debug-layout) .opponent .opponent-wallet strong {
  position: relative;
  z-index: 2;
  min-width: 0;
  color: #fff2c7;
  font-size: clamp(11px, 3.15cqw, 15px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
  white-space: nowrap;
  text-shadow: none;
}

.game-artboard:not(.debug-layout) .wallet.is-slot-spinning {
  box-shadow: none;
}

.game-artboard:not(.debug-layout) .wallet.is-slot-spinning strong {
  will-change: transform, filter;
}

.game-artboard:not(.debug-layout) .wallet .money-reel-ghost {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  pointer-events: none;
  will-change: transform, filter;
}

.result-money-balance .money-reel-ghost {
  position: absolute;
  left: 0 ;
  top: auto ;
  bottom: 0;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100% ;
  pointer-events: none;
}

.money-transfer-token {
  position: fixed;
  z-index: 10020;
  display: block;
  min-width: 168px;
  height: 44px;
  padding: 0;
  overflow: visible;
  border: 0;
  color: #ffe89d;
  background: transparent;
  box-shadow: none;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.money-transfer-window {
  position: relative;
  display: block;
  width: 100%;
  height: 44px;
  overflow: hidden;
}

.money-transfer-value {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: clamp(28px, 8vw, 34px);
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: -.055em;
  text-shadow: none;
  will-change: transform, filter;
}

.money-transfer-value-ghost {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.money-transfer-token.is-slot-processing { filter: none; }
.money-transfer-token.is-hero.is-slot-processing .money-transfer-window {
  height: calc(var(--money-hero-font, 56px) * 1.2);
  overflow: hidden;
}
.money-transfer-token.is-hero.is-slot-processing .money-transfer-value {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  white-space: nowrap;
  overflow-wrap: normal;
}

.money-transfer-token.is-amount-locked {
  animation: money-amount-lock 190ms cubic-bezier(.16, 1.45, .35, 1) both;
}

.money-transfer-token.is-delivered {
  animation: money-number-absorbed 260ms cubic-bezier(.48,0,.9,.42) both;
}

.money-transfer-token.is-hero {
  min-width: 0;
  height: auto;
  text-align: center;
}
.is-hero .money-transfer-caption {
  display: block;
  margin-bottom: 14px;
  color: #fff7df;
  font-size: clamp(14px, 3vw, 22px);
  font-weight: 800;
  text-shadow: none;
}
.is-hero .money-transfer-window { height: auto; overflow: visible; }
.is-hero .money-transfer-value {
  height: auto;
  display: block;
  font-size: var(--money-hero-font, 56px);
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: keep-all;
  letter-spacing: -.04em;
}
.money-transfer-token.is-hero.is-amount-locked {
  animation: money-hero-arrival 240ms ease-out both;
}
@keyframes money-hero-arrival {
  from { transform: translate(-50%, -50%) scale(.95); }
  55% { transform: translate(-50%, -50%) scale(1.04); }
  to { transform: translate(-50%, -50%) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .money-transfer-token.is-hero.is-amount-locked { animation: none; }
}

.wallet.is-money-arrival {
  animation: money-wallet-arrival 360ms cubic-bezier(.16, 1.32, .32, 1);
}

.wallet.is-money-departure {
  animation: money-wallet-departure 330ms ease-out both;
}

.result-money-balance.is-money-departure strong {
  animation: money-result-departure 190ms ease-out both;
}

.result-money-balance.is-money-arrival strong {
  animation: money-result-arrival 260ms cubic-bezier(.16, 1.18, .32, 1);
}

@keyframes money-amount-lock {
  0% { transform: translate(-50%, -50%) scale(.95); }
  62% { transform: translate(-50%, -50%) scale(1.12); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes money-number-absorbed {
  from { transform: translate(-50%, -50%) scale(1); opacity: 1; filter: blur(0); }
  to { transform: translate(-50%, -50%) scale(.54); opacity: 0; filter: blur(1.4px); }
}

@keyframes money-wallet-departure {
  0% { transform: scale(1); filter: brightness(1); }
  46% { transform: scale(.96); filter: brightness(.82); }
  100% { transform: scale(1); filter: brightness(1); }
}

@keyframes money-wallet-arrival {
  0% { transform: scale(1); }
  42% { transform: scale(1.07); }
  68% { transform: scale(.99); }
  100% { transform: scale(1); }
}

@keyframes money-result-departure {
  0% { color: #fff3cd; transform: translateY(0); }
  52% { color: #d8a996; transform: translateY(1px); }
  100% { color: #fff3cd; transform: translateY(0); }
}

@keyframes money-result-arrival {
  0% { color: #fff3cd; transform: scale(1); }
  48% { color: #ffe98e; transform: scale(1.06); text-shadow: 0 0 8px rgba(255, 211, 91, .55); }
  100% { color: #fff3cd; transform: scale(1); text-shadow: none; }
}

.player-money-delta,
.opponent-money-delta {
  position: absolute;
  left: 45%;
  top: 82%;
  z-index: 26;
  font-size: clamp(12px, 3.5cqw, 17px);
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  pointer-events: none;
  white-space: nowrap;
  text-shadow: none;
}

.opponent-money-delta {
  left: 44%;
  top: 86%;
}

.player-money-delta.is-loss,
.opponent-money-delta.is-loss { color: #ff7667; animation: player-money-leave 950ms cubic-bezier(.2, .8, .28, 1) both; }
.player-money-delta.is-win,
.opponent-money-delta.is-win { color: #ffe18a; animation: player-money-enter 950ms cubic-bezier(.18, 1.2, .28, 1) both; }
.player-money-delta.is-draw,
.opponent-money-delta.is-draw { color: var(--simple-muted); }

.player-wallet.is-money-loss,
.opponent-wallet.is-money-loss { animation: player-wallet-loss 950ms ease-out; }
.player-wallet.is-money-win,
.opponent-wallet.is-money-win { animation: player-wallet-win 950ms ease-out; }

@keyframes player-money-leave {
  0% { transform: translate(0, 0) scale(1); }
  30% { transform: translate(4px, 4px) scale(1.18); }
  100% { transform: translate(30px, 18px) scale(.82); }
}

@keyframes player-money-enter {
  0% { transform: translate(28px, 18px) scale(.82); }
  55% { transform: translate(-3px, -3px) scale(1.16); }
  100% { transform: translate(0, 0) scale(1); }
}

@keyframes player-wallet-loss {
  0%, 100% { transform: translateX(0); }
  24% { transform: translateX(-3px); }
  48% { transform: translateX(3px); }
  72% { transform: translateX(-2px); }
}

@keyframes player-wallet-win {
  0%, 100% { transform: scale(1); }
  48% { transform: scale(1.08); }
}

@keyframes avatar-turn-led-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px #064700,
      0 0 0 4px #00e800,
      0 0 5px 1px #00ff00,
      inset 0 0 0 1px #006b00;
  }
  50% {
    box-shadow:
      0 0 0 1px #064700,
      0 0 0 5px #00ff00,
      0 0 7px 2px #00ff00,
      inset 0 0 0 1px #006b00;
  }
}

.game-artboard .character-avatar {
  box-sizing: border-box;
  border: 2px solid #b98533 ;
  box-shadow:
    0 0 0 1px #281508,
    inset 0 0 0 1px #f4d67c;
  transition: none;
}

.game-artboard .character-avatar.is-current-turn {
  z-index: 9;
  border-color: #00ff00 ;
  outline: 2px solid #00e800;
  outline-offset: 2px;
  box-shadow:
    0 0 0 1px #064700,
    0 0 0 4px #00e800,
    0 0 5px 1px #00ff00,
    inset 0 0 0 1px #006b00;
  animation: avatar-turn-led-pulse 1.1s ease-in-out infinite;
}

.game-artboard .character-avatar .character-avatar-image {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block ;
  width: 100% ;
  max-width: none ;
  height: 100% ;
  max-height: none ;
  object-fit: cover ;
  object-position: center;
  border-radius: inherit;
  filter: saturate(1.3) contrast(1.08);
  pointer-events: none;
}

#playerAvatar:hover,
#playerAvatar:focus-visible { outline: 2px solid #ffe29a; outline-offset: 2px; }
.game-artboard #playerAvatar.is-current-turn:hover,
.game-artboard #playerAvatar.is-current-turn:focus-visible { outline-color: #00e800; }
.opponent .character-avatar { cursor: default; }

@media (prefers-reduced-motion: reduce) {
  .game-artboard .character-avatar.is-current-turn { animation: none ; }
}

.simple-captured-label {
  right: 4%;
  top: 8%;
  height: 26%;
  color: var(--simple-muted);
  font-size: clamp(11px, 3cqw, 14px);
}

.game-artboard:not(.debug-layout) #playerScore { left: 16%; top: 27%; width: 38%; height: 11%; }
.game-artboard:not(.debug-layout) .player-strip { left: 4%; width: 92%; }

/* 획득패와 경계가 겹쳐도 손패가 항상 앞쪽 레이어에 남도록 한다. */
.game-artboard:not(.debug-layout) > .player { z-index: 8; }

.game-artboard:not(.debug-layout) > .hand {
  z-index: 20;
  contain: layout style;
  isolation: isolate;
  overflow: visible;
  background: #141512;
  border: 0;
  box-shadow: inset 0 1px rgba(255, 255, 255, .05);
}

.game-artboard:not(.debug-layout) .hand .game-card {
  position: absolute;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .38));
}

/* 확대된 손패는 좌우의 나중 형제 패보다 항상 위에 그린다. */
.game-artboard:not(.debug-layout) .hand .game-card.pending-hand-card {
  z-index: 100 ;
}

/* 터치 브라우저의 고정 hover 때문에 손패가 미리 선택돼 보이지 않게 한다. */
@media (hover: none), (pointer: coarse) {
  .game-artboard:not(.debug-layout) .hand .game-card,
  .game-artboard:not(.debug-layout) .hand .game-card:nth-child(even) {
    top: 4%;
  }

  .game-artboard:not(.debug-layout) .hand button.game-card:hover:not(.pending-hand-card),
  .game-artboard:not(.debug-layout) .hand button.game-card:focus:not(.pending-hand-card),
  .game-artboard:not(.debug-layout) .hand button.game-card:focus-visible:not(.pending-hand-card) {
    transform: none ;
    outline: none ;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .28) ;
  }

  .game-artboard:not(.debug-layout) .hand .game-card.pending-hand-card {
    transform: translateY(-1.2cqw) scale(1.06) ;
  }
}

/* 중앙 진행/족보 이벤트는 글꼴 대신 투명 이미지 스프라이트로 표시한다. */
.event-callout { padding: 10px; }

.event-callout .event-callout-card,
.game-artboard:not(.debug-layout) ~ .event-callout .event-callout-card {
  --callout-tilt: -4deg;
  --callout-rebound: 1.1deg;
  --callout-exit-tilt: -1.4deg;
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 410px);
  max-width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  isolation: isolate;
  animation: none;
}

.event-callout.is-opponent .event-callout-card {
  --callout-tilt: 4deg;
  --callout-rebound: -1.1deg;
  --callout-exit-tilt: 1.4deg;
}

.event-callout .event-callout-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  right: auto;
  top: 50%;
  width: min(62cqw, 250px);
  aspect-ratio: 1;
  border: clamp(2px, .8cqw, 4px) solid rgba(255, 218, 109, .82);
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(255, 191, 67, .42), inset 0 0 18px rgba(255, 224, 136, .3);
  transform: translate(-50%, -50%) scale(.18);
  display: none;
}

.event-callout .event-callout-card::after {
  content: "";
  position: absolute;
  z-index: -2;
  left: 50%;
  right: auto;
  top: 50%;
  width: min(88cqw, 360px);
  height: min(30cqw, 122px);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 221, 126, .34), rgba(255, 188, 45, .08) 45%, transparent 72%);
  transform: translate(-50%, -50%) scale(.35);
  display: none;
}

.event-callout-word {
  position: relative;
  z-index: 2;
  width: min(61.333cqw, 260px);
  max-width: calc(100% - 8px);
  aspect-ratio: var(--callout-cell-ratio, 2.3333);
  background-repeat: no-repeat;
  filter: drop-shadow(0 10px 8px rgba(0, 0, 0, .5));
  transform-origin: 50% 58%;
  animation: callout-image-impact 1.7s cubic-bezier(.18, .82, .2, 1) both;
  will-change: transform, opacity;
}

/* 중앙 글씨가 등장하는 첫 순간에만 짧게 퍼지는 경량 DOM 파티클. */
.event-callout-particles {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  width: min(72cqw, 300px);
  height: min(32cqw, 132px);
  transform: translate(-50%, -50%);
  overflow: visible;
  pointer-events: none;
}

.event-callout-particle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--particle-size, 5px);
  height: var(--particle-size, 5px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #fff8c8 0 18%, #f5cc63 36%, #b66b20 72%, transparent 76%);
  box-shadow: 0 0 5px rgba(255, 211, 92, .58);
  opacity: 0;
  will-change: transform, opacity;
}

.event-callout-particle:nth-child(3n) {
  border-radius: 1px;
  background: linear-gradient(135deg, #fff5b0, #dc8a27 72%);
}

.event-callout-particles.is-active .event-callout-particle {
  animation: callout-particle-burst 880ms cubic-bezier(.16, .72, .28, 1) var(--particle-delay, 0ms) both;
}

.event-callout .event-callout-card > span,
.event-callout .event-callout-card > small {
  position: absolute ;
  width: 1px ;
  height: 1px ;
  padding: 0 ;
  margin: -1px ;
  overflow: hidden ;
  clip: rect(0, 0, 0, 0) ;
  clip-path: inset(50%) ;
  white-space: nowrap ;
  border: 0 ;
}

/* 이미지 로드 실패 시에도 중앙 정보가 사라지지 않도록 글자 대체 출력을 둔다. */
.event-callout .event-callout-card > strong {
  position: relative ;
  display: block;
  width: auto ;
  height: auto ;
  margin: 0 ;
  padding: .08em .18em ;
  overflow: visible ;
  clip: auto ;
  clip-path: none ;
  white-space: nowrap ;
  border: 0 ;
  color: #fff1c6;
  font-size: clamp(28px, 9.333cqw, 45px);
  font-weight: 950;
  line-height: 1;
  letter-spacing: -.06em;
  text-shadow: 0 3px 0 #6f180c, 0 7px 12px rgba(0, 0, 0, .55);
  animation: callout-text-impact 1.7s cubic-bezier(.18, .82, .2, 1) both;
}

.event-callout-card.has-callout-sprite > strong {
  position: absolute ;
  width: 1px ;
  height: 1px ;
  padding: 0 ;
  margin: -1px ;
  overflow: hidden ;
  clip: rect(0, 0, 0, 0) ;
  clip-path: inset(50%) ;
}

.event-callout-card:not(.has-callout-sprite) .event-callout-word { display: none; }

@keyframes callout-image-impact {
  0% { opacity: 0; transform: translateY(16px) scale(.34) rotate(var(--callout-tilt)); }
  12% { opacity: 1; transform: translateY(0) scale(1.18) rotate(var(--callout-rebound)); }
  34% { transform: translateY(0) scale(.96) rotate(var(--callout-rebound)); }
  50%, 78% { opacity: 1; transform: translateY(0) scale(1.02) rotate(0); }
  100% { opacity: 0; transform: translateY(-18px) scale(.93) rotate(var(--callout-exit-tilt)); }
}

@keyframes callout-text-impact {
  0% { opacity: 0; transform: translateY(12px) scale(.72); }
  14% { opacity: 1; transform: translateY(0) scale(1.08); }
  36%, 78% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-12px) scale(.96); }
}

@keyframes callout-impact-ring {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.18); }
  12% { opacity: .9; }
  48%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.42); }
}

@keyframes callout-impact-flash {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.35); }
  16% { opacity: 1; transform: translate(-50%, -50%) scale(1.16); }
  46%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.48); }
}

@keyframes callout-particle-burst {
  0% {
    opacity: 0;
    transform: translate(calc(-50% + var(--particle-start-x)), calc(-50% + var(--particle-start-y))) scale(.2) rotate(0deg);
  }
  16% { opacity: .92; }
  52% { opacity: .72; }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--particle-end-x)), calc(-50% + var(--particle-end-y))) scale(.05) rotate(var(--particle-rotation));
  }
}

@media (prefers-reduced-motion: reduce) {
  .event-callout-word { animation: callout-image-reduced .16s ease-out both; }
  .event-callout .event-callout-card::before,
  .event-callout .event-callout-card::after { animation: none; opacity: 0; }
  .event-callout-particles { display: none; }
}

@keyframes callout-image-reduced {
  from { opacity: 0; transform: scale(.92); }
  to { opacity: 1; transform: scale(1); }
}

/* ── 팝업: 장식 대신 명확한 선택 구조 ───────────────────── */
.overlay { background: rgba(4, 8, 7, .82); backdrop-filter: blur(7px); }

#result.is-money-settling {
  background: rgba(0, 0, 0, .48);
  backdrop-filter: none;
  pointer-events: none;
}

#result.is-money-settling .result-dialog {
  visibility: hidden;
}

.dialog {
  border: 1px solid var(--simple-line-strong);
  border-radius: 18px;
  background: #171d1a;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .5);
}

.dialog-kicker { color: var(--simple-accent); }
.setup-option > span,
.rule-book-grid section { border-color: var(--simple-line); background: rgba(255, 255, 255, .035); }
.rules-guide-dialog .rules-review-credit {
  margin: 16px 0 0;
  padding: 14px;
  border-left: 3px solid #eedba5;
  border-radius: 6px;
  background: rgba(238, 219, 165, .09);
  color: #fff1cc;
  font-size: 15px;
  line-height: 1.7;
  word-break: keep-all;
}
.rules-guide-dialog .rule-book-grid p {
  font-size: 15px;
  line-height: 1.75;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.setup-option input:checked + span { border-color: #83b89e; background: rgba(42, 112, 78, .28); box-shadow: none; }

.primary {
  border: 0;
  color: white;
  background: var(--simple-green);
  box-shadow: none;
}

.result-money-flow {
  position: relative;
  display: grid;
  grid-template-columns: 1fr .82fr 1fr;
  align-items: center;
  gap: 6px;
  min-height: 78px;
  margin-top: 12px;
  padding: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.result-money-flow.is-collecting,
.result-money-flow.is-resolving,
.result-money-flow.is-paying,
.result-money-flow.is-complete { border: 0; background: transparent; box-shadow: none; }

.result-money-flow small,
.result-money-flow strong { display: block; }
.result-money-flow small { color: var(--simple-muted); font-size: clamp(8px, 2.2cqw, 10px); }
.result-money-balance strong { margin-top: 0; color: #fff3cd; font-size: clamp(12px, 3.45cqw, 16px); }
.result-money-balance {
  position: relative;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: 3px 0;
  overflow: hidden;
}
.result-money-balance small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-money-transfer { position: relative; z-index: 2; }
.result-money-transfer > strong { font-size: clamp(16px, 4.6cqw, 21px); font-weight: 950; }
.result-money-flow.is-animating .result-money-transfer > strong { visibility: hidden; }
.result-money-transfer > small { margin-top: 5px; }
.result-money-flow.is-loss .result-money-transfer > strong,
.result-money-flow.is-win .result-money-transfer > strong { color: #ffe18a; }
.result-money-flow.is-draw .result-money-transfer > strong { color: var(--simple-muted); }
.result-money-after { position: relative; z-index: 3; }

@media (prefers-reduced-motion: reduce) {
  .player-money-delta,
  .opponent-money-delta,
  .player-wallet.is-money-loss,
  .player-wallet.is-money-win,
  .opponent-wallet.is-money-loss,
  .opponent-wallet.is-money-win,
  .wallet.is-money-arrival,
  .wallet.is-money-departure,
  .money-transfer-token.is-slot-processing,
  .money-transfer-token.is-amount-locked { animation-duration: 80ms ; }
}

.result-actions {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.result-actions .wide { margin-top: 0; }

.result-exit-button {
  min-height: 56px;
  border: 1px solid var(--simple-line-strong);
  border-radius: 14px;
  color: var(--simple-text);
  background: rgba(255, 255, 255, .055);
  font-size: clamp(16px, 4.8cqw, 20px);
  font-weight: 850;
  box-shadow: none;
  cursor: pointer;
}

.result-exit-button:hover,
.result-exit-button:focus-visible {
  border-color: #d7bd78;
  background: rgba(255, 255, 255, .095);
  outline: 2px solid rgba(255, 226, 154, .35);
  outline-offset: 1px;
}

.result-exit-button:active { transform: translateY(1px); }

/* 선택형 빠른 대화: 대화 버튼은 고정하고 문구는 캐릭터 오른쪽에 표시한다. */
.game-artboard .quick-chat-button {
  --chat-button-fill: #eedba5;
  position: absolute;
  z-index: 12;
  right: 3.8%;
  top: 7%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(58px, 18.5%, 78px);
  height: clamp(32px, 24%, 40px);
  padding: 0;
  border: 0;
  border-radius: 12px;
  color: #29251b;
  background: var(--chat-button-fill);
  box-shadow: none;
  text-shadow: none;
  overflow: visible;
  font-size: clamp(13px, 3.5cqw, 16px);
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.game-artboard .quick-chat-button::after {
  content: "";
  position: absolute;
  left: 13px;
  bottom: -7px;
  width: 12px;
  height: 9px;
  background: var(--chat-button-fill);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  pointer-events: none;
}

.game-artboard .quick-chat-button:hover,
.game-artboard .quick-chat-button:focus-visible {
  --chat-button-fill: #fff0c2;
  background: var(--chat-button-fill);
  box-shadow: none;
}

.game-artboard .quick-chat-button:focus-visible {
  outline: 2px solid #fff5da;
  outline-offset: 4px;
}

.game-artboard .quick-chat-button:active {
  --chat-button-fill: #d8c38d;
  transform: none;
  box-shadow: none;
}

.game-artboard .quick-chat-bubble {
  position: absolute;
  z-index: 23;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4.1%;
  width: max-content;
  max-width: 57%;
  padding: clamp(7px, 1.8cqw, 10px) clamp(13px, 3.5cqw, 18px);
  border-radius: clamp(10px, 3cqw, 15px);
  color: #32180e;
  background: #fbefc5;
  box-shadow: 0 5px 12px rgba(0, 0, 0, .34);
  font-size: clamp(12px, 3.5cqw, 17px);
  font-weight: 850;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: break-word;
  pointer-events: none;
  animation: quick-chat-pop 170ms cubic-bezier(.2, .9, .25, 1.18) both;
}

.game-artboard .quick-chat-bubble.hidden { display: none; }
.game-artboard .quick-chat-bubble.local {
  left: calc(4% + clamp(36px, 10cqw, 48px) + clamp(8px, 2.5cqw, 12px));
  right: auto;
  top: 6%;
}
.game-artboard .quick-chat-bubble.remote {
  left: calc(15.5% + clamp(8px, 2.5cqw, 12px));
  right: auto;
  top: 9%;
  background: #ffe0b5;
}
.game-artboard .quick-chat-bubble::after {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  border-style: solid;
  border-width: 8px 10px 8px 0;
  border-color: transparent #fbefc5 transparent transparent;
  transform: translateY(-50%);
}
.game-artboard .quick-chat-bubble.remote::after { border-right-color: #ffe0b5; }

@keyframes quick-chat-pop {
  from { transform: translateX(-7px) scale(.92); }
  to { transform: translateX(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .game-artboard .quick-chat-bubble { animation: none; }
}

#quickChatPicker { z-index: 48; }
.quick-chat-dialog { padding: 22px 18px 20px; text-align: left; }
.quick-chat-dialog h2 { margin-top: 4px; }
.quick-chat-dialog > p { margin: 8px 0 0; }
.quick-chat-grid { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.quick-chat-grid button {
  min-height: 52px;
  padding: 8px 7px;
  border: 1px solid var(--simple-line);
  border-radius: 12px;
  color: var(--simple-text);
  background: rgba(255, 255, 255, .055);
  font-size: clamp(11px, 3.2cqw, 15px);
  font-weight: 800;
  cursor: pointer;
}
.quick-chat-grid button:hover,
.quick-chat-grid button:focus-visible { border-color: #d7bd78; background: rgba(224, 189, 106, .13); outline: none; }

#characterPicker { z-index: 74; }
.character-picker-dialog {
  width: min(94%, 390px);
  max-height: 86%;
  padding: 20px 16px 16px;
  overflow: auto;
  overscroll-behavior: contain;
  text-align: left;
}
.character-picker-dialog h2 { margin-top: 4px; }
.character-picker-dialog > p { margin: 7px 0 12px; color: var(--simple-muted); font-size: 11px; line-height: 1.45; }
.character-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 2px 2px 8px;
}
.character-option {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 18%;
  background: #101612;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .24);
  cursor: pointer;
}
.character-option img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.character-option::after {
  content: "✓";
  position: absolute;
  right: 4px;
  bottom: 4px;
  display: grid;
  place-items: center;
  width: 20px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 247, 217, .7);
  border-radius: 50%;
  color: #201308;
  background: #f0cf75;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .35);
  font-size: 12px;
  font-weight: 950;
  opacity: 0;
}
.character-option[aria-pressed="true"] { border-color: #ffe29a; box-shadow: 0 0 0 2px rgba(255, 226, 154, .24); }
.character-option[aria-pressed="true"]::after { opacity: 1; }
.character-option:hover,
.character-option:focus-visible { border-color: #d7bd78; outline: none; }

/* ── 대국 시작 전: 메인 화면의 목재·금장·화문 모듈을 이어 쓴다. ─── */
.opening-setup {
  z-index: 50;
  padding: clamp(7px, 2.2cqw, 12px);
  background:
    radial-gradient(circle at 50% 42%, rgba(19, 74, 52, .3), transparent 54%),
    rgba(5, 4, 3, .94);
  backdrop-filter: blur(5px);
}
.opening-setup-dialog {
  --opening-gold: #d9a84b;
  --opening-gold-light: #ffe6a0;
  isolation: isolate;
  position: relative;
  width: min(100%, 390px);
  max-height: calc(100% - 6px);
  padding: clamp(43px, 12cqw, 53px) clamp(17px, 4.8cqw, 23px) clamp(18px, 5cqw, 24px);
  overflow: auto;
  border: 3px solid #8b551c;
  border-radius: clamp(12px, 3.5cqw, 17px);
  color: #fff4cf;
  background:
    url("assets/lobby/responsive/frame_corner_tl.png") left top / clamp(48px, 15cqw, 65px) auto no-repeat,
    url("assets/lobby/responsive/frame_corner_tr.png") right top / clamp(48px, 15cqw, 65px) auto no-repeat,
    url("assets/lobby/responsive/frame_corner_bl.png") left bottom / clamp(48px, 15cqw, 65px) auto no-repeat,
    url("assets/lobby/responsive/frame_corner_br.png") right bottom / clamp(48px, 15cqw, 65px) auto no-repeat,
    linear-gradient(rgba(67, 16, 7, .42), rgba(20, 8, 4, .48)),
    url("assets/lobby/responsive/surface_wood_tile.png") center / 240px auto repeat;
  box-shadow:
    0 18px 50px rgba(0, 0, 0, .72),
    inset 0 0 0 2px #2a1007,
    inset 0 0 0 4px rgba(232, 177, 73, .48),
    inset 0 0 26px rgba(0, 0, 0, .72);
  text-align: left;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.opening-setup-dialog::-webkit-scrollbar { display: none; }
.opening-setup-dialog::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 13%;
  top: 3px;
  width: 74%;
  height: clamp(42px, 13cqw, 55px);
  background: url("assets/game-ui/floral_header_ornament.png") center / contain no-repeat;
  filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .48));
  pointer-events: none;
}
.opening-setup-dialog::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 8px;
  border: 1px solid rgba(255, 220, 126, .32);
  border-radius: clamp(8px, 2.5cqw, 12px);
  box-shadow: inset 0 0 0 1px rgba(52, 24, 9, .9);
  pointer-events: none;
}
.opening-setup-dialog > * { position: relative; z-index: 2; }
.opening-setup-dialog > .dialog-kicker {
  display: block;
  margin: 0 auto 3px;
  color: #f5c75e;
  font-size: clamp(10px, 2.9cqw, 13px);
  font-weight: 950;
  letter-spacing: .16em;
  text-align: center;
  text-shadow: 0 2px 2px #240b03;
}
.opening-setup-dialog h2 {
  min-height: clamp(50px, 14cqw, 60px);
  margin: 0;
  padding: clamp(10px, 2.8cqw, 13px) clamp(22px, 6cqw, 28px);
  border: 12px solid transparent;
  border-image: url("assets/lobby/menu_brown.png") 52 118 fill / 12px 27px stretch;
  color: #fff2c6;
  font-size: clamp(23px, 7cqw, 31px);
  font-weight: 950;
  line-height: 1;
  text-align: center;
  text-shadow: 0 3px 0 #3c1506, 0 0 8px rgba(255, 212, 105, .2);
}
.opening-setup-dialog .opening-guide {
  margin: 7px 6px 0;
  color: #eadfc2;
  font-size: clamp(10px, 3cqw, 13px);
  font-weight: 650;
  line-height: 1.45;
  text-align: center;
  text-shadow: 0 2px 2px rgba(0, 0, 0, .8);
}
.opening-hand {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: clamp(86px, 25cqw, 108px);
  margin-top: clamp(10px, 3cqw, 14px);
  padding: 11px 8px 13px;
  border: 4px solid #7d4a18;
  border-radius: 10px;
  background:
    linear-gradient(rgba(0, 63, 42, .16), rgba(0, 17, 12, .3)),
    url("assets/lobby/responsive/surface_felt_tile.png") center / 210px auto repeat;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 2px #d6a547,
    inset 0 0 0 4px #351607,
    inset 0 8px 18px rgba(0, 0, 0, .6),
    0 6px 10px rgba(0, 0, 0, .35);
}
.opening-hand .opening-preview-card {
  position: relative;
  flex: 0 0 clamp(46px, 13.5cqw, 58px);
  width: clamp(46px, 13.5cqw, 58px);
  height: auto;
  aspect-ratio: 2 / 3;
  margin: 0 0 0 -5.2cqw;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .38));
  transform: none;
  transition: transform 120ms ease, filter 120ms ease;
  overflow: visible;
}
.opening-hand .opening-preview-card:first-child { margin-left: 0; }
.opening-hand button.opening-preview-card { cursor: pointer; }
.opening-hand button.opening-preview-card:active { transform: translateY(-3px) scale(1.03); }
.opening-hand .opening-preview-card.opening-selected {
  z-index: 3;
  transform: translateY(-6px) scale(1.025);
  filter: drop-shadow(0 0 7px rgba(255, 220, 126, .9)) drop-shadow(0 5px 4px rgba(0, 0, 0, .5));
}
.opening-card-badge {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: -8px;
  min-width: 32px;
  padding: 3px 5px;
  border: 1px solid #ffe6a0;
  border-radius: 999px;
  color: #351706;
  background: linear-gradient(#fff0ae, #d69b35);
  box-shadow: 0 2px 0 #552509, 0 3px 5px rgba(0, 0, 0, .5), inset 0 1px rgba(255, 255, 255, .55);
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  transform: translateX(-50%);
}
.opening-options { display: grid; gap: 8px; margin-top: 10px; }
.opening-option-row {
  display: grid;
  grid-template-columns: minmax(86px, .8fr) minmax(0, 1.5fr);
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 10px;
  border: 10px solid transparent;
  border-image: url("assets/lobby/menu_brown.png") 50 112 fill / 10px 24px stretch;
  color: #fff0c7;
  background: #3d1709;
  filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .38));
}
.opening-option-row > div:first-child { min-width: 0; }
.opening-option-row strong { display: block; color: #fff3cf; font-size: clamp(12px, 3.6cqw, 15px); text-shadow: 0 2px #2b0e04; }
.opening-option-row small { display: block; margin-top: 3px; color: #d8c59d; font-size: clamp(8px, 2.5cqw, 11px); }
.opening-segments { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.opening-segments button {
  min-width: 0;
  min-height: 34px;
  padding: 5px 4px;
  border: 1px solid rgba(228, 188, 99, .42);
  border-radius: 7px;
  color: #dfd2b5;
  background: linear-gradient(#271d13, #17130e);
  font-size: clamp(9px, 2.7cqw, 12px);
  font-weight: 800;
  white-space: nowrap;
}
.opening-segments button[aria-pressed="true"] {
  border-color: #ffe197;
  color: #fff6d5;
  background:
    linear-gradient(rgba(34, 110, 65, .34), rgba(0, 38, 23, .34)),
    url("assets/lobby/responsive/surface_felt_tile.png") center / 110px auto repeat;
  box-shadow: 0 0 0 2px rgba(183, 125, 35, .7), inset 0 1px rgba(255, 241, 185, .28), 0 3px 5px rgba(0, 0, 0, .42);
}
.opening-empty {
  margin: 0;
  padding: 13px;
  border: 1px solid rgba(222, 177, 83, .58);
  border-radius: 9px;
  color: #e5d4ae;
  background: rgba(35, 13, 6, .76);
  font-size: clamp(10px, 3cqw, 13px);
  text-align: center;
}
.opening-setup-dialog .opening-summary {
  min-height: 19px;
  margin: 10px 0 0;
  color: #ffe19a;
  font-size: clamp(10px, 2.9cqw, 13px);
  font-weight: 850;
  text-align: center;
  text-shadow: 0 2px 2px #2c0d03;
}
.opening-confirm {
  min-height: clamp(58px, 16cqw, 66px);
  margin-top: 8px;
  padding: 8px 24px ;
  border: 14px solid transparent ;
  border-image: url("assets/lobby/menu_green.png") 54 124 fill / 14px 31px stretch ;
  border-radius: 0;
  color: #fff4cf ;
  background: #064723 ;
  box-shadow: none ;
  filter: drop-shadow(0 6px 5px rgba(0, 0, 0, .46));
  font-size: clamp(16px, 4.8cqw, 21px);
  font-weight: 950;
  text-shadow: 0 3px 0 #193f23;
}
.opening-confirm:hover,
.opening-confirm:focus-visible { filter: brightness(1.08) drop-shadow(0 6px 5px rgba(0, 0, 0, .46)); outline: none; }
.opening-confirm:active { transform: translateY(2px); filter: brightness(.96) drop-shadow(0 3px 3px rgba(0, 0, 0, .4)); }

@media (max-height: 620px) {
  .lobby-artboard:not(.debug-layout) .lobby-main-subtitle { top: 16%; }
  .lobby-artboard:not(.debug-layout) .hero-plum { top: 25.8%; }
  .opening-setup-dialog { max-height: calc(100% - 2px); padding: 35px 14px 12px; }
  .opening-setup-dialog::before { height: 40px; }
  .opening-setup-dialog h2 { min-height: 44px; padding-block: 8px; }
  .opening-setup-dialog .opening-guide { margin-top: 4px; line-height: 1.3; }
  .opening-hand { min-height: 72px; margin-top: 7px; padding-block: 8px 10px; }
  .opening-options { margin-top: 8px; }
  .opening-option-row { min-height: 46px; padding-block: 5px; }
  .opening-setup-dialog .opening-summary { margin-top: 6px; }
  .opening-confirm { min-height: 51px; margin-top: 5px; }
}

/* ── 첫 실행 회원 가입 · 약관 · 내 정보 ─────────────────── */
.signup-setup { z-index: 70; padding: clamp(8px, 2.5cqw, 16px); background: rgba(3, 8, 6, .94); }
.account-panel { z-index: 68; }
.terms-detail { z-index: 76; }

.signup-dialog,
.account-dialog,
.terms-dialog {
  width: min(100%, 390px);
  max-height: calc(100% - 8px);
  overflow: auto;
  overscroll-behavior: contain;
  text-align: left;
}

.signup-dialog { padding: clamp(17px, 4.6cqw, 22px); }
.signup-dialog h2,
.account-dialog h2,
.terms-dialog h2 {
  margin: 4px 0 0;
  font-size: clamp(22px, 6.8cqw, 30px);
  letter-spacing: -.045em;
}

.signup-dialog .signup-lead {
  margin: 7px 0 0;
  color: var(--simple-muted);
  font-size: clamp(11px, 3cqw, 14px);
  line-height: 1.48;
}

.signup-field {
  display: grid;
  gap: 6px;
  margin-top: 15px;
}

.signup-field > span {
  color: #f6edda;
  font-size: clamp(11px, 3cqw, 13px);
  font-weight: 800;
}

.signup-field input {
  width: 100%;
  min-height: 47px;
  padding: 10px 12px;
  border: 1px solid var(--simple-line-strong);
  border-radius: 11px;
  color: var(--simple-text);
  background: rgba(0, 0, 0, .23);
  font: inherit;
  font-size: 16px;
  font-weight: 750;
  user-select: text;
  -webkit-user-select: text;
}

.signup-field input:focus {
  border-color: #dfc06f;
  outline: 2px solid rgba(223, 192, 111, .2);
  outline-offset: 1px;
}

.signup-field small { color: var(--simple-muted); font-size: 10px; }
.signup-field.is-invalid input { border-color: #d76d64; }

.member-id-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
  padding: 10px 11px;
  border: 1px solid var(--simple-line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .035);
}

.member-id-card small,
.member-id-card strong { display: block; }
.member-id-card small { color: var(--simple-muted); font-size: 9px; }
.member-id-card strong { margin-top: 2px; color: #f0d98f; font-size: clamp(14px, 4cqw, 17px); letter-spacing: .04em; }
.member-id-card button,
.agreement-row > button,
.account-term-links button {
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--simple-line);
  border-radius: 8px;
  color: #ede4d0;
  background: rgba(255, 255, 255, .055);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.signup-agreements { margin-top: 14px; }
.signup-agreements h3 { margin: 0 0 7px; color: #f5ead5; font-size: 12px; }
.agreement-all,
.agreement-row {
  display: flex;
  align-items: center;
  min-height: 38px;
}

.agreement-all {
  padding: 8px 10px;
  border: 1px solid rgba(224, 189, 106, .34);
  border-radius: 10px;
  color: #fff6df;
  background: rgba(224, 189, 106, .09);
  font-size: 12px;
  font-weight: 850;
}

.agreement-row {
  justify-content: space-between;
  gap: 8px;
  padding: 4px 5px 2px 10px;
  border-bottom: 1px solid rgba(242, 222, 169, .1);
}

.agreement-all,
.agreement-row label { cursor: pointer; }
.agreement-row label { display: flex; align-items: center; min-width: 0; color: #dfd8c8; font-size: clamp(10px, 2.8cqw, 12px); }
.agreement-row b { color: #e5c56d; font-weight: 850; }
.agreement-all input,
.agreement-row input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0 8px 0 0;
  accent-color: #2b8962;
}

.signup-status {
  min-height: 17px;
  margin: 9px 0 0 ;
  color: var(--simple-muted) ;
  font-size: 10px ;
  text-align: center;
}
.signup-status[data-tone="error"] { color: #ffaea8 ; }
.signup-status[data-tone="success"] { color: #9de4be ; }

.signup-confirm,
.account-save,
.terms-confirm {
  min-height: 49px;
  margin-top: 7px;
  border-radius: 11px;
  font-size: clamp(14px, 4cqw, 17px);
  font-weight: 850;
}

.signup-confirm:disabled {
  color: rgba(255, 255, 255, .48);
  background: #39443e;
  cursor: not-allowed;
}

.account-dialog,
.terms-dialog { padding: 20px 17px 17px; }
.account-summary { display: grid; gap: 7px; margin: 15px 0 0; }
.account-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .04);
}
.account-summary dt { color: var(--simple-muted); font-size: 10px; }
.account-summary dd { margin: 0; color: #f0d98f; font-size: 12px; font-weight: 800; }
.account-name-field { margin-top: 11px; }
.account-character-button {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 62px;
  margin-top: 11px;
  padding: 6px 11px 6px 6px;
  border: 1px solid var(--simple-line);
  border-radius: 12px;
  color: var(--simple-text);
  background: rgba(255, 255, 255, .04);
  text-align: left;
  cursor: pointer;
}
.account-character-button:hover,
.account-character-button:focus-visible { border-color: #d7bd78; background: rgba(224, 189, 106, .09); outline: none; }
.account-character-button img {
  display: block;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(255, 232, 174, .38);
  border-radius: 10px;
  object-fit: cover;
}
.account-character-button span,
.account-character-button strong,
.account-character-button small { display: block; }
.account-character-button strong { font-size: 12px; }
.account-character-button small { margin-top: 4px; color: var(--simple-muted); font-size: 10px; font-weight: 650; }
.account-character-button > b { color: #e0bd6a; font-size: 24px; line-height: 1; }
.account-term-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 13px; }
.account-delete {
  display: block;
  margin: 15px auto 0;
  padding: 7px 5px;
  border: 0;
  color: #d9aaa5;
  background: transparent;
  font-size: 10px;
  text-decoration: underline;
  cursor: pointer;
}

.terms-body { margin-top: 14px; color: #d9d2c3; }
.terms-body section + section { margin-top: 15px; }
.terms-body h3 { margin: 0 0 5px; color: #f0d98f; font-size: 13px; }
.terms-body p,
.terms-body li { color: #d0c8b8; font-size: 11px; line-height: 1.55; }
.terms-body p { margin: 0; }
.terms-body ul { margin: 6px 0 0; padding-left: 18px; }
.terms-body strong { color: #fff5dc; }
.terms-version { margin: 16px 0 0 ; color: #968e7e ; font-size: 9px ; text-align: center; }

/* 선택할 패의 외곽만 흐르게 한다. 패 자체의 좌표·회전에는 관여하지 않는다. */
@property --choice-led-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.game-artboard:not(.debug-layout) .game-card.match-choice {
  overflow: visible;
  animation: none;
  outline: none;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .32);
  filter: drop-shadow(0 0 3px rgba(255, 235, 184, .6));
}

.game-artboard:not(.debug-layout) .game-card.match-choice::after {
  content: "";
  position: absolute;
  inset: -5px;
  z-index: 2;
  padding: 3px;
  border-radius: 9px;
  pointer-events: none;
  background: conic-gradient(from var(--choice-led-angle),
    #ff526c, #ffbd45, #fff477, #61ee9b, #4bdfff, #7885ff, #e66bff, #ff526c);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: choiceLedOrbit 2.4s linear infinite;
}

@keyframes choiceLedOrbit {
  to { --choice-led-angle: 360deg; }
}

@media (prefers-reduced-motion: reduce) {
  .game-artboard:not(.debug-layout) .game-card.match-choice::after,
  .game-artboard:not(.debug-layout) .deck .bomb-draw-ring::before {
    animation: none;
  }
}

@media (max-height: 700px) {
  .signup-dialog { padding-block: 13px; }
  .signup-dialog .signup-lead { margin-top: 4px; line-height: 1.35; }
  .signup-field { margin-top: 10px; }
  .signup-field input { min-height: 42px; }
  .member-id-card { margin-top: 8px; padding-block: 7px; }
  .signup-agreements { margin-top: 9px; }
  .agreement-all,
  .agreement-row { min-height: 34px; }
  .signup-confirm { min-height: 44px; }
}

}
