
:root{
  --bg:#0b1020;
  --panel:#121a33;
  --muted:#93a4c7;
  --text:#e8efff;
  --accent:#5bd6ff;
  --danger:#ff6b6b;
  --ok:#7dff9a;
  --border:rgba(255,255,255,.12);
  --shadow:0 6px 20px rgba(0,0,0,.35);
  --radius:14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 800px at 20% 0%, rgba(91,214,255,.15), transparent 55%),
              radial-gradient(1000px 700px at 80% 10%, rgba(125,255,154,.12), transparent 55%),
              var(--bg);
  color:var(--text);
}

a{color:inherit}

.app-header{
  position: sticky;
  top: 0;
  z-index: 10;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:14px 16px;
  background: rgba(11,16,32,.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.title h1{margin:0;font-size:18px;letter-spacing:.2px}
.subtitle{margin:2px 0 0;color:var(--muted);font-size:12px}

.header-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:flex-end}

.btn{
  border:1px solid var(--border);
  background: rgba(255,255,255,.06);
  color:var(--text);
  padding:8px 10px;
  border-radius:10px;
  cursor:pointer;
  box-shadow: var(--shadow);
  text-decoration:none;
  font-size: 13px;
}
.btn:hover{border-color:rgba(255,255,255,.28)}
.btn.primary{border-color:rgba(91,214,255,.45);background: rgba(91,214,255,.14)}
.btn.danger{border-color:rgba(255,107,107,.45);background: rgba(255,107,107,.12)}

.layout{padding:16px; max-width: 1400px; margin:0 auto;}
.panel{
  background: rgba(18,26,51,.88);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding:16px;
  box-shadow: var(--shadow);
}
.hidden{display:none !important}

.grid2{
  display:grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap:12px;
}
label{display:flex;flex-direction:column;gap:6px;color:var(--muted);font-size:13px}
input, select, textarea{
  background: rgba(255,255,255,.06);
  border:1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 10px;
  font-size: 14px;
  outline: none;
}
input:focus, select:focus, textarea:focus{border-color: rgba(91,214,255,.55)}
.row{display:flex;gap:10px;align-items:center;margin-top:14px}
.row.end{justify-content:flex-end}

.hint{color:var(--muted);font-size:12px}

.columns{
  display:grid;
  grid-template-columns: 1.1fr 1.4fr 1fr;
  gap:14px;
  margin-top:14px;
}
.col{min-width: 0;}
h2{margin:12px 0 10px; font-size:15px}
h3{margin:10px 0 8px; font-size:13px; color:var(--muted)}

.topbar{display:flex; align-items:center; justify-content:space-between; gap:14px}
.status{display:flex; gap:16px; flex-wrap:wrap; color:var(--muted); font-size:13px}
.status strong{color:var(--text)}

.action-board{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:8px;
}
.action{
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255,255,255,.05);
  display:flex;
  flex-direction:column;
  gap:6px;
}
.action .name{display:flex; justify-content:space-between; gap:10px; align-items:baseline}
.action .cap{font-family:var(--mono); font-size:11px; color:var(--muted)}
.action .desc{color:var(--muted); font-size:12px; line-height:1.25}
.action .meta{display:flex; justify-content:space-between; align-items:center; gap:10px}
.action .occupied{font-family:var(--mono); font-size:11px; color:var(--muted)}
.action .actbtn{margin-top:6px}
.action.disabled{opacity:.45}

.banquet{
  display:flex; flex-wrap:wrap; gap:8px;
}
.plate{
  border:1px solid var(--border);
  border-radius:12px;
  padding:8px 10px;
  min-width: 74px;
  background: rgba(255,255,255,.05);
}
.plate .n{font-family:var(--mono); font-size:12px; color:var(--muted)}
.plate .f{margin-top:4px; font-size: 13px}
.plate.full{border-color: rgba(125,255,154,.30)}
.plate.empty{border-color: rgba(255,255,255,.10)}

.supply{
  display:flex; gap:10px; flex-wrap:wrap; color:var(--muted); font-size:13px
}
.pill{
  border:1px solid var(--border);
  border-radius:999px;
  padding:6px 10px;
  background: rgba(255,255,255,.05);
}
.pill strong{color:var(--text)}

.market{display:grid; grid-template-columns: repeat(3, 1fr); gap:12px}
.cards{display:flex; flex-direction:column; gap:8px}
.card{
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px;
  background: rgba(255,255,255,.05);
  cursor:pointer;
}
.card:hover{border-color:rgba(255,255,255,.28)}
.card .title{display:flex; justify-content:space-between; gap:10px; font-size:13px}
.card .cost{font-family: var(--mono); color:var(--muted); font-size:12px}
.card .body{margin-top:6px; color:var(--muted); font-size:12px; line-height:1.25}
.card.selected{outline:2px solid rgba(91,214,255,.55)}

.players{display:flex; flex-direction:column; gap:12px}
.player{
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px;
  background: rgba(255,255,255,.04);
}
.player .head{display:flex; justify-content:space-between; gap:10px; align-items:center}
.player .name{font-weight:700; font-size:14px}
.player .tag{font-size:11px; color:var(--muted); font-family:var(--mono)}
.player .res{display:flex; flex-wrap:wrap; gap:8px; margin-top:8px}
.player .res .pill{box-shadow:none}
.player .mini{margin-top:8px; color:var(--muted); font-size:12px; display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:6px}
.player .grid{
  margin-top:10px;
  display:grid;
  grid-template-columns: repeat(5, 1fr);
  gap:6px;
}
.cell{
  border:1px solid var(--border);
  border-radius:10px;
  padding:8px;
  min-height: 44px;
  background: rgba(255,255,255,.04);
  font-size: 11px;
  color: var(--muted);
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
}
.cell.forest{border-color: rgba(125,255,154,.35); color: rgba(125,255,154,.9)}
.cell.building{border-color: rgba(91,214,255,.35); color: rgba(91,214,255,.95)}
.cell.empty{opacity:.8}

.log{
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px;
  background: rgba(0,0,0,.15);
  height: 560px;
  overflow:auto;
  font-family: var(--mono);
  font-size: 12px;
  white-space: pre-wrap;
}
.log .line{margin-bottom:8px}
.log .who{color:var(--accent)}
.log .bot{color:var(--ok)}
.log .warn{color:var(--danger)}
.log .ts{color:var(--muted); font-size: 11px}

dialog{
  border:1px solid var(--border);
  border-radius: 16px;
  background: rgba(18,26,51,.98);
  color: var(--text);
  box-shadow: var(--shadow);
  padding: 0;
}
.dlg-form{padding: 14px; min-width: 520px; max-width: 640px}
.dlg-form h3{margin:0 0 10px}
