:root {
  --bg: #102119;
  --bg-2: #183228;
  --cream: #f4ead8;
  --cream-2: #e7dcc4;
  --ink: #24180f;
  --gold: #e2b043;
  --gold-2: #8a6418;
  --line: rgba(244, 234, 216, 0.16);
  --panel: rgba(244, 234, 216, 0.12);
  --panel-dim: rgba(0, 0, 0, 0.25);
  --danger: #c4492c;
  --ok: #2f7d4a;
  --dock: #0c1b15;
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  --opp-h: calc(var(--card-h) + 24px);
  --opp-slot-h: calc(var(--opp-h) + 22px);
  --me-h: calc(var(--card-h) + 24px);
  --card-w: 72px;
  --card-h: 118px;
  --opp-card-w: 54px;
  --opp-card-h: 86px;
  --opp-fields-gap: 4px;
  --opp-head-h: 38px;
  color-scheme: dark;
}

.bgm-dock {
  position: fixed;
  z-index: 50;
  top: auto;
  bottom: calc(10px + env(safe-area-inset-bottom));
  right: 12px;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 8px;
}

#bgm-toggle, .bgm-toggle {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(12, 27, 21, 0.88);
  color: var(--cream);
  font-size: 22px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.bgm-panel {
  width: 196px;
  padding: 12px 14px 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(12, 27, 21, 0.94);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--cream);
}

.bgm-panel[hidden] { display: none; }

.bgm-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  font-weight: 700;
}

#bgm-volume-value {
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}

.bgm-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  margin: 0;
  padding: 0;
  flex: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

.bgm-range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(244, 234, 216, 0.22);
}

.bgm-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -8px;
  border: 0;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.bgm-range::-moz-range-track {
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: rgba(244, 234, 216, 0.22);
}

.bgm-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.bgm-toggle.muted {
  color: rgba(244, 234, 216, 0.55);
  background: rgba(12, 27, 21, 0.7);
}

.bgm-toggle:active { transform: scale(0.96); }

.lobby .top, .wait .top {
  padding-right: 0;
}

.wait .top {
  width: 100%;
  align-items: flex-start;
  justify-content: space-between;
}

.wait .top .top-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.wait .top .leave-btn {
  flex: none;
  margin-left: auto;
  align-self: flex-start;
}

* { box-sizing: border-box; }

body {
  display: block;
  margin: 0;
  font-family: "Apple SD Gothic Neo", "Noto Sans CJK KR", "Noto Sans KR", "Malgun Gothic", sans-serif;
  color: var(--cream);
  -webkit-tap-highlight-color: transparent;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(226, 176, 67, 0.16), transparent 50%),
    var(--bg);
  min-height: 100%;
  min-height: 100dvh;
}

html, body {
  margin: 0;
  height: auto;
  min-height: 100%;
  min-height: 100dvh;
}

button, input { font: inherit; }

button {
  touch-action: manipulation;
  cursor: pointer;
}

button:disabled { opacity: 0.45; cursor: default; }

#app {
  width: 100%;
  max-width: none;
  min-height: 100%;
  min-height: 100dvh;
  margin: 0 auto;
}

#fx, #toasts { pointer-events: none; }

.boot, .nick, .lobby, .wait, .shell {
  min-height: 100dvh;
}

.boot, .nick, .lobby, .wait {
  width: min(100%, 480px);
  margin: 0 auto;
}

.boot, .nick {
  display: flex;
  flex-direction: column;
  padding: calc(24px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
  gap: 14px;
}

.boot { justify-content: center; }

.boot .boot-hint {
  margin: 8px 0 0;
  font-size: 13px;
  text-align: center;
}
.nick { justify-content: center; text-align: center; align-items: center; }

.nick .eyebrow,
.nick h1 {
  width: 100%;
  text-align: center;
}

.nick .lead {
  width: 100%;
  text-align: center;
  margin-bottom: 2vh;
}

.nick-entry {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  flex: none;
}

.nick-entry #code {
  margin-bottom: 1vh;
}

.nick-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  flex: none;
}

.nick-actions .primary,
.nick-actions .ghost {
  flex: 1 1 0;
  min-height: 48px;
  height: 48px;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--gold);
}

h1, h2, p { margin: 0; }

h1 {
  font-size: 48px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.lead, .sub {
  color: rgba(244, 234, 216, 0.78);
  line-height: 1.45;
}

.fan {
  display: flex;
  justify-content: center;
  gap: 0;
  margin: 0;
  padding-top: 0;
}

.fan .card {
  width: calc(var(--card-w) * 1.8);
  min-width: calc(var(--card-w) * 1.8);
  max-width: calc(var(--card-w) * 1.8);
  height: calc(var(--card-h) * 1.8);
  min-height: calc(var(--card-h) * 1.8);
  max-height: calc(var(--card-h) * 1.8);
  transform: rotate(var(--tilt));
  margin: 0 -14px;
  border-radius: 16px;
}

.fan .card .total { font-size: 18px; }
.fan .card .card-name { font-size: 16px; }
.fan .card .emo { font-size: 42px; }
.fan .card .meter { font-size: 11px; }

.nick form, .join, .rename {
  display: flex;
  gap: 8px;
}

input {
  flex: 1;
  min-width: 0;
  height: 52px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream);
  padding: 0 14px;
  font-size: 16px;
}

.nick-entry input {
  flex: none;
  width: 100%;
  height: 48px;
  min-height: 48px;
  box-sizing: border-box;
  font-size: 16px;
}

.primary, .ghost, .danger {
  min-height: 48px;
  border-radius: 14px;
  border: 0;
  padding: 0 16px;
  font-weight: 700;
}

.primary { background: var(--gold); color: var(--ink); }
.ghost { background: transparent; color: var(--cream); border: 1px solid var(--line); }
.danger { background: var(--danger); color: white; }
.wide { width: 100%; }

.lobby, .wait {
  padding: calc(18px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lobby {
  justify-content: center;
}

.lobby .top {
  align-items: center;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.icon, .textish {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream);
  padding: 0 12px;
}

.icon { min-width: 44px; font-size: 18px; }

.room-list, .people { display: flex; flex-direction: column; gap: 8px; }

.room, .person {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--cream);
  border-radius: 16px;
  padding: 12px;
}

.room small, .person small, .muted { color: rgba(244, 234, 216, 0.62); }

.share-url {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--gold);
  overflow-wrap: anywhere;
}

.code-card {
  background: var(--cream);
  color: var(--ink);
  border-radius: 20px;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.code-card-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.code-card-main small {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(36, 24, 15, 0.55);
}

.code-card strong {
  font-size: 36px;
  letter-spacing: 0.12em;
  line-height: 1.05;
}

.code-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: none;
}

.code-act {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(36, 24, 15, 0.92);
  color: var(--cream);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(255, 248, 232, 0.08);
}

.code-act:hover {
  background: #1a120c;
}

.code-act:active {
  transform: scale(0.98);
}

.code-act[data-act="copy-link"] {
  background: color-mix(in srgb, var(--gold) 82%, #24180f);
  color: #1a1208;
}

.code-act[data-act="copy-link"]:hover {
  background: var(--gold);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: #86c98a;
  display: inline-block;
}

.dot.off { background: #a45a4a; }

.shell {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 420px at 50% -12%, rgba(226, 176, 67, 0.08), transparent 58%),
    linear-gradient(180deg, #0a1611 0%, #0c1a14 28%, #08110d 72%, #060c09 100%);
}

.shell.my-turn {
  box-shadow: inset 0 -3px 0 var(--gold);
}

.stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: calc(6px + env(safe-area-inset-top)) 8px 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  align-self: center;
  width: 100%;
  max-width: 1000px;
  box-sizing: border-box;
}

.stage > * {
  flex: 0 0 auto;
}

.stage > .table-block {
  flex: 0 0 auto;
  margin-top: 0;
}

.stage > .action-col,
.stage > .result {
  flex: 1 1 0;
  min-height: 0;
}

.stage > .me-block {
  flex: 0 0 auto;
  margin-top: auto;
}

.stage.lift { scroll-padding-bottom: 46vh; }

/* --- compact game chrome --- */
.action-col,
.log-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  width: 100%;
  justify-content: flex-start;
  min-height: 0;
}

.action-area-head,
.log-area-head {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  margin: 0;
  padding: 0;
  height: 18px;
  line-height: 1.1;
  width: 100%;
}

.last-log,
.action-banner {
  margin-top: 0;
  margin-bottom: 0;
  width: 100%;
  box-sizing: border-box;
  font-size: 12px;
  color: #2a2218;
  background:
    linear-gradient(180deg, rgba(255, 248, 232, 0.98), rgba(236, 220, 186, 0.96));
  border: 1px solid rgba(226, 176, 67, 0.55);
  border-radius: 12px;
  padding: 8px 10px;
  min-height: 0;
  line-height: 1.4;
  font-weight: 650;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 4px 14px rgba(0, 0, 0, 0.18);
}

.action-banner {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.action-panel {
  flex: 1 1 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  background: var(--panel);
  color: var(--cream);
  box-shadow: none;
}

.action-panel .action-space {
  flex: 1 1 0;
  min-height: 0;
  pointer-events: none;
}

.action-panel .action-space-top,
.action-panel .action-space-bottom {
  flex: 1 1 0;
}

.action-panel .action-copy {
  flex: none;
  width: 100%;
  text-align: center;
  z-index: 1;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  box-sizing: border-box;
}

.action-panel .action-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  box-sizing: border-box;
}

.action-panel .action-body .action-space {
  flex: 1 1 0;
  min-height: 0;
  pointer-events: none;
}

.action-panel .action-body .action-tools {
  position: absolute;
  right: 2px;
  bottom: 2px;
  display: flex;
  gap: 6px;
  z-index: 3;
}

.action-copy.compact {
  display: flex;
  width: 100%;
  padding: 8px 12px;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(244, 234, 216, 0.18);
  flex: none;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  font-weight: 400;
  min-height: 0;
}

.action-copy.compact .action-turn {
  width: auto;
  flex: none;
  display: inline-flex;
  justify-content: flex-start;
  align-items: center;
  font-size: 20px;
  font-weight: 400;
  gap: 8px;
  line-height: 1;
  margin: 0;
}

.action-copy.compact .turn-steps.compact {
  align-self: center;
  margin: 0;
}

.action-copy.compact .action-turn .turn-label-text {
  font-weight: 400;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.action-copy.compact .action-turn .name-badge {
  font-size: 0.72em;
  font-weight: 400;
  padding: 1px 7px;
  line-height: 1;
  height: auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.action-copy.compact .turn-steps.compact,
.action-copy.compact .turn-steps.compact li,
.action-copy.compact .turn-steps.compact .step-num,
.action-copy.compact .turn-steps.compact .step-label {
  font-weight: 400;
}

.action-panel > .action-hint,
.action-panel .action-body > .action-hint {
  margin: auto 0;
  padding: 8px 12px;
  text-align: center;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 650;
  color: rgba(244, 234, 216, 0.88);
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  align-self: center;
}

.action-panel .action-body > .action-hint .name-badge {
  margin: 0;
  vertical-align: middle;
}

.action-copy p {
  margin: 0;
  text-align: center;
}

.action-copy .action-turn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  font-size: 15px;
  line-height: 1;
  font-weight: 800;
  color: rgba(244, 234, 216, 0.96);
  box-sizing: border-box;
}

.action-copy .action-turn .turn-label-text {
  line-height: 1.15;
  font-size: 1em;
  font-weight: 800;
}

.action-copy .action-turn .name-badge {
  margin: 0;
  padding: 2px 8px;
  font-size: 1em;
  line-height: 1.15;
  vertical-align: unset;
}

.action-panel .action-controls {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  z-index: 2;
  margin: 0;
  padding: 0 12px;
  width: 100%;
}

.action-panel .action-tools {
  position: absolute;
  right: 2px;
  bottom: 2px;
  display: flex;
  gap: 6px;
  z-index: 3;
}

.action-panel.has-plant,
.action-panel.has-queue,
.action-panel.has-trade {
  gap: 8px;
  padding: 0 10px 10px;
}

.action-panel.has-plant .plant-board,
.action-panel.has-queue .queue.in-action {
  flex: none;
}

.action-panel.has-trade .trade-board {
  flex: 1 1 auto;
  min-height: 0;
  align-self: stretch;
  height: 100%;
}

.action-panel.has-plant .action-body {
  justify-content: center;
}

.action-panel.has-trade .action-body {
  justify-content: stretch;
  align-items: stretch;
}

.action-panel.has-trade .action-body > .action-space {
  flex: 0 0 0;
  min-height: 0;
  max-height: 0;
  overflow: hidden;
}

.plant-board.queue-plant .plant-board-row {
  height: auto;
  min-height: var(--card-h);
  align-items: center;
}

.plant-board.queue-plant .plant-slot-col {
  height: auto;
  min-height: var(--card-h);
}

.plant-board.queue-plant .plant-slots {
  height: auto;
  min-height: var(--card-h);
  flex-wrap: wrap;
  max-width: calc(var(--card-w) * 3 + 24px);
}

.plant-board.queue-plant .plant-slot .card {
  pointer-events: auto;
  cursor: pointer;
  overflow: hidden;
}

.plant-board.queue-plant .plant-slot.is-selected .card,
.plant-board.queue-plant .plant-slot .card.picked {
  outline: 2px solid #e2b043;
  box-shadow:
    0 0 0 2px rgba(226, 176, 67, 0.35),
    0 4px 10px rgba(201, 148, 32, 0.28);
}

.plant-board.queue-plant .plant-board-fields.is-waiting .plant-field {
  opacity: 0.45;
  filter: grayscale(0.15);
}

.plant-board.queue-plant .plant-board-fields.is-waiting .plant-field.pickable,
.plant-board.queue-plant .plant-board-fields.is-waiting button.plant-field {
  pointer-events: none;
  cursor: default;
}

.plant-board.queue-plant .plant-board-fields {
  height: auto;
  min-height: calc(var(--card-h) * 1.2);
  max-width: calc(var(--card-w) * 1.2 * 3 + 24px);
  flex-wrap: wrap;
}

.plant-board-fields {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  min-width: 0;
  height: auto;
  min-height: var(--card-h);
  max-width: calc(var(--card-w) * 1.2 * 3 + 24px);
}

.plant-board {
  flex: none;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 8px;
  width: 100%;
  box-sizing: border-box;
}

.plant-board-row {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: calc(var(--card-h) * 1.2);
  height: auto;
  width: 100%;
  box-sizing: border-box;
}

.plant-slot-col {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  flex: none;
  height: var(--card-h);
}

.plant-slots {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  height: var(--card-h);
}

.plant-board-arrow {
  flex: none;
  width: 28px;
  height: var(--card-h);
  font-size: 28px;
  font-weight: 800;
  color: rgba(244, 234, 216, 0.72);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plant-eye-row {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  min-height: 28px;
  width: max(var(--card-w), 120px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
}

.plant-eye-caption {
  margin: 0;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
  color: rgba(244, 234, 216, 0.68);
  text-align: center;
  white-space: nowrap;
}

.plant-slot {
  position: relative;
  display: block;
  width: var(--card-w);
  height: var(--card-h);
  flex: none;
  overflow: visible;
}

.plant-slot .slot-tag {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 4px);
  font-size: 11px;
  font-weight: 800;
  color: rgba(244, 234, 216, 0.78);
  letter-spacing: -0.02em;
  text-align: center;
  line-height: 1.1;
  white-space: nowrap;
}

.plant-slot .card,
.plant-slot-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: var(--card-w);
  height: var(--card-h);
  min-width: var(--card-w);
  max-width: var(--card-w);
  min-height: var(--card-h);
  max-height: var(--card-h);
  box-sizing: border-box;
}

.plant-slot .card {
  pointer-events: none;
  transform: none;
}

.plant-slot-face {
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.34);
  border: 1px dashed rgba(244, 234, 216, 0.28);
  color: rgba(244, 234, 216, 0.78);
  font-size: 13px;
  font-weight: 800;
}

.plant-slot-face.mystery {
  font-size: 34px;
  border-style: solid;
  border-color: rgba(244, 234, 216, 0.22);
  background:
    linear-gradient(165deg, rgba(48, 36, 24, 0.92), rgba(18, 12, 8, 0.95));
}

.plant-slot.is-done .plant-slot-face {
  border-style: solid;
  opacity: 0.72;
}

.plant-eye {
  width: 34px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(244, 234, 216, 0.28);
  background: rgba(0, 0, 0, 0.35);
  color: rgba(244, 234, 216, 0.55);
  font-size: 16px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  filter: grayscale(1);
  opacity: 0.7;
}

.plant-eye.on {
  color: #fff8e8;
  border-color: rgba(226, 176, 67, 0.85);
  background: color-mix(in srgb, var(--gold) 28%, rgba(0, 0, 0, 0.45));
  box-shadow: 0 0 0 2px rgba(226, 176, 67, 0.22);
  filter: none;
  opacity: 1;
}

.plant-eye-status {
  font-size: 11px;
  font-weight: 700;
  color: rgba(244, 234, 216, 0.7);
  text-align: center;
  line-height: 1.25;
  max-width: 120px;
}

.plant-field,
button.plant-field {
  position: relative;
  width: calc(var(--card-w) * 1.2);
  height: calc(var(--card-h) * 1.2);
  min-width: calc(var(--card-w) * 1.2);
  max-width: calc(var(--card-w) * 1.2);
  min-height: calc(var(--card-h) * 1.2);
  max-height: calc(var(--card-h) * 1.2);
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  overflow: hidden;
  color: inherit;
  cursor: default;
  box-sizing: border-box;
  flex: none;
}

.plant-field:has(.plant-field-empty),
button.plant-field:has(.plant-field-empty) {
  color: rgba(244, 234, 216, 0.45);
  background: transparent;
  border: 3px dashed rgba(244, 234, 216, 0.22);
  opacity: 0.55;
}

button.plant-field.pickable {
  cursor: pointer;
}

button.plant-field.pickable:has(.plant-field-empty) {
  opacity: 0.9;
  color: rgba(244, 234, 216, 0.88);
  border-color: rgba(226, 176, 67, 0.45);
}

button.plant-field.pickable:hover:has(.plant-field-empty) {
  border-color: rgba(244, 234, 216, 0.5);
}

button.plant-field.blocked {
  opacity: 0.55;
  cursor: not-allowed;
}

.plant-field .field-cover,
.plant-field .card.field-cover {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: none;
  max-height: none;
  pointer-events: none;
  box-sizing: border-box;
}

.plant-field-empty {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0;
  box-sizing: border-box;
  position: relative;
}

.plant-field-empty > b {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.15;
  margin: 0;
  text-align: center;
  color: inherit;
}

.plant-field .pick-note {
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 3px;
  z-index: 2;
  border-radius: 7px;
  padding: 3px 2px;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  background: rgba(16, 12, 8, 0.84);
  border: 1px solid rgba(255, 248, 232, 0.25);
  color: var(--cream);
  pointer-events: none;
}

.plant-field .pick-note.center {
  left: 50%;
  right: auto;
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
  width: max-content;
  min-width: 52px;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

.plant-field .plant-field-act {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 26%;
  bottom: 36%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  margin: auto 0;
  max-height: 40px;
  min-height: 34px;
  padding: 4px 3px;
  border-radius: 8px;
  line-height: 1.15;
  background: rgba(16, 12, 8, 0.82);
  border: 1px solid rgba(255, 248, 232, 0.28);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  color: var(--cream);
  pointer-events: none;
}

.plant-field .plant-field-act .act-title {
  font-size: 11px;
  font-weight: 800;
}

.plant-field .plant-field-act .act-sub {
  font-size: 10px;
  font-weight: 650;
  opacity: 0.9;
}

.plant-finish {
  position: absolute;
  top: 0;
  right: 0;
  height: var(--card-h);
  width: 33.333%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  box-sizing: border-box;
  z-index: 2;
  pointer-events: none;
}

.plant-finish > * {
  pointer-events: auto;
}

.plant-finish-btn {
  min-width: 160px;
  min-height: 40px;
  font-size: 15px;
  font-weight: 800;
}

.plant-finish-note {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  color: rgba(244, 234, 216, 0.78);
  text-align: center;
}

.trade-board {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  padding: 0;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(270px, 396px) minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 0;
  align-items: stretch;
}

.trade-inbox {
  grid-column: 1;
  grid-row: 1 / -1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  margin: 0;
  background: transparent;
  border: 0;
  border-right: 1px solid rgba(244, 234, 216, 0.22);
  border-radius: 0;
  height: 100%;
  min-height: 0;
  max-height: none;
  align-self: stretch;
  overflow: hidden;
  box-sizing: border-box;
}

.trade-inbox > .sheet-label,
.trade-inbox-head {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  margin: 0;
  padding: 0;
  height: 18px;
  line-height: 1.1;
  width: 100%;
}

.trade-inbox-head .area-badge {
  width: 100%;
}

.trade-inbox-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 2px 2px 2px 0;
}

.trade-inbox-item {
  display: grid;
  grid-template-columns: var(--inbox-name-w, 4em) minmax(0, 1fr) 48px;
  align-items: center;
  column-gap: 6px;
  row-gap: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  height: 30px;
  min-height: 30px;
  max-height: 30px;
  flex: none;
  overflow: hidden;
}

.trade-inbox-item.idle {
  opacity: 0.65;
}

.trade-inbox-body {
  min-width: 0;
  display: flex;
  align-items: center;
  align-self: stretch;
  overflow: hidden;
  padding-right: 4px;
  box-sizing: border-box;
}

.trade-inbox-idle {
  margin: 0;
  font-size: 11px;
  line-height: 1;
  width: 100%;
  text-align: left;
}

.trade-inbox-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 0;
  height: 100%;
}

.trade-inbox-name {
  flex: none;
  width: var(--inbox-name-w, 4em);
  min-width: var(--inbox-name-w, 4em);
  max-width: var(--inbox-name-w, 4em);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  align-self: center;
  line-height: 1;
  box-sizing: border-box;
}

.trade-inbox-name .name-badge {
  margin: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  justify-content: center;
  box-sizing: border-box;
  font-size: 10px;
  padding: 1px 6px;
  line-height: 1.2;
}

.trade-inbox-cards {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  align-self: center;
  gap: 3px;
  flex-wrap: nowrap;
  overflow: hidden;
  min-height: 0;
  height: 24px;
  padding: 0;
  box-sizing: border-box;
}

.trade-inbox-cards .tiles {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 2px;
  min-height: 0;
  height: 22px;
  overflow: hidden;
  padding-right: 0;
}

.trade-inbox-cards .tiles .tile.compact {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  border-radius: 5px;
}

.trade-inbox-cards .want-tile {
  position: relative;
  overflow: visible;
  margin-right: 2px;
}

.trade-board .trade-inbox .tile.want-tile,
.trade-inbox-cards .tile.want-tile {
  overflow: visible;
}

.trade-inbox-cards .want-count {
  position: absolute;
  top: -4px;
  right: -4px;
  z-index: 2;
  min-width: 12px;
  height: 12px;
  padding: 0 2px;
  border-radius: 999px;
  background: var(--gold, #e2b043);
  color: #1a120c;
  font-size: 8px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

.trade-inbox .trade-accept-btn,
.trade-inbox .trade-accept-btn.primary {
  flex: none;
  min-width: 44px;
  width: 44px;
  min-height: 22px;
  height: 22px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  align-self: center;
  border-radius: 8px;
}

.trade-inbox-tag {
  flex: none;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
  line-height: 1;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 22px;
}

.trade-board-core {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  align-self: stretch;
  padding: 0 8px;
  box-sizing: border-box;
  overflow: hidden;
}

.trade-board-core-head {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  margin: 0;
  padding: 0;
  height: 18px;
  line-height: 1.1;
  width: 100%;
}

.trade-board-core-head .area-badge {
  width: 100%;
}

.trade-board-mid {
  display: block;
  min-width: 0;
  width: 100%;
  flex: 1 1 auto;
}

.trade-board-main {
  width: auto;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
  padding: 0;
}

.trade-board-tip {
  margin: 0;
  margin-top: auto;
  flex: none;
  font-size: 12px;
  text-align: center;
  color: rgba(244, 234, 216, 0.72);
}

.trade-board .trade-heads {
  margin: 4px 0 4px;
  min-height: 32px;
}

.trade-board .trade-swap-row {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.trade-board .trade-grid {
  margin: 4px 0 0;
  gap: 8px;
}

.trade-board .trade-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: transparent;
  border: 0;
  padding: 0;
}

.trade-board .trade-side-hand {
  flex: 1 1 auto;
  min-width: 0;
}

.trade-board .trade-side-give {
  flex: 1 1 auto;
  min-width: 0;
}

.trade-board .trade-side-offer {
  flex: 0 1 280px;
  width: auto;
  max-width: 320px;
  min-width: 160px;
}

.trade-board .trade-side-offer .trade-side-head {
  justify-content: flex-end;
}

.trade-board .trade-side-offer .trade-slot .tiles,
.trade-board .trade-side-request .trade-slot .tiles,
.trade-board .trade-side-offer .trade-pool-tiles,
.trade-board .trade-side-request .trade-pool-tiles {
  justify-content: flex-end;
}


.trade-board .trade-side-request {
  flex: 0 1 280px;
  min-width: 160px;
  max-width: 320px;
}

.trade-board .trade-side-request .trade-side-head {
  justify-content: flex-end;
}

.trade-board .trade-side-label {
  font-size: 11px;
  font-weight: 650;
  color: rgba(244, 234, 216, 0.78);
  letter-spacing: 0.02em;
}

.trade-board .trade-slot {
  min-height: 40px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(244, 234, 216, 0.24);
  background:
    linear-gradient(180deg, rgba(244, 234, 216, 0.08), rgba(8, 6, 4, 0.28));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
  box-sizing: border-box;
}

.trade-board .trade-slot .tiles {
  min-height: 26px;
}

.trade-board .trade-slot-empty {
  font-size: 11px;
  line-height: 1.25;
  white-space: normal;
}

.trade-board .trade-pool {
  min-height: 26px;
}

.trade-board .trade-pool-split {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.trade-board .trade-pool-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  column-gap: 6px;
  min-width: 0;
}

.trade-board .trade-pool-label {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  color: rgba(244, 234, 216, 0.62);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.trade-board .trade-pool-tiles {
  opacity: 0.92;
}

.trade-board .trade-pool-tiles .ghost-tile,
.trade-board .want-tiles .ghost-tile {
  opacity: 0.42;
  filter: saturate(0.85);
}

.trade-board .trade-pool-tiles .ghost-tile:hover,
.trade-board .want-tiles .ghost-tile:hover {
  opacity: 0.72;
  filter: saturate(1);
}

.trade-board .want-tiles {
  justify-content: flex-end;
  gap: 4px;
}

.trade-board .want-tile {
  position: relative;
}

.trade-board .want-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--gold, #e2b043);
  color: #1a120c;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.trade-board .trade-side-head {
  display: flex;
  align-items: center;
  min-height: 22px;
  padding: 0;
  border-bottom: 0;
  box-sizing: border-box;
}

.trade-board .trade-side-badge {
  font-size: 11px;
  font-weight: 650;
  padding: 2px 8px;
  margin: 0;
}

.trade-board .trade-anyone-badge {
  --pc: #5c6570;
  color: #ffffff;
  background: #5c6570;
  border: 0;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22);
}

.trade-board .trade-swap-arrow {
  flex: none;
  align-self: flex-start;
  font-size: 18px;
  font-weight: 700;
  color: rgba(244, 234, 216, 0.7);
  line-height: 1;
  padding-top: 36px;
}

.trade-board .trade-swap-row.is-pending > .trade-side,
.trade-board .trade-swap-row.is-pending > .trade-swap-arrow {
  filter: brightness(0.45);
  opacity: 0.7;
  pointer-events: none;
}

.trade-swap-pending {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(8, 6, 4, 0.55);
  pointer-events: none;
}

.trade-swap-pending span {
  font-size: 15px;
  font-weight: 700;
  color: rgba(255, 248, 232, 0.95);
  letter-spacing: -0.01em;
}

.trade-board .sheet-label {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(244, 234, 216, 0.72);
}

.trade-board .tiles {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-height: 26px;
}

.trade-board .tile,
.trade-board .tile.compact,
.trade-board .tiles.compact .tile {
  width: 26px;
  height: 26px;
  min-width: 26px;
  max-width: 26px;
  border-radius: 6px;
  padding: 1px;
  box-sizing: border-box;
}

.trade-board .tile .tile-emo,
.trade-board .tile .emo,
.trade-board .tiles.compact .tile-emo {
  font-size: 11px;
}

.trade-board .tile.picked,
.trade-board .card.picked {
  outline: 2px solid #e2b043;
  box-shadow:
    0 0 0 2px rgba(226, 176, 67, 0.45),
    0 4px 10px rgba(201, 148, 32, 0.35);
  transform: translateY(-2px) scale(1.06);
  z-index: 3;
  filter: brightness(1.12);
}

.trade-board .muted {
  color: rgba(244, 234, 216, 0.55);
  font-size: 12px;
}

.trade-finish {
  position: static;
  top: auto;
  right: auto;
  bottom: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0;
  box-sizing: border-box;
  z-index: 2;
  pointer-events: none;
  flex: none;
  margin-top: auto;
}

.trade-finish-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.trade-finish > * {
  pointer-events: auto;
}

.trade-finish-btn {
  min-width: 140px;
  min-height: 40px;
  font-size: 15px;
  font-weight: 800;
}

.trade-finish-btn[data-act="end-trade"] {
  min-width: 160px;
}

.trade-finish-note {
  margin: 0;
  max-width: 100%;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
  color: rgba(244, 234, 216, 0.72);
  text-align: center;
}

.trade-history {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 8px;
  border-top: 1px solid rgba(244, 234, 216, 0.14);
}

.trade-history-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trade-history-msg {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: rgba(244, 234, 216, 0.88);
  text-align: center;
}

.trade-history-swap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.trade-history-arrow {
  font-size: 16px;
  font-weight: 800;
  color: rgba(244, 234, 216, 0.7);
}

@media (max-width: 1000px) {
  .trade-board {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
    align-content: start;
  }

  .trade-inbox {
    grid-column: 1;
    grid-row: 1;
    border-right: 0;
    border-bottom: 1px solid rgba(244, 234, 216, 0.22);
    padding: 4px 0 10px;
    margin: 0;
    height: auto;
    min-height: 0;
    max-height: min(32vh, 240px);
    align-self: start;
    overflow: hidden;
  }

  .trade-board-core {
    grid-column: 1;
    grid-row: 2;
    height: auto;
    min-height: 0;
    max-height: none;
    align-self: stretch;
    padding: 2px 0 0;
    overflow: visible;
  }

  .trade-finish-row {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .trade-finish-note {
    max-width: none;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .plant-board-arrow {
    font-size: 22px;
  }
}

.last-log {
  flex: none;
  text-align: left;
  cursor: pointer;
}

.last-log:hover,
.action-banner:hover {
  border-color: rgba(196, 148, 48, 0.75);
  background:
    linear-gradient(180deg, rgba(255, 250, 236, 1), rgba(240, 224, 188, 0.98));
}

.action-copy .action-hint {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 650;
  color: rgba(244, 234, 216, 0.82);
}

.action-controls .primary,
.action-controls .ghost {
  flex: 1 1 140px;
  max-width: 280px;
  min-height: 44px;
}

.action-controls .icon,
.action-tools .icon {
  flex: none;
}

.action-tools .trade-tool-btn {
  display: none;
}

.turn-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.action-copy .turn-steps.compact {
  width: auto;
  max-width: none;
  margin: 0;
  flex: none;
  justify-content: flex-end;
  gap: 2px;
}

.action-copy .turn-steps.compact li:not(.step-arrow) {
  flex: 0 1 auto;
  gap: 3px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(244, 234, 216, 0.08);
  color: rgba(244, 234, 216, 0.42);
  border: 1px solid transparent;
}

.action-copy .turn-steps.compact li.step-arrow {
  color: rgba(244, 234, 216, 0.35);
  font-size: 11px;
  padding: 0;
}

.action-copy .turn-steps.compact li.done {
  color: rgba(244, 234, 216, 0.7);
  border-color: rgba(244, 234, 216, 0.12);
  background: rgba(244, 234, 216, 0.1);
}

.action-copy .turn-steps.compact li.current {
  color: rgba(255, 248, 232, 0.98);
  background: rgba(226, 176, 67, 0.42);
  border-color: rgba(226, 176, 67, 0.55);
  box-shadow: none;
}

.action-copy .turn-steps.compact .step-num,
.action-copy .turn-steps.compact .step-label {
  font-size: 11px;
  line-height: 1.1;
  white-space: nowrap;
}

.turn-steps li:not(.step-arrow) {
  flex: 1 1 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 2px;
  border-radius: 999px;
  background: rgba(42, 34, 24, 0.06);
  color: rgba(42, 34, 24, 0.38);
  border: 1px solid transparent;
  text-align: center;
  white-space: nowrap;
  min-width: 0;
}

.turn-steps li.step-arrow {
  flex: none;
  color: rgba(168, 120, 36, 0.72);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  padding: 0 1px;
}

.turn-steps li.done {
  color: rgba(42, 34, 24, 0.72);
  border-color: rgba(42, 34, 24, 0.12);
  background: rgba(42, 34, 24, 0.08);
}

.turn-steps li.current {
  color: #1a120c;
  background: rgba(226, 176, 67, 0.9);
  border-color: rgba(226, 176, 67, 0.95);
  font-weight: 800;
  box-shadow: 0 0 0 1px rgba(226, 176, 67, 0.25);
}

.step-num {
  width: auto;
  height: auto;
  border-radius: 0;
  display: inline;
  font-size: 11px;
  font-weight: 800;
  background: transparent;
  padding: 0;
}

.turn-steps li.current .step-num { background: transparent; }
.step-label { font-size: 11px; line-height: 1.1; }

.bean-badge, .name-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  vertical-align: baseline;
  margin: 0 2px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.bean-badge {
  background: var(--bean, var(--gold));
  color: var(--ink, var(--bg));
}

.name-badge {
  background: var(--pc, #a67c16);
  color: #ffffff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22);
}

.opps-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.opps-area-head {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  margin: 0;
  padding: 0;
  height: 18px;
  line-height: 1.1;
  width: 100%;
}

.table-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 auto;
}

.opps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  overflow: visible;
  padding-bottom: 0;
}

.opps.fixed-quarter {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.opps.fixed-quarter > .opp-slot {
  width: 100%;
  height: var(--opp-slot-h);
  min-height: var(--opp-slot-h);
  max-height: var(--opp-slot-h);
}

.opp-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  height: var(--opp-slot-h);
  min-height: var(--opp-slot-h);
  max-height: var(--opp-slot-h);
  box-sizing: border-box;
}

.opp-head {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  align-items: center;
  flex-wrap: nowrap;
  flex: none;
  margin: 0;
  padding: 4px 6px;
  min-height: 22px;
  height: auto;
  line-height: 1.1;
  border-bottom: 1px solid rgba(244, 234, 216, 0.18);
  box-sizing: border-box;
}

.opp-head .opp-name {
  font-size: 12px;
  line-height: 1;
  margin: 0;
  padding-left: 2px;
  font-weight: 700;
}

.opp-head .opp-name .name-badge {
  padding: 0 5px;
  font-size: 11px;
  line-height: 1.3;
}

.opp-meta {
  display: none;
}

.opp {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  min-width: 0;
  position: relative;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: none;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  box-shadow: inset 3px 0 0 var(--pc, transparent);
}

.opp-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  padding: 6px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.opp-slot.live,
.opp-slot.need {
  border-radius: 14px;
  padding: 4px;
  box-sizing: border-box;
}

.opp-slot.live {
  border: 2px solid rgba(226, 176, 67, 0.72);
  box-shadow: inset 0 0 0 1px rgba(226, 176, 67, 0.35);
  background: transparent;
}

.opp-slot.need {
  border: 1px solid #f0a04b;
  box-shadow: inset 0 0 0 1px rgba(240, 160, 75, 0.35);
  background: color-mix(in srgb, var(--pc, #000) 10%, rgba(0, 0, 0, 0.34));
}

.opp-slot.need > .opp {
  filter: brightness(0.62);
}

.plant-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  pointer-events: none;
  background: rgba(8, 6, 4, 0.42);
}

.plant-overlay-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  justify-content: center;
}

.plant-overlay-label {
  font-size: 13px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: rgba(244, 234, 216, 0.96);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.plant-overlay-label .plant-dots::after {
  content: ".";
  animation: plant-dots 1.5s infinite;
}

@keyframes plant-dots {
  0%, 33.32% { content: "."; }
  33.33%, 66.65% { content: ".."; }
  66.66%, 100% { content: "..."; }
}

.opp-slot.live > .opp,
.opp-slot.need > .opp {
  border-color: var(--line);
  box-shadow: inset 3px 0 0 var(--pc, transparent);
  background: var(--panel);
}

.shell.my-turn .me-block.live {
  border-radius: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
}

.shell.my-turn .me-block.live .me-panel {
  border-color: var(--line);
  box-shadow: inset 3px 0 0 var(--pc, transparent);
  background: var(--panel);
}

.shell.my-turn .me-block.live .hand-panel {
  border-color: var(--line);
  box-shadow: none;
  background: var(--panel);
}

.shell.my-turn .me-block.live > .me-area-head .area-badge {
  color: rgba(244, 234, 216, 0.55);
  border-color: rgba(244, 234, 216, 0.12);
  background: rgba(244, 234, 216, 0.08);
}

.shell.my-turn .action-panel.live,
.action-panel.has-trade.live {
  border: 2px solid rgba(226, 176, 67, 0.55);
  box-shadow: inset 0 0 0 1px rgba(226, 176, 67, 0.32);
  background: transparent;
}

.action-panel.has-plant .plant-slot .card,
.action-panel.has-plant .plant-slot .card.front {
  outline: none;
  box-shadow: none;
  transform: none;
}

.action-panel.has-plant .plant-board.queue-plant .plant-slot.is-selected .card,
.action-panel.has-plant .plant-board.queue-plant .plant-slot .card.picked {
  outline: 2px solid #e2b043;
  box-shadow:
    0 0 0 2px rgba(226, 176, 67, 0.35),
    0 4px 10px rgba(201, 148, 32, 0.28);
}

.action-panel.has-plant button.plant-field.pickable:has(.plant-field-empty) {
  opacity: 0.95;
  color: rgba(244, 234, 216, 0.92);
  border-color: rgba(226, 176, 67, 0.55);
  box-shadow: 0 0 0 1px rgba(226, 176, 67, 0.28);
}

.action-panel.has-plant button.plant-field.pickable:hover:has(.plant-field-empty) {
  border-color: rgba(226, 176, 67, 0.85);
  box-shadow: 0 0 0 2px rgba(226, 176, 67, 0.35);
}

.action-panel.has-plant .plant-field .pick-note {
  border-color: rgba(255, 248, 232, 0.2);
  background: rgba(16, 12, 8, 0.78);
}

.opp header, .row {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  align-items: center;
  flex-wrap: nowrap;
}

.hand-inline {
  font-size: 11px;
  line-height: 1;
  letter-spacing: -0.04em;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: rgba(244, 234, 216, 0.88);
}

.hand-inline .hand-icons {
  letter-spacing: -0.12em;
}

.hand-inline .hand-count-empty,
.hand-inline .hand-offline {
  letter-spacing: 0;
  opacity: 0.7;
}

.opp-coins,
.coin-line {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  white-space: nowrap;
  color: rgba(244, 234, 216, 0.92);
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  height: auto;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.02em;
  box-sizing: border-box;
  color: rgba(244, 234, 216, 0.78);
  background: rgba(244, 234, 216, 0.12);
  border: 1px solid rgba(244, 234, 216, 0.18);
  white-space: nowrap;
}

.rank-badge .rank-crown {
  display: inline-flex;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

.rank-badge .rank-crown-1 {
  font-size: 12px;
  transform: translateY(-0.5px);
}

.rank-badge .rank-crown-2 {
  font-size: 9px;
  opacity: 0.92;
  transform: translateY(-0.5px);
}

.rank-badge .rank-label {
  font-variant-numeric: tabular-nums;
}

.rank-badge.rank-1 {
  min-width: 0;
  height: auto;
  font-size: 9px;
  padding: 2px 7px 2px 5px;
  color: #1a1208;
  background: linear-gradient(180deg, #ffe08a 0%, #e2b043 55%, #c49220 100%);
  border-color: rgba(226, 176, 67, 0.85);
  box-shadow: 0 0 8px rgba(226, 176, 67, 0.4);
}

.rank-badge.rank-2 {
  min-width: 0;
  height: auto;
  font-size: 9px;
  color: #1c1c1c;
  background: linear-gradient(180deg, #f5f5f5 0%, #c8c8c8 100%);
  border-color: rgba(220, 220, 220, 0.7);
  box-shadow: 0 0 5px rgba(220, 220, 220, 0.25);
}

.rank-badge.rank-3 {
  min-width: 0;
  height: auto;
  font-size: 9px;
  color: #2a1a0c;
  background: linear-gradient(180deg, #e8c4a0 0%, #b07848 100%);
  border-color: rgba(176, 120, 72, 0.7);
  box-shadow: 0 0 4px rgba(176, 120, 72, 0.25);
}

.rank-badge.rank-low {
  opacity: 0.78;
}

.opp-coins {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  flex: none;
  white-space: nowrap;
  color: rgba(244, 234, 216, 0.92);
}

.coin-line {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.coin-ico {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #fff3c4 0%, #f0d060 35%, #d4a017 70%, #a67c00 100%);
  border: 1px solid #7a5a12;
  box-shadow: inset 0 0 0 1px rgba(255, 245, 180, 0.45);
  flex: none;
}

.opp-fields {
  display: grid;
  grid-template-columns: repeat(3, var(--card-w));
  gap: 6px;
  margin-top: 0;
  justify-content: center;
  align-content: center;
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
  max-width: 100%;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 0;
}

.opp-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: var(--card-w);
  height: var(--card-h);
  min-width: var(--card-w);
  max-width: var(--card-w);
  min-height: var(--card-h);
  max-height: var(--card-h);
  padding: 0;
  border-radius: 10px;
  --soil: #7a5330;
  --soil-deep: #4a3018;
  color: #f4ead8;
  background: linear-gradient(165deg, #9a6b3e 0%, var(--soil) 48%, var(--soil-deep) 100%);
  border: 3px dashed #5c3a1c;
  box-shadow: none;
  text-align: center;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
}

.opp-field.empty,
.opp-field.locked {
  color: rgba(244, 234, 216, 0.45);
  background: transparent;
  border: 3px dashed rgba(244, 234, 216, 0.22);
  gap: 4px;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0.55;
  font-size: 12px;
  font-weight: 800;
}

.opp-field.locked {
  color: rgba(244, 234, 216, 0.38);
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(244, 234, 216, 0.18);
  opacity: 1;
}

.opp-field.empty > b,
.opp-field.locked > b {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;
  margin: 0;
  padding: 0;
}

.opp-field.planted {
  border: 0;
  background: transparent;
  overflow: visible;
}

.opp-field .field-cover {
  position: absolute;
  inset: 0;
  width: var(--card-w);
  height: var(--card-h);
  min-width: var(--card-w);
  max-width: var(--card-w);
  min-height: var(--card-h);
  max-height: var(--card-h);
  pointer-events: none;
  box-sizing: border-box;
}

.reveal-row { margin-top: 4px; }

.plant-badge {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(165deg, color-mix(in srgb, var(--bean) 70%, #1a120c), color-mix(in srgb, var(--bean) 55%, #000));
  color: #fff8f0;
  font-size: 14px;
  overflow: hidden;
  position: relative;
}

.plant-badge.has-art {
  background:
    linear-gradient(165deg, color-mix(in srgb, var(--bean) 70%, #1a120c), color-mix(in srgb, var(--bean) 55%, #000));
}

.plant-badge.hot {
  outline: 2px solid var(--gold);
  box-shadow: 0 0 0 2px rgba(226, 176, 67, 0.25);
}

.pills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

.pill {
  background: var(--bean);
  color: var(--ink);
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 700;
}

.pill.empty { background: transparent; color: var(--cream); border: 1px dashed var(--line); }

.pop {
  position: absolute;
  right: 6px;
  top: -8px;
  font-size: 18px;
}

.market {
  display: flex;
  gap: 6px;
  align-items: stretch;
}

.board-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
  gap: 6px;
  align-items: stretch;
  min-height: var(--opp-slot-h);
}

.side-opps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  grid-column: auto;
  height: var(--opp-slot-h);
}

.market-slot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  height: var(--opp-slot-h);
  min-height: var(--opp-slot-h);
  max-height: var(--opp-slot-h);
  box-sizing: border-box;
}

.market-head {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  margin: 0;
  padding: 0;
  height: 18px;
  line-height: 1.1;
  width: 100%;
}

.area-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: rgba(244, 234, 216, 0.55);
  background: rgba(244, 234, 216, 0.08);
  border: 1px solid rgba(244, 234, 216, 0.12);
  box-sizing: border-box;
  text-align: center;
}

.board-row > .market-slot > .market-panel {
  flex: 1 1 auto;
  width: 100%;
  height: var(--opp-h);
  min-height: var(--opp-h);
  max-height: var(--opp-h);
  box-sizing: border-box;
  padding: 6px;
}

.side-opps > .opp-slot {
  flex: none;
  width: 100%;
}

.opp-slot.ghost-slot .opp-head {
  visibility: hidden;
  border-bottom-color: transparent;
}

.opp-slot.ghost-slot .opp,
.opp-slot.ghost-slot .ghost-panel {
  border: 1px dashed rgba(244, 234, 216, 0.28);
  background: rgba(0, 0, 0, 0.28);
  box-shadow: none;
  pointer-events: none;
  height: 100%;
  min-height: 0;
  max-height: none;
  border-radius: 12px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.opp-slot.ghost-slot .ghost-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.opp-slot.ghost-slot .ghost-empty-label {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: rgba(244, 234, 216, 0.42);
}

.market-panel, .fields-panel, .me-panel, .hand-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.market-panel {
  background: var(--panel-dim);
}

.market-panel,
.fields-panel {
  padding: 6px;
}

.market-panel {
  padding-left: 10px;
  padding-right: 10px;
}

.me-panel,
.hand-panel {
  padding: 0;
}

.me-panel {
  position: relative;
  overflow: hidden;
  box-shadow: inset 3px 0 0 var(--pc, transparent);
}

.me-panel.need {
  background: color-mix(in srgb, var(--gold) 8%, rgba(0, 0, 0, 0.34));
}

.me-panel.need > .me-body > .fields {
  filter: brightness(0.62);
}

.fields-panel h3, .me-panel h3, .hand-panel h3 {
  margin: 0;
  font-size: 11px;
  color: rgba(244, 234, 216, 0.72);
}

.market-panel {
  display: grid;
  grid-template-columns: var(--card-w) minmax(0, 1fr) var(--card-w);
  gap: 6px;
  align-items: center;
  justify-items: center;
}

.market-offer-row {
  min-width: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.market-offer-label {
  display: none;
}

.market-panel .offer.cards {
  justify-content: center;
  align-content: center;
  align-items: center;
  flex-wrap: nowrap;
  overflow: hidden;
  min-height: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  gap: 6px;
}

.market-panel .offer .card,
.market-panel .offer .offer-ghost {
  width: var(--card-w);
  min-width: var(--card-w);
  max-width: var(--card-w);
  min-height: var(--card-h);
  height: var(--card-h);
  max-height: var(--card-h);
  padding: 8px;
  box-sizing: border-box;
}

.market-panel .offer .offer-ghost {
  border: 1px dashed rgba(244, 234, 216, 0.32);
  background: transparent;
  box-shadow: none;
  border-radius: 14px;
  pointer-events: none;
  color: inherit;
}

.market-panel .offer .card-name { font-size: 13px; margin-top: 0; }
.market-panel .offer .emo { font-size: 28px; }
.market-panel .offer .meter { padding-top: 2px; gap: 1px; }
.market-panel .offer .meter-row { font-size: 9px; }
.market-panel .offer .meter-vals { gap: 3px; }

.market-panel > .pile {
  width: var(--card-w);
  min-width: var(--card-w);
  max-width: var(--card-w);
  height: var(--card-h);
  min-height: var(--card-h);
  max-height: var(--card-h);
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 4px;
  box-sizing: border-box;
  border-radius: 14px;
}

.market-panel > .pile b {
  font-size: 22px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.market-panel > .pile span {
  font-size: 12px;
  color: rgba(244, 234, 216, 0.78);
}

.me-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  width: 100%;
}

.me-area-head {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  margin: 0;
  padding: 0;
  height: 18px;
  line-height: 1.1;
  width: 100%;
}

.me-row {
  display: grid;
  grid-template-columns: calc((100% - 12px) / 4) minmax(0, 1fr);
  gap: 6px;
  align-items: stretch;
  width: 100%;
}

.me-col, .hand-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
}

.me-col {
  width: 100%;
}

.me-panel > .hand-head,
.hand-panel > .hand-head {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  align-items: center;
  flex-wrap: nowrap;
  flex: none;
  margin: 0;
  padding: 4px 6px;
  min-height: 22px;
  height: auto;
  line-height: 1.1;
  border-bottom: 1px solid rgba(244, 234, 216, 0.18);
  box-sizing: border-box;
}

.me-panel > .hand-head h3,
.hand-panel > .hand-head h3 {
  margin: 0;
  line-height: 1;
  font-size: 12px;
}

.me-body,
.hand-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 6px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.hand-body .hand .card,
.hand-panel .hand .card {
  pointer-events: none;
  cursor: default;
}

.me-panel,
.hand-panel {
  display: flex;
  flex-direction: column;
  height: var(--opp-slot-h);
  min-height: var(--opp-slot-h);
  max-height: var(--opp-slot-h);
  box-sizing: border-box;
  flex: none;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.me-panel .fields {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}

.me-panel .fields > .field,
.me-panel .fields > .field.buy {
  flex: none;
  width: var(--card-w);
  min-width: var(--card-w);
  max-width: var(--card-w);
  height: var(--card-h);
  min-height: var(--card-h);
  max-height: var(--card-h);
}

.hand-body .hand,
.hand-panel .hand {
  flex: 1 1 auto;
  align-content: center;
  min-height: 0;
}

.hand-pager {
  display: flex;
  align-items: stretch;
  gap: 4px;
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
}

.hand-pager > .hand {
  flex: 1 1 auto;
  min-width: 0;
}

.hand-page-btn {
  display: none;
  flex: none;
  align-self: center;
  width: 28px;
  height: 70%;
  min-height: 36px;
  max-height: 72px;
  margin: 0;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(244, 234, 216, 0.1);
  color: rgba(244, 234, 216, 0.9);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.hand-page-btn:disabled {
  opacity: 0.28;
  cursor: default;
}

.hand-pager.is-overflow > .hand-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.piles { display: flex; flex-direction: column; gap: 6px; width: 86px; flex: none; }

.pile {
  flex: 1;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 8px;
  min-height: 64px;
}

.market-panel > .pile {
  background: rgba(0, 0, 0, 0.32);
}

.pile b { font-size: 20px; font-variant-numeric: tabular-nums; }
.pile span { font-size: 11px; color: rgba(244, 234, 216, 0.7); }

.offer {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow: visible;
  align-items: center;
}

.empty-note {
  flex: 1;
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 12px;
  color: rgba(244, 234, 216, 0.75);
  font-size: 13px;
  line-height: 1.4;
}

.stage h3, .hand-head h3 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: rgba(244, 234, 216, 0.72);
}

.me-panel > .hand-head h3 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  padding-left: 2px;
}

.me-panel > .hand-head .name-badge {
  font-size: 11px;
  padding: 2px 8px;
}

.sheet .cards { margin: 6px 0 10px; }

.cards, .hand {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow: visible;
  padding: 2px 2px 8px;
}

.cards.mini .card {
  width: 58px;
  min-height: 92px;
  padding: 6px;
}

.card {
  position: relative;
  flex: 0 0 auto;
  width: var(--card-w);
  min-width: var(--card-w);
  max-width: var(--card-w);
  min-height: var(--card-h);
  height: var(--card-h);
  max-height: var(--card-h);
  border: 0;
  border-radius: 14px;
  padding: 6px 6px 8px;
  --card-ink: #fff8f0;
  color: var(--card-ink);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0.12) 40%, rgba(0, 0, 0, 0.38) 100%),
    linear-gradient(165deg, color-mix(in srgb, var(--bean) 72%, #1a120c) 0%, color-mix(in srgb, var(--bean) 82%, #0d0906) 55%, color-mix(in srgb, var(--bean) 55%, #000) 100%);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-sizing: border-box;
  overflow: hidden;
}

.card.field-cover {
  overflow: visible;
}

.card.has-art {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.1) 38%, rgba(0, 0, 0, 0.4) 100%),
    linear-gradient(165deg, color-mix(in srgb, var(--bean) 72%, #1a120c) 0%, color-mix(in srgb, var(--bean) 82%, #0d0906) 55%, color-mix(in srgb, var(--bean) 55%, #000) 100%);
}

.card-bg {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  width: 78%;
  height: 52%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  z-index: 0;
  user-select: none;
  -webkit-user-drag: none;
}

.tile > .card-bg,
.plant-badge > .card-bg {
  top: 45%;
  width: 82%;
  height: 70%;
}

.card .total,
.card .card-name,
.card .meter,
.card .meter-row,
.card .meter-vals,
.card .meter-ico {
  color: var(--card-ink);
}

.card.front { outline: 3px solid var(--gold); }
.card.picked { transform: translateY(-6px); outline: 3px solid #fff6d8; }
.card.locked { opacity: 0.55; }
.card.revealed {
  outline: 3px solid var(--gold);
  box-shadow:
    0 0 0 2px rgba(226, 176, 67, 0.55),
    0 6px 14px rgba(226, 176, 67, 0.28);
  transform: translateY(-6px);
}
.card.picked.revealed {
  outline: 3px solid var(--gold);
  box-shadow:
    0 0 0 2px rgba(226, 176, 67, 0.65),
    0 6px 14px rgba(226, 176, 67, 0.35);
}

.total, .emo, .emo-space, .card-name, .meter, .tag, .stack-badge { pointer-events: none; }

.total {
  position: relative;
  z-index: 1;
  font-size: 14px;
  font-weight: normal;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  opacity: 0.95;
  align-self: center;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0) 100%);
  width: 100%;
}

.stack-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  z-index: 3;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #1a120c;
  background: #f0d060;
  border: 2px solid #fff8f0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.field-count {
  display: none;
}

.emo {
  display: block;
  margin-top: 5px;
  font-size: 30px;
  line-height: 1;
}

.emo-space {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-height: 36px;
}

img.emo.art,
img.art {
  width: 36px;
  height: 36px;
  object-fit: contain;
  margin-top: 5px;
  display: block;
}

.tile-emo.art,
img.tile-emo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.bean-art.art,
img.bean-art {
  width: 14px;
  height: 14px;
  object-fit: contain;
  vertical-align: -2px;
  display: inline-block;
  margin: 0;
}

.plant-art.art,
img.plant-art {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}

.card-name {
  margin-top: 5px;
  font-size: 10px;
  font-weight: normal;
  line-height: 1.15;
  text-align: center;
  z-index: 1;
  padding: 2px 0;
  width: calc(100% + 12px);
  max-width: none;
  margin-left: -6px;
  margin-right: -6px;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 0;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.55) 22%,
    rgba(0, 0, 0, 0.55) 78%,
    rgba(0, 0, 0, 0) 100%
  );
  transform: translateY(-10%);
}

.card.has-art .card-name {
  margin-top: 0;
}

.meter {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin-top: auto;
  padding-top: 1px;
  width: 100%;
  z-index: 1;
}

.meter-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 9px;
  line-height: 1.1;
  font-weight: 800;
}

.meter-ico,
.meter-coin {
  flex: none;
  width: 11px;
  height: 11px;
  text-align: center;
  font-size: 10px;
  line-height: 1;
}

.meter-coin.coin-ico {
  width: 10px;
  height: 10px;
}

.meter-vals {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.meter-vals span {
  min-width: 0.85em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.tag {
  align-self: center;
  margin-top: 4px;
  background: rgba(36, 24, 15, 0.88);
  color: var(--cream);
  border-radius: 999px;
  padding: 2px 5px;
  font-size: 10px;
  font-style: normal;
}

.fields { display: flex; gap: 6px; flex-wrap: wrap; }

.field {
  flex: none;
  width: var(--card-w);
  min-width: var(--card-w);
  max-width: var(--card-w);
  height: var(--card-h);
  min-height: var(--card-h);
  max-height: var(--card-h);
  border-radius: 10px;
  padding: 6px 5px;
  --soil: #7a5330;
  --soil-deep: #4a3018;
  color: #f4ead8;
  background: linear-gradient(165deg, #9a6b3e 0%, var(--soil) 48%, var(--soil-deep) 100%);
  border: 3px dashed #5c3a1c;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
}

.field.planted {
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.field.empty, .field.buy {
  color: rgba(244, 234, 216, 0.45);
  background: transparent;
  border: 3px dashed rgba(244, 234, 216, 0.22);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0;
  opacity: 0.55;
  position: relative;
}

.field.buy {
  color: rgba(244, 234, 216, 0.38);
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(244, 234, 216, 0.18);
  opacity: 1;
  cursor: pointer;
}

.field.buy:disabled {
  cursor: not-allowed;
  color: rgba(244, 234, 216, 0.38);
  border: 1px solid rgba(244, 234, 216, 0.18);
}

.field.buy:not(:disabled) {
  color: rgba(244, 234, 216, 0.92);
  border: 1px solid rgba(226, 176, 67, 0.55);
}

.field.buy:not(:disabled):hover {
  border-color: rgba(226, 176, 67, 0.85);
  color: rgba(244, 234, 216, 0.98);
}

.field.empty > b,
.field.buy > b {
  font-size: 14px;
  line-height: 1.15;
  margin: 0;
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
}

.field.buy > .buy-inline {
  display: none;
}

.field.buy > b {
  top: calc(50% - 10px);
}

.field.empty > .gold,
.field.buy > .gold {
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 8px;
  font-size: 10px;
  margin: 0;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
}

.field.buy > .gold {
  top: calc(50% + 8px);
  bottom: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
}

.field.buy > .gold .coin-ico {
  width: 11px;
  height: 11px;
}

.field.empty .field-actions,
.field.buy .field-actions {
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 3px;
  margin: 0;
  z-index: 3;
}

.field.blocked {
  outline: 2px solid rgba(196, 73, 44, 0.85);
}

.field-cover {
  position: absolute;
  inset: 0;
  width: var(--card-w);
  height: var(--card-h);
  min-width: var(--card-w);
  max-width: var(--card-w);
  min-height: var(--card-h);
  max-height: var(--card-h);
  z-index: 1;
  pointer-events: none;
}

.field-x, .card-x {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 900;
  color: rgba(196, 73, 44, 0.92);
  text-shadow: 0 1px 0 #fff;
  pointer-events: none;
  z-index: 2;
}

.total-chip {
  font-style: normal;
  font-size: 10px;
  opacity: 0.75;
}

.queue.hot h3 { color: var(--gold); }
.queue.hot .card { outline: 2px solid var(--gold); }

.queue.in-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 4px 8px 2px;
  box-sizing: border-box;
}

.queue.in-action h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.queue.in-action .cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.field .count { font-size: 18px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.field .gold { font-size: 10px; opacity: 0.85; line-height: 1.2; }
.field-name { font-size: 11px; font-weight: 800; line-height: 1.15; }
.field.empty b, .field.buy b { font-size: 14px; }
.field-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  z-index: 3;
}

.field.planted .field-actions {
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 3px;
  margin: 0;
}

.field.planted .field-actions.on-art {
  top: 26%;
  bottom: 36%;
  left: 6px;
  right: 6px;
  justify-content: center;
  pointer-events: none;
}

.field.planted .field-actions.on-art button {
  pointer-events: auto;
  min-height: 26px;
  font-size: 10px;
  padding: 3px 4px;
  border-radius: 8px;
  background: rgba(16, 12, 8, 0.82);
  border: 1px solid rgba(255, 248, 232, 0.28);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

.field-act.harvest-only {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1.15;
  min-height: 34px;
  padding: 4px 3px;
}

.field-act.harvest-only .act-title {
  font-size: 11px;
  font-weight: 800;
}

.field-act.harvest-only .act-sub {
  font-size: 9px;
  font-weight: 650;
  opacity: 0.88;
}

.field-actions button, .sheet button.choice {
  min-height: 28px;
  border: 0;
  border-radius: 8px;
  background: rgba(36, 24, 15, 0.88);
  color: var(--cream);
  font-size: 10px;
  font-weight: 700;
  padding: 4px;
}

.field.empty .field-actions button,
.field.buy .field-actions button { color: var(--cream); }

.hand-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hand-head p { font-size: 12px; margin: 0; }
.hand-head .muted {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dock {
  flex: none;
  width: 100%;
  max-width: none;
  background: var(--dock);
  border-top: 1px solid var(--line);
  padding: 8px 64px calc(10px + env(safe-area-inset-bottom)) 12px;
  box-sizing: border-box;
}

.dock-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}
.dock-row .primary, .dock-row .ghost { flex: 1; min-width: 120px; }

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 19;
  background: rgba(8, 16, 12, 0.62);
}

.sheet {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100vw, 100%);
  max-height: min(52vh, 460px);
  overflow: auto;
  background: var(--cream);
  color: var(--ink);
  border-radius: 20px 20px 0 0;
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom));
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.35);
}

.sheet.trade-modal {
  left: 50%;
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
  width: min(920px, calc(100vw - 24px));
  max-height: min(86vh, 740px);
  border-radius: 20px;
  padding: 16px 16px 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.sheet.confirm-modal {
  left: 50%;
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
  width: min(360px, calc(100vw - 40px));
  max-height: none;
  overflow: visible;
  border-radius: 16px;
  padding: 16px 16px 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  text-align: center;
}

.sheet.confirm-modal h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.sheet.confirm-modal p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.sheet.confirm-modal .sheet-actions {
  margin-top: 14px;
}

.sheet.confirm-modal .sheet-actions button {
  min-height: 42px;
  font-size: 14px;
}

.trade-progress-msg {
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  margin: 8px 0 12px !important;
}

.trade-swap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin: 12px 0 14px;
}

.trade-swap-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trade-swap-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.trade-swap-side .tiles {
  justify-content: center;
  min-height: 48px;
}

.trade-swap-arrow {
  align-self: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  padding-top: 18px;
}

@media (max-width: 640px) {
  .trade-swap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .trade-swap-arrow {
    padding-top: 0;
    transform: rotate(90deg);
  }
}

.trade-target-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.trade-target-row .sheet-label {
  margin: 0;
  flex: none;
}

.trade-target-row .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.trade-heads {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 10px 0 6px;
  min-height: 36px;
}

.trade-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 36px;
}

.trade-head .chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.trade-head .chip {
  pointer-events: auto;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  line-height: 1;
  margin: 0;
}

.trade-head-me {
  justify-content: flex-end;
}

.trade-head-me .chip {
  pointer-events: none;
}

.trade-modal .tile {
  width: 50px;
  height: 50px;
}

.trade-modal .tile.picked,
.trade-modal .card.picked {
  outline: 3px solid #e2b043;
  box-shadow:
    0 0 0 3px rgba(226, 176, 67, 0.45),
    0 10px 22px rgba(201, 148, 32, 0.42);
  transform: translateY(-6px) scale(1.08);
  z-index: 3;
  filter: brightness(1.12);
}

.trade-modal .tiles {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trade-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin: 10px 0 8px;
}

.trade-col {
  min-width: 0;
  background: rgba(36, 24, 15, 0.05);
  border: 1px solid rgba(36, 24, 15, 0.1);
  border-radius: 14px;
  padding: 10px;
}

.trade-col .sheet-label:first-child {
  margin-top: 0;
}

.want-tiles .tile {
  position: relative;
}

.want-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--gold);
  color: #1a120c;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

@media (max-width: 720px) {
  .trade-grid,
  .trade-heads {
    grid-template-columns: 1fr;
  }

  .trade-head-me {
    justify-content: flex-start;
  }
}

.grab {
  width: 42px;
  height: 4px;
  border-radius: 99px;
  background: rgba(36, 24, 15, 0.2);
  margin: 2px auto 10px;
}

.sheet h3 { margin: 0 0 6px; font-size: 18px; }
.sheet p { line-height: 1.4; font-size: 14px; }
.sheet .muted { color: rgba(36, 24, 15, 0.62); }

.chips, .emoji-grid { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }

.chip {
  border: 1px solid rgba(36, 24, 15, 0.16);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  min-height: 36px;
  padding: 0 10px;
  font-weight: 700;
}

.chip.on, .person.on { background: var(--ink); color: var(--cream); }

.emoji-grid button {
  width: 52px;
  height: 48px;
  border-radius: 12px;
  border: 0;
  background: rgba(36, 24, 15, 0.06);
  font-size: 26px;
}

.sheet-actions { display: flex; gap: 8px; margin-top: 10px; }
.sheet-actions button { flex: 1; min-height: 52px; font-size: 16px; }
.sheet .ghost {
  background: rgba(36, 24, 15, 0.08);
  color: var(--ink);
  border: 2px solid rgba(36, 24, 15, 0.35);
}
.sheet .ghost.reject {
  background: #fff;
  color: var(--danger);
  border: 2px solid var(--danger);
  font-weight: 800;
}
.sheet .primary { border: 2px solid transparent; }

.rules { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.rules b { display: block; }

.log-list { display: flex; flex-direction: column; gap: 6px; padding: 0; margin: 0; list-style: none; }
.log-list li { font-size: 13px; line-height: 1.35; }

.discard-list { display: flex; flex-direction: column; gap: 6px; }
.discard-list div { display: flex; justify-content: space-between; font-weight: 700; }

.result {
  background: var(--cream);
  color: var(--ink);
  border-radius: 18px;
  padding: 14px;
}

.result ol { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.result li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  background: rgba(36, 24, 15, 0.05);
}
.result li.win { background: #f3d48a; }
.result strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.result small { grid-column: 2 / -1; color: rgba(36, 24, 15, 0.65); }

#toasts {
  position: fixed;
  z-index: 40;
  left: 50%;
  top: calc(10px + env(safe-area-inset-top));
  transform: translateX(-50%);
  width: min(92%, 440px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toast {
  background: #3a241c;
  color: var(--cream);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  overflow: hidden;
}

.toast.ok {
  background: #1f6b45;
  color: #eef8f0;
  border: 1px solid rgba(170, 230, 190, 0.35);
}

.float-emo {
  position: fixed;
  z-index: 35;
  bottom: 22%;
  transform: translateX(-50%);
  animation: floatup 2.3s ease-out forwards;
  text-align: center;
}

.float-emo b { display: block; font-size: 46px; font-weight: 400; }
.float-emo small { background: rgba(16, 33, 25, 0.8); border-radius: 999px; padding: 2px 8px; }

@keyframes floatup {
  to { transform: translate(-50%, -90px); opacity: 0; }
}

@media (min-width: 481px) {
  body { align-items: stretch; }
  #app { box-shadow: none; }
}

.tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
}

.tile-name {
  position: relative;
  z-index: 1;
}

.tile {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background:
    linear-gradient(165deg, color-mix(in srgb, var(--bean) 70%, #1a120c), color-mix(in srgb, var(--bean) 55%, #000));
  color: #fff8f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tile.has-art {
  background:
    linear-gradient(165deg, color-mix(in srgb, var(--bean) 70%, #1a120c), color-mix(in srgb, var(--bean) 55%, #000));
  position: relative;
}

.tile.named {
  width: auto;
  min-width: 52px;
  height: 48px;
  padding: 4px 6px;
}

.tile.compact, .tiles.compact .tile {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  box-shadow: none;
}

.tile.picked {
  outline: 2px solid #fff6d8;
  transform: translateY(-2px);
}

.tile-emo { font-size: 18px; line-height: 1; }
.tile.compact .tile-emo, .tiles.compact .tile-emo { font-size: 14px; }
.tile-name {
  font-size: 9px;
  font-weight: 800;
  line-height: 1.1;
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reveal-pick {
  border: 1px solid color-mix(in srgb, var(--pc, var(--line)) 50%, transparent);
  border-radius: 10px;
  padding: 6px;
  margin-bottom: 6px;
  background: color-mix(in srgb, var(--pc, #000) 10%, transparent);
}

.reveal-pick-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.textish.tiny {
  min-height: 28px;
  font-size: 11px;
  padding: 0 8px;
}

.textish.tiny.on {
  background: var(--ink);
  color: var(--cream);
}

.sheet.compact { max-height: min(62vh, 520px); }
.sheet-label {
  margin: 8px 0 4px;
  font-size: 12px;
  font-weight: 800;
}

.chip[style*="--pc"] {
  border-color: color-mix(in srgb, var(--pc) 45%, transparent);
  background: color-mix(in srgb, var(--pc) 18%, transparent);
}

.chip.on[style*="--pc"] {
  background: var(--pc);
  color: #ffffff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}


.dock {
  padding: 6px 56px calc(8px + env(safe-area-inset-bottom)) 8px;
}

.bgm-dock {
  bottom: calc(8px + env(safe-area-inset-bottom));
  right: 8px;
}

#bgm-toggle, .bgm-toggle {
  width: 40px;
  height: 40px;
  font-size: 18px;
}

/* ≤1000: 모바일 반응형 전부 적용 */
@media (max-width: 1000px) {
  :root {
    --card-w: 64px;
    --card-h: 104px;
    --opp-fields-gap: 3px;
    --opp-head-h: 28px;
    --opp-strip-h: 44px;
    --opp-h: calc(var(--opp-strip-h) * 3 + var(--opp-fields-gap) * 2 + 10px);
    --opp-slot-h: calc(var(--opp-h) + var(--opp-head-h) + 2px);
    --hand-card-h: calc(var(--opp-slot-h) - var(--opp-head-h) - 10px);
    --hand-card-w: calc(var(--hand-card-h) * var(--card-w) / var(--card-h));
    --plant-card-h: calc(var(--hand-card-h) * 1.5);
    --plant-card-w: calc(var(--hand-card-w) * 1.5);
  }

  .stage {
    padding-left: 6px;
    padding-right: 6px;
    gap: 5px;
  }

  .rank-badge {
    display: none;
  }

  .action-copy.compact {
    flex-wrap: nowrap;
    gap: 8px;
    row-gap: 6px;
    overflow-x: auto;
  }

  .action-copy.compact .action-turn {
    font-size: 17px;
    flex: none;
  }

  .action-copy .turn-steps.compact {
    flex-wrap: nowrap;
    justify-content: flex-start;
    max-width: none;
    overflow-x: auto;
  }

  /* 공용 영역 = 플레이어 영역 가로 2배 고정 */
  .board-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
    gap: 5px;
  }

  .opps.fixed-quarter {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .opp-head {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    padding: 3px 5px;
    min-height: var(--opp-head-h);
    height: var(--opp-head-h);
  }

  .opp-head .opp-name {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
  }

  .opp-head .opp-name .name-badge {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    font-size: 10px;
    padding: 0 4px;
  }

  .opp-head .hand-inline,
  .opp-head .opp-coins-wide {
    display: none;
  }

  .opp-meta {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    width: auto;
    flex: none;
    min-width: 0;
  }

  .opp-meta .opp-hand,
  .opp-meta .opp-coins {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin: 0;
    line-height: 1;
    white-space: nowrap;
    min-width: 0;
  }

  .opp-meta .opp-hand {
    justify-content: flex-start;
    font-size: 10px;
    font-weight: 700;
    color: rgba(244, 234, 216, 0.82);
  }

  .opp-meta .opp-coins {
    justify-content: flex-end;
    font-size: 11px;
    font-weight: 800;
    color: rgba(244, 234, 216, 0.95);
  }

  .opp-body {
    padding: 4px;
  }

  .opp-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: var(--opp-fields-gap);
    width: 100%;
    height: 100%;
    justify-items: stretch;
    align-content: stretch;
    overflow: hidden;
  }

  .opp-field {
    width: 100%;
    height: 100%;
    min-width: 0;
    max-width: none;
    min-height: 0;
    max-height: none;
    border-radius: 8px;
    border-width: 2px;
    flex-direction: row;
  }

  .opp-field.empty,
  .opp-field.locked {
    border-width: 2px;
    font-size: 11px;
    gap: 0;
    flex-direction: row;
  }

  .opp-field.empty > b,
  .opp-field.locked > b {
    font-size: 11px;
    line-height: 1.1;
    padding: 0 4px;
  }

  .opp-field.planted {
    overflow: hidden;
    position: relative;
  }

  .opp-field .field-cover,
  .opp-field .card.field-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 0;
    max-width: none;
    min-height: 0;
    max-height: none;
    border-radius: 8px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    padding: 2px 6px 2px 4px;
    box-sizing: border-box;
    box-shadow: none;
  }

  .opp-field .field-cover .card-bg {
    left: 40%;
    top: 50%;
    right: auto;
    bottom: auto;
    width: 36%;
    height: 84%;
    transform: translate(-50%, -50%);
    object-fit: contain;
    object-position: center;
    border-radius: 4px;
    filter: brightness(0.88);
  }

  .opp-field .field-cover .card-name,
  .opp-field .field-cover .total,
  .opp-field .field-cover .emo-space,
  .opp-field .field-cover .emo,
  .opp-field .field-cover .art {
    display: none;
  }

  .opp-field .field-cover .stack-badge {
    display: none;
  }

  .opp-field .field-cover .field-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    order: 1;
    top: auto;
    right: auto;
    left: auto;
    font-size: 12px;
    font-weight: 800;
    padding: 1px 6px;
    margin: 0;
    flex: none;
    min-width: 0;
    height: auto;
    border-radius: 6px;
    color: #1a120c;
    background: #f0d060;
    border: 1px solid #fff8f0;
    box-shadow: none;
  }

  .opp-field .field-cover .meter {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    order: 2;
    z-index: 1;
    margin: 0 0 0 auto;
    padding: 2px 5px;
    gap: 1px;
    width: auto;
    max-width: 68%;
    transform: none;
    border-radius: 6px;
    background: rgba(8, 6, 4, 0.62);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    color: #fff8f0;
  }

  .opp-field .field-cover .meter,
  .opp-field .field-cover .meter-row,
  .opp-field .field-cover .meter-vals,
  .opp-field .field-cover .meter-vals span,
  .opp-field .field-cover .meter-ico {
    color: #fff8f0;
  }

  .opp-field .field-cover .meter-row {
    justify-content: flex-end;
    font-size: 9px;
    gap: 2px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.55);
  }

  .opp-field .field-cover .meter-vals {
    gap: 2px;
  }

  .opp-field .field-cover .meter-ico,
  .opp-field .field-cover .meter-coin {
    width: 9px;
    height: 9px;
    font-size: 9px;
  }

  /* 내 프로필 = 상대 플레이어 슬롯과 동일 비율(전체의 1/4) */
  .me-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
    gap: 5px;
    align-items: stretch;
  }

  .me-panel {
    overflow: hidden;
    box-shadow: inset 3px 0 0 var(--pc, transparent);
  }

  .me-panel,
  .hand-panel {
    height: var(--opp-slot-h);
    min-height: var(--opp-slot-h);
    max-height: var(--opp-slot-h);
  }

  .me-panel > .hand-head,
  .hand-panel > .hand-head {
    min-height: var(--opp-head-h);
    height: var(--opp-head-h);
    padding: 3px 6px;
    flex-wrap: nowrap;
  }

  .hand-panel > .hand-head .muted {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .me-body {
    padding: 4px;
  }

  .me-panel .fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: var(--opp-fields-gap);
    width: 100%;
    height: 100%;
    overflow: hidden;
    flex-wrap: nowrap;
    align-content: stretch;
    justify-content: stretch;
  }

  .me-panel .fields > .field,
  .me-panel .fields > .field.buy {
    width: 100%;
    height: 100%;
    min-width: 0;
    max-width: none;
    min-height: 0;
    max-height: none;
    border-radius: 8px;
    border-width: 2px;
    padding: 2px 6px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
  }

  .me-panel .fields > .field.empty,
  .me-panel .fields > .field.buy {
    font-size: 11px;
  }

  .me-panel .fields > .field.empty > b,
  .me-panel .fields > .field.buy > b {
    font-size: 11px;
    line-height: 1.1;
  }

  .me-panel .fields > .field.buy > .gold {
    font-size: 10px;
  }

  .me-panel .fields > .field.planted {
    padding: 0;
    overflow: hidden;
  }

  .me-panel .fields > .field .field-cover,
  .me-panel .fields > .field .card.field-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 0;
    max-width: none;
    min-height: 0;
    max-height: none;
    border-radius: 8px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    padding: 2px 6px 2px 4px;
    box-sizing: border-box;
    box-shadow: none;
  }

  .me-panel .fields > .field .field-cover .card-bg {
    left: 40%;
    top: 50%;
    right: auto;
    bottom: auto;
    width: 36%;
    height: 84%;
    transform: translate(-50%, -50%);
    object-fit: contain;
    object-position: center;
    border-radius: 4px;
    filter: brightness(0.88);
  }

  .me-panel .fields > .field .field-cover .emo-space,
  .me-panel .fields > .field .field-cover .emo,
  .me-panel .fields > .field .field-cover .art,
  .me-panel .fields > .field .field-cover .card-name,
  .me-panel .fields > .field .field-cover .total {
    display: none;
  }

  .me-panel .fields > .field .field-cover .stack-badge {
    display: none;
  }

  .me-panel .fields > .field .field-cover .field-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    order: 1;
    top: auto;
    right: auto;
    left: auto;
    margin: 0;
    font-size: 12px;
    font-weight: 800;
    padding: 1px 6px;
    flex: none;
    min-width: 0;
    height: auto;
    border-radius: 6px;
    color: #1a120c;
    background: #f0d060;
    border: 1px solid #fff8f0;
    box-shadow: none;
  }

  .me-panel .fields > .field .field-cover .meter {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    order: 2;
    z-index: 1;
    margin: 0 0 0 auto;
    padding: 2px 5px;
    gap: 1px;
    width: auto;
    max-width: 68%;
    transform: none;
    border-radius: 6px;
    background: rgba(8, 6, 4, 0.62);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    color: #fff8f0;
  }

  .me-panel .fields > .field .field-cover .meter,
  .me-panel .fields > .field .field-cover .meter-row,
  .me-panel .fields > .field .field-cover .meter-vals,
  .me-panel .fields > .field .field-cover .meter-vals span,
  .me-panel .fields > .field .field-cover .meter-ico {
    color: #fff8f0;
  }

  .me-panel .fields > .field .field-cover .meter-row {
    justify-content: flex-end;
    font-size: 9px;
    gap: 2px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.55);
  }

  .me-panel .fields > .field .field-cover .meter-vals {
    gap: 2px;
  }

  .me-panel .fields > .field .field-cover .meter-ico,
  .me-panel .fields > .field .field-cover .meter-coin {
    width: 9px;
    height: 9px;
    font-size: 9px;
  }

  .me-panel .fields > .field.buy {
    justify-content: center;
    padding: 2px 8px;
  }

  .me-panel .fields > .field.buy > b,
  .me-panel .fields > .field.buy > .gold {
    display: none;
  }

  .me-panel .fields > .field.buy > .buy-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: static;
    transform: none;
    width: 100%;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
  }

  .me-panel .fields > .field.buy > .buy-inline .coin-ico {
    width: 11px;
    height: 11px;
  }

  .me-panel .fields > .field .field-actions {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    padding: 2px 4px;
    pointer-events: none;
  }

  .me-panel .fields > .field .field-actions button {
    pointer-events: auto;
    min-height: 22px;
    font-size: 9px;
    padding: 2px 5px;
  }

  .trade-board .trade-swap-row {
    align-items: flex-start;
  }

  .trade-board .trade-swap-arrow {
    padding-top: 0;
    margin-top: calc(22px + 6px);
    align-self: flex-start;
    min-height: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 16px;
  }

  /* 손패: 높이 고정 + 비율로 가로 통일 + 페이징 */
  .hand-body {
    padding: 4px;
    min-height: 0;
  }

  .hand-pager {
    gap: 3px;
  }

  .hand-page-btn {
    width: 24px;
    font-size: 18px;
  }

  .hand-body .hand,
  .hand-panel .hand,
  .hand-pager > .hand {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    align-content: center;
    gap: 6px;
    height: 100%;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .hand-body .hand::-webkit-scrollbar,
  .hand-pager > .hand::-webkit-scrollbar {
    display: none;
  }

  .hand-body .hand .card,
  .hand-panel .hand .card,
  .hand-pager > .hand .card {
    height: var(--hand-card-h);
    width: var(--hand-card-w);
    flex: 0 0 var(--hand-card-w);
    min-width: var(--hand-card-w);
    max-width: var(--hand-card-w);
    min-height: var(--hand-card-h);
    max-height: var(--hand-card-h);
    aspect-ratio: auto;
  }

  /* 심기 보드: 한 줄 + 손패 대비 카드 1.5배 */
  .plant-board-row {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--plant-card-h);
    height: auto;
    overflow: visible;
  }

  .plant-board.queue-plant .plant-board-row,
  .plant-board .plant-board-row {
    flex-direction: row;
  }

  .plant-slot-col {
    height: var(--plant-card-h);
    min-height: var(--plant-card-h);
    width: auto;
    flex: none;
  }

  .plant-slots,
  .plant-board.queue-plant .plant-slots {
    display: flex;
    flex-wrap: nowrap;
    height: var(--plant-card-h);
    min-height: var(--plant-card-h);
    width: auto;
    max-width: none;
    gap: 6px;
  }

  .plant-slot {
    width: var(--plant-card-w);
    height: var(--plant-card-h);
    min-width: var(--plant-card-w);
    max-width: var(--plant-card-w);
    min-height: var(--plant-card-h);
    max-height: var(--plant-card-h);
    flex: 0 0 var(--plant-card-w);
    overflow: visible;
  }

  .plant-board-arrow {
    height: var(--plant-card-h);
    width: 22px;
    font-size: 22px;
    transform: none;
    flex: none;
  }

  .plant-board-fields,
  .plant-board.queue-plant .plant-board-fields {
    display: flex;
    flex-wrap: nowrap;
    height: var(--plant-card-h);
    min-height: var(--plant-card-h);
    width: auto;
    max-width: none;
    gap: 6px;
    overflow: visible;
    flex: none;
  }

  .plant-slot .card,
  .plant-slot .card.front,
  .plant-slot-face,
  .plant-field,
  button.plant-field {
    width: var(--plant-card-w);
    height: var(--plant-card-h);
    min-width: var(--plant-card-w);
    max-width: var(--plant-card-w);
    min-height: var(--plant-card-h);
    max-height: var(--plant-card-h);
    flex: 0 0 var(--plant-card-w);
    border-radius: 10px;
  }

  .plant-field .field-cover,
  .plant-field .card.field-cover {
    width: 100%;
    height: 100%;
    min-width: 0;
    max-width: none;
    min-height: 0;
    max-height: none;
  }

  .plant-eye-row {
    width: max(var(--plant-card-w), 140px);
  }

  /* 공용: 오퍼 2장 + 덱/버림 1줄, 크기는 상대 밭 스트립과 동일 */
  .market-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "offer deck discard";
    gap: var(--opp-fields-gap);
    align-items: center;
    justify-items: stretch;
    width: 100%;
    padding: 4px 6px;
    box-sizing: border-box;
  }

  .market-panel > .pile:first-of-type {
    grid-area: deck;
  }

  .market-panel > .pile:last-of-type {
    grid-area: discard;
  }

  .market-panel > .market-offer-row {
    grid-area: offer;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
    height: var(--opp-strip-h);
    min-height: var(--opp-strip-h);
    max-height: var(--opp-strip-h);
  }

  .market-offer-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 3.6em;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: rgba(244, 234, 216, 0.72);
    text-align: center;
    white-space: pre-line;
  }

  .market-panel > .pile {
    width: auto;
    min-width: 4.2em;
    max-width: none;
    height: var(--opp-strip-h);
    min-height: var(--opp-strip-h);
    max-height: var(--opp-strip-h);
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 8px;
  }

  .market-panel > .pile b {
    font-size: 14px;
  }

  .market-panel > .pile span {
    font-size: 10px;
  }

  .market-panel .offer.cards {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: var(--opp-fields-gap);
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: none;
    height: 100%;
    min-height: 0;
    max-height: none;
    overflow: hidden;
  }

  .market-panel .offer .card,
  .market-panel .offer .offer-ghost {
    width: auto;
    min-width: 0;
    max-width: none;
    height: 100%;
    min-height: 0;
    max-height: none;
    flex: 1 1 0;
    border-radius: 8px;
    border-width: 2px;
    padding: 2px 6px 2px 4px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    box-sizing: border-box;
  }

  .market-panel .offer .card .emo-space,
  .market-panel .offer .card .emo,
  .market-panel .offer .card .art,
  .market-panel .offer .card .card-name {
    display: none;
  }

  .market-panel .offer .card .total {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    order: 1;
    width: auto;
    margin: 0;
    padding: 1px 6px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    border-radius: 6px;
    color: #1a120c;
    background: #f0d060;
    border: 1px solid #fff8f0;
  }

  .market-panel .offer .card .card-bg {
    left: 40%;
    top: 50%;
    width: 34%;
    height: 86%;
    transform: translate(-50%, -50%);
    object-fit: contain;
    object-position: center;
    border-radius: 4px;
    filter: brightness(0.88);
  }

  .market-panel .offer .card .meter {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    order: 2;
    z-index: 1;
    margin: 0 0 0 auto;
    padding: 2px 4px;
    gap: 1px;
    width: auto;
    min-width: 4.8em;
    border-radius: 6px;
    background: rgba(8, 6, 4, 0.62);
  }

  .market-panel .offer .card .meter-row {
    display: grid;
    grid-template-columns: 11px minmax(0, 1fr);
    align-items: center;
    column-gap: 3px;
    width: 100%;
    justify-content: stretch;
  }

  .market-panel .offer .card .meter-vals {
    display: flex;
    justify-content: flex-end;
    gap: 2px;
    min-width: 0;
  }

  .market-panel .offer .card .meter-vals span {
    min-width: 0.85em;
    text-align: center;
    font-variant-numeric: tabular-nums;
  }

  .market-panel .offer .offer-ghost {
    border: 2px dashed rgba(244, 234, 216, 0.22);
    background: transparent;
    opacity: 0.55;
  }
}

@media (max-width: 768px) {
  :root {
    --card-w: 56px;
    --card-h: 90px;
    --opp-fields-gap: 2px;
    --opp-head-h: 20px;
    --opp-strip-h: 40px;
    --opp-h: calc(var(--opp-strip-h) * 3 + var(--opp-fields-gap) * 2 + 6px);
    --opp-slot-h: calc(var(--opp-h) + var(--opp-head-h));
    --hand-card-h: 78px;
    --hand-card-w: calc(var(--hand-card-h) * var(--card-w) / var(--card-h));
    --plant-card-h: calc(var(--hand-card-h) * 1.5);
    --plant-card-w: calc(var(--hand-card-w) * 1.5);
  }

  .stage {
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: 4px;
    padding-right: 4px;
    gap: 4px;
  }

  /* 카드: 장수(total)와 이름 사이 여백 제거 + 이름 숨김 + 점수 대비 */
  .card {
    padding: 2px 3px 3px;
    gap: 0;
  }

  .card .total {
    margin: 0;
    padding: 0;
    line-height: 1;
    font-size: 12px;
  }

  .card .emo-space {
    display: none;
    flex: none;
    min-height: 0;
    height: 0;
  }

  .card .emo {
    margin-top: 0;
    font-size: 18px;
  }

  .card .card-name {
    display: none;
  }

  .card .meter {
    margin-top: auto;
    margin-bottom: 0;
    padding: 2px 4px;
    gap: 1px;
    width: calc(100% + 6px);
    margin-left: -3px;
    margin-right: -3px;
    border-radius: 0 0 8px 8px;
    background: rgba(0, 0, 0, 0.72);
    box-sizing: border-box;
  }

  .card .meter,
  .card .meter-row,
  .card .meter-vals,
  .card .meter-vals span,
  .card .meter-ico {
    color: #fff8f0;
  }

  .card .meter-row {
    font-size: 8px;
    gap: 2px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.55);
  }

  .hand-pager > .hand .card .meter,
  .hand-body .hand .card .meter {
    width: 88%;
    max-width: 88%;
    margin: auto auto 4px;
    padding: 2px 4px;
    gap: 1px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.52);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  }

  .hand-pager > .hand .card .meter-row,
  .hand-body .hand .card .meter-row {
    font-size: 8px;
    gap: 2px;
    line-height: 1.1;
  }

  .hand-pager > .hand .card .meter-ico,
  .hand-pager > .hand .card .meter-coin,
  .hand-body .hand .card .meter-ico,
  .hand-body .hand .card .meter-coin {
    width: 9px;
    height: 9px;
    font-size: 9px;
  }

  .hand-pager > .hand .card .meter-vals,
  .hand-body .hand .card .meter-vals {
    gap: 3px;
  }

  .hand-pager > .hand .card .meter-vals span,
  .hand-body .hand .card .meter-vals span {
    min-width: 0.75em;
  }

  .hand-pager > .hand .card .card-bg,
  .hand-body .hand .card .card-bg {
    top: 38%;
    width: 86%;
    height: 62%;
  }

  .card .card-bg {
    top: 46%;
    width: 78%;
    height: 48%;
  }

  .plant-slot .card,
  .plant-slot .card.front,
  .hand-pager > .hand .card,
  .hand-body .hand .card,
  .market-panel .offer .card {
    padding: 2px 3px 3px;
  }

  .hand-body {
    padding: 0;
  }

  .hand-page-btn,
  .hand-pager.is-overflow > .hand-page-btn {
    display: none;
  }

  .hand-pager > .hand,
  .hand-body .hand {
    height: 100%;
    align-items: stretch;
    padding: 0;
  }

  .hand-pager > .hand .card,
  .hand-body .hand .card,
  .hand-panel .hand .card {
    height: 100%;
    width: auto;
    aspect-ratio: calc(var(--card-w) * 1.28) / var(--card-h);
    flex: 0 0 auto;
    min-width: 0;
    max-width: none;
    min-height: 0;
    max-height: none;
  }

  .market-head,
  .action-area-head,
  .me-area-head {
    display: none;
  }

  .opp-head {
    padding: 0 4px;
    gap: 2px;
    min-height: var(--opp-head-h);
    height: var(--opp-head-h);
    border-bottom: 0;
  }

  .opp-head b { font-size: 11px; }
  .opp-head .name-badge { font-size: 10px; }
  .opp-head .opp-name {
    padding-left: 0;
    margin: 0;
  }

  .opp-head .opp-name .name-badge {
    margin: 0;
    padding: 0 4px;
  }

  .opp-meta {
    gap: 3px;
  }

  .hand-inline { font-size: 10px; }
  .opp-coins { font-size: 10px; }

  .opp-meta .opp-hand { font-size: 10px; }
  .opp-meta .opp-coins { font-size: 11px; }

  .opp-body {
    padding: 2px;
  }

  .me-panel > .hand-head,
  .hand-panel > .hand-head {
    min-height: var(--opp-head-h);
    height: var(--opp-head-h);
    padding: 0 4px;
    border-bottom: 0;
  }

  .me-panel > .hand-head h3 {
    padding-left: 0;
    margin: 0;
  }

  .me-body,
  .hand-body {
    padding: 2px 4px;
  }

  .action-copy.compact {
    justify-content: space-between;
    gap: 8px;
  }

  .action-copy.compact .action-turn {
    font-size: 15px;
  }

  .action-copy.compact .turn-steps.compact {
    margin-left: auto;
    justify-content: flex-end;
    gap: 4px;
  }

  .action-copy .turn-steps.compact .step-label {
    display: none;
  }

  .action-copy .turn-steps.compact .step-num {
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
  }

  .action-copy .turn-steps.compact li:not(.step-arrow) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    min-width: 22px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(244, 234, 216, 0.18);
    background: rgba(244, 234, 216, 0.1);
    box-sizing: border-box;
  }

  .action-copy .turn-steps.compact li.done {
    border-radius: 999px;
    border-color: rgba(244, 234, 216, 0.28);
    background: rgba(244, 234, 216, 0.16);
  }

  .action-copy .turn-steps.compact li.current {
    border-radius: 999px;
    border-color: rgba(226, 176, 67, 0.7);
    background: rgba(226, 176, 67, 0.45);
    box-shadow: 0 0 0 1px rgba(226, 176, 67, 0.25);
  }

  .action-copy .turn-steps.compact li.step-arrow {
    padding: 0 1px;
    font-size: 11px;
  }

  .area-badge {
    font-size: 10px;
  }

  .trade-inbox-head,
  .trade-board-core-head {
    display: none;
  }

  /* 공용 1줄 레이아웃은 ≤1000 공통 규칙 유지, 덱/버림·오퍼 크기 조정 */
  .market-panel {
    gap: 4px;
    padding: 4px 6px;
    container-type: inline-size;
    container-name: market;
  }

  .market-panel > .pile {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0;
    width: var(--opp-strip-h);
    min-width: var(--opp-strip-h);
    max-width: var(--opp-strip-h);
    height: var(--opp-strip-h);
    min-height: var(--opp-strip-h);
    max-height: var(--opp-strip-h);
    padding: 1px 2px;
    line-height: 1.05;
    aspect-ratio: 1;
    box-sizing: border-box;
    border-radius: 8px;
  }

  .market-panel > .pile span {
    order: -1;
    font-size: 7px;
    font-weight: 700;
    line-height: 1.05;
    white-space: nowrap;
  }

  .market-panel > .pile b {
    font-size: 12px;
    line-height: 1.05;
  }

  .market-panel > .pile:first-of-type,
  .market-panel > .pile:last-of-type {
    min-width: var(--opp-strip-h);
    width: var(--opp-strip-h);
    padding: 1px 2px;
  }

  .market-offer-label {
    width: 2.8em;
    font-size: 9px;
  }

  .market-panel > .market-offer-row {
    gap: 4px;
  }

  .market-panel .offer.cards {
    flex: 0 1 auto;
    width: auto;
    max-width: none;
    gap: var(--opp-fields-gap);
  }

  /* 상대 밭(1/3 열)과 동일 폭: 마켓 전체폭 ÷ 3 − 패딩 */
  .market-panel .offer .card,
  .market-panel .offer .offer-ghost {
    flex: 0 0 calc((100cqi - 12px) / 3 - 8px);
    width: calc((100cqi - 12px) / 3 - 8px);
    min-width: 0;
    max-width: calc((100cqi - 12px) / 3 - 8px);
    height: var(--opp-strip-h);
    min-height: var(--opp-strip-h);
    max-height: var(--opp-strip-h);
  }

  .action-panel.has-trade .trade-board {
    padding-bottom: 8px;
  }

  .action-panel.has-trade .trade-finish {
    display: none;
  }

  .action-panel.has-trade .action-tools {
    left: 4px;
    right: 4px;
    bottom: 4px;
    z-index: 5;
    gap: 4px;
    justify-content: flex-end;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .action-tools .trade-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 36px;
    height: 36px;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    border-radius: 8px;
    flex: none;
  }

  .action-panel.has-trade .action-tools .icon {
    width: 36px;
    height: 36px;
    min-height: 36px;
    font-size: 16px;
  }

  .hand-panel > .hand-head .muted {
    font-size: 10px;
    max-width: 58%;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
  }

  .opp-field.empty > b,
  .opp-field.locked > b,
  .me-panel .fields > .field.empty > b,
  .me-panel .fields > .field.buy > b {
    font-size: 10px;
  }

  .me-panel .field-act.harvest-only {
    display: none;
  }

  /* 상대 3x2 → 공용 → (행동) → 내 프로필 → 손패 */
  .table-block {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    align-items: stretch;
  }

  .opps-wrap,
  .opps.fixed-quarter,
  .board-row,
  .side-opps {
    display: contents;
  }

  .opps-area-head {
    display: none;
  }

  .board-row > .side-opps:first-child > .opp-slot {
    order: 1;
  }

  .opps.fixed-quarter > .opp-slot:nth-child(1) { order: 2; }
  .opps.fixed-quarter > .opp-slot:nth-child(2) { order: 3; }
  .opps.fixed-quarter > .opp-slot:nth-child(3) { order: 4; }
  .opps.fixed-quarter > .opp-slot:nth-child(4) { order: 5; }

  .board-row > .side-opps:last-child > .opp-slot {
    order: 6;
  }

  .table-block .opp-slot {
    width: 100%;
    height: var(--opp-slot-h);
    min-height: var(--opp-slot-h);
    max-height: var(--opp-slot-h);
  }

  .market-slot {
    grid-column: 1 / -1;
    order: 7;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .board-row > .market-slot > .market-panel {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .me-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 4px;
    align-items: stretch;
  }

  .me-col,
  .hand-col {
    width: 100%;
    min-width: 0;
    flex: none;
    order: unset;
  }

  .me-panel {
    width: 100%;
    height: var(--opp-slot-h);
    min-height: var(--opp-slot-h);
    max-height: var(--opp-slot-h);
  }

  .hand-panel {
    width: 100%;
    height: var(--opp-slot-h);
    min-height: var(--opp-slot-h);
    max-height: var(--opp-slot-h);
  }
}

@media (max-width: 640px) {
  :root {
    --card-w: 50px;
    --card-h: 80px;
    --opp-strip-h: 36px;
    --opp-h: calc(var(--opp-strip-h) * 3 + var(--opp-fields-gap) * 2 + 8px);
    --opp-slot-h: calc(var(--opp-h) + var(--opp-head-h) + 2px);
    --hand-card-h: 72px;
    --hand-card-w: calc(var(--hand-card-h) * var(--card-w) / var(--card-h));
    --plant-card-h: calc(var(--hand-card-h) * 1.5);
    --plant-card-w: calc(var(--hand-card-w) * 1.5);
  }

  .action-copy.compact .action-turn {
    font-size: 14px;
  }
}

@media (max-width: 380px) {
  :root {
    --card-w: 44px;
    --card-h: 70px;
  }

  .turn-steps li { padding: 3px 1px; }
  .step-label { font-size: 9px; }
  .opp { padding: 4px; }
  .me-panel .fields > .field,
  .me-panel .fields > .field.buy {
    width: var(--card-w);
    min-width: var(--card-w);
    max-width: var(--card-w);
    height: var(--card-h);
    min-height: var(--card-h);
    max-height: var(--card-h);
    padding: 4px 3px;
  }
  .field-actions button { min-height: 26px; font-size: 9px; padding: 3px; }
  .action-copy.compact .action-turn { font-size: 13px; }
}
