:root {
  --bg: #e3f0fa;
  --ink: #1d2433;
  --muted: #5b6577;
  --card: #ffffff;
  --line: #d5dde8;
  --sea: #8ec5e8;
  --sea2: #5fa8d8;
  --primary: #1c7ed6;
  --good: #2b8a3e;
  --bad: #c92a2a;
  --gold: #f59f00;
  --t1: #0c8599;
  --t2: #e8590c;
  --t3: #6741d9;
  --tilt: 30deg;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "Pretendard", "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", sans-serif;
  font-size: 16px; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* 버튼 */
.btn { border: 0; border-radius: 12px; padding: 12px 20px; font-weight: 700; background: #e7edf5; color: var(--ink); transition: transform .08s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.good { background: var(--good); color: #fff; }
.btn.warn { background: var(--gold); color: #1d2433; }
.btn.danger { background: #fff0f0; color: var(--bad); border: 2px solid #ffc9c9; }
.btn.ghost { background: rgba(255,255,255,.7); border: 2px solid var(--line); }
.btn.big { font-size: 1.15rem; padding: 14px 24px; }
.btn.tiny { padding: 4px 10px; font-size: .8rem; border-radius: 8px; }

/* 일반 화면 */
.screen { padding: 24px 16px; display: flex; justify-content: center; }
.card { background: var(--card); border-radius: 22px; padding: 26px; width: 100%; max-width: 620px; box-shadow: 0 10px 30px rgba(20,60,110,.12); }
.card.wide { max-width: 1200px; }
.logo { font-size: 2.2rem; text-align: center; }
h1 { margin: 6px 0 2px; text-align: center; font-size: 1.8rem; letter-spacing: -.5px; }
h2 { font-size: 1.15rem; margin: 22px 0 10px; }
.sub { text-align: center; color: var(--muted); margin: 0 0 16px; }
.field { margin: 14px 0; }
.field label.l { display: block; font-weight: 700; margin-bottom: 6px; }
input[type=text], select { width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; font: inherit; font-size: 1.1rem; background: #fff; color: var(--ink); }
input.code { letter-spacing: 6px; text-align: center; font-weight: 800; }
.checks label { display: flex; gap: 8px; align-items: center; margin: 4px 0; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.muted { color: var(--muted); }
.center-text { text-align: center; }

/* 교사 화면 */
.t-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.bigcode { font-size: 3.2rem; font-weight: 900; letter-spacing: 8px; color: var(--primary); line-height: 1; }
.urls { font-size: 1.05rem; font-weight: 700; }
.urls code { background: #f1f3f5; padding: 2px 8px; border-radius: 6px; }
.people { display: flex; flex-wrap: wrap; gap: 6px; }
.person { background: #f1f3f5; border-radius: 999px; padding: 6px 8px 6px 12px; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.person .x { border: 0; background: #dee2e6; border-radius: 50%; width: 22px; height: 22px; font-size: .8rem; line-height: 1; }
.on-dot { width: 9px; height: 9px; border-radius: 50%; background: #adb5bd; display: inline-block; }
.on-dot.on { background: #37b24d; }
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.gcard { border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; background: #fff; }
.gcard.done { background: #f8f9fa; }
.gcard h3 { margin: 0 0 6px; font-size: 1.1rem; display: flex; justify-content: space-between; align-items: center; }
.gcard .st { font-size: .9rem; color: var(--muted); margin-bottom: 6px; }
.gcard table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.gcard td { padding: 3px 2px; border-top: 1px solid #f1f3f5; }
.gcard td.n { text-align: right; font-weight: 800; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 800; background: #e7f5ff; color: var(--primary); }
.pill.warn { background: #fff4e6; color: #d9480f; }

/* ── 게임 화면: 나무 테이블 위의 보드판 ── */
#play {
  display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 12px; padding: 10px; min-height: 100vh; align-items: center;
  background:
    repeating-linear-gradient(92deg, rgba(0,0,0,.05) 0 2px, transparent 2px 38px),
    repeating-linear-gradient(88deg, rgba(255,255,255,.04) 0 1px, transparent 1px 23px),
    radial-gradient(ellipse at 45% 40%, #9a6a42 0%, #7a4f2e 50%, #4f3019 100%);
}
.stage { perspective: 1600px; perspective-origin: 50% 12%; display: flex; justify-content: center; padding: 18px 0 40px; }
.board {
  --ln: #24312d;
  position: relative;
  display: grid; gap: 0;
  grid-template-columns: 1.55fr repeat(6, 1fr) 1.55fr;
  grid-template-rows: 1.55fr repeat(5, 1fr) 1.55fr;
  width: min(100%, calc((100vh - 70px) * 9.1 / 8.1)); aspect-ratio: 9.1 / 8.1;
  background: #fbf7ea;
  border: 3px solid var(--ln); border-radius: 6px;
  box-shadow:
    0 0 0 9px #f3ead2, 0 0 0 12px var(--ln),
    0 16px 0 9px #3b2414, 0 18px 0 12px #2a190d,
    0 40px 60px rgba(0,0,0,.6);
  transform: rotateX(var(--tilt)); transform-style: preserve-3d; transform-origin: 50% 60%;
  transition: transform .6s ease;
}
.stage.flat .board { transform: none; }

/* 칸 */
.cell {
  position: relative; background: #fbf7ea; min-width: 0; min-height: 0;
  box-shadow: inset 0 0 0 1px var(--ln);
  display: flex; flex-direction: column; text-align: center; cursor: pointer;
  transform-style: preserve-3d; transition: transform .2s, box-shadow .2s;
}
.cell .body { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 2px; }
.cell .ic { font-size: clamp(14px, 2vw, 28px); line-height: 1.1; filter: drop-shadow(0 1px 0 rgba(0,0,0,.15)); }
.cell .nm { font-size: clamp(9px, .95vw, 14px); font-weight: 900; line-height: 1.12; color: #1d2433; word-break: break-all; max-width: 100%; text-shadow: 0 0 3px #fff, 0 0 3px #fff; position: relative; z-index: 1; }
.cell .gd { font-size: clamp(7px, .75vw, 10.5px); color: #5b6577; line-height: 1.1; word-break: break-all; max-width: 100%; }

/* 색 띠: 보드 안쪽을 향함 (가격표 역할) */
.cell .band { background: var(--rc); color: #fff; font-weight: 900; font-size: clamp(7px, .72vw, 10px); display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1px var(--ln); text-shadow: 0 1px 0 rgba(0,0,0,.3); white-space: nowrap; overflow: hidden; }
.side-top { flex-direction: column-reverse; }
.side-top .band, .side-bottom .band { height: 20%; flex: none; }
.side-left { flex-direction: row-reverse; }
.side-right { flex-direction: row; }
.side-left .band, .side-right .band { width: 19%; flex: none; writing-mode: vertical-rl; }
.special .band { background: repeating-linear-gradient(45deg, var(--rc) 0 6px, color-mix(in srgb, var(--rc) 80%, #fff) 6px 12px); }

/* 모서리 칸 */
.corner { background: #f3ead2; }
.corner .ic { font-size: clamp(22px, 3.2vw, 46px); }
.corner .nm { font-size: clamp(11px, 1.25vw, 18px); color: var(--rc); }
.corner.sp-customs { background: repeating-linear-gradient(135deg, #f3ead2 0 10px, #ece0c0 10px 20px); }
.corner.sp-coop { background: radial-gradient(circle at 50% 50%, #efe7ff, #f3ead2 70%); }
.start { background: radial-gradient(circle at 50% 55%, #ffe3e3, #f3ead2 75%); }
.start .go { position: absolute; top: -6px; left: -4px; z-index: 3; font-size: clamp(11px, 1.3vw, 18px); font-weight: 900; color: #fff; background: #e03131; padding: 1px 10px; border-radius: 999px; box-shadow: 0 2px 0 #a51d1d; transform: rotate(-6deg); }

/* 이 나라 카드를 가진 친구 */
.owners { position: absolute; top: 3px; right: 3px; display: flex; gap: 2px; }
.side-left .owners { right: auto; left: 3px; }
.owners i { width: clamp(6px, .6vw, 9px); height: clamp(6px, .6vw, 9px); border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1.5px #fff, 0 1px 2px rgba(0,0,0,.4); }

/* 지금 차례인 칸 */
.cell.hl { z-index: 2; transform: translateZ(18px); box-shadow: inset 0 0 0 1px var(--ln), 0 0 0 3px #fcc419, 0 14px 16px rgba(0,0,0,.35); }
.stage.flat .cell.hl { transform: scale(1.04); }

.tokens { position: absolute; left: 0; right: 0; bottom: 3%; display: flex; justify-content: center; align-items: flex-end; flex-wrap: wrap; gap: 0 1px; pointer-events: none; transform-style: preserve-3d; }
.corner .tokens { bottom: 5%; }
.corner .body { justify-content: flex-start; padding-top: 10%; padding-bottom: 34%; }

/* 3D 말: 머리 + 몸통 + 받침 */
.pawn { --c: #e03131; position: relative; width: clamp(12px, 1.35vw, 20px); height: clamp(18px, 2.05vw, 30px); transform-origin: 50% 100%; transform: rotateX(calc(-1 * var(--tilt))) translateZ(3px); filter: drop-shadow(0 3px 2px rgba(0,0,0,.45)); }
.stage.flat .pawn { transform: none; }
.pawn::before { content: ''; position: absolute; left: 22%; top: 0; width: 56%; aspect-ratio: 1; border-radius: 50%; z-index: 1;
  background: radial-gradient(circle at 35% 30%, #fff 0 10%, var(--c) 42%, color-mix(in srgb, var(--c) 55%, #000) 100%); }
.pawn::after { content: ''; position: absolute; left: 0; bottom: 0; width: 100%; height: 64%;
  border-radius: 46% 46% 22% 22% / 62% 62% 20% 20%;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 65%, #fff), var(--c) 38%, color-mix(in srgb, var(--c) 55%, #000)); }
.pawn.me { animation: hop .7s ease-in-out infinite alternate; }
@keyframes hop { to { translate: 0 -5px; } }

/* 보드 가운데 */
.center {
  grid-column: 2 / 8; grid-row: 2 / 7; margin: 8px; border-radius: 10px; padding: 10px 14px;
  display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-height: 0; overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(255,255,255,.7), rgba(255,255,255,0) 62%),
    repeating-linear-gradient(45deg, rgba(36,49,45,.04) 0 10px, transparent 10px 20px),
    #d3e7da;
  border: 2px dashed rgba(36,49,45,.28);
  transform: translateZ(1px); transform-style: preserve-3d;
}
.center-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.center-btns { display: flex; gap: 6px; }
.round { font-weight: 800; color: #3d4b46; font-size: .9rem; }
.logo-plate { align-self: center; display: flex; align-items: center; gap: 10px; background: #24312d; color: #fff; padding: 5px 16px; border-radius: 10px; transform: rotate(-2.5deg); box-shadow: 0 4px 0 #101815, 0 8px 12px rgba(0,0,0,.25); border: 2px solid #f3ead2; }
.logo-plate b { display: block; font-size: clamp(9px, .9vw, 12px); color: #ffd43b; letter-spacing: 3px; }
.logo-plate strong { display: block; font-size: clamp(16px, 2.1vw, 30px); letter-spacing: 1px; line-height: 1.05; }
.globe { font-size: clamp(20px, 2.6vw, 36px); }
.turn { align-self: center; font-size: clamp(.95rem, 1.7vw, 1.35rem); font-weight: 900; display: flex; align-items: center; gap: 8px; color: #1d2433; }
.turn .dot { width: 20px; height: 20px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px #fff; }
.table-row { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 3vw, 44px); transform-style: preserve-3d; }
.deck { position: relative; width: clamp(50px, 6.2vw, 86px); aspect-ratio: 3 / 4; border-radius: 9px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: #fff; font-size: clamp(8px, .85vw, 12px); font-weight: 900; border: 3px solid #fff;
  box-shadow: 3px 3px 0 -1px #f3ead2, 4px 4px 0 0 rgba(0,0,0,.2), 7px 7px 0 -1px #f3ead2, 8px 8px 0 0 rgba(0,0,0,.2), 0 10px 14px rgba(0,0,0,.2); }
.deck span { font-size: clamp(16px, 2.2vw, 30px); }
.deck-news { background: repeating-linear-gradient(-45deg, #f08c00 0 8px, #e8590c 8px 16px); transform: rotate(-8deg); }
.deck-quiz { background: repeating-linear-gradient(45deg, #5c7cfa 0 8px, #7048e8 8px 16px); transform: rotate(7deg); }
.dice-tray { width: clamp(74px, 8.5vw, 116px); aspect-ratio: 1; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 38%, #37b24d, #1b5e2a 75%); border: 5px solid #6b4226;
  box-shadow: inset 0 8px 16px rgba(0,0,0,.45), 0 4px 0 #3b2414; transform-style: preserve-3d; }
.btn.roll { align-self: center; background: linear-gradient(#ff6b6b, #e03131); box-shadow: 0 4px 0 #a51d1d; border: 2px solid #fff; }
.btn.roll:disabled { background: #adb5bd; box-shadow: 0 4px 0 #868e96; opacity: .85; }
.btn.roll:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #a51d1d; }

/* 3D 주사위 */
.dice-wrap { width: 56px; height: 56px; perspective: 400px; flex: none; }
.cube { --s: 56px; width: var(--s); height: var(--s); position: relative; transform-style: preserve-3d; transform: rotateX(-20deg) rotateY(25deg); transition: transform 1s cubic-bezier(.2,.7,.2,1); }
.face { position: absolute; inset: 0; background: linear-gradient(145deg, #fff, #eef1f5); border: 2px solid #ced4da; border-radius: 11px; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 8px; box-shadow: inset 0 0 8px rgba(0,0,0,.12); }
.face i { width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #495057, #111); place-self: center; }
.face.f1 i { background: radial-gradient(circle at 40% 35%, #ff8787, #c92a2a); width: 13px; height: 13px; }
.f1 { transform: translateZ(28px); }
.f6 { transform: rotateY(180deg) translateZ(28px); }
.f3 { transform: rotateY(90deg) translateZ(28px); }
.f4 { transform: rotateY(-90deg) translateZ(28px); }
.f5 { transform: rotateX(90deg) translateZ(28px); }
.f2 { transform: rotateX(-90deg) translateZ(28px); }

.log { list-style: none; margin: 0; padding: 6px 0 0; overflow: auto; font-size: .85rem; color: #3d4b46; flex: 1; min-height: 0; border-top: 1px dashed rgba(36,49,45,.3); }
.log li { padding: 1px 0; }
.log li:first-child { color: #1d2433; font-weight: 800; }


/* 옆 패널 */
.side { display: flex; flex-direction: column; gap: 8px; overflow: auto; max-height: calc(100vh - 20px); }
.side .gname { font-weight: 900; font-size: 1.15rem; padding: 4px 6px 0; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.pcard { background: #fff; border-radius: 14px; padding: 10px 12px; border-left: 6px solid var(--pc); box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.pcard.now { box-shadow: 0 0 0 3px var(--pc); }
.pcard .top { display: flex; justify-content: space-between; align-items: center; font-weight: 800; gap: 6px; }
.pcard .who { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pcard .me-tag { font-size: .7rem; background: var(--pc); color: #fff; border-radius: 6px; padding: 1px 6px; }
.pcard .stats { display: flex; gap: 10px; font-size: .9rem; margin: 4px 0; flex-wrap: wrap; }
.pcard .cards { display: flex; flex-wrap: wrap; gap: 3px; }
.mini { font-size: .76rem; padding: 2px 6px; border-radius: 6px; background: #f1f3f5; border-bottom: 3px solid var(--rc, #adb5bd); white-space: nowrap; }
.mini.raw { background: #fff4e6; }
.mini.exp { background: #e7f5ff; border-bottom-color: #1c7ed6; font-weight: 700; }
.regions { display: flex; gap: 3px; margin-top: 4px; }
.regions span { width: 14px; height: 14px; border-radius: 4px; background: #e9ecef; }
.score { font-size: .85rem; color: var(--muted); }

/* 모달 */
.modal { position: fixed; inset: 0; background: rgba(15,25,45,.5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.modal-box { --mc: #1c7ed6; background: #fffdf6; border-radius: 18px; padding: 22px; border: 3px solid #24312d; border-top: 14px solid var(--mc); width: 100%; max-width: 620px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,.3); animation: deal .35s cubic-bezier(.2,.8,.3,1.2); }
@keyframes deal { from { transform: perspective(900px) rotateY(-75deg) translateX(-40px) scale(.9); opacity: 0; } }
.modal-box h3 { margin: 0 0 8px; font-size: 1.3rem; }
.modal-box p { line-height: 1.55; }
.watch { background: #f1f3f5; border-radius: 10px; padding: 6px 12px; font-size: .9rem; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.chip { display: inline-block; font-size: .78rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; color: #fff; background: var(--muted); margin-bottom: 8px; }
.chip.t1 { background: var(--t1); } .chip.t2 { background: var(--t2); } .chip.t3 { background: var(--t3); }
.qtext { font-size: 1.22rem; font-weight: 700; line-height: 1.5; margin: 6px 0 14px; word-break: keep-all; }
.opts { display: grid; gap: 8px; }
.opts.ox { grid-template-columns: 1fr 1fr; }
.opt { text-align: left; border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 12px 14px; font-size: 1.05rem; line-height: 1.4; color: var(--ink); word-break: keep-all; }
.opts.ox .opt { text-align: center; font-size: 2rem; font-weight: 900; }
.opt:hover:not(:disabled) { border-color: var(--primary); }
.opt:disabled { cursor: default; color: var(--ink); }
.opt.right { border-color: var(--good); background: #ebfbee; }
.opt.wrong { border-color: var(--bad); background: #fff5f5; }
.feedback { margin-top: 14px; padding: 12px 14px; border-radius: 12px; line-height: 1.5; }
.feedback.ok { background: #ebfbee; }
.feedback.no { background: #fff5f5; }
.feedback b { display: block; font-size: 1.1rem; margin-bottom: 4px; }
.note { margin-top: 6px; font-weight: 800; }
.actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.waiting { color: var(--muted); font-weight: 700; }
.goods { display: flex; gap: 14px; align-items: center; background: #f8f9fa; border-radius: 14px; padding: 12px 14px; border-left: 8px solid var(--rc, #adb5bd); margin-bottom: 12px; }
.goods .big { font-size: 2.6rem; }
.goods .t { font-weight: 800; font-size: 1.1rem; }
.goods .s { color: var(--muted); font-size: .9rem; }
.tag { display: inline-block; font-size: .75rem; font-weight: 800; padding: 1px 7px; border-radius: 6px; background: #e9ecef; margin-left: 4px; }
.pick { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.pick button { border: 2px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 12px; font-size: .95rem; color: var(--ink); }
.pick button.on { border-color: var(--primary); background: #e7f5ff; font-weight: 700; }
.pick button:disabled { cursor: default; }
.news { background: #fffbea; border: 2px dashed #f2c94c; border-radius: 14px; padding: 14px; }
.news .concept { font-size: .8rem; font-weight: 800; color: #a87b00; }
.rules h4 { margin: 14px 0 4px; }
.rules ul { margin: 4px 0; padding-left: 20px; line-height: 1.6; }

/* 결과 */
.rank-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: #f8f9fa; margin: 8px 0; border-left: 8px solid var(--pc); }
.rank-row .no { font-size: 1.6rem; font-weight: 900; text-align: center; }
.rank-row .nm { font-weight: 800; font-size: 1.1rem; }
.rank-row .br { font-size: .85rem; color: var(--muted); }
.rank-row .tot { font-size: 1.5rem; font-weight: 900; }
.review-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 8px 0; }
.review-item .q { font-weight: 700; }
.review-item .a { color: var(--good); font-weight: 700; margin: 4px 0; }
.review-item .e { color: var(--muted); font-size: .92rem; }
.review-item .who { font-size: .82rem; color: var(--bad); font-weight: 700; }

.toast { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); background: #1d2433; color: #fff; padding: 10px 18px; border-radius: 12px; font-weight: 700; z-index: 30; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: calc(100vw - 32px); }
.conn { position: fixed; right: 12px; bottom: 12px; background: #fff3bf; color: #5c3c00; padding: 6px 12px; border-radius: 10px; font-weight: 700; z-index: 30; }

@media (max-width: 900px) {
  :root { --tilt: 22deg; }
  #play { grid-template-columns: 1fr; }
  .board { width: calc(100% - 30px); }
  .stage { padding: 18px 0 34px; }
  .cell .ic { font-size: 20px; }
  .corner .ic { font-size: 30px; }
  .cell .nm { font-size: 11.5px; }
  .corner .nm { font-size: 13px; }
  .cell .gd { font-size: 9px; }
  .cell .band { font-size: 8.5px; }
  .pawn { width: 15px; height: 23px; }
  .side { max-height: none; display: grid; grid-template-columns: 1fr 1fr; }
  .center { padding: 8px; gap: 4px; }
  .dice-wrap, .cube { --s: 46px; width: 46px; height: 46px; }
  .deck { display: none; }
  .logo-plate strong { font-size: 16px; }
  .face { padding: 6px; } .face i { width: 8px; height: 8px; } .face.f1 i { width: 10px; height: 10px; }
  .f1 { transform: translateZ(23px); } .f6 { transform: rotateY(180deg) translateZ(23px); } .f3 { transform: rotateY(90deg) translateZ(23px); }
  .f4 { transform: rotateY(-90deg) translateZ(23px); } .f5 { transform: rotateX(90deg) translateZ(23px); } .f2 { transform: rotateX(-90deg) translateZ(23px); }
  .btn.big { font-size: 1rem; padding: 10px 16px; }
  .log { display: none; }
}
@media (max-width: 560px) {
  .side { grid-template-columns: 1fr; }
  .cell .gd { display: none; }
  .bigcode { font-size: 2.4rem; }
}

/* ── 기업 행동 막대 (내 차례) ── */
.actbar { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.actbar .act { border: 2px solid #fff; border-radius: 12px; padding: 6px 2px; background: linear-gradient(#fff, #e9f2ec); color: #1d2433; font-weight: 800; font-size: clamp(10px, .9vw, 13px); display: flex; flex-direction: column; align-items: center; gap: 1px; box-shadow: 0 3px 0 rgba(36,49,45,.35); }
.actbar .act span { font-size: clamp(16px, 1.8vw, 24px); }
.actbar .act small { font-size: 10px; color: #5b6577; }
.actbar .act:disabled { opacity: .45; }
.actbar .act:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 rgba(36,49,45,.35); }
.actbar .act.end { background: linear-gradient(#ff8787, #e03131); color: #fff; }
.actbar .act.end small { color: #ffe3e3; }
.waitbar { grid-column: 1 / -1; background: #fff; border-radius: 12px; padding: 10px; text-align: center; font-weight: 800; }

/* ── 우리나라 경제 패널 ── */
.econ { background: #fffdf6; border-radius: 14px; padding: 10px 12px; border: 2px solid #24312d; box-shadow: 0 3px 0 rgba(0,0,0,.25); font-size: .86rem; }
.econ-h { font-weight: 900; margin-bottom: 4px; }
.econ-h.small { font-size: .78rem; color: #5b6577; margin-top: 6px; }
.econ-row { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; border-top: 1px dashed #e2e8f0; }
.who-ic { font-size: 1.3rem; line-height: 1; }
.sub2 { font-size: .76rem; color: #5b6577; line-height: 1.35; }
.meter { height: 8px; border-radius: 99px; background: #e9ecef; overflow: hidden; margin-top: 3px; }
.meter i { display: block; height: 100%; border-radius: 99px; transition: width .4s; }
.market { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.mk { background: #f1f3f5; border-radius: 8px; text-align: center; padding: 3px 0; display: flex; flex-direction: column; line-height: 1.15; }
.mk span { font-size: 1.1rem; }
.mk b { font-size: .95rem; }
.mk b.up { color: #e03131; } .mk b.down { color: #1971c2; }
.mk small { font-size: .62rem; color: #5b6577; }

/* 기업 카드: 자원 */
.reslist { display: flex; gap: 4px; margin: 4px 0; flex-wrap: wrap; }
.reslist .rc { background: #fff4e6; border: 1px solid #ffd8a8; border-radius: 8px; padding: 1px 6px; font-size: .85rem; display: inline-flex; gap: 3px; align-items: center; }
.reslist .rc.zero { opacity: .35; background: #f1f3f5; border-color: #dee2e6; }
.reslist.big .rc { font-size: 1.05rem; padding: 3px 10px; }

/* 행동 창 */
.sub3 { color: #5b6577; font-size: .9rem; line-height: 1.5; }
.recipe { display: flex; align-items: center; gap: 10px; border: 2px solid var(--line); border-radius: 12px; padding: 8px 10px; margin: 6px 0; background: #fff; }
.recipe.off { opacity: .6; }
.recipe .big { font-size: 2rem; }
.recipe .r-body { flex: 1; font-size: .92rem; line-height: 1.45; }
.recipe .r-body small { color: #5b6577; }
.recipe .btns { display: flex; flex-direction: column; gap: 4px; }
.miss { color: var(--bad); font-weight: 700; font-size: .85rem; }
.trade-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.step { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 1.1rem; }
.step span { width: 28px; text-align: center; }
.step button { width: 32px; height: 32px; border-radius: 8px; border: 2px solid var(--line); background: #fff; font-size: 1.1rem; font-weight: 900; }
.step b { min-width: 20px; text-align: center; }
.tbox { background: #f8f9fa; border-radius: 12px; padding: 10px; text-align: center; }
.big2 { font-size: 1.4rem; font-weight: 900; margin-top: 4px; }

/* 결과: 경제 성적표 */
.report { display: flex; gap: 16px; align-items: center; background: #fffdf6; border: 3px solid #24312d; border-radius: 16px; padding: 14px 18px; margin: 10px 0; }
.grade { font-size: 3.4rem; font-weight: 900; width: 90px; height: 90px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; flex: none; box-shadow: 0 4px 0 rgba(0,0,0,.25); }
.g-S { background: #7048e8; } .g-A { background: #2f9e44; } .g-B { background: #1971c2; } .g-C { background: #868e96; }
.report h3 { margin: 0 0 6px; }
.rep-row { display: flex; justify-content: space-between; gap: 20px; padding: 2px 0; font-size: .95rem; }
.rep-row.total { border-top: 2px solid #24312d; margin-top: 4px; padding-top: 4px; font-weight: 900; }
.pol { margin: 4px 0; padding-left: 20px; line-height: 1.6; }
@media (max-width: 900px) { .actbar { grid-template-columns: repeat(3, 1fr); } }
