/* ბუნკერი თბილისი - გაფართოებული სტილები (Cloud & Auth Premium UI) */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Georgian:wght@300;400;500;700&family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');

:root {
  --bg-color: #0b0c10;
  --bg-darker: #050608;
  --bg-card: rgba(15, 22, 36, 0.85);
  --bg-overlay: rgba(5, 6, 8, 0.95);
  
  /* Hazard palette */
  --accent-glow: #39ff14; /* Toxic green */
  --orange-hazard: #ff5f1f; /* Radioactive orange */
  --red-hazard: #ef4444; /* Emergency red */
  --yellow-caution: #facc15; /* Warning yellow */
  
  /* Text */
  --text-color: #f1f5f9;
  --text-muted: #94a3b8;
  --border-color: rgba(57, 255, 20, 0.15);
  --border-hover: rgba(255, 95, 31, 0.5);
  
  /* Glassmorphism */
  --glass-bg: rgba(17, 24, 39, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  
  /* Fonts */
  --font-family: 'Noto Sans Georgian', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-title: 'Rubik', 'Noto Sans Georgian', sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and body */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  background-image: linear-gradient(rgba(11, 12, 16, 0.88), rgba(5, 6, 8, 0.96)), 
                    url('../assets/tbilisi_apocalypse.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  transition: background-image 0.5s ease-in-out;
}

/* Warning / Alert Banner */
.warning-banner {
  background: linear-gradient(90deg, #78350f, #92400e);
  color: #fef3c7;
  border-bottom: 2px solid var(--yellow-caution);
  padding: 8px 15px;
  font-size: 0.85rem;
  text-align: center;
  font-weight: 500;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  z-index: 1000;
  position: relative;
}

.warning-banner a {
  color: #fff;
  text-decoration: underline;
  font-weight: bold;
}

/* Hazard striping */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: repeating-linear-gradient(
    -45deg,
    var(--yellow-caution),
    var(--yellow-caution) 10px,
    #000 10px,
    #000 20px
  );
  z-index: 9999;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-darker);
}
::-webkit-scrollbar-thumb {
  background: rgba(57, 255, 20, 0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-glow);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  width: 100%;
}

.hidden {
  display: none !important;
}

/* Buttons */
.btn {
  font-family: var(--font-title);
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
}

.btn-primary {
  background-color: transparent;
  color: var(--accent-glow);
  border: 1px solid var(--accent-glow);
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.1);
}

.btn-primary:hover {
  background-color: var(--accent-glow);
  color: #000;
  box-shadow: 0 0 20px rgba(57, 255, 20, 0.4);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--orange-hazard);
  border: 1px solid var(--orange-hazard);
  box-shadow: 0 0 10px rgba(255, 95, 31, 0.1);
}

.btn-secondary:hover {
  background-color: var(--orange-hazard);
  color: #000;
  box-shadow: 0 0 20px rgba(255, 95, 31, 0.4);
  transform: translateY(-2px);
}

.btn-large {
  padding: 16px 36px;
  font-size: 1.1rem;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-danger {
  background-color: transparent;
  color: var(--red-hazard);
  border: 1px solid var(--red-hazard);
}

.btn-danger:hover {
  background-color: var(--red-hazard);
  color: #fff;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
  transform: translateY(-2px);
}

/* Form controls */
.form-select, input[type="text"], input[type="email"], input[type="password"] {
  width: 100%;
  padding: 12px;
  background-color: rgba(5, 6, 8, 0.85);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  border-radius: 4px;
  font-family: var(--font-family);
  font-size: 1rem;
  transition: var(--transition);
  outline: none;
}

.form-select:focus, input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus {
  border-color: var(--orange-hazard);
  box-shadow: 0 0 10px rgba(255, 95, 31, 0.2);
}

.input-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-family: var(--font-title);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Sections Transition */
section {
  display: flex;
  flex-direction: column;
  min-height: 80vh;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

section.active {
  opacity: 1;
  transform: translateY(0);
}

/* Glassmorphism panels */
.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  padding: 40px;
  width: 100%;
  max-width: 600px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  position: relative;
}

.glass-panel::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.15) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  border-radius: 8px;
}

/* Titles */
.setup-title, .screen-title {
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 25px;
  text-align: center;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 12px;
  color: var(--orange-hazard);
  text-transform: uppercase;
}

/* 1. Landing Screen */
#screen-landing {
  text-align: center;
  width: 100%;
}

.hero-title {
  font-family: var(--font-title);
  font-size: 5.5rem;
  font-weight: 900;
  letter-spacing: 4px;
  margin-bottom: 10px;
  position: relative;
  background: linear-gradient(
    to bottom,
    #94a3b8 20%,    /* Steel gray */
    #86efac 55%,    /* Light moss green */
    #166534 90%     /* Dark forest green */
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.4)) 
          drop-shadow(0 0 20px rgba(21, 128, 61, 0.35));
  animation: titleGlowPulse 4s infinite alternate ease-in-out;
}

/* Moss & Post-apocalyptic decorations */
.moss-decor-wrapper {
  position: relative;
  display: inline-block;
  padding: 10px 45px;
  margin-top: -35px; /* Pulls title up */
  margin-bottom: 5px;
}

/* Hanging moss vine simulation */
.moss-hanging {
  position: absolute;
  background: linear-gradient(to bottom, rgba(34, 197, 94, 0.65), rgba(21, 128, 61, 0));
  border-radius: 50% 50% 0 0;
  pointer-events: none;
  filter: blur(1.2px);
}

.mh-1 {
  bottom: -35px;
  left: 20%;
  width: 10px;
  height: 60px;
  border-radius: 5px;
  box-shadow: 15px 12px 0 rgba(22, 163, 74, 0.55), 
              -25px 8px 0 rgba(74, 222, 128, 0.45),
              65px 20px 0 rgba(21, 128, 61, 0.65),
              110px 15px 0 rgba(34, 197, 94, 0.5),
              -80px 25px 0 rgba(22, 163, 74, 0.4);
  opacity: 0.85;
  animation: swingMoss 7s infinite ease-in-out;
}

/* Moss leaks dripping down the title */
.moss-leak {
  position: absolute;
  top: 15px;
  width: 4px;
  border-radius: 0 0 2px 2px;
  pointer-events: none;
  filter: blur(0.5px);
}

.ml-1 {
  left: 30%;
  height: 35px;
  background: linear-gradient(to bottom, #16a34a, transparent);
  box-shadow: 20px 0 0 #15803d, 60px -5px 0 #22c55e, 120px 10px 0 #166534;
  opacity: 0.8;
}

.ml-2 {
  right: 32%;
  height: 45px;
  background: linear-gradient(to bottom, #15803d, transparent);
  box-shadow: -30px -5px 0 #166534, -75px 5px 0 #4ade80, -130px 15px 0 #15803d;
  opacity: 0.75;
}

/* Swing animation for hanging moss */
@keyframes swingMoss {
  0%, 100% { transform: rotate(-2.5deg) skewX(-1deg); }
  50% { transform: rotate(2.5deg) skewX(1deg); }
}

/* title glow pulse animation */
@keyframes titleGlowPulse {
  0% {
    filter: drop-shadow(0 0 5px rgba(34, 197, 94, 0.35)) 
            drop-shadow(0 0 15px rgba(21, 128, 61, 0.25));
  }
  100% {
    filter: drop-shadow(0 0 12px rgba(34, 197, 94, 0.7)) 
            drop-shadow(0 0 35px rgba(74, 222, 128, 0.45));
  }
}

.hero-subtitle {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--yellow-caution);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 65px; /* Pushes subtitle further down */
  margin-bottom: 45px;
  background: rgba(0, 0, 0, 0.45);
  padding: 10px 24px;
  border-left: 2px solid var(--orange-hazard);
  border-right: 2px solid var(--orange-hazard);
  border-radius: 4px;
  display: inline-block;
  box-shadow: inset 0 0 10px rgba(255, 95, 31, 0.12), 0 4px 15px rgba(0, 0, 0, 0.5);
  text-shadow: 0 0 8px rgba(250, 204, 21, 0.4);
  animation: subtitleWarningPulse 2.5s infinite alternate ease-in-out;
}

@keyframes subtitleWarningPulse {
  0% {
    border-color: var(--orange-hazard);
    box-shadow: inset 0 0 6px rgba(255, 95, 31, 0.15), 0 4px 15px rgba(0, 0, 0, 0.5);
  }
  100% {
    border-color: var(--yellow-caution);
    box-shadow: inset 0 0 14px rgba(250, 204, 21, 0.3), 0 4px 20px rgba(250, 204, 21, 0.15);
  }
}

.hero-buttons-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

/* 2. Authentication Screen */
#screen-auth {
  width: 100%;
}

.auth-tabs {
  display: flex;
  margin-bottom: 25px;
  border-bottom: 1px solid var(--border-color);
}

.auth-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 12px;
  cursor: pointer;
  font-family: var(--font-title);
  font-weight: 700;
  text-transform: uppercase;
  transition: var(--transition);
}

.auth-tab-btn.active {
  color: var(--accent-glow);
  border-bottom: 2px solid var(--accent-glow);
}

.auth-footer {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 15px;
}

/* Avatars Selector grid */
.avatar-grid-select {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-top: 10px;
  margin-bottom: 20px;
}

.avatar-option-btn {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 1.8rem;
  border-radius: 4px;
  padding: 8px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  justify-content: center;
  align-items: center;
}

.avatar-option-btn:hover {
  border-color: var(--orange-hazard);
  background: rgba(255, 95, 31, 0.1);
}

.avatar-option-btn.selected {
  border-color: var(--accent-glow);
  background: rgba(57, 255, 20, 0.15);
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
}

/* 3. User Profile Screen */
#screen-profile {
  width: 100%;
}

.profile-card-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 30px;
}

@media (max-width: 768px) {
  .profile-card-layout {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.profile-left-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  border-right: 1px solid rgba(255,255,255,0.08);
  padding-right: 25px;
}

@media (max-width: 768px) {
  .profile-left-col {
    border-right: none;
    padding-right: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 25px;
  }
}

.profile-avatar-display {
  font-size: 5rem;
  background: rgba(0, 0, 0, 0.3);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid var(--accent-glow);
  box-shadow: 0 0 20px rgba(57, 255, 20, 0.2);
}

.profile-nickname-title {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
}

.profile-stats-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.stat-row-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.stat-row-item span:first-child {
  color: var(--text-muted);
}

.profile-right-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.achievements-heading {
  font-family: var(--font-title);
  color: var(--orange-hazard);
  font-size: 1.1rem;
  text-transform: uppercase;
  border-bottom: 1px dashed rgba(255,255,255,0.1);
  padding-bottom: 6px;
}

/* Achievements grid */
.achievements-panel-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 8px;
}

@media (max-width: 900px) {
  .achievements-panel-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 600px) {
  .achievements-panel-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.achievement-badge-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 6px;
  padding: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.35;
  filter: grayscale(100%);
  transition: var(--transition);
  position: relative;
}

.achievement-badge-card:hover {
  opacity: 0.9;
  filter: grayscale(0%);
  transform: translateY(-2px);
}

.achievement-badge-card.unlocked {
  opacity: 1;
  filter: grayscale(0%);
  background: rgba(255, 255, 255, 0.02);
}

.achievement-badge-card.unlocked.bronze {
  border-color: #cd7f32;
  box-shadow: 0 0 10px rgba(205, 127, 50, 0.15);
}

.achievement-badge-card.unlocked.silver {
  border-color: #c0c0c0;
  box-shadow: 0 0 10px rgba(192, 192, 192, 0.15);
}

.achievement-badge-card.unlocked.gold {
  border-color: #ffd700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.achievement-badge-icon {
  font-size: 2rem;
}

.achievement-badge-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.8rem;
}

.achievement-badge-desc {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.achievement-unlocked-date {
  font-size: 0.6rem;
  color: var(--accent-glow);
  font-weight: bold;
}

/* 4. Setup / Lobby Screen */
#screen-setup {
  width: 100%;
}

.lobby-invite-box {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 20px;
  text-align: center;
  margin-bottom: 25px;
}

.room-code-display-value {
  font-family: var(--font-title);
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 5px;
  color: var(--accent-glow);
  margin-top: 5px;
  text-shadow: 0 0 15px rgba(57, 255, 20, 0.3);
}

.lobby-players-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-top: 15px;
  margin-bottom: 30px;
}

@media (max-width: 600px) {
  .lobby-players-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.lobby-player-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 6px;
  padding: 15px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.lobby-player-card.host {
  border-color: var(--orange-hazard);
  box-shadow: 0 0 10px rgba(255, 95, 31, 0.1);
}

.lobby-player-avatar {
  font-size: 2.5rem;
}

.lobby-player-name {
  font-weight: 700;
  font-size: 0.9rem;
}

/* 5. Disaster Reveal Screen */
#screen-disaster {
  width: 100%;
}

.disaster-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  max-width: 1100px;
  width: 100%;
}

@media (max-width: 850px) {
  .disaster-container {
    grid-template-columns: 1fr;
  }
}

.danger-box {
  background: rgba(239, 68, 68, 0.05);
  border: 1px dashed var(--red-hazard);
  padding: 30px;
  border-radius: 8px;
  box-shadow: inset 0 0 20px rgba(239, 68, 68, 0.1);
}

.danger-tag {
  color: var(--red-hazard);
  font-family: var(--font-title);
  font-weight: 800;
  letter-spacing: 2px;
  display: inline-block;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.danger-box h2 {
  font-family: var(--font-title);
  font-size: 2.2rem;
  margin-bottom: 20px;
  color: #fff;
}

/* Disaster Stats & History Styling */
.disaster-stats-box {
  display: flex;
  gap: 15px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.stat-badge-item {
  flex: 1;
  min-width: 180px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-badge-item:hover {
  transform: translateY(-2px);
  border-color: rgba(239, 68, 68, 0.4);
}

.stat-label {
  font-size: 0.75rem;
  color: #ffb8b8;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
  font-weight: 600;
}

.stat-value {
  font-size: 1.45rem;
  font-weight: bold;
  color: #ff4d4d;
  font-family: var(--font-title);
  text-shadow: 0 0 12px rgba(255, 77, 77, 0.6);
}

.disaster-history-box {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.disaster-history-box h3 {
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
  font-family: var(--font-title);
  display: flex;
  align-items: center;
  gap: 8px;
}

.disaster-history-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #d8d8d8;
  text-align: justify;
}

.bunker-box {
  background: rgba(57, 255, 20, 0.03);
  border: 1px solid var(--border-color);
  padding: 30px;
  border-radius: 8px;
  box-shadow: inset 0 0 20px rgba(57, 255, 20, 0.05);
}

.bunker-box h2 {
  font-family: var(--font-title);
  color: var(--accent-glow);
  font-size: 1.8rem;
  margin-bottom: 20px;
}

.bunker-image-wrapper {
  width: 100%;
  height: 180px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}

.bunker-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.specs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.spec-item strong {
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.8rem;
  display: block;
}

.disaster-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 20px;
}

/* 6. Game Board Styling */
#screen-board {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  align-items: stretch;
  justify-content: flex-start;
}

.board-header {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 15px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.mini-disaster-info {
  font-size: 0.95rem;
}

.mini-disaster-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ff9e9e;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-primary);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

.mini-disaster-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ff4d4d;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.pulse-red {
  display: inline-block;
  animation: redPulseAnim 2s infinite;
}

@keyframes redPulseAnim {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.25);
    opacity: 0.85;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.round-badge {
  background: rgba(255, 95, 31, 0.1);
  border: 1px solid var(--orange-hazard);
  padding: 10px 20px;
  border-radius: 6px;
  text-align: right;
}

.board-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 25px;
  width: 100%;
  margin-top: 20px;
}

@media (max-width: 900px) {
  .board-grid {
    grid-template-columns: 1fr;
  }
}

.board-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
}

.board-sidebar h3 {
  font-family: var(--font-title);
  font-size: 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 10px;
  margin-bottom: 15px;
  text-transform: uppercase;
  color: var(--orange-hazard);
}

.players-scroller {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 5px;
}

.player-list-item {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.player-list-item:hover {
  border-color: var(--border-hover);
}

.player-list-item.current {
  border-color: var(--accent-glow);
  background: rgba(57, 255, 20, 0.04);
}

.player-list-item.excluded {
  opacity: 0.3;
  border-color: var(--red-hazard);
}

.player-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: bold;
}

.status-badge.alive {
  background: rgba(57, 255, 20, 0.15);
  color: var(--accent-glow);
}

.status-badge.dead {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red-hazard);
}

/* Active Player Card */
.active-player-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.active-player-card::after {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
  z-index: 2;
  background-size: 100% 4px;
  pointer-events: none;
}

.card-placeholder-private {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
  text-align: center;
  gap: 20px;
  z-index: 3;
}

.active-card-content {
  padding: 30px;
  z-index: 3;
}

.active-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 15px;
  margin-bottom: 25px;
}

.active-card-header h3 {
  font-family: var(--font-title);
  color: var(--accent-glow);
  font-size: 1.8rem;
}

.traits-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

@media (max-width: 600px) {
  .traits-grid {
    grid-template-columns: 1fr;
  }
}

.trait-row {
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.03);
  border-radius: 6px;
  padding: 15px;
  transition: var(--transition);
}

.trait-row.revealed {
  border-color: rgba(57, 255, 20, 0.25);
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.05);
}

.trait-row.hidden-trait {
  border-color: rgba(255, 95, 31, 0.15);
}

.hidden-trait .trait-value {
  filter: blur(4px);
  user-select: none;
  opacity: 0.5;
}

/* Control Hub */
.control-hub {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 20px;
  align-items: center;
}

@media (max-width: 650px) {
  .control-hub {
    grid-template-columns: 1fr;
  }
}

.timer-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timer-bar-wrapper {
  background: rgba(0, 0, 0, 0.5);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}

.timer-bar {
  height: 100%;
  width: 100%;
  background-color: var(--accent-glow);
  box-shadow: 0 0 10px var(--accent-glow);
  transition: width 1s linear, background-color 0.3s ease;
}

/* Logs */
.logs-panel {
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  font-family: monospace;
  color: var(--accent-glow);
}

.logs-box {
  max-height: 120px;
  overflow-y: auto;
}

/* 7. Voting */
#screen-voting {
  width: 100%;
}

.voting-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 40px;
  width: 90%;
  max-width: 600px;
}

.voters-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 30px;
}

.voting-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 20px;
  align-items: center;
}

/* 8. Game Over Screen */
#screen-gameover {
  width: 100%;
}

.gameover-container {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 30px;
  width: 90%;
  max-width: 950px;
}

@media (max-width: 800px) {
  .gameover-container {
    grid-template-columns: 1fr;
  }
}

.score-circle {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 4px solid var(--accent-glow);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 3rem;
  font-family: var(--font-title);
  font-weight: 900;
  color: var(--accent-glow);
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.4);
}

.gameover-details {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 35px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; bottom: 0; right: 0;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}

.modal-card {
  background: var(--bg-card);
  border: 2px solid var(--orange-hazard);
  box-shadow: 0 0 30px rgba(255, 95, 31, 0.3);
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  padding: 35px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Animations */
.scale-up {
  animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes scaleUp {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Background 3D Canvas */
#bg-canvas-3d {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

/* Card Activation Full-Screen Alert Overlay */
.alert-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100000;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(8px);
  transition: opacity 0.3s ease;
}

.alert-content-card {
  background: rgba(15, 22, 36, 0.95);
  border: 3px solid var(--orange-hazard);
  box-shadow: 0 0 40px rgba(255, 95, 31, 0.5);
  border-radius: 8px;
  padding: 40px 30px;
  text-align: center;
  max-width: 500px;
  width: 90%;
  position: relative;
  overflow: hidden;
}

.alert-content-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: repeating-linear-gradient(
    -45deg,
    var(--yellow-caution),
    var(--yellow-caution) 10px,
    #000 10px,
    #000 20px
  );
}

.alert-hazard-header {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--orange-hazard);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 15px;
  animation: pulseGlow 1.5s infinite alternate;
}

.alert-message-body {
  font-size: 1.15rem;
  color: var(--text-color);
  line-height: 1.5;
}

@keyframes pulseGlow {
  from {
    text-shadow: 0 0 10px rgba(255, 95, 31, 0.2);
  }
  to {
    text-shadow: 0 0 25px rgba(255, 95, 31, 0.8);
  }
}

/* Active Effect Badges */
.active-effect-badge {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 95, 31, 0.3);
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeInSlideIn 0.3s ease forwards;
}

.active-effect-badge.veto {
  border-color: var(--red-hazard);
  background: rgba(239, 68, 68, 0.05);
}

.active-effect-badge.immunity {
  border-color: var(--accent-glow);
  background: rgba(57, 255, 20, 0.05);
}

.active-effect-badge.muted {
  border-color: var(--yellow-caution);
  background: rgba(250, 204, 21, 0.05);
}

.active-effect-badge.card-use {
  border-color: rgba(255,255,255,0.15);
  font-style: italic;
}

@keyframes fadeInSlideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Floating Audio Control Button */
.btn-ambient-audio {
  position: fixed;
  top: 15px;
  right: 20px;
  z-index: 10000;
  padding: 8px 16px;
  font-size: 0.85rem;
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  font-family: var(--font-title);
  font-weight: 700;
}
.btn-ambient-audio:hover {
  border-color: var(--orange-hazard);
  color: var(--orange-hazard);
  box-shadow: 0 4px 20px rgba(255, 95, 31, 0.25);
  transform: scale(1.05);
}

/* Speaker Turn Banner */
.speaker-banner {
  background: rgba(57, 255, 20, 0.06);
  border: 1px solid rgba(57, 255, 20, 0.25);
  border-radius: 6px;
  padding: 12px 25px;
  width: 100%;
  text-align: center;
  margin-top: 15px;
  margin-bottom: 5px;
  font-family: var(--font-title);
  font-size: 1.05rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  animation: speakerBannerPulse 2s infinite alternate;
  box-shadow: inset 0 0 10px rgba(57, 255, 20, 0.05);
}

.speaker-pulse-mic {
  animation: micFlash 1s infinite alternate;
  display: inline-block;
}

@keyframes speakerBannerPulse {
  from {
    box-shadow: 0 0 5px rgba(57, 255, 20, 0.08), inset 0 0 10px rgba(57, 255, 20, 0.03);
    border-color: rgba(57, 255, 20, 0.2);
  }
  to {
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.18), inset 0 0 20px rgba(57, 255, 20, 0.08);
    border-color: rgba(57, 255, 20, 0.45);
  }
}

@keyframes micFlash {
  from { opacity: 0.4; transform: scale(0.9); }
  to { opacity: 1.0; transform: scale(1.1); }
}

/* Active Speaker highlight in list */
.player-list-item.speaking {
  border-color: var(--accent-glow) !important;
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.2) !important;
  background: rgba(57, 255, 20, 0.04) !important;
}

/* Board View Navigation Tabs */
.board-navigation-tabs {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-top: 15px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 5px;
}

.board-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 20px;
  font-family: var(--font-title);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.95rem;
  text-transform: uppercase;
  border-radius: 4px 4px 0 0;
  border-bottom: 2px solid transparent;
}

.board-nav-btn:hover {
  color: var(--text-color);
}

.board-nav-btn.active {
  color: var(--orange-hazard);
  border-bottom-color: var(--orange-hazard);
  background: rgba(255, 95, 31, 0.04);
}

/* Blueprint visualizer layouts */
.blueprint-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 10px;
}

@media (max-width: 600px) {
  .blueprint-grid {
    grid-template-columns: 1fr;
  }
}

.blueprint-room-card {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  padding: 20px;
  position: relative;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.blueprint-room-card:hover {
  transform: translateY(-2px);
  background: rgba(0,0,0,0.55);
}

.room-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-bottom: 8px;
}

.room-card-header h4 {
  font-family: var(--font-title);
  font-size: 1.05rem;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-status-indicator {
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Room Status colors */
.status-excellent {
  background: rgba(57, 255, 20, 0.12);
  color: var(--accent-glow);
  border: 1px solid rgba(57, 255, 20, 0.2);
}

.status-stable {
  background: rgba(250, 204, 21, 0.1);
  color: var(--yellow-caution);
  border: 1px solid rgba(250, 204, 21, 0.2);
}

.status-critical {
  background: rgba(255, 95, 31, 0.12);
  color: var(--orange-hazard);
  border: 1px solid rgba(255, 95, 31, 0.2);
}

.status-failure {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red-hazard);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.room-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.room-metric-bar-wrapper {
  background: rgba(0, 0, 0, 0.6);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.room-metric-bar {
  height: 100%;
  width: 100%;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.5s ease;
}

.room-metric-bar.excellent { background-color: var(--accent-glow); box-shadow: 0 0 5px var(--accent-glow); }
.room-metric-bar.stable { background-color: var(--yellow-caution); box-shadow: 0 0 5px var(--yellow-caution); }
.room-metric-bar.critical { background-color: var(--orange-hazard); box-shadow: 0 0 5px var(--orange-hazard); }
.room-metric-bar.failure { background-color: var(--red-hazard); box-shadow: 0 0 5px var(--red-hazard); }

.room-staffing-info {
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px dashed rgba(255,255,255,0.04);
  padding-top: 8px;
  display: flex;
  justify-content: space-between;
}

/* Traits Table View */
.traits-table-wrapper {
  overflow-x: auto;
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.traits-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(0, 0, 0, 0.35);
  font-size: 0.82rem;
  color: var(--text-color);
}

.traits-table th, .traits-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.traits-table th {
  background-color: rgba(255, 95, 31, 0.06);
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--orange-hazard);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border-color);
}

.traits-table tr {
  transition: background-color 0.2s ease;
}

.traits-table tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.traits-table tr.table-row-excluded {
  opacity: 0.35;
  background-color: rgba(239, 68, 68, 0.02);
  text-decoration: line-through;
}

.traits-table tr.table-row-self {
  background-color: rgba(57, 255, 20, 0.02);
  border-left: 3px solid var(--accent-glow);
}

.traits-table td.cell-hidden {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.78rem;
  opacity: 0.6;
}

.traits-table td.cell-revealed {
  color: var(--text-color);
  font-weight: 500;
}

/* Speaker Status Panel (Floating bottom bar) */
.speaker-status-panel {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 600px;
  border-radius: 12px;
  padding: 15px 25px;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* When the current user is the speaker */
.speaker-status-panel.speaker-mode {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.96), rgba(5, 150, 105, 0.96));
  border: 2px solid #10b981;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.4);
}

/* When the current user is a listener */
.speaker-status-panel.listener-mode {
  background: linear-gradient(135deg, rgba(31, 41, 55, 0.96), rgba(17, 24, 39, 0.96));
  border: 2px solid rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
}

.speaker-status-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.speaker-status-icon {
  font-size: 2.2rem;
  display: inline-block;
}

.speaker-status-panel.speaker-mode .speaker-status-icon {
  animation: pulseMicBig 1.2s infinite alternate;
}

.speaker-status-panel.listener-mode .speaker-status-icon {
  animation: pulseEar 1.5s infinite alternate;
}

.speaker-status-details {
  display: flex;
  flex-direction: column;
}

.speaker-status-title {
  font-size: 1.1rem;
  font-weight: bold;
  font-family: var(--font-title);
  color: #fff;
  letter-spacing: 0.5px;
}

.speaker-status-sub {
  font-size: 0.8rem;
  color: #e5e7eb;
}

.speaker-status-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.speaker-giant-timer {
  font-size: 2.6rem;
  font-weight: 800;
  font-family: var(--font-title);
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  padding: 5px 18px;
  border-radius: 8px;
  min-width: 78px;
  text-align: center;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.3);
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.speaker-giant-timer-unit {
  font-size: 0.9rem;
  font-weight: normal;
  color: #d1d5db;
}

@keyframes pulseMicBig {
  from { transform: scale(1) rotate(0deg); filter: drop-shadow(0 0 2px rgba(255,255,255,0.4)); }
  to { transform: scale(1.2) rotate(5deg); filter: drop-shadow(0 0 10px rgba(255,255,255,0.8)); }
}

@keyframes pulseEar {
  from { transform: scale(1) translateX(0); opacity: 0.8; }
  to { transform: scale(1.1) translateX(2px); opacity: 1; }
}

/* When general debate is active */
.speaker-status-panel.general-debate-mode {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.96), rgba(79, 70, 229, 0.96));
  border: 2px solid #6366f1;
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.4);
}

.speaker-status-panel.general-debate-mode .speaker-status-icon {
  animation: pulseMegaphone 1.3s infinite alternate;
}

@keyframes pulseMegaphone {
  from { transform: scale(1) rotate(-5deg); filter: drop-shadow(0 0 2px rgba(255,255,255,0.4)); }
  to { transform: scale(1.2) rotate(10deg); filter: drop-shadow(0 0 8px rgba(255,255,255,0.7)); }
}

@keyframes pulsePrison {
  from { transform: scale(1) rotate(-3deg); filter: drop-shadow(0 0 5px rgba(255,77,77,0.4)); }
  to { transform: scale(1.1) rotate(3deg); filter: drop-shadow(0 0 15px rgba(255,77,77,0.8)); }
}

/* Inventory Slots System Styling */
.inventory-grid-wrapper {
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.inventory-grid {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.inventory-slot {
  width: 65px;
  height: 65px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.6);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.inventory-slot.empty::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
}

.inventory-slot.active-item {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.1) 0%, rgba(0, 0, 0, 0.5) 100%);
  border: 1px solid var(--orange-hazard);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.15), inset 0 0 8px rgba(245, 158, 11, 0.08);
}

.inventory-slot.active-item:hover {
  transform: translateY(-2px) scale(1.03);
  border-color: #f59e0b;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.35), inset 0 0 8px rgba(245, 158, 11, 0.15);
}

.inventory-slot.active-item.selected-slot {
  transform: translateY(-2px) scale(1.03);
  border-color: var(--accent-glow);
  box-shadow: 0 0 15px rgba(57, 255, 20, 0.45), inset 0 0 8px rgba(57, 255, 20, 0.2);
  background: radial-gradient(circle, rgba(57, 255, 20, 0.15) 0%, rgba(0, 0, 0, 0.65) 100%);
}

.inventory-item-image {
  font-size: 1.85rem;
  user-select: none;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
  animation: itemFloat 2s infinite ease-in-out alternate;
  display: inline-block;
}

.inventory-item-details {
  font-size: 0.82rem;
  line-height: 1.45;
  color: #e5e7eb;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  padding: 10px 14px;
  min-height: 52px;
  border-left: 3px solid var(--orange-hazard);
  display: flex;
  align-items: center;
  text-align: left;
}

@keyframes itemFloat {
  from { transform: translateY(0); }
  to { transform: translateY(-2.5px); }
}

/* Ensure that own characteristics are fully readable (unblurred) to the player from the start */
.active-player-card .hidden-trait .trait-value {
  filter: none;
  user-select: text;
  opacity: 1;
}

/* Backpack Card Styling */
.luggage-backpack-card {
  grid-column: span 2;
  background: 
    radial-gradient(circle at 25% 25%, rgba(0,0,0,0.45) 0%, transparent 22%), /* oil stain */
    radial-gradient(circle at 75% 75%, rgba(92, 61, 38, 0.4) 0%, transparent 28%), /* mud stain */
    radial-gradient(circle at 12% 80%, rgba(0,0,0,0.35) 0%, transparent 18%), /* dirt/wear */
    repeating-linear-gradient(45deg, rgba(0,0,0,0.12) 0px, rgba(0,0,0,0.12) 2px, transparent 2px, transparent 6px), /* heavy canvas weave */
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.015) 0px, rgba(255,255,255,0.015) 1px, transparent 1px, transparent 4px), /* cross weave */
    linear-gradient(135deg, #3a3028 0%, #221c17 60%, #15110e 100%); /* dirty brown base */
  border: 2px solid #28201a;
  outline: 2px dashed #5c4b3e; /* crude double-stitched outline */
  outline-offset: -5px;
  border-radius: 28px 28px 14px 14px;
  padding: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.75), 
    inset 0 0 20px rgba(0, 0, 0, 0.7);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.luggage-backpack-card.hidden-trait {
  border-color: rgba(255, 95, 31, 0.25);
  outline-color: rgba(255, 95, 31, 0.15);
}

.luggage-backpack-card.revealed {
  border-color: rgba(57, 255, 20, 0.35);
  outline-color: rgba(57, 255, 20, 0.25);
  box-shadow: 
    0 15px 35px rgba(57, 255, 20, 0.08), 
    0 15px 35px rgba(0, 0, 0, 0.75),
    inset 0 0 20px rgba(0, 0, 0, 0.7);
}

/* Worn post-apocalyptic patches */
.backpack-patch {
  position: absolute;
  border-radius: 3px;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.75), 0 2px 5px rgba(0,0,0,0.55);
  opacity: 0.88;
  pointer-events: none;
  z-index: 2;
}

.backpack-patch.patch-1 {
  bottom: 15px;
  right: 25px;
  width: 55px;
  height: 36px;
  background: #3e322a; /* Faded leather patch */
  border: 1px solid #271f1a;
  transform: rotate(-5deg);
}

.backpack-patch.patch-1::before {
  content: '';
  position: absolute;
  top: 3px; left: 3px; right: 3px; bottom: 3px;
  border: 1px dashed #9b7e6b; /* Light brown thread stitches */
  opacity: 0.8;
}

.backpack-patch.patch-2 {
  top: 50px;
  left: 20px;
  width: 44px;
  height: 30px;
  background: #2c382c; /* Faded green canvas patch */
  border: 1px solid #1c251c;
  transform: rotate(8deg);
}

.backpack-patch.patch-2::before {
  content: '';
  position: absolute;
  top: 2px; left: 2px; right: 2px; bottom: 2px;
  border: 1px dashed #597359; /* Greenish thread stitches */
  opacity: 0.85;
}

/* Strap lines on backpack face */
.luggage-backpack-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 18%;
  width: 14px;
  height: 100%;
  background: linear-gradient(90deg, #181512, #2d241f, #181512);
  border-left: 1px dashed #614e40;
  border-right: 1px dashed #614e40;
  pointer-events: none;
  opacity: 0.55;
}

.luggage-backpack-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 18%;
  width: 14px;
  height: 100%;
  background: linear-gradient(90deg, #181512, #2d241f, #181512);
  border-left: 1px dashed #614e40;
  border-right: 1px dashed #614e40;
  pointer-events: none;
  opacity: 0.55;
}

/* Backpack Handle */
.backpack-handle {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 20px;
  border: 4px solid #544438; /* Rusted metal color */
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(90deg, #2d241e, #4a3c31, #2d241e);
  box-shadow: 
    0 -2px 6px rgba(0,0,0,0.65), 
    inset 0 1px 2px rgba(255,255,255,0.05);
  pointer-events: none;
}

/* Zipper teeth styling */
.backpack-zipper-line {
  height: 10px;
  background: repeating-linear-gradient(90deg, #664d3c 0px, #664d3c 2px, #302219 2px, #302219 5px); /* Rusty/dirty zipper teeth */
  margin: 20px 0;
  border-radius: 5px;
  position: relative;
  box-shadow: 
    inset 0 3px 5px rgba(0,0,0,0.9), 
    0 1px 2px rgba(255,255,255,0.03);
  border: 1px solid #1e1611;
}

/* Zipper slider tab */
.backpack-zipper-slider {
  position: absolute;
  top: -6px;
  left: 5%;
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, #8c5b36 0%, #4f3018 100%); /* Weathered brass/iron slider */
  border-radius: 6px;
  border: 1px solid #23160b;
  box-shadow: 0 4px 8px rgba(0,0,0,0.75);
  transform: rotate(0deg);
  transition: all 0.7s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 5;
}

.backpack-zipper-slider::after {
  content: '⚙️'; /* Rusty gear pull */
  font-size: 12px;
  color: #ccbba7;
  text-shadow: 0 1px 2px #000;
}

/* Open backpack states */
.luggage-backpack-card.open {
  border-color: #7a5e4b;
  box-shadow: 
    0 18px 40px rgba(0,0,0,0.65), 
    inset 0 0 10px rgba(0,0,0,0.5);
}

.luggage-backpack-card.open .backpack-zipper-slider {
  left: 95%;
  transform: translateX(-100%) rotate(360deg); /* zipper gear rolls when sliding open! */
  background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
  border-color: #14532d;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.65);
}

/* Smooth content transitions */
.backpack-inventory-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s ease;
}

.backpack-inventory-content.show {
  max-height: 380px;
  opacity: 1;
}

.backpack-closed-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 15px 0 5px 0;
  transition: all 0.3s ease;
}

.backpack-closed-layout.hide {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  display: none;
}

/* Bunker Details Panel in Blueprint */
.bunker-details-panel {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 95, 31, 0.2);
  border-left: 4px solid var(--orange-hazard);
  border-radius: 6px;
  padding: 18px;
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  text-align: left;
}

@media (max-width: 600px) {
  .bunker-details-panel {
    grid-template-columns: 1fr;
  }
}

.bunker-detail-col h4 {
  font-family: var(--font-title);
  color: #fff;
  font-size: 1.05rem;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bunker-detail-col p {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-color);
  margin: 4px 0;
}

.bunker-detail-col strong {
  color: var(--orange-hazard);
}

.bunker-detail-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: bold;
  border-radius: 4px;
  margin-left: 5px;
}

.bunker-detail-badge.loss {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red-hazard);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.bunker-detail-badge.per-person {
  background: rgba(57, 255, 20, 0.12);
  color: var(--accent-glow);
  border: 1px solid rgba(57, 255, 20, 0.22);
}

/* Timer controls row styling */
.timer-controls-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  margin-top: 10px;
}

/* Mobile Responsive Optimizations */
@media (max-width: 900px) {
  .board-grid {
    grid-template-columns: 1fr;
    grid-template-areas: 
      "main"
      "sidebar";
    gap: 15px;
  }
  .board-sidebar {
    grid-area: sidebar;
  }
  .board-main {
    grid-area: main;
  }
  .players-scroller {
    flex-direction: row !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    gap: 10px !important;
    padding: 5px 2px 10px 2px !important;
    max-height: none !important;
  }
  .player-list-item {
    flex: 0 0 200px !important;
    white-space: normal !important;
    padding: 10px !important;
  }
  .player-info-row {
    font-size: 0.85rem;
  }
  .player-traits-summary {
    font-size: 0.72rem;
    margin-top: 4px;
  }
  .active-effects-box {
    margin-top: 15px !important;
    padding-top: 10px !important;
  }
  .effects-list-scroller {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
}

@media (max-width: 600px) {
  .hero-title {
    font-size: 2.8rem !important;
    letter-spacing: 2px !important;
  }
  .hero-subtitle {
    font-size: 0.85rem !important;
    margin-top: 40px !important;
    margin-bottom: 30px !important;
    padding: 8px 16px !important;
  }
  .glass-panel {
    padding: 20px 15px !important;
  }
  .setup-title, .screen-title {
    font-size: 1.4rem !important;
    margin-bottom: 15px !important;
    padding-bottom: 8px !important;
  }
  .avatar-grid-select {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
  }
  .avatar-option-btn {
    font-size: 1.5rem !important;
    padding: 6px !important;
  }
  .active-card-content {
    padding: 15px !important;
  }
  .active-card-header h3 {
    font-size: 1.4rem !important;
  }
  .control-hub {
    padding: 15px !important;
    gap: 15px !important;
  }
  .timer-controls-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  .timer-controls-row .btn {
    flex: 1 1 calc(50% - 6px) !important;
    font-size: 0.75rem !important;
    padding: 8px !important;
    grid-column: auto !important; /* reset grid layout on mobile */
  }
  .timer-controls-row div[style*="width: 100%"] {
    display: none !important; /* hide separator on mobile */
  }
  .btn-large {
    padding: 12px 20px !important;
    font-size: 0.95rem !important;
  }
  .disaster-container {
    gap: 20px !important;
  }
  .danger-box, .bunker-box {
    padding: 15px !important;
  }
  .danger-box h2, .bunker-box h2 {
    font-size: 1.5rem !important;
  }
  .stat-badge-item {
    min-width: 130px !important;
    padding: 8px 12px !important;
  }
  .stat-value {
    font-size: 1.15rem !important;
  }
  .disaster-history-box {
    padding: 12px !important;
    margin-top: 15px !important;
  }
  .disaster-history-text {
    font-size: 0.85rem !important;
  }
  .speaker-status-panel {
    bottom: 10px !important;
    padding: 10px 15px !important;
    gap: 10px !important;
  }
  .speaker-status-icon {
    font-size: 1.5rem !important;
  }
  .speaker-status-title {
    font-size: 0.85rem !important;
  }
  .speaker-status-sub {
    font-size: 0.7rem !important;
  }
  .speaker-giant-timer {
    font-size: 1.6rem !important;
    padding: 3px 10px !important;
    min-width: 50px !important;
  }
}

@media (max-width: 480px) {
  .inventory-slot {
    width: 50px !important;
    height: 50px !important;
  }
  .inventory-item-image {
    font-size: 1.3rem !important;
  }
  .inventory-grid {
    gap: 8px !important;
  }
  .backpack-inventory-content.show {
    max-height: 450px !important;
  }
  .inventory-item-details {
    padding: 8px 10px !important;
    font-size: 0.75rem !important;
  }
  .lobby-invite-box {
    padding: 12px !important;
  }
  .room-code-display-value {
    font-size: 2rem !important;
  }
  .gameover-container {
    gap: 15px !important;
  }
  .gameover-details {
    padding: 15px !important;
  }
}

