/* KAELEN DOUR 2.5D — Campo di Battaglia / Campo Prove Unità 2.5D Sprite */
:root {
  --bg: #121c17;
  --panel: #182720;
  --panel-border: #6d5b3d;
  --gold: #dfbf82;
  --text: #ede1c6;
  --muted: #a79d85;
  --active: #3e6347;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 Georgia, serif;
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

#header {
  height: 52px;
  background: linear-gradient(90deg, #16261f, #22382b);
  border-bottom: 2px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  flex-shrink: 0;
  z-index: 10;
}

#header h1 {
  margin: 0;
  font-size: 17px;
  color: var(--gold);
  letter-spacing: .5px;
}
#header span {
  font-size: 12px;
  color: var(--muted);
  margin-left: 10px;
}
.header-links a, .header-links button {
  background: #1f3227;
  border: 1px solid var(--panel-border);
  color: #f1e2c3;
  padding: 6px 12px;
  border-radius: 3px;
  text-decoration: none;
  font-size: 12px;
  cursor: pointer;
}
.header-links a:hover, .header-links button:hover {
  background: var(--active);
  border-color: var(--gold);
}

#main-container {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

#world-view {
  flex: 1;
  position: relative;
  background: #1f3327;
  user-select: none;
}

canvas#battle {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}
canvas#battle:active {
  cursor: grabbing;
}

#ui-overlay {
  position: absolute;
  top: 14px;
  left: 14px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 5;
}
.hud-card {
  background: rgba(18, 30, 24, 0.90);
  border: 1px solid var(--panel-border);
  padding: 10px 14px;
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
  pointer-events: auto;
}
.hud-title {
  font-weight: bold;
  color: var(--gold);
  font-size: 13px;
  margin-bottom: 4px;
}
.hud-text {
  font-size: 12px;
  color: #d8ceb6;
}

/* Controlli telecamera a schermo */
#cam-overlay {
  position: absolute;
  bottom: 18px;
  right: 18px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: rgba(18, 30, 24, 0.88);
  border: 1px solid var(--panel-border);
  padding: 10px;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.55);
}

.cam-dpad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.cam-dpad-middle {
  display: flex;
  gap: 3px;
}
.cam-dpad button {
  width: 32px;
  height: 30px;
  background: #1f3227;
  border: 1px solid #5d4e36;
  color: #eadfc7;
  font-size: 13px;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s ease;
}
.cam-dpad button:hover {
  background: var(--active);
  border-color: var(--gold);
  color: #fff;
}
.cam-zoom-row {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}
.cam-zoom-row button {
  background: #1f3227;
  border: 1px solid #5d4e36;
  color: #eadfc7;
  font-size: 11px;
  padding: 4px 7px;
  border-radius: 3px;
  cursor: pointer;
}
.cam-zoom-row button:hover {
  background: var(--active);
  border-color: var(--gold);
  color: #fff;
}

#sidebar {
  width: 360px;
  background: var(--panel);
  border-left: 2px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
  overflow-y: auto;
  padding: 14px;
  gap: 12px;
}

.panel-sec {
  border-bottom: 1px solid #4d402b;
  padding-bottom: 12px;
}
.panel-sec:last-child {
  border-bottom: none;
}
.sec-title {
  font-size: 13px;
  font-weight: bold;
  color: var(--gold);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.roster-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.roster-btn {
  background: #1a2a22;
  border: 1px solid #574830;
  color: #e5d5b7;
  padding: 7px 8px;
  font-size: 11.5px;
  border-radius: 3px;
  cursor: pointer;
  text-align: left;
  line-height: 1.25;
}
.roster-btn:hover, .roster-btn.active {
  background: var(--active);
  border-color: var(--gold);
  color: #fff;
}
.roster-btn small {
  display: block;
  font-size: 10px;
  color: var(--muted);
}

.btn-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 6px;
}
.btn-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 6px;
}
button.act-btn, button.dir-btn, button.tool-btn {
  background: #1f3227;
  border: 1px solid #5d4e36;
  color: #eadfc7;
  padding: 6px 4px;
  font-size: 11px;
  border-radius: 3px;
  cursor: pointer;
}
button.act-btn:hover, button.act-btn.active,
button.dir-btn:hover, button.dir-btn.active,
button.tool-btn:hover, button.tool-btn.active {
  background: var(--active);
  border-color: var(--gold);
  color: #fff;
  font-weight: bold;
}

.stat-box {
  background: #121c17;
  border: 1px solid #4a3e29;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.45;
  color: #e2d5bd;
  border-radius: 3px;
}

#help-legend {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
}
#help-legend b {
  color: var(--gold);
}
