:root {
  --bg-gradient: linear-gradient(135deg, #1a1c2c 0%, #4a192c 50%, #1a1c2c 100%);
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);
  --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --text-primary: #ffffff;
  --text-accent: #ffd700;
  --primary-btn: #f0c345;
  --primary-btn-text: #1a1c2c;
  --secondary-btn: #ffffff;
  --secondary-btn-text: #1a1c2c;
  --tile-bg: rgba(255, 255, 255, 0.9);
  --tile-text: #1a1c2c;
  --tile-hover: #ffffff;
  --font-main: "Outfit", sans-serif;
}

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

body {
  font-family: var(--font-main);
  background: var(--bg-gradient);
  background-size: 200% 200%;
  animation: gradientBG 15s ease infinite;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.app-container {
  width: 100%;
  max-width: 400px; /* Mobile focused max width */
  height: 100vh;
  max-height: 800px;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Increased padding */
  padding: 30px 25px 50px; 
  position: relative;
}

/* Screens */
.screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0; left: 0;
    transition: opacity 0.5s ease;
    opacity: 1;
    z-index: 1;
    padding: 1rem;
}

.screen.hidden {
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}

/* Loading Screen */
#screen-loading {
    z-index: 100;
    background: var(--bg-gradient);
    background-size: 200% 200%;
    animation: gradientBG 15s ease infinite;
}

.loading-bar-container {
    width: 200px;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    margin-top: 20px;
    overflow: hidden;
}

.loading-bar {
    width: 0%;
    height: 100%;
    background: var(--text-accent);
    box-shadow: 0 0 10px var(--text-accent);
    transition: width 0.2s linear;
}

.loading-text {
    margin-top: 10px;
    font-size: 0.8rem;
    opacity: 0.6;
    letter-spacing: 2px;
}

/* Home Screen */
#screen-home {
    z-index: 50;
    justify-content: center;
    gap: 40px;
}

.logo-text {
    font-weight: 800;
    font-size: 2.5rem;
    line-height: 0.9;
    letter-spacing: -1px;
    text-transform: uppercase;
    text-shadow: 0 4px 12px rgba(0,0,0,0.5);
    text-align: center;
}

.logo-text.large {
    font-size: 4rem;
    margin-bottom: 20px;
}

.logo-text .highlight {
    color: var(--text-accent);
}

.home-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    width: 100%;
    max-width: 250px;
}

.pulse {
    animation: btnPulse 2s infinite;
}

@keyframes btnPulse {
    0% { transform: scale(1); box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(240, 195, 69, 0.4); }
    100% { transform: scale(1); box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
}

.version-text {
    margin-top: 25px;
    font-size: 0.6rem;
    opacity: 0.4;
    letter-spacing: 2px;
    font-weight: 500;
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.anim-float {
    animation: float 3s ease-in-out infinite;
}

.anim-slide-up {
    animation: fadeSlideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.anim-slide-down {
    animation: slideDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.anim-pop-in {
    animation: popInBoard 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Header */
.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 20px;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.game-title {
    font-weight: 800;
    font-size: 1.8rem; /* Smaller to fit between icons */
    line-height: 0.9;
    letter-spacing: -1px;
    text-transform: uppercase;
    text-shadow: 0 4px 12px rgba(0,0,0,0.5);
    text-align: center;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(5px);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.icon-btn:active {
    transform: scale(0.95);
}

.hidden {
    display: none !important;
}

/* Side Menu */
.side-menu {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 200;
    visibility: visible;
    transition: visibility 0.3s;
}

.side-menu.hidden {
    visibility: hidden;
    pointer-events: none;
}

.menu-backdrop {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(3px);
    opacity: 1;
    transition: opacity 0.3s;
}

.side-menu.hidden .menu-backdrop {
    opacity: 0;
}

.menu-content {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2a2c3c 0%, #1a1c2c 100%);
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2;
}

.side-menu.hidden .menu-content {
    transform: translateY(-100%);
}

.close-btn {
    position: absolute;
    top: 30px;
    right: 30px;
    background: rgba(255,255,255,0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

.menu-content h2 {
    font-size: 3rem;
    margin-bottom: 60px;
    color: var(--text-accent);
    letter-spacing: 2px;
}

.menu-content nav {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
    max-width: 300px;
}

.menu-content .btn {
    font-size: 1.2rem;
    padding: 20px;
    max-width: none;
}

.game-title .highlight {
  color: var(--text-accent);
}

/* Stats */
.stats-dashboard {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 10px 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-soft);
  gap: 30px;
  flex-shrink: 0;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.8;
  letter-spacing: 1px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-accent);
}

.stat-divider {
  width: 1px;
  height: 30px;
  background: var(--glass-border);
}

/* Controls */
.controls-area {
  display: flex;
  gap: 20px;
  margin-bottom: 0px; /* Increased separation */
  width: 100%;
  justify-content: center;
  flex-shrink: 0;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-family: var(--font-main);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.1s, filter 0.2s;
  flex: 1;
  max-width: 140px;
}

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

.btn.primary {
  background: var(--primary-btn);
  color: var(--primary-btn-text);
}

.btn.secondary {
  background: var(--secondary-btn);
  color: var(--secondary-btn-text);
}

/* Game Screen Control Button Colors */
#btn-pause-text {
  background: #ffd700; /* Yellow/Gold for PAUSE */
  color: #1a1c2c;
}

#btn-pause-text.paused {
  background: #048734; /* Green for RESUME */
  color: #ffffff;
}

#btn-pause-text:hover {
  filter: brightness(1.1);
}


/* Board */
.game-board-container {
  flex-grow: 1;
  display: flex;
  align-items: center; /* Anchor to bottom */
  justify-content: center;
  width: 100%;
  margin-bottom: 10px;
}

.game-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
  aspect-ratio: 1 / 1; /* Keep it square */
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  padding: 10px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
  touch-action: manipulation; /* Fast Click on Mobile */
}

.tile {
  /* Premium Glass Jewel Effect */
  background: linear-gradient(135deg, 
      hsla(var(--tile-hue, 210), 90%, 65%, 0.8) 0%, 
      hsla(var(--tile-hue, 210), 80%, 40%, 0.85) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 
      inset 0 1px 0 rgba(255, 255, 255, 0.6), /* Top Highlight */
      inset 0 -1px 0 rgba(0, 0, 0, 0.2),      /* Bottom Shadow */
      0 4px 10px rgba(0, 0, 0, 0.3);          /* Drop Shadow */
  
  border-radius: 12px;
  color: #ffffff;
  /* Premium 3D Text Shadow */
  text-shadow: 
      0 2px 0 rgba(0, 0, 0, 0.2), 
      0 4px 5px rgba(0, 0, 0, 0.4),
      0 0 10px rgba(255, 255, 255, 0.3); /* Subtle glow */
  
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2em;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.2s;
  backdrop-filter: blur(4px);
  position: relative;
  overflow: hidden;
}

.tile:hover {
  filter: brightness(1.2);
  transform: translateY(-2px);
}

.tile.empty::after {
  display: none;
}

.tile::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 45%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.05));
  border-bottom-left-radius: 40% 20%;
  border-bottom-right-radius: 40% 20%;
  pointer-events: none;
  z-index: 1;
}

.tile:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

.tile.highlight {
  background: #ffd700;
  color: #1a1c2c;
  box-shadow: 0 0 15px #ffd700;
  transform: scale(0.95);
  transition: all 0.1s;
}

.tile.empty {
  background: transparent;
  box-shadow: none;
  cursor: default;
  pointer-events: none;
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 1;
  transition: opacity 0.3s;
  padding: 0 !important;
}

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

.overlay-content {
  background: linear-gradient(135deg, rgba(42, 44, 60, 0.9), rgba(26, 28, 44, 0.95));
  backdrop-filter: blur(20px);
  padding: 40px;
  border-radius: 24px;
  border: 1px solid var(--glass-border);
  text-align: center;
  color: var(--text-primary);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  width: 100%;
  max-width: 380px;
}

@keyframes popIn {
  0% {
    transform: scale(0.8) translateY(20px);
    opacity: 0;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.overlay-content h2 {
  font-size: 2.5rem; /* Slightly smaller for better fit */
  color: var(--text-accent);
  margin-bottom: 30px;
  text-transform: uppercase;
  text-shadow: 0 4px 10px rgba(0,0,0,0.5);
  line-height: 1.1;
}

.overlay-content p {
  font-size: 1.2rem;
  margin-bottom: 10px;
  font-weight: 600;
}

/* Game Over Screen */
.overlay-like {
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    z-index: 90;
}

.gameover-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-top: 20px;
}

/* Confetti */
.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: #ffd700;
  animation: fall linear forwards;
  z-index: 150;
}

@keyframes fall {
  to { transform: translateY(100vh) rotate(720deg); }
}

.btn.large {
  margin-top: 5px;
  width: 100%;
  max-width: none;
  font-size: 1.2rem;
}
/* Confetti Blast Animation */
.confetti {
    position: fixed;
    width: 12px;
    height: 12px;
    z-index: 9999;
    pointer-events: none;
    border-radius: 50%; /* Circle particles */
    animation: blast 3s cubic-bezier(0, 0, 0.2, 1) forwards; /* Slowed to 3s with ease-out */
}

@keyframes blast {
    0% { 
        transform: translate(0, 0) scale(1); 
        opacity: 1; 
    }
    100% { 
        transform: translate(var(--tx), var(--ty)) scale(0); 
        opacity: 0; 
    }
}

/* Sound Settings Modal */
#screen-sound-settings {
    z-index: 300; /* Above Side Menu (200) */
}

.settings-modal {
    max-width: 500px;
    width: 95%; /* Use more screen width on mobile */
    padding: 30px; /* Reduced padding to give content more room */
    text-align: left;
}


.settings-modal h2 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 2rem; /* Reduced from 2.5rem */
}

.settings-modal h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 20px 0 15px 0; /* Added top margin for separation */
    text-transform: uppercase;
    letter-spacing: 1px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5px; /* Increased vertical padding */
    font-size: 1.1rem;
    font-weight: 600;
}

.divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 10px 0;
}

.profiles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px; /* Tighter gap to help fit 3 */
    margin-bottom: 25px;
    max-height: 280px;
    overflow-y: auto;
    padding: 10px 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.profile-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary);
    padding: 10px 2px; /* Very compact */
    border-radius: 8px;
    font-size: 0.75rem; /* Small font as requested */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: capitalize;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; 
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.switch input { 
    opacity: 0; 
    width: 0; 
    height: 0; 
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #4a4c5e; /* Darker inactive state */
  transition: .3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .slider {
  background-color: #f0c345; /* Bright Gold */
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Active Profile Button Highlighting */
.profile-btn.active {
    background: #f0c345 !important;
    color: #1a1c2c !important; /* Dark text */
    border-color: #f0c345 !important;
    font-weight: 800;
    box-shadow: 0 0 15px rgba(240, 195, 69, 0.5);
    transform: scale(1.05);
}

/* Disabled State for Settings */
.settings-disabled {
    opacity: 0.3;
    pointer-events: none;
    filter: grayscale(100%);
    transition: all 0.3s ease;
}

/* Home Screen Buttons */
.home-buttons-row {
    display: flex;
    flex-direction: column; /* Stacked VERTICALLY */
    gap: 12px;
    width: 100%;
    margin-top: 10px; /* More space from Play button */
    align-items: center; 
    animation: fadeSlideUp 1s ease-out 0.2s forwards;
    opacity: 0; /* Start hidden for anim */
}

.home-buttons-row .btn {
    width: 280px;
    font-size: 0.85rem;
    padding: 12px;
    letter-spacing: 1px;
}

/* Secondary Button Style (White Pill) */
.btn.secondary {
    background: #ffffff;
    color: #1a1c2c; /* Dark text */
    border: none;
    font-weight: 700;
    text-transform: uppercase;
    max-width: 240px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.btn.secondary:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

.btn.secondary:active {
    transform: translateY(0);
}

/* Rules List Styling (Missing) */
.rules-list {
    margin: 20px 0 30px 0;
    text-align: left;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    background: rgba(255,255,255,0.05);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
}

.rule-icon {
    font-size: 2rem;
}

.rules-list {
    margin: 20px 0 30px 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    transition: all 0.3s ease;
}

.rule-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(5px);
    border-color: rgba(255, 215, 0, 0.2);
}

.rule-step {
    position: absolute;
    top: -8px;
    left: 12px;
    background: #ffd700;
    color: #1a1c2c;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.rule-icon-bg {
    background: rgba(255, 215, 0, 0.1);
    color: #ffd700;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.1);
}

.rule-item p {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    flex: 1;
    letter-spacing: 0.2px;
}



.rule-item p strong {
    color: #ffd700;
    font-weight: 700;
}

/* Side Menu Button Overrides (Match Home Screen) */
.side-menu .btn {
    width: 280px; 
    max-width: none;
    padding: 16px;
    font-size: 0.85rem;
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.side-menu nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    width: 100%;
}

.side-menu h2 {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 40px;
    text-transform: uppercase;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.menu-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.side-menu .btn.primary {
    background: var(--primary-btn, #ffd700);
    color: var(--primary-btn-text, #000);
}

.side-menu .btn.secondary {
    background: #ffffff;
    color: #1a1c2c;
}

/* Watch & Solve Popup Styling */
.small-modal {
    max-width: 340px !important;
    padding: 30px 20px !important;
    background: #252131 !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px !important; /* Start rounded */
}

.small-modal h2 {
    color: #FFD700 !important; /* YELLOW */
    text-transform: uppercase;
    font-weight: 800;
    font-size: 1.8rem;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.modal-text {
    color: #e0e0e0;
    font-size: 1rem;
    margin-bottom: 25px;
    line-height: 1.5;
    font-weight: 600;
}

.modal-buttons-row {
    display: flex;
    gap: 15px;
    justify-content: center;
    width: 100%;
}

.modal-buttons-row .btn {
    flex: 1;
    font-size: 0.9rem;
    padding: 14px 10px;
    border-radius: 12px;
    text-transform: none; /* Reset */
}

.btn.primary-green {
    background: #409c85; /* Teal */
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 0 #2d7a66;
    font-weight: 700;
    text-transform: none; /* "Yes, Play" */
}

#btn-watch-cancel {
    background: #ffffff;
    color: #000000;
    font-weight: 800;
    text-transform: uppercase; /* CANCEL */
    box-shadow: 0 4px 0 #cccccc;
}

/* Custom Game Over Styling for "Puzzle Solved" */
#screen-gameover .overlay-content {
    background: #252131;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    max-width: 340px;
    padding: 30px;
}
#screen-gameover h2 {
    color: #FFD700;
    font-size: 2.2rem;
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 20px;
    text-shadow: 0 4px 0 rgba(0,0,0,0.5);
}
#screen-gameover p {
     color: #fff;
     font-weight: 600;
     font-size: 1rem;
     margin: 5px 0;
}
#screen-gameover .gameover-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 25px;
    width: 100%;
}
#screen-gameover .btn {
    width: 100%;
    border-radius: 12px;
    padding: 15px;
    font-size: 1rem;
    font-weight: 800;
}
/* Replay Level specific override */
#screen-gameover #btn-play-again {
    background: #FFD700;
    color: #000;
    box-shadow: 0 4px 0 #b29600;
    border: none;
}
/* Home specific override */
#screen-gameover #btn-gameover-home {
    background: #fff;
    color: #000;
    box-shadow: 0 4px 0 #cccccc;
    max-width: none; 
    border: none;
}
