.game-layout { width: min(1400px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 14px; align-items: start; }
.game-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.game-hud {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-weight: 700; letter-spacing: .08em; color: var(--text-2); font-size: 14px;
}
.hud-wind { color: var(--text); }

.canvas-wrap {
  position: relative; width: min(100%, 124vh); aspect-ratio: 2 / 1; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: #0b0f16; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
#game-canvas { display: block; touch-action: manipulation; }

.canvas-banner {
  position: absolute; left: 50%; top: 10px; transform: translateX(-50%);
  background: rgba(8, 13, 36, .85); border: 1px solid var(--border); border-radius: 8px; padding: 6px 14px; font-weight: 700;
  pointer-events: none; max-width: 90%; text-align: center;
}

.controls { display: flex; flex-direction: column; gap: 10px; }
.turn-label { font-weight: 800; letter-spacing: .06em; }
.turn-label.is-mine { color: var(--primary); }

.controls-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.control { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.control > label, .control > .label { font-size: 12px; letter-spacing: .12em; color: var(--text-2); font-weight: 700; }

.stepper { display: grid; grid-template-columns: var(--tap) 1fr var(--tap); gap: 4px; }
.stepper input { text-align: center; font-weight: 700; font-size: 18px; padding: 4px; }
.btn-step { padding: 0; font-size: 22px; line-height: 1; touch-action: manipulation; }
.range { width: 100%; min-height: var(--tap); accent-color: var(--primary); margin: 0; }

.timer { font-size: 28px; font-variant-numeric: tabular-nums; min-height: var(--tap); display: flex; align-items: center; }
.timer.is-low { color: var(--danger); }

.btn-fire { min-height: 56px; font-size: 20px; letter-spacing: .08em; }
.controls-hint { margin: 0; font-size: 13px; min-height: 1.4em; }
.controls.is-disabled .control, .controls.is-disabled .btn-fire { opacity: .6; }

.scoreboard { min-width: 0; }
.scoreboard-title { margin: 0 0 8px; font-size: 14px; letter-spacing: .18em; color: var(--text-2); }
.scoreboard-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.score-row { display: grid; grid-template-columns: 24px 1fr; gap: 8px; align-items: center; padding: 6px; border-radius: 8px; border: 1px solid transparent; }
.score-row.is-active { border-color: var(--primary); background: rgba(234, 179, 8, .08); }
.score-row.is-dead { opacity: .5; }
.score-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.score-tag { font-size: 11px; color: var(--text-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
.score-meta { grid-column: 2; display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.health-bar { grid-column: 2; height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.health-fill { height: 100%; background: var(--ok); }
.health-fill.is-mid { background: var(--primary); }
.health-fill.is-low { background: var(--danger); }
.w-0 { width: 0; } .w-5 { width: 5%; } .w-10 { width: 10%; } .w-15 { width: 15%; } .w-20 { width: 20%; }
.w-25 { width: 25%; } .w-30 { width: 30%; } .w-35 { width: 35%; } .w-40 { width: 40%; } .w-45 { width: 45%; }
.w-50 { width: 50%; } .w-55 { width: 55%; } .w-60 { width: 60%; } .w-65 { width: 65%; } .w-70 { width: 70%; }
.w-75 { width: 75%; } .w-80 { width: 80%; } .w-85 { width: 85%; } .w-90 { width: 90%; } .w-95 { width: 95%; } .w-100 { width: 100%; }

#round-overlay { background: rgba(8, 13, 36, .55); }
.end-card { width: min(640px, 100%); margin-top: 6vh; display: flex; flex-direction: column; gap: 14px; }
.end-title { margin: 0; text-align: center; font-size: 28px; color: var(--primary); }
.end-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* Portrait and narrow screens: scoreboard below, controls wrap. */
@media (max-width: 980px) {
  .game-layout { grid-template-columns: minmax(0, 1fr); }
  .scoreboard-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

@media (max-width: 560px) {
  main { padding: 10px; }
  .controls-grid { grid-template-columns: 1fr 1fr; }
  .btn-fire { grid-column: 1 / -1; }
}

@media (orientation: landscape) and (max-height: 520px) {
  #topbar { padding: 4px 12px; }
  .canvas-wrap { width: min(100%, 104vh); }
  .controls-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .btn-fire { grid-column: auto; }
}
