/**
 * Shikaku Puzzle Quest - Design System & Custom Styling
 * 
 * Implements high-impact visual aesthetics, modern typography, glassmorphism panels,
 * 5 distinct difficulty themes, fluid animations, and robust mobile-first layouts.
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Plus+Jakarta+Sans:wght@300;400;600;700&display=swap');

/* ==========================================
   CSS GLOBAL TOKENS & UTILITIES
   ========================================== */
:root {
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;

  /* Theme variables - will change dynamically per world */
  --primary-color: #00f3ff;
  --primary-glow: rgba(0, 243, 255, 0.4);
  --accent-color: #ff00f3;
  --bg-color: #0a0a14;
  --glass-bg: rgba(15, 15, 27, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --text-primary: #f5f6fa;
  --text-secondary: #a0a5c0;

  /* World Theme Specific Tokens */
  --w1-primary: #00ffa2;
  --w1-glow: rgba(0, 255, 162, 0.4);
  --w2-primary: #00f3ff;
  --w2-glow: rgba(0, 243, 255, 0.4);
  --w3-primary: #0099ff;
  --w3-glow: rgba(0, 153, 255, 0.4);
  --w4-primary: #ff4500;
  --w4-glow: rgba(255, 69, 0, 0.4);
  --w5-primary: #bf00ff;
  --w5-glow: rgba(191, 0, 255, 0.4);

  --cell-size: 50px;
  --grid-border: rgba(255, 255, 255, 0.12);
  --grid-bg: rgba(255, 255, 255, 0.02);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-drag: none;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* Background & Overlays */
#bg-canvas, #victory-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#victory-canvas {
  z-index: 99; /* Draw confetti on top of everything */
}

/* Glassmorphism utility */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-glow);
  border-radius: 20px;
}

/* ==========================================
   APP STAGE LAYOUTS (SPA System)
   ========================================== */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transform: scale(0.97);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.screen.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: all;
}

/* Audio Controller Badge */
.sound-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.sound-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.05);
}
.sound-toggle svg {
  fill: var(--text-primary);
  width: 22px;
  height: 22px;
}

/* ==========================================
   1. SPLASH SCREEN (Opening Screen)
   ========================================== */
#splash-screen {
  gap: 30px;
}

.title-container {
  text-align: center;
  position: relative;
}

.game-logo {
  font-family: var(--font-title);
  font-size: 3.5rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #ffffff 30%, var(--primary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 20px rgba(0, 243, 255, 0.25);
  margin-bottom: 5px;
  animation: floatTitle 4s ease-in-out infinite;
}

.game-subtitle {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 6px;
  text-transform: uppercase;
}

.menu-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 280px;
}

.btn {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), #0099ff);
  color: #030a10;
  box-shadow: 0 6px 20px var(--primary-glow);
}
.btn-primary:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 10px 25px var(--primary-glow);
  filter: brightness(1.1);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* ==========================================
   2. TUTORIAL MODAL
   ========================================== */
.tutorial-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 4, 8, 0.8);
  backdrop-filter: blur(8px);
  z-index: 150;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tutorial-panel {
  max-width: 500px;
  width: 100%;
  padding: 30px;
  text-align: left;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.tutorial-title {
  font-family: var(--font-title);
  font-size: 1.8rem;
  color: var(--primary-color);
}

.tutorial-body {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tutorial-body strong {
  color: var(--text-primary);
}

.tutorial-gif {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255,255,255,0.02);
  padding: 10px;
  display: flex;
  justify-content: center;
}

.tutorial-grid-demo {
  display: grid;
  grid-template-columns: repeat(4, 35px);
  gap: 4px;
  justify-content: center;
  background: rgba(0,0,0,0.2);
  padding: 12px;
  border-radius: 8px;
}
.demo-cell {
  width: 35px;
  height: 35px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: bold;
}
.demo-cell.filled {
  background: rgba(0, 243, 255, 0.2);
  border-color: var(--primary-color);
}

.close-tutorial {
  align-self: flex-end;
  margin-top: 10px;
}

/* ==========================================
   3. LEVEL SELECTOR SCREEN
   ========================================== */
#level-select-screen {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  justify-content: flex-start;
  overflow-y: auto;
  padding-top: 40px;
}

.header-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.page-title {
  font-family: var(--font-title);
  font-size: 2.2rem;
  background: linear-gradient(135deg, #fff 40%, var(--primary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Worlds Container */
.worlds-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding-bottom: 40px;
}

.world-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

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

.world-title {
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.world-badge {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  font-weight: bold;
}

/* World Color Palettes */
.world-1 .world-title { color: var(--w1-primary); }
.world-1 .world-badge { background: rgba(0, 255, 162, 0.15); border: 1px solid var(--w1-primary); }
.world-2 .world-title { color: var(--w2-primary); }
.world-2 .world-badge { background: rgba(0, 243, 255, 0.15); border: 1px solid var(--w2-primary); }
.world-3 .world-title { color: var(--w3-primary); }
.world-3 .world-badge { background: rgba(0, 153, 255, 0.15); border: 1px solid var(--w3-primary); }
.world-4 .world-title { color: var(--w4-primary); }
.world-4 .world-badge { background: rgba(255, 69, 0, 0.15); border: 1px solid var(--w4-primary); }
.world-5 .world-title { color: var(--w5-primary); }
.world-5 .world-badge { background: rgba(191, 0, 255, 0.15); border: 1px solid var(--w5-primary); }

.levels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 15px;
}

.level-card {
  height: 110px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.2);
}

.level-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
}

.level-card.locked {
  cursor: not-allowed;
  opacity: 0.55;
  background: rgba(255, 255, 255, 0.02);
}
.level-card.locked:hover {
  transform: none;
  border-color: var(--glass-border);
}

.level-num {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 800;
}

.level-stars {
  display: flex;
  gap: 3px;
}
.star-icon {
  width: 14px;
  height: 14px;
  fill: #8088a0;
}
.star-icon.earned {
  fill: #ffcc00;
  filter: drop-shadow(0 0 3px rgba(255, 204, 0, 0.5));
}

.lock-icon {
  width: 24px;
  height: 24px;
  fill: var(--text-secondary);
}

/* Card World Modifiers */
.world-1 .level-card:not(.locked):hover { border-color: var(--w1-primary); box-shadow: 0 4px 15px var(--w1-glow); }
.world-2 .level-card:not(.locked):hover { border-color: var(--w2-primary); box-shadow: 0 4px 15px var(--w2-glow); }
.world-3 .level-card:not(.locked):hover { border-color: var(--w3-primary); box-shadow: 0 4px 15px var(--w3-glow); }
.world-4 .level-card:not(.locked):hover { border-color: var(--w4-primary); box-shadow: 0 4px 15px var(--w4-glow); }
.world-5 .level-card:not(.locked):hover { border-color: var(--w5-primary); box-shadow: 0 4px 15px var(--w5-glow); }

/* ==========================================
   4. GAMEPLAY SCREEN
   ========================================== */
#game-screen {
  gap: 15px;
  padding: 10px;
}

.game-header {
  width: 100%;
  max-width: 500px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.game-title-panel {
  display: flex;
  flex-direction: column;
}

.active-level-name {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.active-world-name {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 800;
}

/* Game Info Bar */
.game-stats-bar {
  width: 100%;
  max-width: 500px;
  padding: 12px 20px;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.stat-lbl {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}
.stat-val {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
}

/* Gameplay Grid Board Container */
.board-outer-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 500px;
  max-height: 500px;
  aspect-ratio: 1 / 1;
  position: relative;
  touch-action: none; /* Crucial: stops touch page-scroll scrolling during drags */
}

.shikaku-board {
  position: relative;
  display: grid;
  background: var(--grid-bg);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  width: 100%;
  height: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.board-cell {
  position: relative;
  border-right: 1px solid var(--grid-border);
  border-bottom: 1px solid var(--grid-border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

/* Thick borders for subgrid isolation elements if needed, or outer boundaries */
.board-cell.edge-right { border-right-width: 1px; }
.board-cell.edge-bottom { border-bottom-width: 1px; }

.cell-val {
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: bold;
  z-index: 2;
  pointer-events: none;
}

/* User Drawn Rectangles */
.shikaku-rectangle {
  position: absolute;
  border-radius: 8px;
  border: 2.5px solid var(--rect-color, #fff);
  background: var(--rect-bg, rgba(255, 255, 255, 0.12));
  z-index: 5;
  transition: all 0.12s ease-out;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.shikaku-rectangle:hover {
  filter: brightness(1.15);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

/* Real-time active drawing overlay */
.shikaku-overlay {
  position: absolute;
  border-radius: 8px;
  border: 2.5px dashed var(--overlay-color, var(--primary-color));
  background: var(--overlay-bg, rgba(0, 243, 255, 0.1));
  z-index: 6;
  pointer-events: none;
}

/* Visual dimensions pill label inside rectangles */
.rect-label {
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-family: var(--font-title);
  font-size: 0.65rem;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 1px 5px;
  border-radius: 10px;
  border: 0.5px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
  z-index: 7;
}

/* Control Action Bar */
.game-controls {
  width: 100%;
  max-width: 500px;
  display: flex;
  gap: 10px;
}

.btn-ctrl {
  flex: 1;
  font-family: var(--font-title);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 10px 5px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.btn-ctrl svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ==========================================
   5. VICTORY OVERLAY SCREEN
   ========================================== */
.victory-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 4, 8, 0.85);
  backdrop-filter: blur(12px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.victory-panel {
  max-width: 420px;
  width: 100%;
  padding: 35px 25px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  transform: scale(0.9);
  animation: popPanel 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.25) forwards;
}

.victory-title {
  font-family: var(--font-title);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--w1-primary);
  text-shadow: 0 4px 15px rgba(0, 255, 162, 0.3);
  text-transform: uppercase;
}

.victory-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
}

.victory-stars {
  display: flex;
  gap: 15px;
  margin: 10px 0;
}
.victory-stars .star-icon {
  width: 44px;
  height: 44px;
  opacity: 0.2;
  transform: scale(0.6);
}

.victory-stars .star-icon.earned {
  opacity: 1;
  transform: scale(1);
  animation: starPopIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.4) forwards;
}
.victory-stars .star-icon.earned:nth-child(2) { animation-delay: 0.15s; }
.victory-stars .star-icon.earned:nth-child(3) { animation-delay: 0.3s; }

.victory-scores {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.score-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}
.score-row.total {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 8px;
  font-weight: bold;
  font-size: 1.1rem;
  color: var(--primary-color);
}

.leaderboard-name-input {
  width: 100%;
  padding: 10px 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  text-align: center;
}
.leaderboard-name-input:focus {
  border-color: var(--primary-color);
  outline: none;
}

.victory-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}
.victory-actions .btn {
  flex: 1;
}

.share-message-banner {
  width: 100%;
  padding: 10px 15px;
  background: rgba(0, 255, 162, 0.15);
  border: 1px solid rgba(0, 255, 162, 0.3);
  border-radius: 8px;
  color: #00ffa2;
  font-size: 0.85rem;
  text-align: center;
  margin-bottom: 12px;
  box-sizing: border-box;
  animation: popPanel 0.3s ease;
}

/* ==========================================
   6. PERSISTENT LEADERBOARD SCREEN
   ========================================== */
#leaderboard-screen {
  max-width: 500px;
  width: 100%;
  justify-content: flex-start;
  overflow-y: auto;
  padding-top: 40px;
}

.leaderboard-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 30px;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th {
  text-align: left;
  padding: 12px 10px;
  font-family: var(--font-title);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.leaderboard-table td {
  padding: 14px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.95rem;
}

.leaderboard-table tr:hover td {
  background: rgba(255,255,255,0.01);
}

.rank-cell {
  font-family: var(--font-title);
  font-weight: 800;
  width: 60px;
}
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.8rem;
}
.rank-1 .rank-badge { background: gold; color: #000; }
.rank-2 .rank-badge { background: silver; color: #000; }
.rank-3 .rank-badge { background: #cd7f32; color: #000; }

.score-cell {
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--primary-color);
}

.leaderboard-empty {
  text-align: center;
  padding: 40px 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ==========================================
   ANIMATIONS & HAPTICS (Visual Feedback)
   ========================================== */
@keyframes floatTitle {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0px); }
}

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

@keyframes starPopIn {
  0% { transform: scale(0.3); opacity: 0; }
  70% { transform: scale(1.3); }
  100% { transform: scale(1); opacity: 1; }
}

.shake {
  animation: screenShake 0.35s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes screenShake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* Responsive Scaling details */
@media (max-width: 480px) {
  .game-logo {
    font-size: 2.5rem;
  }
  .page-title {
    font-size: 1.8rem;
  }
  .cell-val {
    font-size: 1.1rem;
  }
  .board-outer-container {
    max-width: 92vw;
    max-height: 92vw;
  }
}

/* ==========================================
   7. USER AUTHENTICATION & PROFILE BADGES STYLES
   ========================================== */
.auth-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 4, 8, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease forwards;
}

.auth-panel {
  max-width: 400px;
  width: 100%;
  padding: 30px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transform: scale(0.92);
  opacity: 0;
  animation: popPanelIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.25) forwards;
}

.auth-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.8rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.auth-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.auth-tabs {
  display: flex;
  border-bottom: 2px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 10px;
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 600;
  padding: 12px 5px;
  cursor: pointer;
  position: relative;
  transition: all 0.25s ease;
  text-align: center;
}

.auth-tab:hover {
  color: #fff;
}

.auth-tab.active {
  color: var(--primary-color);
  font-weight: 700;
}

.auth-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary-color);
  box-shadow: 0 0 10px var(--primary-glow);
}

.auth-panel-title {
  font-family: var(--font-title);
  font-size: 1.4rem;
  color: #fff;
  margin-bottom: 4px;
}

.auth-panel-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 15px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
  text-align: left;
}

.input-group label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.input-group input {
  width: 100%;
  padding: 12px 15px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all 0.25s ease;
}

.input-group input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary-color);
  box-shadow: 0 0 12px var(--primary-glow);
  outline: none;
}

.auth-message-banner {
  font-size: 0.85rem;
  padding: 10px 15px;
  border-radius: 8px;
  margin-bottom: 18px;
  display: none;
  font-weight: 500;
  text-align: center;
}

.auth-message-banner.error {
  display: block;
  background: rgba(255, 69, 0, 0.15);
  border: 1px solid #ff4500;
  color: #ff8855;
  box-shadow: 0 4px 15px rgba(255, 69, 0, 0.15);
}

.auth-message-banner.success {
  display: block;
  background: rgba(0, 255, 162, 0.15);
  border: 1px solid #00ffa2;
  color: #88ffcc;
  box-shadow: 0 4px 15px rgba(0, 255, 162, 0.15);
}

.auth-submit-btn {
  width: 100%;
  padding: 14px;
}

/* User Badges in Headers */
.splash-badge-container {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 100;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-radius: 30px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-glow);
  font-size: 0.85rem;
  font-family: var(--font-title);
  height: 44px;
  transition: all 0.3s ease;
}

.user-profile-badge:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.badge-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.badge-username {
  font-weight: 700;
  color: #fff;
}

.badge-status {
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.badge-action-btn {
  background: linear-gradient(135deg, var(--primary-color), #0099ff);
  color: #030a10;
  font-family: var(--font-title);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.badge-action-btn:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.badge-action-btn.logout {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge-action-btn.logout:hover {
  background: rgba(255, 69, 0, 0.15);
  border-color: #ff4500;
  color: #fff;
  transform: scale(1.05);
}

/* Victory leaderboard section prompt styles */
.victory-leaderboard-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  margin: 5px 0;
  width: 100%;
}

.victory-leaderboard-title {
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: bold;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.victory-leaderboard-text {
  font-size: 0.85rem;
  color: var(--text-primary);
  text-align: center;
}

.victory-leaderboard-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}

.victory-leaderboard-actions .btn {
  padding: 10px 15px;
  font-size: 0.85rem;
  flex: 1;
}

/* Transitions */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popPanelIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Custom locked cards styling */
.level-card.locked .lock-icon {
  fill: var(--text-secondary);
  opacity: 0.7;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.5));
  animation: pulseLock 2s infinite ease-in-out;
}

@keyframes pulseLock {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
