/**
 * ArenaWar Imposter Word Guess - Main Stylesheet
 * High-end Dark Gaming Theme (Navy, Black, Deep Purple, Electric Blue)
 */

:root {
  --bg-primary: #070913;
  --bg-secondary: #0D1122;
  --bg-surface: #141A30;
  --bg-surface-elevated: #1B2342;
  --bg-surface-translucent: rgba(20, 26, 48, 0.75);

  --accent-blue: #00E5FF;
  --accent-blue-glow: rgba(0, 229, 255, 0.35);
  --accent-purple: #8B5CF6;
  --accent-purple-glow: rgba(139, 92, 246, 0.35);
  --accent-civilian: #10B981;
  --accent-civilian-glow: rgba(16, 185, 129, 0.35);
  --accent-imposter: #FF2E55;
  --accent-imposter-glow: rgba(255, 46, 85, 0.45);
  --accent-gold: #F59E0B;

  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(0, 229, 255, 0.4);

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI", Roboto, sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-glow-blue: 0 0 24px var(--accent-blue-glow);
  --shadow-glow-red: 0 0 30px var(--accent-imposter-glow);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  user-select: none;
}

/* Background Atmosphere Gradients */
.arena-bg-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.arena-bg-glow::before {
  content: "";
  position: absolute;
  top: -20%;
  left: 10%;
  width: 50vw;
  height: 50vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, transparent 70%);
  filter: blur(80px);
}

.arena-bg-glow::after {
  content: "";
  position: absolute;
  bottom: -20%;
  right: 5%;
  width: 55vw;
  height: 55vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.1) 0%, transparent 70%);
  filter: blur(80px);
}

/* App Container */
#app-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 16px;
}

/* Navigation / Header Bar */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-surface-translucent);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.brand-logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  color: #fff;
  box-shadow: 0 0 12px var(--accent-blue-glow);
}

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

.brand-eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-blue);
  font-weight: 800;
}

.brand-game-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

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

.btn-icon {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 17px;
}

.btn-icon:hover {
  border-color: var(--border-active);
  transform: translateY(-1px);
  box-shadow: 0 0 10px var(--accent-blue-glow);
}

.btn-icon-back {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-icon-back:hover {
  border-color: var(--border-active);
  color: var(--accent-blue);
  box-shadow: 0 0 10px var(--accent-blue-glow);
  transform: translateY(-1px);
}

.player-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-elevated);
  padding: 4px 10px 4px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
}

.player-mini-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.player-mini-name {
  font-size: 12px;
  font-weight: 600;
  max-width: 90px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-mini-lvl {
  font-size: 10px;
  background: var(--accent-purple);
  color: #fff;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

/* View Container */
.game-view {
  display: none;
  flex: 1;
  flex-direction: column;
}

.game-view.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

/* BUTTONS */
.btn-primary {
  background: linear-gradient(135deg, #00C6FF, #0072FF);
  color: #FFFFFF;
  border: none;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0, 114, 255, 0.35);
  transition: var(--transition-normal);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 198, 255, 0.5);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-normal);
}

.btn-secondary:hover {
  border-color: var(--border-active);
  background: rgba(255, 255, 255, 0.05);
}

.btn-danger {
  background: linear-gradient(135deg, #FF2E55, #E11D48);
  color: #fff;
  border: none;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 4px 16px var(--accent-imposter-glow);
  transition: var(--transition-normal);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 46, 85, 0.6);
}

.btn-large {
  padding: 18px 28px;
  font-size: 17px;
  border-radius: var(--radius-md);
}

/* MAIN MENU VIEW */
.menu-hero {
  text-align: center;
  padding: 30px 10px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent-purple);
  margin-bottom: 16px;
}

.menu-title-glow {
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin-bottom: 12px;
  background: linear-gradient(180deg, #FFFFFF 20%, #94A3B8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.menu-title-highlight {
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.menu-tagline {
  color: var(--text-secondary);
  font-size: 15px;
  max-width: 440px;
  margin-bottom: 30px;
  line-height: 1.5;
}

.menu-actions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto 30px;
}

.menu-card-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  text-align: left;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.menu-card-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.08), transparent);
  opacity: 0;
  transition: var(--transition-fast);
}

.menu-card-btn:hover {
  transform: translateY(-2px);
  border-color: var(--border-active);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 16px var(--accent-blue-glow);
}

.menu-card-btn:hover::before {
  opacity: 1;
}

.menu-card-icon {
  font-size: 28px;
  width: 50px;
  height: 50px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}

.menu-card-content {
  flex: 1;
}

.menu-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menu-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

.menu-card-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(0, 229, 255, 0.15);
  color: var(--accent-blue);
  font-weight: 700;
  text-transform: uppercase;
}

/* Secondary Nav Bar on Main Menu */
.menu-footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 10px;
}

.footer-link-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.footer-link-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}

/* LOBBY / ROOM SETUP VIEW */
.lobby-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.lobby-header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.room-code-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.room-code-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 700;
}

.room-code-val {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--accent-blue);
  background: var(--bg-surface-elevated);
  padding: 4px 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--accent-blue);
}

.lobby-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.lobby-card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Player Grid in Lobby */
.player-roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.player-roster-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: var(--transition-normal);
}

.player-roster-card.is-host {
  border-color: rgba(245, 158, 11, 0.4);
}

.player-roster-card .avatar-circle {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 8px;
  position: relative;
}

.player-roster-card.is-host .avatar-circle {
  border-color: var(--accent-gold);
}

.host-crown-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  font-size: 14px;
}

.player-card-name {
  font-size: 13px;
  font-weight: 700;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.player-card-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.player-card-status.ready {
  color: var(--accent-civilian);
}

.player-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: rgba(255, 46, 85, 0.2);
  color: var(--accent-imposter);
  border: none;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.player-remove-btn:hover {
  background: var(--accent-imposter);
  color: #fff;
}

.add-player-slot {
  background: rgba(255, 255, 255, 0.02);
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition-fast);
  min-height: 120px;
}

.add-player-slot:hover {
  border-color: var(--border-active);
  color: var(--accent-blue);
  background: rgba(0, 229, 255, 0.05);
}

.add-player-icon {
  font-size: 24px;
  margin-bottom: 6px;
}

/* SETTINGS CONTROLS */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.setting-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setting-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

.setting-val-badge {
  color: var(--accent-blue);
  font-weight: 800;
}

.setting-input,
.setting-select {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: var(--transition-fast);
}

.setting-input:focus,
.setting-select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 10px var(--accent-blue-glow);
}

.setting-range {
  accent-color: var(--accent-blue);
  cursor: pointer;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-surface-elevated);
}

/* ROLE REVEAL FULLSCREEN VIEW */
.role-reveal-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  padding: 20px;
  text-align: center;
}

.reveal-privacy-shield {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 40px 30px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-card);
  animation: slideUp 0.3s ease;
}

.pass-device-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  font-size: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  border: 3px solid var(--accent-purple);
  box-shadow: 0 0 20px var(--accent-purple-glow);
}

.pass-device-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
}

.pass-device-player-name {
  color: var(--accent-blue);
}

.pass-device-hint {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* Interactive Role Flip Card */
.role-card-wrapper {
  perspective: 1000px;
  width: 100%;
  max-width: 400px;
  min-height: 380px;
  margin-bottom: 24px;
}

.role-card-inner {
  width: 100%;
  height: 100%;
  min-height: 380px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.role-card-wrapper.flipped .role-card-inner {
  transform: rotateY(180deg);
}

.role-card-front,
.role-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 24px;
  border: 1px solid var(--border-subtle);
}

.role-card-front {
  background: linear-gradient(135deg, #18203B, #0E1428);
  cursor: pointer;
}

.card-peek-icon {
  font-size: 54px;
  margin-bottom: 16px;
  animation: pulseGentle 2s infinite ease-in-out;
}

.card-front-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.card-front-tap-prompt {
  font-size: 13px;
  color: var(--accent-blue);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* SECRET WORD CARD & ROLE REVEAL STYLES */
.secret-card,
#secretWordCard,
.role-card {
  position: relative;
  z-index: 10;
  display: block;
  visibility: visible;
  opacity: 1;
  width: 100%;
  max-width: 420px;
  min-height: 320px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  box-sizing: border-box;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

/* CIVILIAN CARD */
.secret-card.civilian,
#secretWordCard.civilian,
.role-card.civilian,
.role-card-back.civilian {
  background: #0D1326;
  background: radial-gradient(circle at 50% 15%, #16243C 0%, #090E1A 85%);
  border: 2px solid rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 35px rgba(16, 185, 129, 0.3), 0 10px 30px rgba(0, 0, 0, 0.5);
}

.secret-card.civilian .role-badge,
#secretWordCard.civilian .role-badge,
.role-card.civilian .role-badge,
.role-card-back.civilian .role-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #10B981;
  border: 1px solid #10B981;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.secret-card.civilian p,
#secretWordCard.civilian p {
  color: #94A3B8;
  font-size: 14px;
  margin: 8px 0;
  line-height: 1.5;
}

.role-card.civilian h2,
.role-card-back.civilian h2,
.role-card-title {
  color: #F8FAFC;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}

/* Civilian Secret Word Styling */
.secret-card.civilian h1.secret-word,
.secret-card.civilian .secret-word,
#secretWordCard.civilian h1.secret-word,
#secretWordCard.civilian .secret-word,
.role-card.civilian .secret-word,
.role-card-back.civilian .secret-word {
  color: #FFFFFF !important;
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 18px 0;
  padding: 16px 20px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-md);
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
  word-break: break-word;
}

.role-card.civilian .secret-word .secret-word-text {
  font-size: 32px;
  font-weight: 900;
  color: #FFFFFF;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
}

.role-card.civilian .secret-word .secret-word-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #10B981;
  margin-bottom: 6px;
  font-weight: 700;
}

/* IMPOSTER CARD */
.secret-card.imposter,
#secretWordCard.imposter,
.role-card.imposter,
.role-card-back.imposter {
  background: #150912;
  background: radial-gradient(circle at 50% 15%, #2B0D1B 0%, #0E0710 85%);
  border: 2px solid rgba(255, 59, 85, 0.65);
  box-shadow: 0 0 40px rgba(255, 59, 85, 0.38), 0 10px 30px rgba(0, 0, 0, 0.5);
}

.secret-card.imposter .role-badge,
#secretWordCard.imposter .role-badge,
.role-card.imposter .role-badge,
.role-card-back.imposter .role-badge {
  background: rgba(255, 59, 85, 0.2);
  color: #FF3B55;
  border: 1px solid #FF3B55;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
  animation: imposterAlert 1.2s infinite ease-in-out;
}

.secret-card.imposter p,
#secretWordCard.imposter p {
  color: #FFA3B3;
  font-size: 14px;
  margin: 8px 0;
  line-height: 1.5;
}

.role-card.imposter h2,
.role-card-back.imposter h2,
.role-card.imposter .role-card-title,
.role-card-back.imposter .role-card-title {
  color: #FFA3B3;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}

/* Imposter Secret Word Styling: bright red (#ff3b55), bold and clearly visible */
.secret-card.imposter h1.secret-word,
.secret-card.imposter .secret-word,
#secretWordCard.imposter h1.secret-word,
#secretWordCard.imposter .secret-word,
.role-card.imposter .secret-word,
.role-card-back.imposter .secret-word {
  color: #FF3B55 !important;
  font-size: 52px;
  font-weight: 900;
  letter-spacing: 8px;
  text-transform: uppercase;
  margin: 18px 0;
  padding: 16px 20px;
  background: rgba(255, 59, 85, 0.12);
  border: 1px solid rgba(255, 59, 85, 0.5);
  border-radius: var(--radius-md);
  text-shadow: 0 0 25px rgba(255, 59, 85, 0.8);
  box-shadow: inset 0 0 20px rgba(255, 59, 85, 0.15);
  line-height: 1;
}

.role-card.imposter .secret-word .secret-word-text {
  font-size: 44px;
  font-weight: 900;
  color: #FF3B55;
  letter-spacing: 6px;
  text-shadow: 0 0 22px rgba(255, 59, 85, 0.7);
  line-height: 1.1;
}

.role-card.imposter .secret-word .secret-word-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #FF8095;
  margin-bottom: 6px;
  font-weight: 700;
}

/* HIDDEN CARD SCREEN STATE */
.secret-card.hidden-state,
#secretWordCard.hidden-state,
.secret-card.hidden-card,
#secretWordCard.hidden-card {
  background: #0B0E17 !important;
  background: radial-gradient(circle at 50% 15%, #182033 0%, #080B12 85%) !important;
  border: 2px dashed rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

.hidden-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 16px;
}

.role-badge.civilian {
  background: rgba(16, 185, 129, 0.2);
  color: #10B981;
  border: 1px solid #10B981;
}

.role-badge.imposter {
  background: rgba(255, 59, 85, 0.2);
  color: #FF3B55;
  border: 1px solid #FF3B55;
}

.secret-word.imposter-word,
.imposter-word {
  color: #FF3B55 !important;
  text-shadow: 0 0 25px rgba(255, 59, 85, 0.8) !important;
}

.reveal-card-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  position: relative;
  z-index: 5;
}

.secret-word-category {
  font-size: 12px;
  color: var(--accent-blue);
  margin-top: 8px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.role-instruction-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

/* HINT ROUND VIEW */
.hint-round-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.phase-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
}

.phase-pill {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  gap: 8px;
}

.phase-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--accent-blue);
  box-shadow: 0 0 8px var(--accent-blue);
  animation: pulseDot 1.5s infinite;
}

/* Timer Ring Component */
.timer-widget {
  display: flex;
  align-items: center;
  gap: 10px;
}

.timer-circle-wrap {
  position: relative;
  width: 44px;
  height: 44px;
}

.timer-circle-wrap svg {
  transform: rotate(-90deg);
}

.timer-circle-bg {
  stroke: rgba(255, 255, 255, 0.1);
}

.timer-circle-progress {
  stroke: var(--accent-blue);
  transition: stroke-dashoffset 0.2s linear, stroke 0.3s ease;
}

.timer-circle-progress.warning {
  stroke: var(--accent-imposter);
}

.timer-number-display {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
}

/* Active Turn Spotlight */
.active-turn-spotlight {
  background: linear-gradient(135deg, var(--bg-surface-elevated), var(--bg-surface));
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-glow-blue);
  position: relative;
  overflow: hidden;
}

.active-turn-avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  font-size: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  border: 3px solid var(--accent-blue);
  box-shadow: 0 0 20px var(--accent-blue-glow);
  animation: pulseAvatar 2s infinite ease-in-out;
}

.active-turn-player-name {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}

.active-turn-instruction {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.hint-input-form {
  display: flex;
  width: 100%;
  max-width: 420px;
  gap: 8px;
}

.hint-input {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  transition: var(--transition-fast);
}

.hint-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 12px var(--accent-blue-glow);
}

/* Hint History Feed */
.hint-feed-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.hint-feed-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hint-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.hint-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-surface-elevated);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  animation: slideInLeft 0.25s ease;
}

.hint-item-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.hint-item-content {
  flex: 1;
}

.hint-item-author {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 2px;
}

.hint-item-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.hint-item-text.skipped {
  color: var(--text-muted);
  font-style: italic;
}

/* DISCUSSION PHASE VIEW */
.discussion-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.chat-box-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  height: 320px;
}

.chat-messages-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 6px;
  margin-bottom: 12px;
}

.chat-bubble {
  background: var(--bg-surface-elevated);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  border: 1px solid var(--border-subtle);
  max-width: 85%;
  align-self: flex-start;
}

.chat-bubble.mine {
  background: rgba(0, 229, 255, 0.15);
  border-color: rgba(0, 229, 255, 0.3);
  align-self: flex-end;
}

.chat-sender {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-purple);
  margin-bottom: 2px;
}

.chat-input-row {
  display: flex;
  gap: 8px;
}

/* VOTING PHASE VIEW */
.voting-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.voting-prompt-banner {
  text-align: center;
  padding: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.voting-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}

.voting-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.voting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.vote-candidate-card {
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-normal);
  position: relative;
}

.vote-candidate-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-purple);
  box-shadow: 0 4px 18px var(--accent-purple-glow);
}

.vote-candidate-card.selected {
  border-color: var(--accent-imposter);
  background: rgba(255, 46, 85, 0.08);
  box-shadow: 0 0 20px var(--accent-imposter-glow);
}

.vote-candidate-card.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.candidate-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  border: 2px solid var(--border-subtle);
}

.candidate-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.candidate-hint-quote {
  font-size: 11px;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 6px;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voting-progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 10px;
}

.voting-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-blue));
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* ELIMINATION & DRAMATIC SPOTLIGHT VIEW */
.elimination-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 20px;
}

.elimination-spotlight-card {
  background: var(--bg-surface);
  border: 2px solid var(--accent-imposter);
  border-radius: var(--radius-lg);
  padding: 40px 30px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 0 40px var(--accent-imposter-glow);
  animation: dramaticZoom 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.eliminated-avatar {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  font-size: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  border: 3px solid var(--accent-imposter);
}

.eliminated-title {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 6px;
}

.eliminated-role-tag {
  display: inline-block;
  padding: 6px 18px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.eliminated-role-tag.imposter {
  background: rgba(255, 46, 85, 0.2);
  color: var(--accent-imposter);
  border: 1px solid var(--accent-imposter);
}

.eliminated-role-tag.civilian {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-civilian);
  border: 1px solid var(--accent-civilian);
}

/* FINAL WORD GUESS VIEW */
.final-guess-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 65vh;
  padding: 20px;
  text-align: center;
}

.final-guess-card {
  background: linear-gradient(135deg, #1C0F1A, #121828);
  border: 2px solid var(--accent-imposter);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 0 35px var(--accent-imposter-glow);
}

.final-guess-title {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 8px;
  color: #FFA3B3;
}

.final-guess-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* RESULTS & GAME OVER VIEW */
.results-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 30px;
}

.results-hero-card {
  text-align: center;
  padding: 36px 20px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}

.results-hero-card.civilians-win {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 35px var(--accent-civilian-glow);
}

.results-hero-card.imposters-win {
  border-color: rgba(255, 46, 85, 0.5);
  box-shadow: 0 0 35px var(--accent-imposter-glow);
}

.results-trophy-icon {
  font-size: 52px;
  margin-bottom: 12px;
}

.results-winner-team {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.results-winner-team.civilians {
  color: var(--accent-civilian);
}

.results-winner-team.imposters {
  color: var(--accent-imposter);
}

.results-reason {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 20px;
}

.results-secret-reveal-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: inline-block;
  margin-bottom: 10px;
}

.results-scoreboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.score-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}

.score-player-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.score-player-role-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.score-player-role-badge.imposter {
  background: rgba(255, 46, 85, 0.2);
  color: var(--accent-imposter);
}

.score-player-role-badge.civilian {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-civilian);
}

.score-xp-val {
  font-size: 18px;
  font-weight: 900;
  color: var(--accent-gold);
}

.score-breakdown-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.xp-chip {
  font-size: 10px;
  background: var(--bg-surface-elevated);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
}

.results-actions-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 10px;
}

/* MODALS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 15, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-card);
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.25s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

.avatar-selector-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.avatar-opt-btn {
  background: var(--bg-surface-elevated);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 26px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.avatar-opt-btn.selected {
  border-color: var(--accent-blue);
  box-shadow: 0 0 12px var(--accent-blue-glow);
}

/* Toast Alerts */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-card);
  animation: slideInRight 0.3s ease;
  pointer-events: auto;
}

.toast.toast-error {
  border-color: var(--accent-imposter);
  background: #1C0C12;
}

.toast.toast-success {
  border-color: var(--accent-civilian);
  background: #091812;
}

