﻿:root {
  --bg: #0a1221;
  --panel: rgba(8, 14, 26, 0.78);
  --line: rgba(144, 178, 255, 0.35);
  --txt: #edf4ff;
  --muted: #b7c6e6;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 20% 10%, #142b53 0%, #071123 46%, #040912 100%);
  color: var(--txt);
  font-family: "Segoe UI", system-ui, sans-serif;
}

#app {
  position: fixed;
  inset: 0;
  display: block;
}

.hud {
  position: fixed;
  top: 14px;
  left: 14px;
  width: min(320px, calc(100vw - 28px));
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  z-index: 5;
}

.hud h1 {
  margin: 0 0 8px;
  font-size: 20px;
}

#status {
  margin: 0 0 10px;
  color: #fff;
  font-weight: 700;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

label { color: var(--muted); font-size: 13px; }

select, button {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #10203d;
  color: #fff;
  padding: 8px 10px;
  font-weight: 600;
}

button { cursor: pointer; }
button:hover { border-color: #80a6ff; }

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

.turn-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-weight: 800;
  color: #fff;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4), 0 0 14px currentColor;
}

.dot.red {
  background: #ff4b4b;
  color: #ff4b4b;
}

.dot.yellow {
  background: #ffd84b;
  color: #ffd84b;
}

.setup-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  padding: 14px;
}

.setup-overlay.hidden {
  display: none;
}

.setup-card {
  width: min(1440px, 99vw);
  height: min(620px, 88vh);
  min-height: 0;
  max-height: 88vh;
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  border: 1px solid rgba(144, 178, 255, 0.45);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(11, 20, 37, 0.96);
}

.setup-left {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, rgba(80, 132, 245, 0.25), rgba(6, 12, 24, 0.95));
  padding: 12px;
}

.setup-left img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.setup-right {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setup-right h2 {
  margin: 0;
  font-size: 24px;
}

.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.player-box {
  border: 1px solid rgba(144, 178, 255, 0.35);
  border-radius: 12px;
  padding: 10px;
  background: rgba(5, 12, 24, 0.48);
}

.player-box h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.player-box label {
  display: block;
  font-size: 12px;
  margin: 8px 0 0;
}

.player-box input,
.player-box select {
  width: 100%;
  margin-top: 5px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #10203d;
  color: #fff;
  padding: 8px 10px;
  font-weight: 600;
}

.setup-actions {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
}

.setup-actions button {
  border-radius: 10px;
  border: 1px solid #56f3af;
  background: #173325;
  color: #d8ffe9;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}

.player-box input[readonly] {
  opacity: 0.78;
  cursor: not-allowed;
}

.vittoria-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.68);
  padding: 14px;
}

.vittoria-overlay.hidden {
  display: none;
}

.vittoria-card {
  width: min(460px, 96vw);
  border: 1px solid rgba(144, 178, 255, 0.45);
  border-radius: 14px;
  background: rgba(11, 20, 37, 0.98);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.5);
  padding: 18px;
}

.vittoria-card h2 {
  margin: 0 0 10px;
}

.vittoria-card p {
  margin: 0 0 14px;
  color: #eaf2ff;
  font-weight: 700;
}

.vittoria-card button {
  border-radius: 10px;
  border: 1px solid #80a6ff;
  background: #132849;
  color: #eaf2ff;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 920px) {
  .setup-card {
    grid-template-columns: 1fr;
  }
  .setup-left {
    max-height: 260px;
  }
  .setup-grid {
    grid-template-columns: 1fr;
  }
}
