:root {
  /* Forest & Pine Greens */
  --prussian-deep: #07190f;
  --prussian-dark: #0d2919;
  --prussian-mid: #16442a;
  --prussian-steel: #256641;
  --seafoam-blue: #4c9c6e;
  --seafoam-light: #8ed8a8;

  /* Warm Parchment & Cream (inspired by ref 1 moon & ref 2 paper) */
  --parchment-light: #fbf4e2;
  --parchment-mid: #efe1c1;
  --parchment-dark: #d8c296;
  --ink-dark: #0f2e1c;

  /* Steampunk Brass, Bronze & Copper (inspired by ref 3) */
  --brass-bright: #f7d88b;
  --brass-mid: #cf9444;
  --brass-dark: #8c561b;
  --brass-deep: #4a2908;
  --copper-mid: #c86432;
  --crimson-danger: #c93b2b;

  /* Fonts */
  --font-title: 'Cinzel Decorative', 'Cinzel', Georgia, serif;
  --font-heading: 'Cinzel', Georgia, serif;
  --font-word: 'Playfair Display', Georgia, serif;
  --font-body: 'Crimson Pro', Georgia, serif;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea,
label {
  touch-action: manipulation;
}

body {
  background-color: var(--prussian-deep);
  color: var(--parchment-light);
  font-family: var(--font-body);
  font-size: 18px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

input,
textarea {
  user-select: text;
  -webkit-user-select: text;
}

/* ==========================================
   ARTISTIC BACKGROUND (FOREST GREEN + MOON)
   ========================================== */
.art-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-scene-svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 0.4s ease;
}

.vignette-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 45%, transparent 45%, rgba(4, 15, 9, 0.72) 100%);
  transition: background 0.4s ease;
}

body.urgency-high .vignette-overlay {
  background:
    radial-gradient(circle at 50% 45%, rgba(217, 119, 6, 0.18) 20%, rgba(9, 26, 16, 0.8) 100%);
}

body.urgency-critical .vignette-overlay {
  background:
    radial-gradient(circle at 50% 45%, rgba(201, 59, 43, 0.35) 25%, rgba(25, 10, 12, 0.85) 100%);
  animation: criticalPulseBg 0.35s infinite alternate;
}

@keyframes criticalPulseBg {
  from { opacity: 0.75; }
  to { opacity: 1; }
}

/* Screen shake when bomb explodes */
@keyframes screenShake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  12% { transform: translate(-11px, -8px) rotate(-1.5deg); }
  25% { transform: translate(11px, 7px) rotate(1.5deg); }
  38% { transform: translate(-9px, 8px) rotate(-1deg); }
  50% { transform: translate(9px, -6px) rotate(1deg); }
  65% { transform: translate(-6px, 4px) rotate(-0.5deg); }
  80% { transform: translate(5px, -3px) rotate(0.3deg); }
}

body.shake-explosion {
  animation: screenShake 0.7s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* ==========================================
   TOP BAR / HEADER
   ========================================== */
.top-bar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  border-bottom: 2px solid rgba(207, 148, 68, 0.38);
  background: linear-gradient(180deg, rgba(8, 28, 17, 0.88) 0%, rgba(13, 41, 25, 0.65) 100%);
  backdrop-filter: blur(6px);
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.08s ease;
}

.logo-group:active {
  transform: translateY(2px) scale(0.97);
}

.logo-gear-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--brass-bright), var(--brass-mid) 60%, var(--brass-deep));
  border: 2px solid var(--brass-bright);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.logo-titles {
  display: flex;
  flex-direction: column;
}

.logo-group h1 {
  font-family: var(--font-title);
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  background: linear-gradient(180deg, #fff6db 0%, #f0c46c 55%, #c48332 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  line-height: 1.1;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: linear-gradient(180deg, #1b4d31 0%, #0f2e1c 100%);
  color: var(--parchment-light);
  border: 1.5px solid var(--brass-mid);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  min-height: 38px;
  font-size: 0.92rem;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 3px 8px rgba(0, 0, 0, 0.4);
  transition: transform 0.08s ease, filter 0.15s ease, border-color 0.15s ease;
}

.icon-btn.sound-btn,
.icon-btn.fullscreen-btn {
  padding: 7px 11px;
}

.icon-btn:hover {
  filter: brightness(1.15);
  border-color: var(--brass-bright);
}

.icon-btn:active {
  transform: translateY(2px) scale(0.96);
}

/* ==========================================
   MAIN CONTAINER & SCOREBOARD
   ========================================== */
.game-container {
  position: relative;
  z-index: 5;
  flex: 1;
  max-width: 840px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 18px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

:fullscreen .game-panel,
:-webkit-full-screen .game-panel {
  flex: 0 1 auto;
}

.scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
}

.team-card {
  position: relative;
  background: linear-gradient(180deg, rgba(21, 64, 39, 0.92) 0%, rgba(11, 34, 21, 0.96) 100%);
  border: 2px solid var(--brass-mid);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(247, 216, 139, 0.3),
    0 6px 18px rgba(0, 0, 0, 0.5);
  transition: transform 0.25s ease;
}

.team-card.team-1 {
  border-color: #62b884;
}

.team-card.team-2 {
  border-color: #d69849;
}

.brass-corner {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--brass-bright), var(--brass-dark));
}

.brass-corner.tl { top: 5px; left: 6px; }
.brass-corner.tr { top: 5px; right: 6px; }
.brass-corner.bl { bottom: 5px; left: 6px; }
.brass-corner.br { bottom: 5px; right: 6px; }

.team-card.score-bump {
  transform: scale(1.06);
}

.team-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
}

.team-name-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--parchment-light);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  width: 100%;
  max-width: 170px;
  padding: 2px 6px;
  transition: border-color 0.2s, background 0.2s;
}

.team-name-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--brass-bright);
}

.edit-hint {
  font-size: 0.8rem;
  color: var(--seafoam-light);
  opacity: 0.7;
  pointer-events: none;
}

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

.score-value {
  font-family: var(--font-word);
  font-size: 2.1rem;
  font-weight: 900;
  min-width: 40px;
  text-align: center;
  line-height: 1;
  color: var(--parchment-light);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
}

.team-1 .score-value {
  color: #a3ecc0;
}

.team-2 .score-value {
  color: var(--brass-bright);
}

.score-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--brass-mid);
  background: radial-gradient(circle at 30% 30%, #286943, #11301e);
  color: var(--parchment-light);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: filter 0.15s, transform 0.1s;
}

.score-btn:hover {
  filter: brightness(1.2);
  border-color: var(--brass-bright);
}

.score-btn:active {
  transform: scale(0.9);
}

.vs-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--brass-bright), var(--brass-mid) 60%, var(--brass-deep));
  border: 2px solid #fff0c2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.vs-badge strong {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  color: #261403;
}

/* ==========================================
   GAME PANELS (STEAMPUNK FOREST FRAMES)
   ========================================== */
.game-panel {
  display: none;
  position: relative;
  flex-direction: column;
  flex: 1;
  background:
    linear-gradient(180deg, rgba(15, 46, 29, 0.9) 0%, rgba(8, 26, 16, 0.94) 100%);
  border: 2.5px solid var(--brass-mid);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.65),
    inset 0 0 0 2px rgba(247, 216, 139, 0.16),
    0 16px 40px -10px rgba(0, 0, 0, 0.75);
  justify-content: space-between;
  gap: 18px;
  backdrop-filter: blur(8px);
}

.game-panel.active {
  display: flex;
}

/* Setup Screen */
.hero-bomb {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hero-steampunk-emblem {
  width: 256px;
  height: 256px;
  margin-bottom: 2px;
}

.emblem-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.setup-heading {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  color: var(--brass-bright);
  letter-spacing: 0.04em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.subtitle {
  color: var(--parchment-mid);
  font-size: 1.08rem;
  line-height: 1.45;
  max-width: 560px;
  margin: 0 auto;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 14px;
}

.setting-box {
  background: linear-gradient(180deg, rgba(22, 66, 41, 0.85) 0%, rgba(12, 38, 23, 0.9) 100%);
  border: 1.5px solid rgba(207, 148, 68, 0.55);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.setting-box label {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--brass-bright);
}

.custom-select {
  background: var(--prussian-deep);
  color: var(--parchment-light);
  border: 1.5px solid rgba(142, 216, 168, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 1rem;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
}

.custom-select:focus {
  outline: none;
  border-color: var(--brass-bright);
}

/* 4 Timer Buttons under Urværkets tid */
.timer-choice-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.timer-choice-btn {
  background: linear-gradient(180deg, #1b4d31 0%, #0d2919 100%);
  color: var(--parchment-mid);
  border: 1.5px solid rgba(142, 216, 168, 0.35);
  border-radius: 8px;
  padding: 10px 6px;
  font-family: var(--font-heading);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-align: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 3px 8px rgba(0, 0, 0, 0.45);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
}

.timer-choice-btn:hover {
  border-color: var(--brass-mid);
  color: var(--parchment-light);
}

.timer-choice-btn:active {
  transform: translateY(2px) scale(0.96);
}

.timer-choice-btn.active {
  background: linear-gradient(180deg, #f3cb78 0%, #c98835 55%, #915514 100%);
  color: #1f1002;
  border-color: #fff0c4;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.65),
    0 3px 10px rgba(0, 0, 0, 0.6),
    0 0 12px rgba(247, 216, 139, 0.35);
}

/* Primary Brass & Copper CTA Button */
.primary-cta-btn {
  background: linear-gradient(180deg, #f3cb78 0%, #c98835 50%, #915514 100%);
  color: #1f1002;
  border: 2px solid #fde6a6;
  border-radius: var(--radius-md);
  padding: 16px 24px;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.6),
    0 8px 24px -4px rgba(0, 0, 0, 0.7),
    0 0 18px rgba(207, 148, 68, 0.35);
  transition: transform 0.08s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.primary-cta-btn:hover {
  filter: brightness(1.06);
}

.primary-cta-btn:active {
  transform: translateY(3px) scale(0.98);
}

/* ==========================================
   ACTIVE PLAY SCREEN & STEAMPUNK BOMB
   ========================================== */
.active-round-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(9, 30, 18, 0.85);
  padding: 9px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid rgba(207, 148, 68, 0.45);
}

.bomb-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bomb-icon-wrapper {
  position: relative;
  font-size: 1.8rem;
  line-height: 1;
  transition: transform 0.1s ease;
}

.bomb-icon-wrapper.beep-pulse {
  transform: scale(1.25) rotate(20deg);
}

.spark-character {
  position: absolute;
  top: -5px;
  right: -7px;
  font-size: 1rem;
}

.tempo-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 20px;
}

.tempo-bars span {
  width: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  transition: background 0.3s;
}

.tempo-bars span:nth-child(1) { height: 30%; }
.tempo-bars span:nth-child(2) { height: 48%; }
.tempo-bars span:nth-child(3) { height: 65%; }
.tempo-bars span:nth-child(4) { height: 82%; }
.tempo-bars span:nth-child(5) { height: 100%; }

.tempo-bars.level-1 span:nth-child(-n+1) { background: #4c9c6e; }
.tempo-bars.level-2 span:nth-child(-n+2) { background: #8ed8a8; }
.tempo-bars.level-3 span:nth-child(-n+3) { background: #f0c46c; }
.tempo-bars.level-4 span:nth-child(-n+4) { background: #e07a38; }
.tempo-bars.level-5 span:nth-child(-n+5) { background: #d93829; box-shadow: 0 0 8px #d93829; }

.tempo-label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--parchment-mid);
  letter-spacing: 0.03em;
}

.round-controls {
  display: flex;
  gap: 8px;
}

.small-control-btn {
  background: rgba(22, 68, 42, 0.75);
  color: var(--parchment-light);
  border: 1px solid var(--brass-mid);
  border-radius: 8px;
  padding: 6px 12px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s, transform 0.08s ease;
}

.small-control-btn:hover {
  filter: brightness(1.2);
}

.small-control-btn:active {
  transform: translateY(2px) scale(0.96);
}

.small-control-btn.danger:hover {
  background: rgba(185, 45, 32, 0.55);
  border-color: #f87171;
}

/* ==========================================
   THE STEAMPUNK CLOCKWORK BOMB
   ========================================== */
.word-card-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 4px 0;
}

.steampunk-bomb {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 460px;
  padding: 6px 16px 12px;
  transition: transform 0.1s ease;
}

.steampunk-bomb.beep-pulse {
  transform: scale(1.032);
}

/* Background SVG Cogwheels & Copper Coils */
.steampunk-gears-svg {
  position: absolute;
  inset: -6px 0 0 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.7));
}

@keyframes spinCW {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spinCCW {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

.gear-spin-main {
  animation: spinCW 28s linear infinite;
}

.gear-spin-cw {
  animation: spinCW 10s linear infinite;
}

.gear-spin-ccw {
  animation: spinCCW 10s linear infinite;
}

body.urgency-high .gear-spin-main {
  animation-duration: 10s;
}
body.urgency-high .gear-spin-cw,
body.urgency-high .gear-spin-ccw {
  animation-duration: 4s;
}

body.urgency-critical .gear-spin-main {
  animation-duration: 4s;
}
body.urgency-critical .gear-spin-cw,
body.urgency-critical .gear-spin-ccw {
  animation-duration: 1.6s;
}

body.untimed-round .gear-spin-main,
body.untimed-round .gear-spin-cw,
body.untimed-round .gear-spin-ccw {
  animation-play-state: paused;
}

/* Steam Puffs on Left & Right */
.steam-puff {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 244, 226, 0.55) 0%, rgba(142, 216, 168, 0.2) 55%, transparent 75%);
  filter: blur(4px);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  animation: steamRise 2.6s ease-out infinite;
}

.left-steam {
  left: 24px;
  bottom: 115px;
}

.right-steam {
  right: 24px;
  bottom: 115px;
  animation-delay: 1.3s;
}

body.urgency-high .steam-puff {
  animation-duration: 1.3s;
}

body.urgency-critical .steam-puff {
  animation-duration: 0.65s;
}

body.untimed-round .steam-puff,
body.untimed-round .fuse-spark-cluster,
body.untimed-round .spark-character {
  display: none;
}

@keyframes steamRise {
  0% {
    transform: translateY(10px) scale(0.5);
    opacity: 0;
  }
  35% {
    opacity: 0.75;
  }
  100% {
    transform: translateY(-55px) scale(1.7);
    opacity: 0;
  }
}

/* Top Manometer & Fuse Assembly */
.bomb-top-assembly {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: -14px;
  position: relative;
  z-index: 4;
}

.bomb-fuse-wrap {
  position: relative;
  width: 140px;
  height: 54px;
  margin-bottom: -10px;
}

.fuse-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.6));
}

.fuse-spark-cluster {
  position: absolute;
  left: 106px;
  top: 11px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: sparkJitter 0.15s infinite alternate;
}

.spark-core {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, #fef08a 45%, #ea580c 85%, transparent 100%);
  box-shadow:
    0 0 12px 4px #fbbf24,
    0 0 24px 8px rgba(234, 88, 12, 0.85);
}

.spark-ray {
  position: absolute;
  background: #fde047;
  border-radius: 999px;
}

.spark-ray.r1 { width: 28px; height: 3px; transform: rotate(18deg); }
.spark-ray.r2 { width: 28px; height: 3px; transform: rotate(108deg); }
.spark-ray.r3 { width: 20px; height: 2.5px; transform: rotate(63deg); }
.spark-ray.r4 { width: 20px; height: 2.5px; transform: rotate(-27deg); }

@keyframes sparkJitter {
  0% { transform: scale(0.88) rotate(-14deg); }
  100% { transform: scale(1.2) rotate(18deg); }
}

.steampunk-neck {
  width: 96px;
  height: 36px;
  background: linear-gradient(90deg, #4a2908 0%, #d49b4b 30%, #f7d88b 50%, #965d1e 80%, #3b2006 100%);
  border: 2.5px solid #241202;
  border-radius: 10px 10px 4px 4px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7);
}

.pressure-gauge {
  width: 34px;
  height: 34px;
  margin-top: -14px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--parchment-light) 60%, #d8c296 100%);
  border: 3.5px solid var(--brass-dark);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gauge-face {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.gauge-needle {
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: 2.5px;
  height: 11px;
  background: #b91c1c;
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(-55deg);
  border-radius: 2px;
  transition: transform 0.25s ease;
}

.bomb-cap-rim {
  position: absolute;
  bottom: -4px;
  left: -7px;
  right: -7px;
  height: 8px;
  background: linear-gradient(90deg, #4a2908 0%, #f7d88b 45%, #6b3b0d 100%);
  border: 2px solid #241202;
  border-radius: 999px;
}

/* Round Steampunk Forest-Iron & Brass Bomb Sphere */
.bomb-sphere {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1 / 0.88;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 24%, #3b8559 0%, #1b4d31 28%, #0d2919 65%, #05120a 100%);
  border: 5px solid var(--brass-mid);
  outline: 2.5px solid #241202;
  box-shadow:
    inset -18px -22px 40px rgba(0, 0, 0, 0.88),
    inset 8px 10px 24px rgba(247, 216, 139, 0.22),
    0 20px 45px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 26px 28px 30px;
  gap: 8px;
  overflow: hidden;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.bomb-brass-band {
  position: absolute;
  left: -8px;
  right: -8px;
  top: 50%;
  height: 22px;
  transform: translateY(-50%);
  background: linear-gradient(180deg, #f7d88b 0%, #b87b2e 50%, #5e360a 100%);
  border-top: 2px solid #241202;
  border-bottom: 2px solid #241202;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6);
  z-index: 0;
}

.bomb-shine {
  position: absolute;
  top: 9%;
  left: 14%;
  width: 64px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(251, 244, 226, 0.28) 0%, transparent 75%);
  transform: rotate(-26deg);
  pointer-events: none;
  z-index: 1;
}

/* Mini Steampunk Dials above the Screen */
.mini-dials-row {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}

.mini-dial {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--parchment-mid);
  border: 2.5px solid var(--brass-mid);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5), 0 2px 4px rgba(0,0,0,0.6);
  position: relative;
}

.mini-dial.center-dial {
  width: 26px;
  height: 26px;
}

.mini-hand {
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: 2px;
  height: 7px;
  background: var(--prussian-deep);
  transform-origin: bottom center;
}

.mini-hand.h1 { transform: translateX(-50%) rotate(35deg); }
.mini-hand.h2 { transform: translateX(-50%) rotate(-40deg); background: #b91c1c; }
.mini-hand.h3 { transform: translateX(-50%) rotate(110deg); }

/* Mounted Steampunk Parchment & Brass Porthole Screen */
.word-card.bomb-screen {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 162px;
  background:
    radial-gradient(circle at 50% 50%, #fdf7e7 0%, #f1e2c3 70%, #dcc394 100%);
  border: 6px solid var(--brass-mid);
  outline: 2.5px solid #2b1603;
  border-radius: 24px;
  padding: 14px 20px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  box-shadow:
    inset 0 3px 14px rgba(74, 41, 8, 0.45),
    inset 0 0 0 2px rgba(255, 246, 219, 0.6),
    0 8px 20px rgba(0, 0, 0, 0.75);
  overflow: hidden;
  transition: transform 0.18s ease, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

body.urgency-high .word-card.bomb-screen {
  background:
    radial-gradient(circle at 50% 50%, #fff3d6 0%, #f7d08a 75%, #e09f45 100%);
  border-color: #f59e0b;
  box-shadow:
    inset 0 3px 14px rgba(146, 64, 14, 0.5),
    0 0 24px rgba(245, 158, 11, 0.55);
}

body.urgency-critical .word-card.bomb-screen {
  background:
    radial-gradient(circle at 50% 50%, #ffe4e1 0%, #fca5a5 75%, #ef4444 100%);
  border-color: #ef4444;
  box-shadow:
    inset 0 3px 16px rgba(127, 29, 29, 0.6),
    0 0 32px rgba(239, 68, 68, 0.8);
}

/* Brass Rivets on the Screen Bezel */
.screen-rivets span {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--brass-bright), var(--brass-deep));
  border: 1px solid #241202;
}

.screen-rivets span:nth-child(1) { top: 7px; left: 9px; }
.screen-rivets span:nth-child(2) { top: 7px; right: 9px; }
.screen-rivets span:nth-child(3) { bottom: 7px; left: 9px; }
.screen-rivets span:nth-child(4) { bottom: 7px; right: 9px; }
.screen-rivets span:nth-child(5) { top: 50%; left: 6px; transform: translateY(-50%); }
.screen-rivets span:nth-child(6) { top: 50%; right: 6px; transform: translateY(-50%); }

.word-card.card-flip {
  animation: wordPop 0.22s ease-out;
}

@keyframes wordPop {
  0% { transform: scale(0.92); opacity: 0.6; }
  70% { transform: scale(1.03); opacity: 1; }
  100% { transform: scale(1); }
}

.word-category-badge {
  position: relative;
  z-index: 1;
  background: var(--prussian-mid);
  color: var(--parchment-light);
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--brass-mid);
  flex-shrink: 0;
}

.the-word {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  font-family: var(--font-word);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--prussian-deep);
  line-height: 1.12;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

body.urgency-critical .the-word {
  color: #450a0a;
}

.screen-ornament {
  font-size: 0.75rem;
  color: var(--brass-dark);
  letter-spacing: 0.15em;
  opacity: 0.85;
}

.pass-instruction {
  font-size: 0.98rem;
  color: var(--parchment-mid);
  text-align: center;
  max-width: 460px;
}

/* ==========================================
   PLAY ACTION BUTTONS
   ========================================== */
.play-actions {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
}

.secondary-action-btn {
  background: linear-gradient(180deg, #1d5234 0%, #0f2e1c 100%);
  color: var(--parchment-light);
  border: 1.5px solid var(--brass-mid);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  transition: filter 0.15s, transform 0.1s;
}

.secondary-action-btn:hover {
  filter: brightness(1.15);
  border-color: var(--brass-bright);
}

.secondary-action-btn:active {
  transform: translateY(2px) scale(0.97);
}

.next-word-btn {
  width: 100%;
  background: linear-gradient(180deg, #f5cf7b 0%, #cf8f3a 50%, #945816 100%);
  color: #1c0e02;
  border: 2px solid #fff0c2;
  border-radius: var(--radius-md);
  padding: 18px 24px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.65),
    0 8px 22px -4px rgba(0, 0, 0, 0.7);
  transition: transform 0.08s ease, filter 0.12s ease;
}

.next-word-btn:hover {
  filter: brightness(1.06);
}

.next-word-btn:active {
  transform: translateY(3px) scale(0.98);
}

.next-main {
  font-family: var(--font-heading);
  font-size: 1.38rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.next-sub {
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 700;
  color: #361b04;
}

/* ==========================================
   EXPLOSION SCREEN
   ========================================== */
.explosion-visual {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.explosion-burst-stage {
  position: relative;
  width: 100%;
  max-width: 390px;
  height: 185px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2px;
}

.explosion-shockwave {
  position: absolute;
  width: 160px;
  height: 95px;
  border-radius: 50%;
  border: 4px solid rgba(247, 216, 139, 0.78);
  box-shadow: 0 0 24px rgba(207, 148, 68, 0.65);
  pointer-events: none;
  opacity: 0;
}

body.exploded-state .explosion-shockwave.ring-1 {
  animation: shockwaveBlast 1.25s cubic-bezier(0.16, 1, 0.3, 1) 8 forwards;
}

body.exploded-state .explosion-shockwave.ring-2 {
  animation: shockwaveBlast 1.25s cubic-bezier(0.16, 1, 0.3, 1) 0.45s 7 forwards;
}

@keyframes shockwaveBlast {
  0% {
    transform: scale(0.35);
    opacity: 0.95;
    border-width: 6px;
  }
  100% {
    transform: scale(2.35);
    opacity: 0;
    border-width: 1px;
  }
}

.explosion-starburst-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 10px 26px rgba(140, 70, 25, 0.75));
  animation: boomPop 0.48s cubic-bezier(0.18, 0.89, 0.32, 1.32);
}

.blast-poly-outer {
  transform-origin: 210px 115px;
  animation: blastOuterPulse 0.25s ease-in-out 40 alternate;
}

.blast-poly-mid {
  transform-origin: 210px 115px;
  animation: blastMidPulse 0.2s ease-in-out 50 alternate;
}

.blast-poly-core {
  transform-origin: 210px 115px;
  animation: blastCoreFlash 0.16s ease-in-out 62 alternate;
}

.blast-smoke-clouds {
  transform-origin: 210px 115px;
  animation: smokeBillow 1s ease-in-out 10 alternate;
}

.blast-sparks {
  transform-origin: 210px 115px;
  animation: sparksScatter 0.5s ease-out 20 alternate;
}

body.explosion-settled .explosion-shockwave,
body.explosion-settled .blast-poly-outer,
body.explosion-settled .blast-poly-mid,
body.explosion-settled .blast-poly-core,
body.explosion-settled .blast-smoke-clouds,
body.explosion-settled .blast-sparks,
body.explosion-settled .boom-badge {
  animation: none !important;
}

@keyframes blastOuterPulse {
  0% { transform: scale(0.96) rotate(-2deg); }
  100% { transform: scale(1.05) rotate(2deg); }
}

@keyframes blastMidPulse {
  0% { transform: scale(1.04) rotate(2.5deg); }
  100% { transform: scale(0.94) rotate(-2.5deg); }
}

@keyframes blastCoreFlash {
  0% { transform: scale(0.92); opacity: 0.85; }
  100% { transform: scale(1.1); opacity: 1; }
}

@keyframes smokeBillow {
  0% { transform: scale(0.95); opacity: 0.75; }
  100% { transform: scale(1.08); opacity: 0.95; }
}

@keyframes sparksScatter {
  0% { transform: scale(0.88); opacity: 0.8; }
  100% { transform: scale(1.14); opacity: 1; }
}

.boom-badge {
  position: relative;
  z-index: 3;
  font-family: var(--font-title);
  font-size: clamp(1.95rem, 6vw, 2.85rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--parchment-light);
  text-shadow:
    0 2px 0 #261204,
    0 -2px 0 #261204,
    2px 0 0 #261204,
    -2px 0 0 #261204,
    0 5px 14px rgba(0, 0, 0, 0.9),
    0 0 20px rgba(247, 216, 139, 0.75);
  padding: 6px 16px;
  display: inline-block;
  animation: boomPop 0.42s cubic-bezier(0.18, 0.89, 0.32, 1.32), boomTextJitter 0.25s ease-in-out 40 alternate;
}

@keyframes boomPop {
  0% { transform: scale(0.25); opacity: 0; }
  75% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes boomTextJitter {
  0% { transform: scale(0.98) rotate(-1deg); }
  100% { transform: scale(1.03) rotate(1deg); }
}

.explosion-visual h2 {
  font-family: var(--font-heading);
  color: var(--brass-bright);
}

.last-word-reveal {
  color: var(--parchment-mid);
  font-size: 1.15rem;
}

.last-word-reveal strong {
  font-family: var(--font-word);
  color: var(--brass-bright);
  font-size: 1.35rem;
}

.award-point-box {
  background: rgba(9, 31, 19, 0.88);
  border: 1.5px solid var(--brass-mid);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.award-point-box h3 {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--brass-bright);
  background: linear-gradient(180deg, #fff6db 0%, #f0c46c 55%, #c48332 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.award-subtext {
  color: var(--seafoam-light);
  font-size: 1rem;
  margin-top: -6px;
}

.award-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.award-btn {
  border: 2px solid var(--brass-bright);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--parchment-light);
  transition: transform 0.08s ease, filter 0.15s ease;
}

.award-btn.team-1-btn {
  background: linear-gradient(180deg, #266b44 0%, #133b24 100%);
  border-color: #8ed8a8;
}

.award-btn.team-2-btn {
  background: linear-gradient(180deg, #9c5a25 0%, #5c310d 100%);
  border-color: var(--brass-bright);
}

.award-btn:hover {
  filter: brightness(1.12);
}

.award-btn:active {
  transform: translateY(2px) scale(0.97);
}

.award-trophy {
  background: rgba(0, 0, 0, 0.3);
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brass-bright);
}

.award-btn strong {
  font-family: var(--font-heading);
  font-size: 1.28rem;
}

.award-btn small {
  font-size: 0.88rem;
  color: var(--parchment-mid);
}

.text-link-btn {
  background: transparent;
  border: none;
  color: var(--seafoam-light);
  font-family: var(--font-body);
  font-size: 0.98rem;
  text-decoration: underline;
  cursor: pointer;
  align-self: center;
  padding: 4px 8px;
}

.post-explosion-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
}

.point-awarded-msg {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--brass-bright);
}

.next-round-btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ==========================================
   MODALS
   ========================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 15, 9, 0.84);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-overlay[hidden] {
  display: none !important;
}

.modal-card {
  background: linear-gradient(180deg, #153d26 0%, #0a2114 100%);
  border: 2.5px solid var(--brass-mid);
  border-radius: var(--radius-lg);
  max-width: 550px;
  width: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(207, 148, 68, 0.35);
  padding-bottom: 10px;
}

.modal-header h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--brass-bright);
}

.close-modal-btn {
  background: transparent;
  border: none;
  color: var(--parchment-mid);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px 8px;
}

.rules-list {
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  line-height: 1.5;
  color: var(--parchment-light);
  font-size: 1.02rem;
}

.rules-list ul {
  padding-left: 20px;
  margin-top: 6px;
  color: var(--seafoam-light);
}

.modal-desc {
  color: var(--parchment-mid);
  font-size: 1rem;
  line-height: 1.45;
}

#customWordsInput {
  width: 100%;
  background: var(--prussian-deep);
  color: var(--parchment-light);
  border: 1.5px solid var(--brass-mid);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: var(--font-body);
  font-size: 1.05rem;
  resize: vertical;
}

.custom-words-status {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  color: var(--brass-bright);
}

.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-actions > button {
  flex: 1;
  min-width: 160px;
}

/* ==========================================
   RESPONSIVE LAYOUT: COMPUTER, IPAD & MOBIL
   ========================================== */

/* iPad Landscape & Laptops with compact height (700px - 830px tall) */
@media (max-height: 830px) and (min-width: 681px) {
  .top-bar {
    padding: 8px 20px;
  }

  .game-container {
    padding: 10px 18px 16px;
    gap: 10px;
  }

  .team-card {
    padding: 7px 12px;
    gap: 4px;
  }

  .score-value {
    font-size: 1.8rem;
  }

  .game-panel {
    padding: 16px 22px;
    gap: 12px;
  }

  .hero-steampunk-emblem {
    width: 208px;
    height: 208px;
  }

  .steampunk-bomb {
    max-width: 420px;
    padding: 2px 14px 6px;
  }

  .bomb-sphere {
    max-width: 345px;
    padding: 20px 24px 24px;
  }

  .word-card.bomb-screen {
    height: 146px;
    padding: 10px 18px;
  }
}

/* Tablets & Mobile Phones (<= 680px) */
@media (max-width: 680px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .timer-choice-group {
    grid-template-columns: repeat(2, 1fr);
  }

  .logo-tagline {
    display: none;
  }

  .top-bar {
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .logo-group h1 {
    font-size: 1.18rem;
  }

  .top-actions {
    gap: 6px;
  }

  .icon-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
    min-height: 36px;
  }

  .game-container {
    padding: 10px 12px 18px;
    gap: 12px;
  }

  .game-panel {
    padding: 16px 14px;
    gap: 14px;
  }

  .active-round-header {
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .play-actions {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .next-word-btn {
    order: -1;
    padding: 15px 14px;
  }

  .award-buttons {
    grid-template-columns: 1fr;
  }
}

/* Mobile Phones (<= 480px) */
@media (max-width: 480px) {
  .top-bar {
    justify-content: center;
  }

  .logo-group {
    width: 100%;
    justify-content: center;
  }

  .top-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .scoreboard {
    gap: 6px;
  }

  .team-card {
    padding: 8px 6px;
    gap: 4px;
  }

  .team-name-input {
    font-size: 1rem;
    padding: 2px 4px;
  }

  .edit-hint {
    display: none;
  }

  .score-controls {
    gap: 8px;
  }

  .score-value {
    font-size: 1.65rem;
    min-width: 28px;
  }

  .score-btn {
    width: 30px;
    height: 30px;
    font-size: 1.05rem;
  }

  .vs-badge {
    width: 36px;
    height: 36px;
  }

  .vs-badge strong {
    font-size: 0.78rem;
  }

  .hero-steampunk-emblem {
    width: 196px;
    height: 196px;
  }

  .setup-heading {
    font-size: 1.22rem;
  }

  .subtitle {
    font-size: 0.98rem;
  }

  /* Proportionally scaled Steampunk Bomb on Mobile Phones */
  .steampunk-bomb {
    max-width: 340px;
    padding: 2px 6px 8px;
  }

  .bomb-fuse-wrap {
    width: 118px;
    height: 46px;
    margin-bottom: -8px;
  }

  .fuse-spark-cluster {
    left: 88px;
    top: 9px;
  }

  .steampunk-neck {
    width: 82px;
    height: 32px;
  }

  .bomb-sphere {
    max-width: 310px;
    aspect-ratio: auto;
    min-height: 218px;
    border-radius: 46%;
    padding: 18px 16px 22px;
    gap: 6px;
  }

  .word-card.bomb-screen {
    height: 132px;
    border-width: 4.5px;
    border-radius: 18px;
    padding: 10px 14px 8px;
  }

  .word-category-badge {
    font-size: 0.66rem;
    padding: 2px 10px;
  }

  .pass-instruction {
    font-size: 0.9rem;
  }

  .next-main {
    font-size: 1.15rem;
  }

  .next-sub {
    font-size: 0.85rem;
  }
}

