* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: #0a0d14; color: #e6edf3;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; overflow: hidden; }

.hidden { display: none !important; }

/* Start screen */
#start-screen {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 1.5rem;
  background: radial-gradient(ellipse at center, #1a2337 0%, #060912 70%);
  z-index: 100;
}
#start-screen h1 { font-size: 4rem; letter-spacing: 0.3rem; margin: 0;
  background: linear-gradient(120deg, #d4af37, #ff6b3d); -webkit-background-clip: text;
  background-clip: text; color: transparent; text-shadow: 0 0 60px rgba(255,107,61,.3); }
#start-screen .tag { color: #9aa6b8; max-width: 600px; text-align: center; }
#start-screen .picker { display: flex; gap: .75rem; align-items: center; }
#start-screen select { padding: .6rem 1rem; background: #0e1422; color: #e6edf3;
  border: 1px solid #2a3552; border-radius: 4px; font-size: 1rem; min-width: 220px; }
#start-screen button { padding: .6rem 1.5rem; background: #d4af37; color: #1a1a1a;
  border: none; border-radius: 4px; font-weight: bold; cursor: pointer; font-size: 1rem;
  letter-spacing: .1em; }
#start-screen button:hover { background: #ffce5e; }
#start-screen .hint { color: #5a6577; font-size: .85rem; }

/* Game */
#game-root { display: flex; flex-direction: column; height: 100vh; }

#topbar { display: flex; align-items: center; gap: 1rem; padding: .5rem 1rem;
  background: linear-gradient(180deg, #161d2e, #0c1120); border-bottom: 1px solid #2a3552;
  flex-shrink: 0; }
.brand { font-weight: bold; letter-spacing: .15em; color: #d4af37; }
.resources { display: flex; gap: 1.25rem; flex: 1; }
.res { font-size: .85rem; color: #9aa6b8; letter-spacing: .05em; }
.res b { color: #e6edf3; margin-left: .35rem; font-size: 1rem; }
.res .goal { color: #5a6577; font-size: .75rem; }
.speed button { background: #0e1422; color: #9aa6b8; border: 1px solid #2a3552;
  padding: .35rem .7rem; cursor: pointer; font-weight: bold; }
.speed button.active { background: #d4af37; color: #1a1a1a; border-color: #d4af37; }
.speed button:first-child { border-radius: 4px 0 0 4px; }
.speed button:last-child { border-radius: 0 4px 4px 0; }
.speed button + button { border-left: none; }

#layout { display: flex; flex: 1; min-height: 0; }

#sidebar { width: 320px; background: #0c1120; border-right: 1px solid #2a3552;
  overflow-y: auto; flex-shrink: 0; }
.panel { padding: 1rem; border-bottom: 1px solid #1a2337; }
.panel h3 { margin: 0 0 .75rem 0; font-size: .8rem; letter-spacing: .15em;
  color: #9aa6b8; text-transform: uppercase; }

.view-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .25rem; }
.view-tabs button { background: #0e1422; color: #9aa6b8; border: 1px solid #1a2337;
  padding: .4rem; cursor: pointer; font-size: .8rem; }
.view-tabs button.active { background: #1e3a8a; color: #fff; border-color: #3b82f6; }
.view-tabs button:hover { color: #e6edf3; }

#country-info { font-size: .85rem; line-height: 1.5; }
#country-info.info-empty { color: #5a6577; font-style: italic; }
#country-info .row { display: flex; justify-content: space-between; padding: .15rem 0; }
#country-info .row span:first-child { color: #9aa6b8; }
#country-info .name { font-size: 1.05rem; font-weight: bold; margin-bottom: .35rem;
  display: flex; align-items: center; gap: .5rem; }
#country-info .flag-mini { width: 28px; height: 18px; border: 1px solid #000;
  display: inline-block; flex-shrink: 0; }
.actions { display: flex; flex-direction: column; gap: .35rem; margin-top: .75rem; }
.actions button { background: #1e3a8a; color: #fff; border: none; padding: .5rem;
  cursor: pointer; font-weight: bold; border-radius: 3px; }
.actions button:hover { background: #2563eb; }
.actions button.danger { background: #991b1b; }
.actions button.danger:hover { background: #dc2626; }
.actions button:disabled { background: #2a3552; color: #5a6577; cursor: not-allowed; }

#research-list { display: flex; flex-direction: column; gap: .5rem; }
.research-item { background: #0e1422; padding: .5rem; border: 1px solid #1a2337;
  border-radius: 3px; }
.research-item .top { display: flex; justify-content: space-between; align-items: center; }
.research-item .name { font-weight: bold; font-size: .9rem; }
.research-item .lvl { color: #d4af37; font-weight: bold; font-size: .85rem; }
.research-item .desc { color: #9aa6b8; font-size: .75rem; margin-top: .25rem; }
.research-item .progress { background: #1a2337; height: 6px; margin-top: .35rem;
  border-radius: 3px; overflow: hidden; }
.research-item .bar { background: linear-gradient(90deg, #3b82f6, #d4af37); height: 100%;
  transition: width .3s; }
.research-item .buy { background: #1e3a8a; color: #fff; border: none;
  padding: .25rem .5rem; cursor: pointer; font-size: .75rem; border-radius: 3px;
  margin-top: .35rem; width: 100%; }
.research-item .buy:hover { background: #2563eb; }
.research-item .buy:disabled { background: #2a3552; color: #5a6577; cursor: not-allowed; }

#log { list-style: none; padding: 0; margin: 0; max-height: 200px; overflow-y: auto;
  font-size: .8rem; }
#log li { padding: .25rem 0; color: #9aa6b8; border-bottom: 1px dotted #1a2337; }
#log li.good { color: #4ade80; }
#log li.bad { color: #f87171; }
#log li .ts { color: #5a6577; margin-right: .35rem; font-size: .7rem; }

#map-wrap { flex: 1; position: relative; overflow: hidden; background: #0a0d14; }
#map { display: block; width: 100%; height: 100%; cursor: crosshair; }

#legend { position: absolute; bottom: 1rem; left: 1rem; background: rgba(12,17,32,.85);
  padding: .5rem .75rem; border: 1px solid #2a3552; font-size: .75rem; color: #9aa6b8;
  pointer-events: none; }
#legend .swatch { display: inline-block; width: 14px; height: 10px; margin-right: .25rem;
  vertical-align: middle; border: 1px solid #000; }

#tooltip { position: absolute; background: rgba(12,17,32,.95); color: #e6edf3;
  border: 1px solid #d4af37; padding: .5rem .75rem; font-size: .8rem; pointer-events: none;
  border-radius: 3px; z-index: 50; max-width: 240px; }
#tooltip .name { font-weight: bold; color: #d4af37; margin-bottom: .25rem; }

#endgame { position: fixed; inset: 0; display: flex; align-items: center;
  justify-content: center; background: rgba(0,0,0,.7); z-index: 200; }
#endgame .card { background: #161d2e; padding: 2rem 3rem; border-radius: 6px;
  text-align: center; border: 2px solid #d4af37; max-width: 500px; }
#endgame h2 { color: #d4af37; font-size: 2.5rem; letter-spacing: .2em; margin: 0 0 1rem; }
#endgame.defeat h2 { color: #f87171; }
#endgame button { padding: .6rem 1.5rem; background: #d4af37; color: #1a1a1a;
  border: none; border-radius: 4px; font-weight: bold; cursor: pointer; margin-top: 1rem; }
