:root {
  /* Premium Dark Palette */
  --bg-dark: #1a1625;
  --bg-gradient: linear-gradient(135deg, #2C2435 0%, #0f0c14 100%);

  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);

  --primary: #a29bfe;
  /* Soft Purple */
  --primary-glow: rgba(162, 155, 254, 0.4);
  --accent: #00cec9;
  /* Teal Cyan */

  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.6);

  --success: #55efc4;
  --wasted-red: #ff7675;
  --mission-gold: #ffeaa7;

  --font-main: 'Inter', sans-serif;
  --font-display: 'Russo One', sans-serif;
  --font-digital: 'Orbitron', monospace;

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 8px;
}

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

body {
  font-family: var(--font-main);
  background: url('../bg.jpg') no-repeat center center fixed;
  background-size: cover;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

#app {
  width: 100%;
  max-width: 800px;
  min-height: 100vh;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding-bottom: 4rem;
  /* Space for footer */
}

/* Utilities */
.hidden {
  display: none !important;
}

.screen {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Global Logo */
.global-logo {
  margin-bottom: 2rem;
  margin-top: 1rem;
  z-index: 50;
}

.logo-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.8;
  font-family: var(--font-display);
  text-transform: lowercase;
}

.logo-stack span {
  font-size: 3rem;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  letter-spacing: -2px;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.2);
}

.logo-stack span.highlight {
  font-size: 3.5rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 0.2rem;
  background: linear-gradient(to bottom, #fff 40%, #a29bfe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 0;
  filter: drop-shadow(0 0 15px rgba(162, 155, 254, 0.5));
}

/* Character Images */
.character-left,
.character-right {
  position: fixed;
  bottom: 0;
  max-height: 60vh;
  height: auto;
  z-index: -1;
  pointer-events: none;
}

.character-left {
  left: 20%;
}

.character-right {
  right: 20%;
}

/* Hide characters on mobile */
@media (max-width: 1024px) {

  .character-left,
  .character-right {
    display: none;
  }
}

/* Glass Card Components */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  width: 100%;
  padding: 2rem;
}

.intro-card,
.game-card,
.result-card {
  background: rgba(45, 20, 60, 0.9);
  /* Deep Purple with slight transparency */
  border: 1px solid rgba(162, 155, 254, 0.3);
}

.game-card {
  padding-bottom: 0;
}

/* Difficulty Selector */
.difficulty-selector {
  margin-bottom: 2rem;
  width: 100%;
}

.difficulty-selector .label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 0.8rem;
  text-align: center;
  font-weight: 600;
}

.toggle-container {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-md);
  position: relative;
}

.toggle-container input {
  display: none;
}

.toggle-btn {
  flex: 1;
  text-align: center;
  padding: 12px;
  cursor: pointer;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.toggle-container input:checked+.toggle-btn {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

/* Theme List */
.theme-selector-container {
  width: 100%;
}

.list-header {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.theme-list-scroll {
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 5px;
}

/* Scrollbar Styling */
.theme-list-scroll::-webkit-scrollbar {
  width: 6px;
}

.theme-list-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 3px;
}

.theme-list-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.theme-list-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.theme-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  padding: 1.2rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--primary);
  transform: translateX(5px);
}

.theme-item h3 {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
  color: #fff;
}

.theme-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Game Screen */
.game-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
  padding: 0 0.5rem;
}

.theme-info .label {
  font-size: 0.7rem;
  color: var(--primary);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
  display: block;
  margin-bottom: 0.3rem;
}

#game-theme-title {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
}

.timer {
  font-family: var(--font-digital);
  font-size: 2.2rem;
  color: var(--text-main);
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.2rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Word Grid */
.word-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  width: 100%;
  margin-bottom: 9rem;
  /* Space for fixed input */
}

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

.word-slot {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

.word-slot.filled {
  background: rgba(85, 239, 196, 0.1);
  border-color: var(--success);
  box-shadow: 0 0 15px rgba(85, 239, 196, 0.1);
}

.word-slot .num {
  font-family: var(--font-digital);
  color: var(--text-muted);
  font-size: 0.9rem;
  width: 30px;
  opacity: 0.5;
}

.word-slot .text {
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.word-slot.filled .text {
  color: var(--success);
  text-shadow: 0 0 10px rgba(85, 239, 196, 0.4);
}

/* Input Area */
.input-area {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 800px;
  padding: 1.5rem;
  padding-bottom: 6rem;
  /* Space for footer */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  z-index: 100;
}

.input-wrapper {
  width: 100%;
  max-width: 800px;
  position: relative;
}

#game-input {
  width: 100%;
  background: rgba(20, 20, 20, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  font-size: 1.2rem;
  color: #fff;
  text-align: center;
  font-family: var(--font-main);
  font-weight: 600;
  text-transform: uppercase;
  outline: none;
  transition: all 0.3s;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#game-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
  transform: translateY(-2px);
}

.btn-give-up {
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-give-up:hover {
  color: var(--wasted-red);
  background: rgba(255, 118, 117, 0.15);
  border-color: var(--wasted-red);
}

/* Result Screen */
.result-card {
  text-align: center;
  margin-top: 2rem;
}

.mission-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--mission-gold);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  -webkit-text-stroke: 2px black;
  paint-order: stroke fill;
}

.respect-score {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: #fff;
  margin-bottom: 2.5rem;
}

#score-value {
  color: var(--success);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2.5rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 1.5rem;
  border-radius: var(--radius-md);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-item .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
}

.stat-item .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.btn {
  width: 100%;
  padding: 1rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  margin-bottom: 1rem;
}

.btn-primary {
  background: var(--primary);
  color: #1a1625;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

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

/* Wasted Screen */
.wasted-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.5s;
}

.wasted-content {
  text-align: center;
}

.wasted-text {
  font-family: var(--font-display);
  font-size: 5rem;
  color: var(--wasted-red);
  text-transform: uppercase;
  letter-spacing: 5px;
  text-shadow: 0 0 30px rgba(255, 118, 117, 0.4);
  animation: slam 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  -webkit-text-stroke: 2px black;
  paint-order: stroke fill;
}

.wasted-sub {
  color: #fff;
  opacity: 0.8;
  margin-top: 1rem;
  font-size: 1.2rem;
}

.btn-outline {
  background: transparent;
  border: 2px solid #fff;
  color: #fff;
  padding: 0.8rem 2rem;
  margin-top: 2rem;
  border-radius: 50px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-outline:hover {
  background: #fff;
  color: #000;
}

/* Global Footer */
.bodog-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 10px 10px 25px 10px;
  text-align: center;
  z-index: 1000;
  /* Always on top */
  background: linear-gradient(to top, #000 0%, transparent 100%);
  pointer-events: none;
  /* Pass clicks through background */
}

.bodog-footer a {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 2px;
  pointer-events: auto;
  /* Enable clicks on link */
  transition: color 0.3s;
}

.bodog-footer a:hover {
  color: #fff;
}

@keyframes slam {
  0% {
    transform: scale(2);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 480px) {
  .logo-stack span {
    font-size: 2.5rem;
  }

  .logo-stack span.highlight {
    font-size: 3rem;
  }

  .wasted-text {
    font-size: 3.5rem;
  }

  .mission-title {
    font-size: 2rem;
  }
}