:root {
  --bg: #050309;
  --bg-secondary: #090f21;
  --bg-panel: rgba(12, 16, 32, 0.88);
  --bg-panel-alt: rgba(34, 21, 53, 0.7);
  --grid-line: rgba(255, 255, 255, 0.04);
  --primary: #f4c85b;
  --primary-strong: #ffdd8a;
  --accent: #ff3e7f;
  --danger: #ff5470;
  --text: #f6f7fb;
  --text-muted: rgba(246, 247, 251, 0.7);
  --border: rgba(255, 255, 255, 0.12);
  --blur: blur(24px);
  --radius: 22px;
  --radius-sm: 14px;
  --font-display: 'Space Grotesk', 'Space Mono', sans-serif;
  --font-mono: 'Space Mono', 'Space Grotesk', sans-serif;
  --shadow-soft: 0 24px 60px rgba(0, 0, 0, 0.68);
  --transition: cubic-bezier(0.25, 0.8, 0.25, 1);
  --concept-gradient: linear-gradient(145deg, rgba(92, 29, 109, 0.92), rgba(23, 32, 70, 0.95));
}

* {
  box-sizing: border-box;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

*::-webkit-scrollbar {
  display: none;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  height: 100dvh;
  width: 100vw;
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  letter-spacing: -0.01em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

img {
  max-width: 100%;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

button,
input,
label,
textarea {
  font-family: inherit;
  color: inherit;
}

.cosmos {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.cosmos__grid,
.cosmos__glow,
.cosmos__noise {
  position: absolute;
  inset: 0;
}

.cosmos__grid {
  background: linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(0deg, var(--grid-line) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.2;
  transform: perspective(420px) rotateX(65deg);
  transform-origin: top;
  filter: blur(1px);
}

.cosmos__glow.glow-one {
  background: radial-gradient(circle at 25% 20%, rgba(255, 110, 172, 0.35), transparent 60%);
}

.cosmos__glow.glow-two {
  background: radial-gradient(circle at 75% 80%, rgba(74, 138, 255, 0.4), transparent 55%);
}

.cosmos__noise {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Crect width='1' height='1' fill='rgba(255,255,255,0.05)'/%3E%3C/svg%3E");
  opacity: 0.25;
  mix-blend-mode: screen;
}

.app-shell {
  width: 100%;
  height: 100%;
  background: rgba(5, 6, 15, 0.85);
  backdrop-filter: blur(18px);
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.command-bar {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 20px;
  background: rgba(5, 5, 12, 0.95);
  border-bottom: 1px solid var(--border);
  z-index: 10;
  padding-top: env(safe-area-inset-top, 20px);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease;
}

.command-bar.hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  position: absolute; /* Take out of flow so content moves up */
  width: 100%;
}

.command-bar__brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.6));
  transform-origin: center;
  will-change: transform;
}

.brand-logo--intro-anim {
  animation: brandLogoIntro 1.4s var(--transition) both;
}

.brand-logo--round-anim {
  animation: brandLogoRound 1.05s ease-out both;
}

@keyframes brandLogoIntro {
  0% {
    opacity: 0;
    transform: translateY(-30px) scale(0.6) rotate(-240deg);
  }
  60% {
    opacity: 1;
    transform: translateY(6px) scale(1.1) rotate(20deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

@keyframes brandLogoRound {
  0% {
    transform: scale(1) rotate(0deg);
  }
  35% {
    transform: scale(1.2) rotate(12deg);
  }
  70% {
    transform: scale(0.92) rotate(-6deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

.brand-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.command-bar__actions {
  display: flex;
  gap: 10px;
}

.chip,
.chip input {
  font-size: 11px;
}

.chip {
  border-radius: 999px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
  cursor: pointer;
  transition: all 220ms var(--transition);
}

.chip--solid {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #050102;
  border-color: transparent;
}

.chip--ghost {
  background: transparent;
}

.chip--tight {
  padding: 6px 12px;
  font-size: 10px;
}

.chip--toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
}

.chip--active,
.chip--toggle.active,
.chip[data-selected='true'] {
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
  border-color: rgba(255, 255, 255, 0.4);
}

.shell {
  flex: 1;
  width: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.shell__grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
}

.screen-stack {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
}

.screen-layer {
  width: 100%;
  height: 100%;
  position: relative;
}

.screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  padding: 20px;
  padding-bottom: env(safe-area-inset-bottom, 20px);
  display: none;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}

.screen::-webkit-scrollbar {
  display: none;
}

.screen[hidden] {
  display: none !important;
}

.screen.active {
  display: flex;
  animation: screenIn 360ms var(--transition);
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.intro-screen {
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 5vh;
  background: radial-gradient(circle at center, rgba(25, 10, 35, 0.4), rgba(8, 16, 32, 0.8));
  padding: 40px 20px;
}

.intro-screen.active {
  display: flex;
}

.intro-visual {
  position: relative;
  flex: 0 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-height: 40vh;
}

.intro-visual::after,
.intro-visual::before {
  content: '';
  position: absolute;
  inset: 5%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  animation: rotate 16s linear infinite;
  pointer-events: none;
}

.intro-visual::before {
  inset: 0%;
  animation-duration: 22s;
  border-color: rgba(255, 255, 255, 0.22);
}

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

.intro-logo {
  width: auto;
  height: auto;
  max-width: 80%;
  max-height: 100%;
  margin: 0 auto;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.6));
  transform-origin: center;
  animation: introLogoArrival 1.8s var(--transition) both;
}

@keyframes introLogoArrival {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(0.5) rotate(-200deg);
  }
  55% {
    opacity: 1;
    transform: translateY(-10px) scale(1.05) rotate(18deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

.intro-copy {
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.intro-tag {
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.intro-headline {
  font-size: clamp(24px, 6vw, 40px);
  line-height: 1.1;
  margin: 12px 0 14px;
}

.intro-description {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 18px;
  max-width: 80%;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.badge {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  font-size: 11px;
  letter-spacing: 0.14em;
}

.btn {
  width: 100%;
  padding: 18px 24px;
  border-radius: 16px;
  border: none;
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: transform 100ms var(--transition), box-shadow 100ms var(--transition), filter 100ms;
  touch-action: manipulation;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn:active::after {
  opacity: 1;
}

.btn-large {
  font-size: 18px;
  padding: 20px;
}

.btn-ignite {
  background: linear-gradient(135deg, var(--primary), var(--danger));
  color: #050101;
  box-shadow: 0 8px 24px rgba(255, 62, 127, 0.4);
  margin-top: 10px;
  margin-bottom: 10px;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text);
  backdrop-filter: blur(10px);
}

.btn:active { transform: scale(0.96); }

.main-menu-screen,
.info-screen,
.setup-screen,
.round-screen,
.round-start-screen,
.end-screen {
  background: rgba(11, 12, 26, 0.6);
}

.menu-header,
.setup-header,
.round-start-content,
.end-header {
  text-align: center;
  margin-bottom: 20px;
  flex: 0 0 auto;
}

.menu-logo {
  width: 100%;
  max-width: 280px;
  margin: 0 auto 10px;
  filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.5));
}

.menu-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 20px;
}

.menu-tab-btn {
  flex: 1;
  min-width: 110px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 700;
  cursor: pointer;
  transition: all 180ms var(--transition);
}

.menu-tab-btn.active {
  border-color: var(--primary);
  background: rgba(244, 200, 91, 0.14);
  color: var(--primary);
}

.menu-tab-content { display: none; }
.menu-tab-content.active { display: block; }

.menu-play-btn {
  margin-bottom: 12px;
}

.menu-rules-btn {
  margin-top: 6px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.06);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.info-section {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.info-section h2 {
  margin-top: 0;
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.info-screen--rules .info-grid {
  display: none;
}

.info-screen--rules .rulebook {
  margin-top: 0;
  display: block;
}

.rulebook {
  margin-top: 26px;
  padding: 22px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(11, 16, 36, 0.95), rgba(38, 16, 44, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 40px 90px rgba(2, 0, 10, 0.65);
  display: none;
}

.rulebook__header {
  text-align: center;
  max-width: 360px;
  margin: 0 auto 26px;
}

.rulebook__tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 10px;
  color: var(--text-muted);
}

.rulebook__header h2 {
  margin: 12px 0 6px;
  letter-spacing: 0.22em;
}

.rulebook__header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.rulebook__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
}

.rule-card {
  position: relative;
  padding: 18px;
  border-radius: var(--radius-sm);
  background: rgba(4, 6, 18, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.rule-card::after {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: calc(var(--radius-sm) - 6px);
  border: 1px solid rgba(255, 255, 255, 0.04);
  opacity: 0.6;
  pointer-events: none;
}

.rule-card__index {
  display: block;
  font-family: var(--font-mono);
  font-size: 32px;
  letter-spacing: 0.18em;
  color: rgba(244, 200, 91, 0.22);
}

.rule-card__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.rule-card h3 {
  margin: 10px 0;
  font-size: 18px;
}

.rule-card p {
  margin: 0;
  font-size: 14px;
  color: rgba(246, 247, 251, 0.85);
  line-height: 1.5;
}

.difficulty-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.diff-item {
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: var(--text-muted);
}

.diff-item strong {
  color: var(--primary);
  letter-spacing: 0.12em;
  margin-right: 6px;
}

.setup-section {
  margin-bottom: 20px;
  flex: 0 0 auto;
}

.setup-label {
  display: block;
  text-align: center;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-size: 10px;
  color: var(--text-muted);
}

.player-counter {
  display: flex;
  justify-content: center;
  gap: 20px;
  align-items: center;
  padding: 18px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.player-counter button {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  font-size: 32px;
  font-weight: 700;
  color: #050101;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.1s;
}

.player-counter button:active {
  transform: scale(0.9);
}

.player-count-display {
  font-size: 48px;
  font-weight: 700;
  min-width: 60px;
  text-align: center;
}

.player-names-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  padding-bottom: 10px;
}

.player-name-input {
  display: flex;
  gap: 10px;
  align-items: center;
}

.player-name-input input {
  flex: 1;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  font-size: 16px;
}

.difficulty-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.difficulty-options label {
  flex: 1;
  min-width: 120px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}

.difficulty-options label:active {
  background: rgba(255, 255, 255, 0.1);
}

.difficulty-options input {
  accent-color: var(--primary);
  width: 20px;
  height: 20px;
}

.round-info,
.instruction {
  border-radius: var(--radius-sm);
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.round-screen {
  display: flex;
  flex-direction: column;
  gap: 18px;
  justify-content: center;
}

.round-info {
  margin: 0;
  text-align: center;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
}

.instruction {
  font-size: 14px;
  line-height: 1.6;
  margin: 10px;
  text-align: center;
}

.player-name {
  font-size: 32px;
  text-align: center;
  margin: 10px 0;
  font-weight: 700;
}

.concept-box {
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  background: var(--concept-gradient);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 28px 60px rgba(5, 0, 18, 0.68);
  transition: transform 180ms var(--transition), box-shadow 200ms var(--transition);
  margin: 20px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.concept-box--crew,
.concept-box--imposter {
  background: var(--concept-gradient);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 28px 60px rgba(5, 0, 18, 0.68);
}

.concept-label {
  text-transform: uppercase;
  letter-spacing: 0.42em;
  font-size: 12px;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.75);
}

.concept-text {
  font-size: clamp(32px, 8vw, 50px);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.concept-text .concept-word {
  display: block;
  font-size: clamp(34px, 9vw, 54px);
}

.concept-text .imposter-tag {
  display: block;
  font-size: 16px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 10px;
}

.imposter-hints {
  display: block;
  margin-top: 24px;
  font-size: clamp(16px, 5vw, 22px);
  line-height: 1.35;
  font-weight: 600;
}

.concept-hidden {
  color: rgba(255, 255, 255, 0.3);
}

.round-screen .next-btn {
  margin-top: auto;
}

.round-start-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  margin-top: 0;
  transform-origin: center;
  flex: 1;
  align-items: center;
}

.round-start-logo-img {
  width: 100%;
  max-width: 240px;
  filter: drop-shadow(0 16px 40px rgba(0, 0, 0, 0.45));
  transform-origin: center;
  will-change: transform;
}

.round-start-logo-img--pulse {
  animation: roundStartLogoPulse 1.2s ease-out both;
}

.round-start-logo--tension {
  animation: roundStartLogoTension 8s ease-in-out infinite 1.3s;
}

.round-start-title,
.round-start-subtitle,
.round-start-timer {
  transition: opacity 220ms ease, transform 220ms ease;
}

.round-start-content--final .round-start-title,
.round-start-content--final .round-start-subtitle,
.round-start-content--final .round-start-timer {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

.round-start-logo-img--final {
  animation:
    roundStartLogoFinale 1.2s ease-out forwards,
    roundStartLogoOrbit 26s linear infinite 1.2s;
}

@keyframes roundStartLogoPulse {
  0% {
    transform: scale(0.85) rotate(-12deg);
    opacity: 0;
  }
  40% {
    transform: scale(1.15) rotate(8deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes roundStartLogoFinale {
  0% {
    transform: scale(1) rotate(0deg);
  }
  35% {
    transform: scale(1.35) rotate(150deg);
  }
  70% {
    transform: scale(1.5) rotate(320deg);
  }
  100% {
    transform: scale(1.6) rotate(360deg);
  }
}

@keyframes roundStartLogoOrbit {
  0% {
    transform: scale(1.6) rotate(0deg);
  }
  100% {
    transform: scale(1.6) rotate(360deg);
  }
}

@keyframes roundStartLogoTension {
  0% {
    transform: translateY(0) scale(1);
  }
  18% {
    transform: translateY(-6px) scale(1.05);
  }
  36% {
    transform: translateY(4px) scale(0.97);
  }
  60% {
    transform: translateY(-3px) scale(1.02);
  }
  82% {
    transform: translateY(2px) scale(0.99);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

.round-start-timer {
  font-size: 60px;
  margin: 18px 0 8px;
  font-family: var(--font-mono);
}

.game-summary {
  border-radius: var(--radius);
  padding: 22px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hud {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hud__panel {
  background: var(--bg-panel);
  border-radius: var(--radius);
  padding: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.hud__panel strong {
  letter-spacing: 0.22em;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.leaderboard-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.leaderboard-body {
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px;
  flex: 1;
  overflow-y: auto;
  min-height: 100px;
}

.leaderboard-body ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.leaderboard-body li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 14px;
}

.leaderboard-body li:last-child { border-bottom: none; }

.leaderboard-rank {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  width: 36px;
}

.leaderboard-placeholder {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.requirements {
  border-radius: var(--radius-sm);
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  font-size: 12px;
  color: var(--text-muted);
}

.solo-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.solo-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.field input {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  padding: 14px 16px;
  font-size: 16px;
}

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

.chip-group--full { width: 100%; }

.chip-toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip-toggle-input:checked + label {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.4);
}

.solo-container {
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  padding: 14px;
  text-align: center;
  min-height: 140px;
}

.solo-container--active {
  border-style: solid;
  background: rgba(255, 255, 255, 0.02);
}

.solo-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

.solo-meta span {
  display: block;
  font-size: 9px;
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.5);
}

.solo-meta div > div {
  margin-top: 4px;
  font-size: 18px;
  letter-spacing: 0.08em;
  color: var(--text);
}

.grid {
  display: grid;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.grid .cell {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 160ms var(--transition), box-shadow 160ms var(--transition);
}

.grid .cell:active {
  transform: scale(0.94);
}

.mobile-dock {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 14px 18px 20px;
  background: rgba(5, 5, 12, 0.92);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

.dock-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 200ms var(--transition);
}

.dock-btn--active {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.5);
}

.dock-icon {
  font-size: 18px;
}

@media (min-width: 640px) {
  .command-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .command-bar__actions {
    justify-content: flex-end;
  }

  .shell {
    padding: 24px 30px 120px;
  }

  .panel-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* --- App-Like Enhancements --- */

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(5, 5, 12, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 16px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bottom-nav.nav-hidden {
    transform: translateY(100%);
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 8px 20px;
    border-radius: 16px;
    font-family: var(--font-display);
}

.nav-item svg {
    width: 24px;
    height: 24px;
    stroke-width: 2px;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active svg {
    stroke: var(--primary);
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(244, 200, 91, 0.4));
    transform: translateY(-2px);
}

.nav-item:active {
    transform: scale(0.92);
}

/* Adjust Shell Padding for Bottom Nav */
.shell {
    padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
}

/* Ripple Effect */
.btn {
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: var(--radius);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Scanner Effect */
.concept-box {
    position: relative;
    overflow: hidden;
}

.scanner-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px var(--primary);
    opacity: 0;
    pointer-events: none;
    z-index: 10;
}

.concept-box.charging .scanner-line {
    opacity: 1;
    animation: scan 1.5s ease-in-out infinite;
}

@keyframes scan {
    0% { top: 0%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* Confetti */
.confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary);
    animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
    0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* Glitch Effect for Imposter Reveal */
.imposter-reveal {
    font-size: 24px;
    font-weight: 700;
    color: var(--danger);
    position: relative;
    display: inline-block;
}

.imposter-reveal::before,
.imposter-reveal::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-panel);
}

.imposter-reveal::before {
    left: 2px;
    text-shadow: -1px 0 #00ffff;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.imposter-reveal::after {
    left: -2px;
    text-shadow: -1px 0 #ff00ff;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(30px, 9999px, 10px, 0); }
    5% { clip: rect(80px, 9999px, 90px, 0); }
    10% { clip: rect(10px, 9999px, 40px, 0); }
    15% { clip: rect(50px, 9999px, 20px, 0); }
    20% { clip: rect(20px, 9999px, 60px, 0); }
    100% { clip: rect(70px, 9999px, 30px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(10px, 9999px, 80px, 0); }
    5% { clip: rect(60px, 9999px, 10px, 0); }
    10% { clip: rect(40px, 9999px, 50px, 0); }
    15% { clip: rect(90px, 9999px, 20px, 0); }
    20% { clip: rect(10px, 9999px, 30px, 0); }
    100% { clip: rect(50px, 9999px, 60px, 0); }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 3, 9, 0.8);
    backdrop-filter: blur(10px);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


.btn:active {
    transform: scale(0.96);
}

.btn-ignite {
    background: linear-gradient(135deg, var(--primary) 0%, #ffb347 100%);
    box-shadow: 0 8px 20px rgba(244, 200, 91, 0.25);
    border: none;
    color: #050309;
}

.btn-ignite:hover {
    box-shadow: 0 12px 28px rgba(244, 200, 91, 0.4);
    transform: translateY(-2px);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Enhanced Inputs */
input[type="text"], 
input[type="number"] {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px;
    font-size: 16px;
    transition: all 0.2s ease;
    color: var(--text);
    width: 100%;
}

input:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(244, 200, 91, 0.1);
    outline: none;
}

/* Screen Transitions */
.screen.active {
    animation: slideUpFade 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Card/Panel Polish */
.screen-layer > div {
    /* Ensure content fits nicely */
    max-width: 100%;
}

.intro-visual {
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.4));
}

/* Toast Notification */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    width: 90%;
    max-width: 350px;
}

.toast {
    background: rgba(20, 20, 30, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text);
    padding: 14px 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    pointer-events: auto;
}

.toast.toast--error {
    border-left: 4px solid var(--danger);
}

.toast.toast--success {
    border-left: 4px solid var(--primary);
}

.toast.toast--info {
    border-left: 4px solid var(--accent);
}

.toast.hiding {
    animation: toastOut 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
    to { opacity: 0; transform: translateY(-10px) scale(0.95); }
}

/* Concept Box Charging Effect */
.concept-box {
    position: relative;
    overflow: hidden;
}

.concept-box::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: var(--primary);
    width: 0%;
    transition: width 0.1s linear;
    opacity: 0.8;
}

.concept-box.charging::before {
    width: 100%;
    transition: width 1.5s linear; /* Adjust duration to match hold time */
}

/* Enhanced Typography & Spacing */
h1, h2, h3 {
    letter-spacing: -0.02em;
}

.intro-headline {
    background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

/* Card Gradient Borders */
.screen-layer .screen > div {
    position: relative;
}

/* Subtle pulse for the cosmos */
.cosmos__glow {
    animation: cosmosPulse 8s ease-in-out infinite alternate;
}

@keyframes cosmosPulse {
    0% { opacity: 0.5; transform: scale(1); }
    100% { opacity: 0.8; transform: scale(1.1); }
}

@media (min-width: 1100px) {
  .app-shell {
    width: 100%;
    max-width: 420px;
    height: min(880px, 90vh);
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
  }
}

/* Intro Overlay */
#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: opacity 0.8s ease;
}

#intro-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    transition: opacity 0.5s ease;
}

#intro-logo-container {
    position: absolute;
    z-index: 2;
    opacity: 0;
    transform: scale(8.5); /* Start slightly zoomed in */
    transition: opacity 0.5s ease, transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

#intro-logo {
    width: 50%;
    max-width: 300px;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(244, 200, 91, 0.3));
}

/* Animation States */
.intro-video-fade {
    opacity: 0 !important;
}

.intro-logo-visible {
    opacity: 1 !important;
    transform: scale(1) !important; /* Zoom to normal */
}

.intro-zoom-out {
    transform: scale(0.1) !important; /* Zoom out to nothing */
    opacity: 0 !important;
}

.intro-hidden {
    opacity: 0;
    pointer-events: none;
}

