/* ── 기본 리셋 & 변수 ─────────────────────────────── */
:root {
  --player-red: #e74c3c; --player-blue: #3498db;
  --player-green: #2ecc71; --player-yellow: #f1c40f; --player-purple: #9b59b6;
  --card-red: #c0392b; --card-blue: #2471a3; --card-green: #1e8449;
  --card-yellow: #d4ac0d; --card-orange: #ca6f1e; --card-purple: #7d3c98;
  --card-white: #f0ebe0; --card-black: #1c1c1c; --card-wild: #d98880;

  /* 기차 테마 */
  --bg:       #130a03;
  --bg-panel: #1c1008;
  --bg-card:  #251508;
  --text:     #ede0c0;
  --text-dim: #8a7050;
  --border:   #4a2c15;
  --accent:   #c8a030;
  --accent2:  #9a7820;
  --wood-dark:#2a1808;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Georgia', 'Times New Roman', serif;
  height: 100vh;
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════
   설정 화면 — 빈티지 철도 포스터
══════════════════════════════════════════════════════ */
#setup-screen {
  display: flex; align-items: center; justify-content: center;
  height: 100vh;
  background:
    radial-gradient(ellipse 70% 90% at 50% 50%, #2a1008 0%, #0a0502 100%);
  position: relative; overflow: hidden;
}
/* 격자 텍스처 */
#setup-screen::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(0deg,  transparent, transparent 47px, rgba(200,160,48,.06) 47px, rgba(200,160,48,.06) 48px),
    repeating-linear-gradient(90deg, transparent, transparent 47px, rgba(200,160,48,.06) 47px, rgba(200,160,48,.06) 48px);
}
#setup-screen[hidden] { display: none; }

.setup-box {
  background: #f5e8d0;
  border: 4px solid var(--accent);
  box-shadow: 0 0 0 8px #3a1e0a, 0 0 0 9px var(--accent), 0 24px 64px rgba(0,0,0,.85);
  border-radius: 3px;
  padding: 44px 48px;
  width: 460px; max-width: 96vw;
  max-height: 90vh; overflow-y: auto;
  text-align: center;
  color: #1a0a03;
  position: relative;
}
#local-setup[hidden]    { display: none; }
#p2p-host-panel[hidden] { display: none; }
#p2p-guest-panel[hidden]{ display: none; }
#p2p-answer-section[hidden] { display: none; }
#start-game-btn[hidden] { display: none; }
/* 모서리 장식 */
.setup-box::before, .setup-box::after {
  content: '◆';
  position: absolute; top: 11px; font-size: 16px; color: var(--accent); opacity: .7;
}
.setup-box::before { left: 14px; }
.setup-box::after  { right: 14px; }

.setup-box h1 {
  font-size: 2.3em; letter-spacing: 2px;
  color: #1a0a03; margin-bottom: 4px;
}
.setup-subtitle {
  color: #5a3a1a; font-style: italic; font-size: .92em;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--accent);
}
#player-count-select label {
  display: block; margin-bottom: 8px;
  color: #3a2010; font-size: 12px; font-weight: bold;
  text-transform: uppercase; letter-spacing: 1.5px;
}
.count-buttons { display: flex; gap: 8px; justify-content: center; margin: 8px 0 20px; }
.count-btn {
  padding: 8px 18px; border: 2px solid #8a6030;
  background: transparent; color: #3a2010;
  border-radius: 2px; cursor: pointer;
  font-family: 'Georgia', serif; font-size: 14px;
  transition: all .2s;
}
.count-btn.selected, .count-btn:hover {
  background: var(--accent); border-color: var(--accent);
  color: #1a0a03; box-shadow: 0 2px 8px rgba(200,160,48,.4);
}
.player-input-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.player-color-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; border: 2px solid rgba(0,0,0,.2); }
.player-input-row input {
  flex: 1; padding: 8px 12px;
  background: rgba(255,255,255,.55);
  border: 1px solid #8a6030; border-radius: 2px;
  color: #1a0a03; font-family: 'Georgia', serif; font-size: 14px;
}
.player-input-row input:focus { outline: none; border-color: var(--accent); background: rgba(255,255,255,.85); }

#start-game-btn {
  margin-top: 24px; padding: 14px 32px;
  background: linear-gradient(160deg, #c8a030, #9a7820);
  color: #1a0a03; font-family: 'Georgia', serif; font-size: 16px; font-weight: bold;
  border: 2px solid #7a5818; border-radius: 2px;
  letter-spacing: 1px; width: 100%; cursor: pointer;
  box-shadow: 0 4px 0 #5a3810, 0 6px 16px rgba(0,0,0,.5);
  transition: all .15s;
}
#start-game-btn:not(:disabled):hover {
  background: linear-gradient(160deg, #d4b040, #c8a030);
  transform: translateY(-1px);
  box-shadow: 0 5px 0 #5a3810, 0 8px 20px rgba(0,0,0,.5);
}
#start-game-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #5a3810; }
#start-game-btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }

/* ══════════════════════════════════════════════════════
   게임 화면 레이아웃
══════════════════════════════════════════════════════ */
#game-screen { display: flex; flex-direction: column; height: 100vh; }
#game-screen[hidden] { display: none; }

/* 헤더 — 출발 안내판 스타일 */
#game-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  background: #0a0603;
  border-bottom: 3px solid var(--accent);
  height: 50px; flex-shrink: 0;
  box-shadow: 0 3px 18px rgba(0,0,0,.6);
}
.game-title {
  font-family: 'Georgia', serif; font-weight: bold; font-size: 1.1em;
  color: var(--accent); letter-spacing: 2px;
}
#current-player-display {
  font-family: 'Courier New', monospace; font-size: .9em;
  color: var(--accent); font-weight: bold;
  background: #160a03; padding: 5px 16px;
  border: 1px solid #4a2c15; border-radius: 2px;
  letter-spacing: .5px;
  box-shadow: inset 0 1px 4px rgba(0,0,0,.5);
}
#final-round-indicator {
  color: #e74c3c; font-weight: bold;
  font-family: 'Courier New', monospace; font-size: .82em;
  animation: blink .8s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.25} }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }

#game-main {
  display: grid; grid-template-columns: 1fr 300px; grid-template-rows: 1fr;
  flex: 1; min-height: 0; overflow: hidden; height: 100%;
}
#board-container {
  overflow: hidden; background: #1e3a1e; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
#board-container svg { width: 100%; height: 100%; }

/* ══════════════════════════════════════════════════════
   사이드바 — 나무 패널
══════════════════════════════════════════════════════ */
#sidebar {
  background: linear-gradient(180deg, #1a0d07 0%, #130803 100%);
  border-left: 3px solid #3a1e0a;
  overflow-y: auto; padding: 10px 8px;
  display: flex; flex-direction: column; gap: 8px;
}
#sidebar::-webkit-scrollbar { width: 5px; }
#sidebar::-webkit-scrollbar-track { background: #0a0502; }
#sidebar::-webkit-scrollbar-thumb { background: #4a2c15; border-radius: 3px; }
#sidebar::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.panel {
  background: var(--bg-panel);
  border: 1px solid #3a1e0a;
  border-radius: 2px; padding: 10px;
  position: relative;
}
/* 패널 상단 황동 라인 */
.panel::before {
  content: '';
  position: absolute; top: 0; left: 8px; right: 8px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.panel h3 {
  font-family: 'Georgia', serif; font-size: 11px;
  color: var(--accent); margin-bottom: 10px;
  text-transform: uppercase; letter-spacing: 1.5px;
  padding-bottom: 7px;
  border-bottom: 1px solid #3a1e0a;
}

/* ══════════════════════════════════════════════════════
   공개 기차 카드 — 티켓 스타일
══════════════════════════════════════════════════════ */
#face-up-cards { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }

.train-card {
  width: 50px; height: 76px;
  border-radius: 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,.15);
  transition: all .15s;
  position: relative; overflow: hidden;
  box-shadow: 2px 3px 8px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.15);
}
/* 퍼포레이션 점선 */
.train-card::after {
  content: '';
  position: absolute; top: 50%; left: 0; right: 0; height: 1px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.25), rgba(255,255,255,.25) 3px, transparent 3px, transparent 7px);
}
/* 광택 */
.train-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 40%;
  background: linear-gradient(180deg, rgba(255,255,255,.12), transparent);
  pointer-events: none;
}
.train-card .card-emoji { font-size: 22px; line-height: 1; position: relative; z-index: 1; }
.train-card .card-label {
  font-size: 7px; font-weight: bold;
  text-align: center; line-height: 1.2; word-break: keep-all;
  font-family: 'Courier New', monospace; letter-spacing: .5px;
  color: rgba(0,0,0,.75);
  position: relative; z-index: 1;
}
.train-card[data-color="blue"]   .card-label,
.train-card[data-color="purple"] .card-label,
.train-card[data-color="black"]  .card-label { color: rgba(255,255,255,.9); }
.train-card[data-color="wild"]   .card-label { color: rgba(0,0,0,.8); }
.train-card:hover {
  border-color: var(--accent);
  transform: translateY(-5px) scale(1.06);
  box-shadow: 0 10px 24px rgba(0,0,0,.7), 0 0 12px rgba(200,160,48,.4);
}
.train-card.disabled { opacity: .3; cursor: not-allowed; }
.train-card.disabled:hover { transform: none; box-shadow: 2px 3px 8px rgba(0,0,0,.6); border-color: rgba(255,255,255,.15); }

.train-card[data-color="red"]    { background: linear-gradient(155deg, #e74c3c 0%, #a93226 100%); }
.train-card[data-color="blue"]   { background: linear-gradient(155deg, #2980b9 0%, #1a5276 100%); }
.train-card[data-color="green"]  { background: linear-gradient(155deg, #27ae60 0%, #1a7a42 100%); }
.train-card[data-color="yellow"] { background: linear-gradient(155deg, #f1c40f 0%, #b8960c 100%); }
.train-card[data-color="orange"] { background: linear-gradient(155deg, #e67e22 0%, #a85b16 100%); }
.train-card[data-color="purple"] { background: linear-gradient(155deg, #8e44ad 0%, #6c3483 100%); }
.train-card[data-color="white"]  { background: linear-gradient(155deg, #f0ebe0 0%, #c8c0b0 100%); border-color: #9a8878; }
.train-card[data-color="black"]  { background: linear-gradient(155deg, #2c3e50 0%, #1a252f 100%); }
.train-card[data-color="wild"]   { background: linear-gradient(135deg, #f39c12, #e74c3c 33%, #8e44ad 66%, #2980b9); }

/* ══════════════════════════════════════════════════════
   내 카드 목록
══════════════════════════════════════════════════════ */
#my-train-cards { display: flex; flex-direction: column; gap: 3px; }
.my-card-group {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 2px;
  border-left: 3px solid #3a1e0a;
  transition: border-color .15s;
}
.my-card-group:hover { border-left-color: var(--accent); }
.my-card-chip {
  display: flex; align-items: center; gap: 3px;
  padding: 2px 7px; border-radius: 2px; min-width: 42px; justify-content: center;
}
.my-card-emoji { font-size: 13px; }
.my-card-count {
  font-size: 14px; font-weight: bold; color: var(--accent);
  font-family: 'Courier New', monospace;
}
.my-card-name { font-size: 11px; color: var(--text-dim); flex: 1; }
.my-cards-total {
  font-size: 11px; color: var(--text-dim); text-align: right;
  padding-top: 5px; border-top: 1px solid #3a1e0a; margin-top: 3px;
  font-family: 'Courier New', monospace;
}
.empty-msg { font-size: 11px; color: #4a3020; font-style: italic; }

/* ══════════════════════════════════════════════════════
   티켓 아이템 — 열차 승차권 스타일
══════════════════════════════════════════════════════ */
.ticket-item {
  padding: 7px 10px; border-radius: 2px; margin-bottom: 5px;
  font-size: 11px; position: relative; overflow: hidden;
  background: var(--wood-dark);
  border: 1px solid #3a1e0a;
  border-left: 4px solid #3a1e0a;
  display: flex; flex-direction: column; gap: 3px;
}
/* 오른쪽 퍼포레이션 장식 */
.ticket-item::after {
  content: '';
  position: absolute; right: 0; top: 4px; bottom: 4px; width: 1px;
  background: repeating-linear-gradient(180deg, rgba(200,160,48,.25), rgba(200,160,48,.25) 3px, transparent 3px, transparent 6px);
}
.ticket-item.completed { border-left-color: #27ae60; }
.ticket-item.incomplete { border-left-color: #c0392b; }
.ticket-item.pending    { border-left-color: #6a5030; }

.ticket-cities { font-family: 'Georgia', serif; font-size: 11.5px; color: var(--text); }
.ticket-row { display: flex; align-items: center; justify-content: space-between; }
.ticket-points {
  font-weight: bold; padding: 2px 7px; border-radius: 2px; font-size: 12px;
  font-family: 'Courier New', monospace;
}
.ticket-item.completed .ticket-points { background: #1a6635; color: #a8f0c0; }
.ticket-item.incomplete .ticket-points { background: #7a1a1a; color: #f5b0b0; }
.ticket-item.pending    .ticket-points { background: #2a1c0a; color: var(--accent); border: 1px solid #4a2c15; }

/* ══════════════════════════════════════════════════════
   플레이어 정보
══════════════════════════════════════════════════════ */
.player-info-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 2px; margin-bottom: 4px;
  border: 1px solid #2a1608; background: var(--wood-dark);
  transition: all .2s;
}
.player-info-row.current {
  border-color: var(--accent);
  background: rgba(200,160,48,.06);
  box-shadow: 0 0 0 1px rgba(200,160,48,.2);
}
.player-color-badge { width: 10px; height: 32px; border-radius: 2px; flex-shrink: 0; }
.player-info-main { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.player-name {
  font-size: 12px; font-weight: bold;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: 'Georgia', serif; color: var(--text);
}
.player-stats {
  font-size: 10px; color: var(--text-dim);
  display: flex; gap: 6px; flex-wrap: wrap;
  font-family: 'Courier New', monospace;
}
.stat-warn { color: #e74c3c; font-weight: bold; }

/* ══════════════════════════════════════════════════════
   액션 버튼 — 황동 레버 스타일
══════════════════════════════════════════════════════ */
.action-btn {
  width: 100%; padding: 9px 12px;
  border: 1px solid #5a3418;
  background: linear-gradient(180deg, #2e1c0c, #1a0e06);
  color: var(--accent);
  border-radius: 2px; cursor: pointer;
  font-family: 'Georgia', serif; font-size: 12px;
  letter-spacing: .3px;
  transition: all .15s; margin-bottom: 4px;
  box-shadow: 0 2px 0 #0a0502;
}
.action-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  border-color: var(--accent); color: #1a0a03;
  box-shadow: 0 3px 10px rgba(200,160,48,.3);
  transform: translateY(-1px);
}
.action-btn:active { transform: translateY(1px); box-shadow: none; }
.action-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════
   티켓 배지
══════════════════════════════════════════════════════ */
.ticket-badge {
  font-size: 9px; padding: 1px 5px; border-radius: 2px;
  font-weight: bold; white-space: nowrap;
  font-family: 'Courier New', monospace; letter-spacing: .5px;
}
.ticket-badge.long  { background: #5c2e80; color: #d7bde2; }
.ticket-badge.mid   { background: #1a4a70; color: #aed6f1; }
.ticket-badge.short { background: #1a6635; color: #a9dfbf; }

/* ══════════════════════════════════════════════════════
   게임 로그 — 전신 테이프 스타일
══════════════════════════════════════════════════════ */
#game-log {
  font-size: 10.5px; color: var(--text-dim);
  max-height: 130px; overflow-y: auto;
  font-family: 'Courier New', monospace;
}
#game-log::-webkit-scrollbar { width: 4px; }
#game-log::-webkit-scrollbar-thumb { background: #3a1e0a; }
.log-entry {
  padding: 3px 0; border-bottom: 1px solid rgba(200,160,48,.05);
  line-height: 1.4;
}
.log-entry::before { content: '▸ '; color: #4a2c15; font-size: 9px; }

/* ══════════════════════════════════════════════════════
   모달 — 역사 게시판 스타일
══════════════════════════════════════════════════════ */
#modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.88);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
#modal-overlay[hidden] { display: none; }
#modal-content {
  background: #1a0d07;
  border: 2px solid var(--accent);
  border-radius: 2px; padding: 30px;
  min-width: 340px; max-width: 520px; max-height: 80vh; overflow-y: auto;
  box-shadow: 0 0 0 7px #3a1e0a, 0 24px 64px rgba(0,0,0,.85);
}
#modal-content h2 {
  margin-bottom: 16px; font-family: 'Georgia', serif;
  color: var(--accent); letter-spacing: .5px;
  border-bottom: 1px solid #3a1e0a; padding-bottom: 10px;
}
.modal-tickets { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.modal-ticket {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border: 1px solid #3a1e0a; border-left: 4px solid #3a1e0a;
  background: var(--wood-dark);
  border-radius: 2px; cursor: pointer; transition: all .15s;
}
.modal-ticket.selected {
  border-left-color: var(--accent);
  background: rgba(200,160,48,.07);
  border-color: #5a3418;
}
.modal-ticket label { cursor: pointer; flex: 1; font-family: 'Georgia', serif; color: var(--text); }
.modal-ticket .pts { font-weight: bold; color: var(--accent); font-family: 'Courier New', monospace; }
.modal-btn {
  padding: 10px 24px; border-radius: 2px; cursor: pointer;
  font-family: 'Georgia', serif; font-size: 14px; margin-right: 8px;
  border: 1px solid #5a3418;
  background: linear-gradient(160deg, #2e1c0c, #1a0e06);
  color: var(--text-dim);
}
.modal-btn.primary {
  background: linear-gradient(160deg, var(--accent), var(--accent2));
  color: #1a0a03; font-weight: bold;
  border-color: #8a6020;
  box-shadow: 0 3px 0 #5a3810;
}
.modal-btn.primary:hover { background: linear-gradient(160deg, #d4b040, var(--accent)); transform: translateY(-1px); }
.modal-btn.primary:active { transform: translateY(1px); box-shadow: none; }
.modal-btn.primary:disabled { opacity: .35; cursor: not-allowed; transform: none; box-shadow: none; }

/* 클레임 옵션 */
.claim-option {
  padding: 10px 14px;
  border: 1px solid #3a1e0a; border-left: 4px solid #3a1e0a;
  background: var(--wood-dark);
  border-radius: 2px; cursor: pointer; margin-bottom: 8px;
  transition: all .15s;
  font-family: 'Georgia', serif; color: var(--text);
}
.claim-option:hover { border-left-color: var(--accent); background: rgba(200,160,48,.07); }

/* 게임 오버 표 */
.game-over-scores { width: 100%; border-collapse: collapse; margin: 12px 0; font-family: 'Courier New', monospace; }
.game-over-scores th, .game-over-scores td {
  padding: 8px 10px; text-align: center; border-bottom: 1px solid #3a1e0a;
}
.game-over-scores th { color: var(--accent); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }
.winner-row { color: var(--accent); font-weight: bold; }

/* ══════════════════════════════════════════════════════
   턴 전환 오버레이 — 출발 안내판 (Departures Board)
══════════════════════════════════════════════════════ */
#turn-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.96);
  display: flex; align-items: center; justify-content: center; z-index: 150;
}
#turn-overlay[hidden] { display: none; }
#turn-overlay-box {
  text-align: center; padding: 56px 80px;
  background: #080503;
  border: 3px solid var(--accent);
  border-radius: 2px; min-width: 360px;
  box-shadow: 0 0 0 8px #2a1608, 0 0 0 9px var(--accent), 0 0 60px rgba(200,160,48,.12);
  position: relative;
}
/* 상단 안내판 레이블 */
#turn-overlay-box::before {
  content: '── NEXT DEPARTURE ──';
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  font-family: 'Courier New', monospace; font-size: 10px;
  color: #4a2c15; white-space: nowrap; letter-spacing: 2px;
}
#turn-overlay-icon { font-size: 60px; margin-bottom: 14px; }
#turn-overlay-name {
  font-size: 2.4em; font-family: 'Georgia', serif; font-weight: bold;
  color: var(--accent); margin-bottom: 6px; letter-spacing: 1.5px;
}
#turn-overlay-sub {
  font-size: .9em; color: #6a5030; margin-bottom: 40px;
  font-family: 'Courier New', monospace;
  letter-spacing: 3px; text-transform: uppercase;
}
#turn-overlay-btn {
  padding: 14px 60px;
  background: linear-gradient(160deg, var(--accent), var(--accent2));
  color: #1a0a03; border: 2px solid #7a5818;
  border-radius: 2px;
  font-family: 'Georgia', serif; font-size: 16px;
  cursor: pointer; font-weight: bold; letter-spacing: 1px;
  box-shadow: 0 4px 0 #4a2c10, 0 6px 20px rgba(0,0,0,.6);
  transition: all .15s;
}
#turn-overlay-btn:hover {
  background: linear-gradient(160deg, #d4b040, var(--accent));
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #4a2c10, 0 10px 28px rgba(0,0,0,.6);
}
#turn-overlay-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #4a2c10; }

/* ══════════════════════════════════════════════════════
   액션 상태 안내
══════════════════════════════════════════════════════ */
#action-status {
  font-size: 11px; color: var(--accent); text-align: center;
  padding: 5px 8px; margin-bottom: 6px; min-height: 20px;
  border-radius: 2px;
  background: rgba(200,160,48,.07);
  border: 1px solid #3a1e0a;
  font-family: 'Courier New', monospace; letter-spacing: .3px;
}

/* ══════════════════════════════════════════════════════
   튜토리얼 — 양피지 여행 안내서
══════════════════════════════════════════════════════ */
#tutorial-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.88);
  display: flex; align-items: center; justify-content: center; z-index: 200;
}
#tutorial-overlay[hidden] { display: none; }
#tutorial-box {
  background: #f5e8d0;
  border: 3px solid var(--accent); border-radius: 2px;
  padding: 42px; width: 520px; max-width: 92vw;
  position: relative; color: #1a0a03;
  box-shadow: 0 0 0 8px #3a1e0a, 0 0 0 9px var(--accent), 0 24px 64px rgba(0,0,0,.85);
}
/* 모서리 장식 */
#tutorial-box::before, #tutorial-box::after {
  content: '◆'; position: absolute;
  bottom: 14px; font-size: 14px; color: var(--accent); opacity: .6;
}
#tutorial-box::before { left: 16px; }
#tutorial-box::after  { right: 16px; }

#tutorial-progress { display: flex; gap: 8px; justify-content: center; margin-bottom: 24px; }
.tutorial-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #c8b090; transition: background .2s;
}
.tutorial-dot.active { background: var(--accent); }
#tutorial-content h2 {
  font-family: 'Georgia', serif; font-size: 1.4em; margin-bottom: 14px;
  color: #1a0a03;
  border-bottom: 2px solid var(--accent); padding-bottom: 10px;
  letter-spacing: .5px;
}
#tutorial-content p { color: #3a2010; line-height: 1.85; font-size: 14px; margin-bottom: 8px; }
#tutorial-content ul { margin: 8px 0 0 18px; color: #3a2010; font-size: 14px; line-height: 2.0; }
#tutorial-content strong { color: #1a0a03; }
#tutorial-nav {
  display: flex; align-items: center; justify-content: space-between; margin-top: 28px;
}
#tutorial-step-indicator { font-size: 12px; color: #5a3a1a; font-family: 'Courier New', monospace; }
#tutorial-prev, #tutorial-next {
  padding: 9px 24px; border-radius: 2px;
  font-family: 'Georgia', serif; font-size: 14px;
  cursor: pointer; transition: all .15s;
}
#tutorial-prev {
  border: 1px solid #8a6030; background: transparent; color: #3a2010;
}
#tutorial-prev:hover:not(:disabled) { background: rgba(200,160,48,.15); }
#tutorial-prev:disabled { opacity: .3; cursor: not-allowed; }
#tutorial-next {
  background: linear-gradient(160deg, var(--accent), var(--accent2));
  border: 1px solid #7a5818; color: #1a0a03; font-weight: bold;
  box-shadow: 0 3px 0 #5a3810;
}
#tutorial-next:hover {
  background: linear-gradient(160deg, #d4b040, var(--accent));
  transform: translateY(-1px);
  box-shadow: 0 4px 0 #5a3810;
}
#tutorial-next:active { transform: translateY(1px); box-shadow: none; }
#tutorial-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: 1px solid #8a6030;
  color: #5a3a1a; cursor: pointer; font-size: 12px;
  padding: 3px 8px; border-radius: 2px;
}
#tutorial-close:hover { color: #1a0a03; border-color: var(--accent); background: rgba(200,160,48,.1); }

/* ══════════════════════════════════════════════════════
   P2P / 온라인 설정 UI
══════════════════════════════════════════════════════ */
#game-mode-select {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--accent);
}
#game-mode-select label {
  display: block; margin-bottom: 8px;
  color: #3a2010; font-size: 12px; font-weight: bold;
  text-transform: uppercase; letter-spacing: 1.5px;
}
.mode-buttons { display: flex; gap: 6px; justify-content: center; }
.mode-btn {
  padding: 7px 14px; border: 2px solid #8a6030;
  background: transparent; color: #3a2010;
  border-radius: 2px; cursor: pointer;
  font-family: 'Georgia', serif; font-size: 13px;
  transition: all .2s; white-space: nowrap;
}
.mode-btn.active, .mode-btn:hover {
  background: var(--accent); border-color: var(--accent); color: #1a0a03;
}

/* 호스트 패널 */
#p2p-host-panel, #p2p-guest-panel { margin-top: 6px; }
#host-count-select { margin-bottom: 12px; }
#host-count-select label {
  display: block; margin-bottom: 6px;
  color: #3a2010; font-size: 12px; font-weight: bold;
  text-transform: uppercase; letter-spacing: 1px;
}

/* 방 만들기 버튼 */
.p2p-create-btn { width: 100%; margin: 8px 0; }

/* 방 코드 표시 — 크고 굵게 */
.p2p-room-code {
  font-family: 'Courier New', monospace;
  font-size: 30px; font-weight: bold;
  color: var(--accent); letter-spacing: 4px;
  text-align: center;
  padding: 14px 10px;
  background: #0a0502;
  border: 2px solid var(--accent);
  border-radius: 3px;
  margin: 8px 0;
  box-shadow: 0 0 16px rgba(200,160,48,.15);
  user-select: all;
}

/* 게스트 패널 */
.p2p-field { margin-bottom: 10px; }
.p2p-field label, .p2p-label {
  display: block; font-size: 11px; color: #5a3a1a;
  margin-bottom: 5px; font-family: 'Georgia', serif;
}
#p2p-room-input {
  width: 100%; padding: 12px 10px;
  font-family: 'Courier New', monospace;
  font-size: 28px; text-align: center; letter-spacing: 6px;
  background: rgba(255,255,255,.7);
  border: 2px solid #8a6030; border-radius: 2px;
  color: #1a0a03; font-weight: bold;
}
#p2p-room-input:focus { outline: none; border-color: var(--accent); }

/* 상태 메시지 */
.p2p-status {
  font-size: 11px; color: #5a3a1a; text-align: center;
  padding: 6px 4px; min-height: 18px;
  font-family: 'Courier New', monospace;
}

/* 내 플레이어 표시 (게임 헤더) */
#my-player-indicator {
  font-family: 'Courier New', monospace; font-size: .82em;
  color: #27ae60; font-weight: bold;
  background: #160a03; padding: 4px 12px;
  border: 1px solid #1a6635; border-radius: 2px;
}

/* 헤더 도움말 버튼 */
#help-btn {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid #4a2c15; background: #0a0603;
  color: var(--accent); cursor: pointer;
  font-size: 14px; font-weight: bold; line-height: 1;
  transition: all .15s;
}
#help-btn:hover { border-color: var(--accent); box-shadow: 0 0 8px rgba(200,160,48,.4); }
