/* ============================================================
   Crownfall v0.1 — game.css
   Royal / medieval theme: parchment, gold, crimson, deep night.
   ============================================================ */

:root{
  --night:      #14110d;
  --night-2:    #1e1a13;
  --panel:      #241f17;
  --panel-2:    #2c2619;
  --ink:        #f2e6c8;
  --ink-dim:    #c9b98f;
  --muted:      #8f7f5e;
  --gold:       #e3b23c;
  --gold-deep:  #a9812a;
  --crimson:    #b5303a;
  --line:       #4a3c24;
  --edge:       #6b5a35;
  --good:       #6fbf73;
  --bad:        #d9605f;
  --shadow:     0 6px 22px rgba(0,0,0,.5);
  --radius:     10px;
}

*{ box-sizing: border-box; }

html,body{
  margin:0; height:100%;
  background:
    radial-gradient(1200px 700px at 50% -10%, #2a2417 0%, var(--night) 60%),
    var(--night);
  color:var(--ink);
  font-family:"Iowan Old Style","Palatino Linotype","Book Antiqua",Georgia,serif;
  -webkit-font-smoothing:antialiased;
}

#app{ display:flex; flex-direction:column; height:100vh; overflow:hidden; }

/* ---------------- Top bar ---------------- */
#topbar{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:10px 18px;
  background:linear-gradient(180deg,#2b2417,#1c180f);
  border-bottom:2px solid var(--gold-deep);
  box-shadow:var(--shadow);
  z-index:5;
}
.brand{ display:flex; align-items:center; gap:12px; }
.brand .crown{ font-size:34px; color:var(--gold); text-shadow:0 0 12px rgba(227,178,60,.5); }
.brand-text h1{ margin:0; font-size:26px; letter-spacing:3px; color:var(--gold); }
.brand-text .subtitle{ font-size:12px; color:var(--muted); letter-spacing:1px; }

#turn-info{ display:flex; gap:22px; }
#turn-info .stat{ display:flex; flex-direction:column; align-items:center; min-width:64px; }
#turn-info .label{ font-size:11px; text-transform:uppercase; letter-spacing:1px; color:var(--muted); }
#turn-info .value{ font-size:19px; color:var(--ink); }
.coin{ color:var(--gold); font-size:11px; margin-left:3px; vertical-align:middle; }

#topbar-actions{ display:flex; gap:10px; }

/* ---------------- Buttons ---------------- */
.btn{
  font-family:inherit; font-size:14px; cursor:pointer;
  color:var(--ink); background:var(--panel-2);
  border:1px solid var(--line); border-radius:8px;
  padding:9px 14px; transition:.15s;
}
.btn:hover{ border-color:var(--gold-deep); background:#332b1b; }
.btn:disabled{ opacity:.4; cursor:not-allowed; }
.btn-primary{
  background:linear-gradient(180deg,var(--gold),var(--gold-deep));
  color:#241a06; font-weight:700; border:none; letter-spacing:.5px;
}
.btn-primary:hover{ filter:brightness(1.08); background:linear-gradient(180deg,var(--gold),var(--gold-deep)); }
.btn-ghost{ background:transparent; }
.btn-small{ padding:6px 10px; font-size:13px; }
.btn-council{ display:flex; justify-content:space-between; align-items:center; gap:8px; width:100%; }
.btn-council .cost{ font-size:11px; color:var(--gold); }

/* ---------------- Main layout ---------------- */
#main{ flex:1; display:grid; grid-template-columns:250px 1fr 320px; min-height:0; }

.panel{
  background:linear-gradient(180deg,var(--panel),var(--night-2));
  border-right:1px solid var(--line);
  padding:14px; overflow-y:auto;
}
#right-panel{ border-right:none; border-left:1px solid var(--line); display:flex; flex-direction:column; gap:14px; }

.panel-title{
  margin:0 0 10px; font-size:13px; letter-spacing:2px; text-transform:uppercase;
  color:var(--gold); border-bottom:1px solid var(--line); padding-bottom:6px;
}

/* ---------------- House list ---------------- */
#house-list{ list-style:none; margin:0 0 20px; padding:0; }
.house-row{
  display:flex; align-items:center; gap:10px; padding:9px 8px; margin-bottom:6px;
  border-radius:8px; background:var(--night-2); border:1px solid transparent;
}
.house-row.you{ border-color:var(--gold-deep); box-shadow:inset 0 0 0 1px rgba(227,178,60,.2); }
.house-row.active{ background:#33291a; }
.house-row.eliminated{ opacity:.4; text-decoration:line-through; }
.house-swatch{ width:16px; height:16px; border-radius:4px; flex:none; box-shadow:0 0 0 1px rgba(0,0,0,.4); }
.house-meta{ flex:1; min-width:0; }
.house-name{ font-size:14px; }
.house-sub{ font-size:11px; color:var(--muted); }
.house-count{ font-size:14px; color:var(--ink-dim); }
.house-tag{ font-size:10px; color:#241a06; background:var(--gold); border-radius:4px; padding:1px 5px; margin-left:6px; }

/* ---------------- Throne box ---------------- */
.throne-box{ text-align:center; background:var(--night-2); border:1px solid var(--line);
  border-radius:var(--radius); padding:14px; }
.throne-crown{ font-size:30px; color:var(--gold); }
#throne-holder{ font-size:14px; margin-top:4px; color:var(--ink-dim); }
.throne-progress{ font-size:12px; color:var(--gold); margin-top:6px; min-height:16px; }

/* ---------------- Map ---------------- */
#map-wrap{ position:relative; background:
    radial-gradient(900px 600px at 50% 40%, #26210f 0%, #171307 70%);
  display:flex; align-items:center; justify-content:center; overflow:hidden; }
#map{ width:100%; height:100%; }

#edges line{ stroke:var(--edge); stroke-width:2; opacity:.5; }
#edges line.hot{ stroke:var(--gold); opacity:.9; stroke-width:3; }

.node{ cursor:pointer; }
.node .disc{ stroke:#0d0b07; stroke-width:2.5; transition:.12s; }
.node:hover .disc{ stroke:var(--ink); }
.node.selected .disc{ stroke:var(--gold); stroke-width:4; }
.node.target .disc{ stroke:#fff; stroke-dasharray:4 3; }
.node.target{ filter:drop-shadow(0 0 6px rgba(255,255,255,.6)); }
.node .p-name{ fill:var(--ink); font-size:12px; text-anchor:middle; paint-order:stroke;
  stroke:#0d0b07; stroke-width:3px; font-family:inherit; pointer-events:none; }
.node .p-army{ fill:#fff; font-size:14px; font-weight:700; text-anchor:middle; dominant-baseline:central;
  paint-order:stroke; stroke:#0d0b07; stroke-width:3px; pointer-events:none; }
.node .crown-mark{ fill:var(--gold); font-size:15px; text-anchor:middle; pointer-events:none; }

.map-hint{
  position:absolute; bottom:12px; left:50%; transform:translateX(-50%);
  background:rgba(20,17,13,.85); border:1px solid var(--line); color:var(--ink-dim);
  padding:6px 14px; border-radius:20px; font-size:13px; pointer-events:none;
}

/* ---------------- Selection box ---------------- */
#sel-name{ margin:4px 0 10px; color:var(--gold); font-size:18px; }
.sel-row{ display:flex; justify-content:space-between; font-size:13px; padding:4px 0;
  border-bottom:1px dotted var(--line); color:var(--ink-dim); }
.sel-row span:last-child{ color:var(--ink); }
.slider-label{ display:block; margin:12px 0 4px; font-size:13px; color:var(--ink-dim); }
#march-slider{ width:100%; accent-color:var(--gold); }
.hint{ font-size:11px; color:var(--muted); margin:6px 0 0; }
#recruit-controls{ margin-top:12px; }

/* ---------------- Council ---------------- */
.council-actions{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.chip{ font-size:10px; background:var(--good); color:#0d1a0d; border-radius:10px; padding:1px 7px; vertical-align:middle; }
.chip.spent{ background:var(--muted); color:#1a1509; }

/* ---------------- Chronicle ---------------- */
#chronicle-box{ flex:1; min-height:120px; display:flex; flex-direction:column; }
#chronicle{ list-style:none; margin:0; padding:0; overflow-y:auto; flex:1; font-size:13px; }
#chronicle li{ padding:6px 8px; border-left:3px solid var(--line); margin-bottom:4px;
  background:var(--night-2); border-radius:0 6px 6px 0; color:var(--ink-dim); line-height:1.35; }
#chronicle li.battle{ border-left-color:var(--crimson); }
#chronicle li.capture{ border-left-color:var(--gold); }
#chronicle li.decree{ border-left-color:#7a9ec4; }
#chronicle li.turn{ border-left-color:var(--good); color:var(--ink); }
#chronicle li .who{ font-weight:700; }

/* ---------------- Modal & banner ---------------- */
.hidden{ display:none !important; }
.muted{ color:var(--muted); font-size:13px; }

.modal{ position:fixed; inset:0; background:rgba(8,6,3,.72); display:flex;
  align-items:center; justify-content:center; z-index:20; }
.modal-card{ background:linear-gradient(180deg,var(--panel-2),var(--night-2));
  border:1px solid var(--gold-deep); border-radius:14px; padding:26px; width:320px;
  text-align:center; box-shadow:var(--shadow); }
.modal-card h2{ color:var(--gold); margin:0 0 16px; letter-spacing:2px; }
.menu-buttons{ display:flex; flex-direction:column; gap:8px; }
.menu-note{ font-size:11px; color:var(--muted); margin:16px 0 0; }

.banner{ position:fixed; inset:0; display:flex; align-items:center; justify-content:center;
  background:rgba(8,6,3,.8); z-index:30; }
.banner-inner{ text-align:center; background:linear-gradient(180deg,#2e2716,#191408);
  border:2px solid var(--gold); border-radius:16px; padding:34px 46px; box-shadow:var(--shadow); }
#banner-text{ font-size:24px; color:var(--gold); margin-bottom:18px; line-height:1.4; }

/* ---------------- v0.2: crests, unit & fort marks ---------------- */
.crest{ width:22px; height:26px; flex:none; object-fit:contain;
  filter:drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
.node .p-knight{ fill:#ffe9a8; font-size:11px; font-weight:700; text-anchor:middle;
  paint-order:stroke; stroke:#0d0b07; stroke-width:3px; pointer-events:none; }
.node .p-fort{ fill:#cfe3ff; font-size:10px; text-anchor:middle;
  paint-order:stroke; stroke:#0d0b07; stroke-width:3px; pointer-events:none; letter-spacing:-1px; }

/* diplomacy status chips */
.dchip{ font-size:9px; text-transform:uppercase; letter-spacing:.5px; border-radius:8px;
  padding:1px 6px; margin-left:4px; vertical-align:middle; }
.dchip.war{ background:#3a1c1e; color:#e79a9a; border:1px solid #6e2a2e; }
.dchip.peace{ background:#1c2f3a; color:#9ad0e7; border:1px solid #2a5a6e; }
.dchip.ally{ background:#1c3a24; color:#9ae7ab; border:1px solid #2a6e3c; }

/* recruit buttons */
#recruit-controls{ display:flex; gap:8px; margin-top:12px; }
#recruit-controls .btn{ flex:1; }

/* diplomacy modal */
.modal-card.wide{ width:440px; }
.diplo-row{ background:var(--night-2); border:1px solid var(--line); border-radius:8px;
  padding:10px; margin-bottom:8px; text-align:left; }
.diplo-head{ display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.diplo-name{ flex:1; font-size:14px; }
.diplo-rel{ font-size:11px; color:var(--muted); }
.diplo-btns{ display:flex; gap:8px; flex-wrap:wrap; }
.btn.danger{ border-color:#6e2a2e; color:#e79a9a; }
.btn.danger:hover{ background:#3a1c1e; }

/* menu sections */
.menu-section{ font-size:11px; letter-spacing:2px; text-transform:uppercase; color:var(--gold);
  text-align:left; margin:14px 0 6px; border-bottom:1px solid var(--line); padding-bottom:4px; }
.menu-buttons a.btn{ text-decoration:none; display:block; }
.seed-row{ display:flex; align-items:center; gap:8px; margin-top:4px; }
.seed-row label{ font-size:12px; color:var(--muted); }
.seed-row input{ flex:1; background:var(--night-2); border:1px solid var(--line); border-radius:6px;
  color:var(--ink); padding:6px 8px; font-family:inherit; }

/* ---------------- v0.3: Council Chamber & events ---------------- */
#council-advisors{ max-height:60vh; overflow-y:auto; margin:6px 0 12px; }
.advisor{ display:flex; gap:12px; padding:11px 12px; margin-bottom:8px; text-align:left;
  background:var(--night-2); border:1px solid var(--line); border-left:4px solid var(--edge);
  border-radius:8px; }
.advisor.stance-war{ border-left-color:var(--crimson); }
.advisor.stance-econ{ border-left-color:var(--gold); }
.advisor.stance-diplo{ border-left-color:#2f7fc4; }
.advisor.stance-caution{ border-left-color:#8f7f5e; }
.advisor.stance-faith{ border-left-color:#a879c4; }
.advisor.stance-lore{ border-left-color:#2e9e6a; }
.adv-icon{ font-size:22px; width:30px; text-align:center; color:var(--gold); flex:none; line-height:1.4; }
.adv-name{ color:var(--gold); font-weight:700; font-size:14px; }
.adv-domain{ font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:1px; margin-left:6px; }
.adv-verdict{ color:var(--ink); margin-top:2px; font-size:14px; }
.adv-detail{ color:var(--ink-dim); font-size:12.5px; margin-top:4px; font-style:italic; }
.event-text{ color:var(--ink-dim); line-height:1.55; margin:10px 0 18px; font-size:15px; }

/* ---------------- v0.5: buildings & roads ---------------- */
#build-controls{ margin-top:14px; border-top:1px solid var(--line); padding-top:10px; }
.build-head{ font-size:11px; color:var(--gold); letter-spacing:1.5px; text-transform:uppercase; margin-bottom:7px; }
#build-list{ display:flex; flex-direction:column; gap:5px; }
.build-item{ display:flex; justify-content:space-between; align-items:center; width:100%; gap:8px; }
.build-item .bcost{ font-size:11px; color:var(--gold); white-space:nowrap; }
.build-item.built{ opacity:.55; }
.build-item.built .bcost{ color:var(--good); }
.road-btn{ width:100%; margin-top:8px; }

/* ---------------- Scrollbars ---------------- */
::-webkit-scrollbar{ width:9px; }
::-webkit-scrollbar-thumb{ background:var(--line); border-radius:6px; }
::-webkit-scrollbar-track{ background:transparent; }

/* ---------------- Responsive ---------------- */
@media (max-width:1080px){
  #main{ grid-template-columns:210px 1fr 280px; }
  .brand-text h1{ font-size:22px; }
}
