/* ==========================================================================
 * BLACKOUT GAME (暗战游戏) — Atmospheric Illuminated Studio Floor-Plan & Console
 * ========================================================================== */

.bg-arena {
  width: 100%;
  max-width: 1040px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Score & Half Status Header */
.bg-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--tg-radius-lg);
  background: linear-gradient(165deg, rgba(16, 19, 32, 0.96), rgba(7, 9, 15, 0.98));
  border: 1px solid var(--tg-border-strong);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.65);
}

.bg-team-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(10, 12, 22, 0.8);
  border: 1px solid var(--tg-border-subtle);
}

.bg-team-box.is-attacker {
  border-color: rgba(34, 211, 238, 0.62);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.16);
}

.bg-team-box.is-defender {
  border-color: rgba(255, 46, 84, 0.62);
  box-shadow: 0 0 20px rgba(255, 46, 84, 0.16);
}

.bg-team-score {
  font-family: var(--tg-font-mono);
  font-size: 28px;
  font-weight: 900;
  color: var(--tg-gold-bright);
  line-height: 1;
}

.bg-half-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
}

/* Studio Floor-Plan Stage (Blackout vs Floodlight States) */
.bg-studio-floor {
  position: relative;
  border-radius: var(--tg-radius-lg);
  padding: 20px;
  border: 1.5px solid var(--tg-border-strong);
  overflow: hidden;
  transition: background 0.45s var(--tg-ease), border-color 0.45s, box-shadow 0.45s;
}

.bg-studio-floor.is-blackout {
  background:
    radial-gradient(ellipse 60% 45% at 50% 50%, rgba(217, 27, 58, 0.12), transparent 72%),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.018) 0px,
      rgba(255, 255, 255, 0.018) 1px,
      transparent 1px,
      transparent 32px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.018) 0px,
      rgba(255, 255, 255, 0.018) 1px,
      transparent 1px,
      transparent 32px
    ),
    #04050a;
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.95), 0 24px 60px rgba(0, 0, 0, 0.8);
  animation: bg-grid-flicker 4.5s ease-in-out infinite;
}

@keyframes bg-grid-flicker {
  0%, 93%, 100% { filter: brightness(1); }
  95% { filter: brightness(0.84); }
  97% { filter: brightness(1.06); }
}

.bg-studio-floor.is-lights-on {
  background:
    radial-gradient(ellipse 90% 65% at 50% 0%, rgba(255, 240, 194, 0.22), transparent 68%),
    radial-gradient(ellipse 65% 50% at 50% 100%, rgba(34, 211, 238, 0.14), transparent 70%),
    linear-gradient(180deg, #1b2238 0%, #0e1222 100%);
  border-color: var(--tg-gold-bright);
  box-shadow: 0 0 60px rgba(228, 185, 91, 0.25), inset 0 0 40px rgba(255, 240, 194, 0.12);
  animation: bg-floodlight-flash 0.55s var(--tg-ease);
}

.bg-studio-floor.is-busted {
  background:
    radial-gradient(ellipse 80% 65% at 50% 50%, rgba(255, 46, 84, 0.3), transparent 70%),
    linear-gradient(180deg, #270b14 0%, #100509 100%);
  border-color: var(--tg-garnet-bright);
  box-shadow: 0 0 64px rgba(255, 46, 84, 0.45), inset 0 0 50px rgba(217, 27, 58, 0.35);
}

@keyframes bg-floodlight-flash {
  0% { filter: brightness(2.2); }
  100% { filter: brightness(1); }
}

.bg-floor-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.bg-power-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px;
  border-radius: 999px;
  font-family: var(--tg-font-mono);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.bg-power-pill.is-dark {
  background: rgba(15, 18, 30, 0.92);
  border: 1px solid rgba(255, 46, 84, 0.55);
  color: #ff99ab;
}

.bg-power-pill.is-lit {
  background: rgba(228, 185, 91, 0.22);
  border: 1px solid var(--tg-gold-bright);
  color: var(--tg-gold-bright);
  box-shadow: 0 0 18px rgba(228, 185, 91, 0.35);
}

/* Red Charge Capacitors */
.bg-charges {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--tg-font-mono);
  font-size: 11.5px;
  color: var(--tg-ink-muted);
}

.bg-charge-cell {
  width: 24px;
  height: 11px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.bg-charge-cell.is-live {
  background: linear-gradient(90deg, #ff2e54, #ff7a93);
  border-color: #ffd1db;
  box-shadow: 0 0 12px rgba(255, 46, 84, 0.85);
}

/* 4-Chamber Studio Floor-Plan Grid split by Crimson Laser Line */
.bg-chambers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  position: relative;
}

.bg-chamber {
  position: relative;
  border-radius: 14px;
  padding: 12px 10px;
  min-height: 210px;
  background: rgba(10, 13, 24, 0.84);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.2s var(--tg-ease), border-color 0.2s, box-shadow 0.2s, background 0.2s;
  overflow: hidden;
}

.bg-chamber::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2.5px;
  background: linear-gradient(90deg, rgba(255, 46, 84, 0.3), #ff2e54, rgba(255, 46, 84, 0.3));
  box-shadow: 0 0 14px #ff2e54, 0 0 28px rgba(255, 46, 84, 0.6);
  z-index: 1;
}

.bg-chamber.is-clickable {
  cursor: pointer;
}

.bg-chamber.is-clickable:hover {
  border-color: var(--tg-gold-bright);
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(228, 185, 91, 0.26);
}

.bg-chamber.is-crossing {
  border-color: var(--tg-cyan);
  background: radial-gradient(circle at 50% 22%, rgba(34, 211, 238, 0.22), rgba(8, 14, 26, 0.92) 72%);
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.32);
}

.bg-chamber.is-eliminated {
  opacity: 0.44;
  border-color: rgba(255, 46, 84, 0.3);
  background: repeating-linear-gradient(
    -45deg,
    rgba(217, 27, 58, 0.12) 0px,
    rgba(217, 27, 58, 0.12) 6px,
    rgba(8, 9, 14, 0.92) 6px,
    rgba(8, 9, 14, 0.92) 14px
  );
}

.bg-chamber.is-busted-hit {
  border-color: var(--tg-garnet-bright);
  background: radial-gradient(circle at 50% 30%, rgba(255, 46, 84, 0.42), #1b060d 78%);
  box-shadow: 0 0 34px rgba(255, 46, 84, 0.72);
  opacity: 1;
}

.bg-chamber.is-bonus-glow {
  border-color: var(--tg-gold-bright);
  background: radial-gradient(circle at 50% 25%, rgba(228, 185, 91, 0.34), #1d1607 78%);
  box-shadow: 0 0 34px rgba(228, 185, 91, 0.58);
}

.bg-zone-label {
  font-family: var(--tg-font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  z-index: 2;
}

.bg-operative-token {
  position: relative;
  z-index: 3;
  width: 100%;
  padding: 9px 8px;
  border-radius: 10px;
  background: rgba(16, 22, 38, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.18);
  text-align: center;
  transition: transform 0.35s var(--tg-ease), border-color 0.25s, box-shadow 0.25s;
}

.bg-chamber.is-crossing .bg-operative-token {
  border-color: var(--tg-cyan);
  background: linear-gradient(160deg, rgba(14, 116, 144, 0.56), rgba(8, 28, 42, 0.96));
  box-shadow: 0 0 22px rgba(34, 211, 238, 0.5);
  transform: translateY(-76px);
}

.bg-chamber.is-safe-zone .bg-operative-token {
  transform: translateY(0);
}

.bg-op-glyph {
  font-size: 20px;
  line-height: 1;
  color: var(--tg-gold-bright);
}

.bg-op-name {
  font-weight: 800;
  font-size: 13px;
  margin-top: 3px;
}

.bg-op-streak {
  font-family: var(--tg-font-mono);
  font-size: 11px;
  color: var(--tg-cyan);
  margin-top: 3px;
}

.bg-streak-dots {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 5px;
}

.bg-streak-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}

.bg-streak-dot.is-lit {
  background: var(--tg-gold-bright);
  box-shadow: 0 0 8px var(--tg-gold);
}

/* Bottom Broadcast Action Console */
.bg-console {
  padding: 18px 20px;
  border-radius: var(--tg-radius-lg);
  background: var(--tg-glass);
  border: 1px solid var(--tg-border);
  box-shadow: var(--tg-shadow-card);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bg-button-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.bg-big-btn {
  padding: 20px 18px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 900;
  letter-spacing: 0.06em;
  transition: transform 0.14s var(--tg-ease), box-shadow 0.14s;
}

.bg-big-btn-red {
  background: radial-gradient(circle at 35% 25%, #ff5c7c, #d91b3a 58%, #7a091e 100%);
  border: 2.5px solid #ffb3c1;
  color: #fff;
  box-shadow: 0 8px 0 #420410, 0 0 34px rgba(255, 46, 84, 0.5);
}

.bg-big-btn-red:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 0 #420410, 0 0 46px rgba(255, 46, 84, 0.72);
}

.bg-big-btn-green {
  background: radial-gradient(circle at 35% 25%, #4ade80, #16a34a 58%, #14532d 100%);
  border: 2.5px solid #bbf7d0;
  color: #031a0c;
  box-shadow: 0 8px 0 #052e16, 0 0 32px rgba(34, 197, 94, 0.42);
}

.bg-big-btn-green:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 0 #052e16, 0 0 44px rgba(34, 197, 94, 0.65);
}

.bg-big-btn-title {
  font-family: var(--tg-font-display);
  font-size: 20px;
}

.bg-big-btn-sub {
  font-size: 12px;
  opacity: 0.9;
  font-weight: 600;
}

.bg-attacker-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.bg-outcome-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  flex-wrap: wrap;
}

.bg-outcome-banner.is-safe {
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.6);
  color: #bbf7d0;
}

.bg-outcome-banner.is-busted {
  background: rgba(217, 27, 58, 0.24);
  border: 1px solid rgba(255, 46, 84, 0.75);
  color: #ffd1db;
}

.bg-outcome-banner.is-false {
  background: rgba(228, 185, 91, 0.2);
  border: 1px solid rgba(228, 185, 91, 0.75);
  color: var(--tg-gold-bright);
}

.bg-history-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.bg-hist-chip {
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--tg-font-mono);
  font-size: 11px;
  font-weight: 700;
  background: rgba(12, 15, 26, 0.86);
  border: 1px solid var(--tg-border-subtle);
}

@media (max-width: 780px) {
  .bg-header {
    grid-template-columns: 1fr;
  }
  .bg-chambers-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .bg-button-duo {
    grid-template-columns: 1fr;
  }
}
