:root {
  --rust-primary: #c85a32;
  --rust-dark: #8c381b;
  --slate-metal: #4f5d6b;
  --screen-bg: #1c2c42;
  --screen-grid: rgba(93, 141, 196, 0.14);
  --sand-gold: #f5b921;
}

body {
  background-color: #14171a;
  color: #e9eef5;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

.container-my {
  max-width: 1020px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 12px;
  padding-right: 12px;
}

/* Scocca esterna stile Carta Viaggio */
.device-shell {
  position: relative;
  background: linear-gradient(145deg, var(--rust-primary), var(--rust-dark));
  border: 4px solid #111;
  border-radius: 18px;
  padding: 22px 18px;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.7), inset 0 2px 4px rgba(255, 255, 255, 0.25);
}

.rivet {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #2c353d;
  border: 2px solid #111;
  border-radius: 50%;
}
.rivet-tl { top: 8px; left: 8px; }
.rivet-tr { top: 8px; right: 8px; }
.rivet-bl { bottom: 8px; left: 8px; }
.rivet-br { bottom: 8px; right: 8px; }

.terminal-header {
  background: rgba(18, 22, 26, 0.85);
  border: 2px solid #111;
  border-radius: 10px;
  padding: 10px 14px;
}

.unit-code {
  font-family: monospace;
  font-size: 0.72rem;
  color: #f5b921;
  letter-spacing: 1px;
}

/* Schermo blu-ardesia con reticolato radar */
.screen-panel {
  background-color: var(--screen-bg);
  background-image:
    linear-gradient(var(--screen-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--screen-grid) 1px, transparent 1px);
  background-size: 28px 28px;
  border: 3px solid #111;
  border-radius: 12px;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.65);
}

.sub-panel {
  background: rgba(15, 24, 36, 0.82);
  border: 1px solid rgba(130, 165, 205, 0.3);
  border-radius: 8px;
}

.status-led {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid #000;
}
.led-online { background: #2ecc71; box-shadow: 0 0 8px #2ecc71; }
.led-offline { background: #e74c3c; box-shadow: 0 0 8px #e74c3c; }

.btn-rust {
  background-color: var(--rust-primary);
  border: 2px solid #111;
  color: #fff;
}
.btn-rust:hover {
  background-color: #d96b43;
  color: #fff;
}

/* Pulsanti Selezione Colore Capitano */
.player-chip {
  border: 2px solid #111;
  border-radius: 8px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.15s ease;
}
.player-chip.taken {
  opacity: 0.35;
  cursor: not-allowed;
  text-decoration: line-through;
}
.player-chip.mine {
  outline: 3px solid #fff;
  transform: scale(1.04);
}

/* Card Clessidra */
.hg-card {
  background: linear-gradient(180deg, #2b3847 0%, #1b2530 100%);
  border: 2px solid #111;
  border-radius: 12px;
  padding: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.hg-card.running {
  border-color: var(--sand-gold);
  box-shadow: 0 0 14px rgba(245, 185, 33, 0.28);
}

.hg-timer-display {
  font-family: 'Courier New', monospace;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
}

.sand-bar-wrap {
  height: 10px;
  background: #0d131a;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid #000;
}
.sand-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #e67e22, var(--sand-gold));
  transition: width 0.15s linear;
}

.queue-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid #111;
}

.log-box {
  max-height: 115px;
  overflow-y: auto;
  color: #a9c1dc;
}