/* ════════════════════════════════════════════════════════════════
   myLibrary — Library Command Center (Premium UI Theme)
   Designed with Glassmorphism, Neon Highlights, and Sleek Transitions
   ════════════════════════════════════════════════════════════════ */
:root {
  /* Dark space background gradients */
  --bg-0: #04080e;
  --bg-1: #070f1a;
  --bg-2: #0c1827;
  
  /* Glassmorphic Panel styling */
  --panel: rgba(10, 20, 38, 0.72);
  --panel-solid: #0d1726;
  --line: rgba(56, 189, 248, 0.10);
  --line-bright: rgba(56, 189, 248, 0.22);
  --line-neon: rgba(56, 189, 248, 0.40);
  
  /* Typography colors */
  --text: #f1f5f9;
  --muted: #94a3b8;
  --faint: #64748b;
  
  /* Cyber Neon Accents */
  --gold: #f5a623;
  --gold-bright: #ffcc00;
  --teal: #00f2fe;
  --blue: #38bdf8;
  --rose: #ff2a5f;
  --green: #00ff87;
  --violet: #8c52ff;
  --orange: #ff7675;
  
  /* Category color codes (운영 정책 5분류) */
  --c-people: #ff7f50;     /* 인력조직 - Orange */
  --c-catalog: #38bdf8;    /* 자료조직 - Cyber Blue */
  --c-collection: #f3b13c; /* 장서구성 - Gold */
  --c-mgmt: #8c52ff;       /* 경영 - Cyber Purple */
  --c-outreach: #00ff87;   /* 대외프로그램 - Neon Green */
  
  --radius: 16px;
  --radius-sm: 10px;
  --font-display: "Black Han Sans", sans-serif;
  --font-body: "Pretendard", -apple-system, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(1300px 900px at 80% -15%, rgba(0, 242, 254, 0.12), transparent 60%),
    radial-gradient(1100px 800px at 15% 115%, rgba(140, 82, 255, 0.12), transparent 60%),
    linear-gradient(90deg, rgba(56, 189, 248, 0.015) 1px, transparent 1px),
    linear-gradient(180deg, rgba(56, 189, 248, 0.015) 1px, transparent 1px),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
  background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px, 100% 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Film Grain Overlay */
.grain {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: 0.04; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.screen { position: fixed; inset: 0; opacity: 0; visibility: hidden; transition: opacity .6s ease; }
.screen.is-active { opacity: 1; visibility: visible; }

.btn-label { position: relative; z-index: 2; }

/* ════════════════ 타이틀 화면 ════════════════ */
.title-screen { display: grid; place-items: center; }
#title-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.title-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(110% 85% at 50% 10%, transparent 20%, rgba(4,8,14,0.6) 75%, rgba(4,8,14,0.95) 100%),
    linear-gradient(180deg, rgba(4,8,14,0.4), transparent 40%, rgba(4,8,14,0.7));
}
.title-content {
  position: relative; z-index: 3; text-align: center;
  display: flex; flex-direction: column; align-items: center;
  padding: 0 24px; max-width: 760px;
}
.title-kicker {
  font-size: 13px; letter-spacing: .45em; text-transform: uppercase;
  color: var(--teal); font-weight: 700; margin-bottom: 24px;
  text-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
}
.title-logo {
  font-family: var(--font-display);
  font-size: clamp(90px, 15vw, 196px); line-height: 0.95;
  padding-top: .1em;
  letter-spacing: -.02em; color: var(--text);
  text-shadow: 0 10px 40px rgba(0,0,0,0.65), 0 0 30px rgba(255,255,255,0.05);
}
.title-logo span { color: var(--gold); }
.title-sub { margin-top: 18px; font-size: clamp(15px, 2vw, 21px); color: var(--muted); font-weight: 300; }
.title-sub b { color: var(--text); font-weight: 600; }

.scenario-card {
  margin-top: 36px; width: 100%; text-align: left; flex: 0 0 auto;
  background: rgba(12, 24, 43, 0.65); backdrop-filter: blur(20px);
  border: 1px solid var(--line-bright); border-radius: var(--radius);
  padding: 24px 28px; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.scenario-tag {
  font: 700 11px/1 var(--font-mono); letter-spacing: .3em; color: var(--teal);
  text-transform: uppercase; margin-bottom: 12px;
}
.scenario-card h2 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.scenario-card > p { margin-top: 8px; color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.scenario-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 20px 0 16px; }
.scenario-stats .s { background: rgba(4,8,14,0.45); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 8px; text-align: center; }
.scenario-stats .s .k { font-size: 11px; color: var(--faint); font-weight: 600; text-transform: uppercase; }
.scenario-stats .s .v { font: 600 18px/1 var(--font-mono); margin-top: 6px; color: var(--text); }
.scenario-goals { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.scenario-goals li { font-size: 12.5px; color: var(--muted); background: rgba(56, 189, 248, 0.08); border: 1px solid rgba(56, 189, 248, 0.22); padding: 6px 12px; border-radius: 999px; }
.scenario-goals li::before { content: "⟡ "; color: var(--teal); }

.title-foot { margin-top: 26px; font: 500 11px/1 var(--font-mono); letter-spacing: .25em; color: var(--faint); text-transform: uppercase; }
.title-copyright { display: block; margin-top: 8px; letter-spacing: .1em; text-transform: none; opacity: .85; }

/* 🌟 Premium Buttons */
.btn-primary {
  position: relative; cursor: pointer; border: none; overflow: hidden;
  font-family: var(--font-body); color: #04080e; font-weight: 800;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  border-radius: 12px; padding: 14px 28px; font-size: 15.5px;
  display: inline-flex; align-items: center; gap: 10px;
  box-shadow: 0 10px 25px rgba(56, 189, 248, 0.25), inset 0 1px 0 rgba(255,255,255,0.3);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow .25s ease;
}
.btn-primary .btn-sub { font: 600 11px/1 var(--font-mono); opacity: .8; color: rgba(4,8,14,0.7); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 15px 35px rgba(56, 189, 248, 0.42); }
.btn-primary:active { transform: translateY(-1px); }
.btn-primary:disabled { filter: grayscale(.8) brightness(.6); cursor: not-allowed; box-shadow: none; transform: none; }
.btn-xl { margin-top: 36px; padding: 18px 48px; font-size: 18.5px; border-radius: 14px; background: linear-gradient(135deg, var(--gold-bright), var(--gold)); box-shadow: 0 10px 25px rgba(245, 166, 35, 0.25), inset 0 1px 0 rgba(255,255,255,0.4); }
.btn-xl:hover { box-shadow: 0 16px 35px rgba(245, 166, 35, 0.45); }
.btn-glow { position: absolute; inset: 0; background: radial-gradient(120px 60px at var(--mx,50%) 50%, rgba(255,255,255,.45), transparent 70%); opacity: 0; transition: opacity .3s; }
.btn-xl:hover .btn-glow { opacity: 1; }
.btn-arrow { font-size: 12px; }

/* Entrance Reveal */
.reveal { opacity: 0; transform: translateY(24px); animation: reveal-up .8s cubic-bezier(.16,1,.3,1) forwards; animation-delay: calc(var(--d) * 110ms + 200ms); }
@keyframes reveal-up { to { opacity: 1; transform: none; } }

/* ════════════════ 게임 화면 레이아웃 ════════════════ */
.game-screen {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px; padding: 16px;
}

/* Glass HUD */
.hud {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px;
  background: var(--panel); backdrop-filter: blur(20px);
  border: 1px solid var(--line-bright); border-radius: var(--radius);
  padding: 12px 20px; box-shadow: 0 15px 40px rgba(0,0,0,.4);
}
.hud-brand { display: flex; align-items: center; gap: 16px; }
.hud-logo { font-family: var(--font-display); font-size: 28px; color: var(--gold-bright); letter-spacing: -.02em; text-shadow: 0 0 15px rgba(255, 204, 0, 0.25); }
.hud-term { display: flex; flex-direction: column; line-height: 1.3; }
.hud-date { font: 600 15px/1.2 var(--font-mono); color: var(--text); }
.hud-level { font-size: 11.5px; color: var(--teal); letter-spacing: .05em; font-weight: 600; text-transform: uppercase; }

.hud-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.stat {
  position: relative; background: rgba(4,8,14,0.48); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 15px; overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.stat:hover {
  border-color: var(--sc, var(--line-neon));
  background: rgba(10, 20, 38, 0.8);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 15px var(--sc, rgba(0, 242, 254, 0.15));
  transform: translateY(-2px);
}
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--sc, var(--muted)); box-shadow: 2px 0 10px var(--sc); }
.stat .label { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; font-weight: 600; }
.stat .label .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sc); box-shadow: 0 0 10px var(--sc); }
.stat .value { font: 600 23px/1 var(--font-mono); margin-top: 6px; color: var(--text); letter-spacing: -.03em; text-shadow: 0 0 10px rgba(255,255,255,0.05); }
.stat .value .unit { font-size: 12.5px; color: var(--faint); margin-left: 2px; }
.stat .bar { height: 4px; margin-top: 9px; background: rgba(255,255,255,.05); border-radius: 2px; overflow: hidden; }
.stat .bar i { display: block; height: 100%; background: var(--sc); border-radius: 2px; transition: width .8s cubic-bezier(.16,1,.3,1); }
.stat.flash-up { animation: flash-up .7s ease; }
.stat.flash-down { animation: flash-down .7s ease; }
@keyframes flash-up { 0%,100%{ background: rgba(4,8,14,0.48);} 30%{ background: rgba(0,255,135,0.22); border-color: var(--green); } }
@keyframes flash-down { 0%,100%{ background: rgba(4,8,14,0.48);} 30%{ background: rgba(255,42,95,0.22); border-color: var(--rose); } }

.hud-actions { display: flex; align-items: center; gap: 16px; }
.turn-pill { font: 600 13px/1 var(--font-mono); color: var(--muted); text-align: right; }
.turn-pill span { font-size: 24px; color: var(--text); font-weight: 700; text-shadow: 0 0 10px rgba(255,255,255,0.05); }
.turn-pill i { font-style: normal; color: var(--faint); margin-left: 4px; }
.end-turn-spin { animation: spin .5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes spin { from{ transform: rotate(0);} to{ transform: rotate(3deg);} }

/* Board Panel layout */
.board { display: grid; grid-template-columns: 1fr 410px; gap: 16px; min-height: 0; }

.panel {
  background: var(--panel); backdrop-filter: blur(20px);
  border: 1px solid var(--line-bright); border-radius: var(--radius);
  display: flex; flex-direction: column; min-height: 0;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
  transition: border-color 0.3s;
}
.panel:hover { border-color: var(--line-neon); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.panel-head h3 { font-size: 14px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: baseline; gap: 8px; }
.panel-head h3 em { font: 600 11px/1 var(--font-mono); color: var(--faint); font-style: normal; }

.map-panel { overflow: hidden; position: relative; }
.map-stage { position: relative; flex: 1; min-height: 0; cursor: grab; }
.map-stage:active { cursor: grabbing; }

/* 맵 컨트롤 버튼 그룹 (우상단): 뷰 감상 · 초기 뷰 */
.map-controls { position: absolute; top: 12px; right: 12px; z-index: 6; display: flex; gap: 8px; }
.map-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: 700 12px/1 var(--font-mono); letter-spacing: .02em;
  color: var(--teal); cursor: pointer;
  background: rgba(6, 14, 26, 0.72); backdrop-filter: blur(8px);
  border: 1px solid var(--line-neon); border-radius: 9px;
  padding: 8px 11px; box-shadow: 0 6px 18px rgba(0,0,0,0.4);
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease, color .2s ease;
}
.map-btn:hover {
  color: var(--text); background: rgba(0, 242, 254, 0.14);
  transform: translateY(-1px); box-shadow: 0 0 18px rgba(0, 242, 254, 0.35);
}
.map-btn:active { transform: translateY(0); }
/* 감상 모드 활성 상태 (자동 회전 중) — 청록 채움 + 은은한 맥동 */
.map-btn.on {
  color: #04080e; background: var(--teal); border-color: var(--teal);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.5);
  animation: admire-pulse 2s ease-in-out infinite;
}
.map-btn.on:hover { color: #04080e; background: var(--teal); }
@keyframes admire-pulse {
  0%,100% { box-shadow: 0 0 14px rgba(0,242,254,.4); }
  50%     { box-shadow: 0 0 26px rgba(0,242,254,.75); }
}
#city-canvas { width: 100%; height: 100%; display: block; }
.map-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; max-width: 70%; justify-content: flex-end; }
.map-legend .lg { font-size: 10.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.map-legend .lg i { width: 10px; height: 10px; border-radius: 3px; }

/* 🌟 Glowing Tooltip */
.tile-tip {
  position: absolute; pointer-events: none; z-index: 10; opacity: 0;
  background: rgba(10, 20, 38, 0.94); border: 1px solid var(--teal);
  border-radius: 10px; padding: 9px 13px; transform: translate(-50%, -130%);
  transition: opacity .18s ease; box-shadow: 0 10px 30px rgba(0, 242, 254, 0.25); white-space: nowrap;
}
.tile-tip .tt-name { font-size: 14px; font-weight: 800; color: var(--text); }
.tile-tip .tt-role { font-size: 11.5px; color: var(--muted); margin-top: 3px; font-weight: 500; }

/* Help text overlay for 3D Camera Controls */
.map-panel::after {
  content: "🖱️ Drag to rotate, Scroll to zoom, Right-drag to pan 3D map";
  position: absolute; left: 20px; bottom: 15px; font-size: 10.5px;
  color: var(--faint); pointer-events: none; font-weight: 600; letter-spacing: 0.05em;
  background: rgba(4,8,14,0.6); padding: 4px 10px; border-radius: 20px; border: 1px solid var(--line);
}

.floaters { position: absolute; inset: 0; pointer-events: none; z-index: 12; }
.floater { position: absolute; font: 800 15px/1 var(--font-mono); animation: float-up 1.5s cubic-bezier(0.1, 0.8, 0.3, 1) forwards; text-shadow: 0 3px 10px rgba(0,0,0,.7); }
.floater.pos { color: var(--green); }
.floater.neg { color: var(--rose); }
@keyframes float-up { 0%{ opacity: 0; transform: translateY(10px) scale(.85);} 15%{ opacity: 1;} 100%{ opacity: 0; transform: translateY(-56px) scale(1.05);} }

/* Policy Cards panel */
.policy-panel { min-height: 0; }
/* English category labels are wider than the original Korean ones, so let the
   filter sit on its own full-width row below the title and wrap its buttons —
   this keeps ALL category tabs visible instead of clipping the last ones. */
.policy-panel .panel-head { flex-wrap: wrap; row-gap: 10px; }
.policy-filter { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; }
.policy-filter button { font-size: 11px; color: var(--muted); font-weight: 700; background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; cursor: pointer; transition: all .2s; }
.policy-filter button.on { color: #04080e; border-color: var(--teal); background: var(--teal); box-shadow: 0 0 10px rgba(0, 242, 254, 0.3); }
.policy-list { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }

/* 🌟 Luxury Policy Cards */
.pcard {
  position: relative; flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 14px; padding: 15px 16px;
  background: rgba(15, 28, 48, 0.38);
  cursor: pointer; transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1); overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
.pcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--cc); box-shadow: 2px 0 10px var(--cc); }
/* Glass shine sweep effect */
.pcard::after {
  content: ""; position: absolute; top: 0; left: -150%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  transform: skewX(-20deg); pointer-events: none;
}
.pcard:hover {
  transform: translateY(-4px); border-color: var(--cc);
  background: rgba(15, 28, 48, 0.65);
  box-shadow: 0 12px 30px rgba(0,0,0,0.45), 0 0 15px var(--cc);
}
.pcard:hover::after {
  left: 150%;
  transition: all 0.75s ease;
}
.pcard.locked { filter: grayscale(0.8) opacity(0.35); cursor: not-allowed; background: rgba(5,10,20,0.2); }
.pcard.locked:hover { transform: none; box-shadow: none; border-color: rgba(255,255,255,0.05); }
.pcard.locked::after { display: none; }
.pcard.cant { filter: brightness(0.65); }
.pcard.cant:hover { border-color: rgba(255,93,108,0.3); }
.pcard.enacted { filter: saturate(0.4) brightness(0.75); cursor: default; }
.pcard.enacted:hover { transform: none; box-shadow: none; border-color: rgba(255,255,255,0.05); }
.pcard.enacted::after { display: none; }
.pcard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pcard-cat { font: 700 10px/1 var(--font-mono); letter-spacing: .15em; color: var(--cc); text-transform: uppercase; }
.pcard-name { font-size: 16px; font-weight: 800; margin-top: 6px; color: var(--text); letter-spacing: -0.01em; }
.pcard-cost { text-align: right; font: 700 15px/1.3 var(--font-mono); color: var(--gold-bright); white-space: nowrap; }
.pcard-cost small { display: block; font-size: 10px; color: var(--muted); font-weight: 500; }
.pcard-fx { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.fx { font: 600 11px/1 var(--font-mono); padding: 4px 8px; border-radius: 6px; background: rgba(4,8,14,0.4); border: 1px solid var(--line); }
.fx.up { color: var(--green); border-color: rgba(0, 255, 135, 0.15); } 
.fx.down { color: var(--rose); border-color: rgba(255, 42, 95, 0.15); }
.pcard-lock { position: absolute; right: 14px; bottom: 13px; font-size: 10.5px; color: var(--teal); font-weight: 700; }
.pcard-syn { margin-top: 10px; font-size: 11px; color: var(--teal); font-weight: 600; display: flex; align-items: center; gap: 4px; }

/* Bottom Dock (Charts + Logs) */
.dock { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; height: 210px; }
.chart-panel, .log-panel { min-height: 0; }
#chart-canvas { width: 100%; flex: 1; min-height: 0; padding: 10px 16px 16px; }
.chart-legend, .log-hint { display: flex; gap: 14px; }
.chart-legend .cl { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; font-weight: 500; }
.chart-legend .cl i { width: 12px; height: 3px; border-radius: 2px; }
.log-hint { font-size: 11px; color: var(--faint); font-weight: 500; }
.log-list { flex: 1; overflow-y: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; }
.log-line { flex: 0 0 auto; font: 500 11.5px/1.5 var(--font-mono); color: var(--muted); padding: 4px 10px; border-radius: 6px; border-left: 3px solid transparent; }
.log-line.imm { color: var(--text); border-left-color: var(--blue); background: rgba(56, 189, 248, 0.04); }
.log-line.side { color: var(--rose); border-left-color: var(--rose); background: rgba(255, 42, 95, 0.02); }
.log-line.long { color: var(--teal); border-left-color: var(--teal); background: rgba(0, 242, 254, 0.02); }
.log-line.syn { color: var(--gold-bright); border-left-color: var(--gold); }
.log-line.level { color: var(--violet); border-left-color: var(--violet); background: rgba(140, 82, 255, 0.08); font-weight: 700; }

/* Custom Scrollbars */
.policy-list::-webkit-scrollbar, .log-list::-webkit-scrollbar { width: 6px; }
.policy-list::-webkit-scrollbar-thumb, .log-list::-webkit-scrollbar-thumb { background: rgba(56, 189, 248, 0.15); border-radius: 8px; }

/* ════════════════ 모달 ════════════════ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: rgba(4,8,14,0.85); backdrop-filter: blur(10px);
  opacity: 0; visibility: hidden; transition: .4s cubic-bezier(0.16,1,.3,1);
}
.modal-backdrop.show { opacity: 1; visibility: visible; }
.modal {
  position: relative; width: min(480px, 92vw); text-align: center;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line-bright); border-radius: 22px; padding: 44px 38px;
  box-shadow: 0 40px 120px rgba(0,0,0,.65); overflow: hidden;
  transform: scale(.9); transition: transform .5s cubic-bezier(.16,1,.3,1);
}
.modal-backdrop.show .modal { transform: scale(1); }
.result-glow { position: absolute; top: -35%; left: 50%; transform: translateX(-50%); width: 380px; height: 380px; border-radius: 50%; filter: blur(80px); opacity: .45; background: var(--gold); }
.result-kicker { font: 700 11px/1 var(--font-mono); letter-spacing: .35em; text-transform: uppercase; color: var(--muted); position: relative; }
.result-score { font-family: var(--font-display); font-size: 96px; line-height: 1; margin: 16px 0 6px; color: var(--gold); position: relative; text-shadow: 0 0 20px rgba(245, 166, 35, 0.3); }
.result-title { font-size: 28px; font-weight: 800; position: relative; letter-spacing: -0.02em; }
.result-desc { color: var(--muted); margin-top: 12px; font-size: 14.5px; position: relative; line-height: 1.5; }
.result-breakdown { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 24px 0; position: relative; }
.result-breakdown .b { background: rgba(4,8,14,0.4); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.result-breakdown .b .k { font-size: 11px; color: var(--faint); font-weight: 700; text-transform: uppercase; }
.result-breakdown .b .v { font: 600 19px/1 var(--font-mono); margin-top: 5px; }

/* Glowing Toasts */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 20px);
  z-index: 300; background: rgba(10, 20, 38, 0.96); border: 1px solid var(--line-neon);
  color: var(--text); padding: 13px 24px; border-radius: 12px; font-size: 14px; font-weight: 700;
  opacity: 0; visibility: hidden; transition: all .35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 15px 40px rgba(0,0,0,.5);
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.toast.bad { border-color: var(--rose); box-shadow: 0 10px 30px rgba(255, 42, 95, 0.22); }
.toast.good { border-color: var(--green); box-shadow: 0 10px 30px rgba(0, 255, 135, 0.22); }

@media (max-width: 980px) {
  .board { grid-template-columns: 1fr; }
  .hud { grid-template-columns: 1fr; gap: 12px; }
  .hud-stats { grid-template-columns: repeat(5, 1fr); }
}

#start-btn {
  animation: reveal-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards, pulse-glow-gold 2.5s infinite alternate;
  animation-delay: 640ms, 1440ms;
}
@keyframes pulse-glow-gold {
  0% { box-shadow: 0 0 10px rgba(255, 204, 0, 0.3), inset 0 1px 0 rgba(255,255,255,0.4); }
  100% { box-shadow: 0 0 25px rgba(255, 204, 0, 0.7), 0 0 5px rgba(255, 204, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.5); }
}

#end-turn-btn {
  animation: pulse-glow-teal 2.5s infinite alternate;
}
@keyframes pulse-glow-teal {
  0% { box-shadow: 0 0 10px rgba(0, 242, 254, 0.3), inset 0 1px 0 rgba(255,255,255,0.3); }
  100% { box-shadow: 0 0 25px rgba(0, 242, 254, 0.7), 0 0 5px rgba(0, 242, 254, 0.4), inset 0 1px 0 rgba(255,255,255,0.4); }
}

/* ══════════════════════════════════════════════════════════════════
   ✦ PREMIUM POLISH — 정성 디테일 (JS 구조 불변, 시각만 강화)
   유리 깊이 · 정밀 헤더 · 라이브 상태 · 게이지 글로우 · 진입 스태거
   ══════════════════════════════════════════════════════════════════ */

/* 게임 화면 대기 분위기 — 상단 청록 광원 + 하단 보라 광원 */
.game-screen::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(85% 42% at 50% -8%, rgba(0,242,254,.055), transparent 60%),
    radial-gradient(65% 48% at 100% 108%, rgba(140,82,255,.05), transparent 55%);
}
.game-screen > * { position: relative; z-index: 1; }

/* 유리 상단 하이라이트 — HUD·패널에 얇은 빛 반사선 */
.hud { box-shadow: 0 16px 42px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.07); }
.panel { box-shadow: 0 22px 54px rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.06); }

/* HUD — 상단 골드 헤어라인 + 좌측 라이브 상태 점 */
.hud { position: relative; }
.hud::before {
  content: ""; position: absolute; top: 0; left: 26px; right: 26px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,204,0,.5), transparent);
}
.hud-brand { position: relative; padding-left: 18px; }
.hud-brand::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 10px var(--green); animation: live-pulse 1.9s ease-in-out infinite;
}
@keyframes live-pulse { 0%,100%{ opacity: 1; transform: translateY(-50%) scale(1);} 50%{ opacity: .4; transform: translateY(-50%) scale(.82);} }

/* 패널 헤더 — 좌측 청록 틱 + 하단 스캔 헤어라인 */
.panel-head { position: relative; }
.panel-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-neon), transparent); opacity: .7;
}
.panel-head h3 { position: relative; padding-left: 13px; }
.panel-head h3::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 13px; border-radius: 2px; background: var(--teal); box-shadow: 0 0 8px var(--teal);
}

/* 지표 카드 — 게이지 선단 글로우 + 상단 유리 하이라이트 */
.stat { box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.stat .bar i { box-shadow: 0 0 8px var(--sc); }
.stat .value { font-variant-numeric: tabular-nums; }

/* 정책 카드 — 분류 알약 칩 + 유리 하이라이트 */
.pcard { box-shadow: 0 6px 16px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.05); }
.pcard-cat {
  display: inline-block; padding: 3px 9px; border-radius: 999px; letter-spacing: .12em;
  background: color-mix(in srgb, var(--cc) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--cc) 34%, transparent);
}
.pcard-name { margin-top: 9px; }
.pcard-cost { font-variant-numeric: tabular-nums; }

/* 로그 라인 — 호버 시 살짝 밝아지는 인터랙션 */
.log-line { transition: background .2s, transform .2s; }
.log-line:hover { background: rgba(255,255,255,.045); transform: translateX(2px); }

/* 3D 조작 안내 — 은은한 한국어로 교체 */
.map-panel::after { content: "drag to rotate · scroll to zoom · right-click to pan"; }

/* 턴 종료 영역 — 정밀한 프레임 */
.turn-pill { padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(4,8,14,.4); }
.turn-pill span { font-variant-numeric: tabular-nums; }

/* 게임 화면 진입 — HUD → 보드 → 도크 순차 등장 */
.game-screen.is-active .hud   { animation: panel-in .55s cubic-bezier(.16,1,.3,1) both; }
.game-screen.is-active .board { animation: panel-in .65s .09s cubic-bezier(.16,1,.3,1) both; }
.game-screen.is-active .dock  { animation: panel-in .65s .18s cubic-bezier(.16,1,.3,1) both; }
@keyframes panel-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

