* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0a0a1a;
  color: #e0e0e0;
  font-family: "Courier New", monospace;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

#game {
  width: 1920px;
  height: 1080px;
  display: flex;
  flex-direction: column;
  border: 2px solid #333;
  border-radius: 8px;
  background: #111122;
  position: relative;
}

/* Header */
#header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid #333;
  font-size: 16px;
}

#round-label {
  color: #888;
}

.score {
  display: flex;
  align-items: center;
  gap: 6px;
}

.score-label {
  color: #aaa;
  font-size: 14px;
}

.pip {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #555;
  display: inline-block;
}

.pip.filled {
  background: #f0c040;
  border-color: #f0c040;
}

/* Arena */
#arena {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 12px;
  position: relative;
}

/* Hand panels */
.hand-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #1a1a2e;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 10px 12px;
  width: 110px;
  align-self: center;
}

.hand-label {
  font-size: 10px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.hand-count {
  font-size: 15px;
  color: #ccc;
  transition: color 0.2s;
}

.hand-count.depleted {
  color: #333;
  text-decoration: line-through;
}

.player-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 140px;
}

.avatar {
  width: 80px;
  height: 100px;
  border: 3px solid #444;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  background: #1a1a2e;
  transition: background 0.1s;
}

.player-col.attacker .avatar {
  border-color: #e04040;
}
.player-col.defender .avatar {
  border-color: #4080e0;
}

.player-name {
  font-size: 14px;
  color: #aaa;
}
.player-role {
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
}
.player-col.attacker .player-role {
  color: #e04040;
}
.player-col.defender .player-role {
  color: #4080e0;
}

/* Active / waiting turn indicators */
.player-col.acting .avatar {
  transform: scale(1.08);
  transition: transform 0.15s, box-shadow 0.15s;
}
#p1-col.acting .avatar {
  box-shadow: 0 0 32px 8px #f0c040;
}
#p2-col.acting .avatar {
  box-shadow: 0 0 32px 8px #40c0f0;
}
.player-col.acting .player-role {
  font-size: 22px;
  letter-spacing: 2px;
}
.player-col.waiting {
  opacity: 0.35;
  transition: opacity 0.2s;
}
.player-col.acting {
  transition: opacity 0.2s;
}

/* Centre area */
#centre {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 260px;
  text-align: center;
}

#spell-banner {
  font-size: 28px;
  font-weight: bold;
  color: #f0c040;
  min-height: 36px;
  letter-spacing: 2px;
}

#phase-label {
  font-size: 16px;
  color: #ccc;
}

#countdown-container {
  width: 200px;
  height: 16px;
  background: #222;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #444;
}

#countdown-bar {
  height: 100%;
  width: 100%;
  background: #40c040;
  border-radius: 8px;
  transition: background-color 0.3s;
}

#countdown-text {
  font-size: 14px;
  color: #888;
  min-height: 20px;
}

/* Outcome overlay */
#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

#overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

#overlay-text {
  font-size: 48px;
  font-weight: bold;
}

#overlay-sub {
  font-size: 18px;
  color: #aaa;
  margin-top: 8px;
}

/* Footer */
#footer {
  display: flex;
  justify-content: space-between;
  padding: 12px 24px;
  border-top: 1px solid #333;
  font-size: 16px;
}

.hint-group {
  display: flex;
  gap: 8px;
}

.key-hint {
  padding: 4px 12px;
  border: 1px solid #555;
  border-radius: 4px;
  background: #1a1a2e;
  color: #ccc;
}

.key-hint .key {
  color: #f0c040;
  font-weight: bold;
}

.key-hint.depleted {
  color: #333;
  border-color: #2a2a2a;
  text-decoration: line-through;
}

/* Hit flash animation */
@keyframes flash-red {
  0% {
    background: #e04040;
  }
  100% {
    background: #1a1a2e;
  }
}

.avatar.flash {
  animation: flash-red 0.4s ease-out;
}

/* Paused overlay */
#paused {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  z-index: 20;
  font-size: 36px;
  color: #f0c040;
  letter-spacing: 4px;
}

#paused.visible {
  display: flex;
}
