/* ============================================
   KOSZYK MEDIOWY – Design System & Styles
   ============================================ */

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

/* --- CSS Variables --- */
:root {
  --teal: #00A5A8;
  --teal-light: #00C9CD;
  --teal-dark: #008587;
  --magenta: #E8006F;
  --magenta-light: #FF2D8A;
  --magenta-dark: #B80058;
  --gray-icon: #777777;
  --bg: #F4F6F8;
  --bg-dark: #0D0D1A;
  --text: #2D2D2D;
  --text-light: #FFFFFF;
  --text-muted: #8A8A9A;
  --glass-bg: rgba(10, 15, 40, 0.45);
  --glass-border: rgba(255, 255, 255, 0.25);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  --shadow-glow-teal: 0 0 40px rgba(0, 165, 168, 0.3);
  --shadow-glow-magenta: 0 0 40px rgba(232, 0, 111, 0.3);
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  height: -webkit-fill-available;
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: 'Outfit', sans-serif;
  background: var(--bg-dark);
  color: var(--text-light);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

/* --- App container (9:16 pillarbox on desktop) --- */
#app {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
  height: -webkit-fill-available;
  overflow: hidden;
}

/* --- Screen Container --- */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  z-index: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  z-index: 10;
}

/* --- Background Image --- */
.bg-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('assets/bg.jpg') center center / cover no-repeat;
  z-index: 0;
}

/* --- Glass Card --- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ============================================
   SCREEN 1: REGISTRATION
   ============================================ */
#screen-register {
  gap: 20px;
}

.register-logo {
  margin-bottom: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logo-img {
  height: 64px;
  width: auto;
  display: block;
}

.register-title {
  position: relative;
  font-size: 35px;
  font-weight: 800;
  color: #f2f1f6;
  -webkit-text-stroke: 6px #f2f1f6;
  text-align: center;
  margin-bottom: 8px;
}

.register-title::after {
  content: "Koszyk Mediowy";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  text-align: center;
  background: linear-gradient(135deg, var(--teal-light), var(--magenta-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  -webkit-text-stroke: 0px;
  pointer-events: none;
}

.btn-ranking-home {
  position: absolute;
  bottom: max(24px, env(safe-area-inset-bottom));
  right: max(24px, env(safe-area-inset-right));
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  color: #FFFFFF;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 16px;
  transition: var(--transition);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  z-index: 2;
}

.btn-ranking-home:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--teal-light);
}

.register-subtitle {
  font-size: 21px;
  color: #009096;
  text-align: center;
  line-height: 1.5;
  margin-bottom: 8px;
  width: 100%;
  max-width: 400px;
  font-weight: 800;
  background: #f2f1f6;
  border-radius: 14px;
  padding: 10px 20px;
  box-sizing: border-box;
}

.form-group {
  width: 100%;
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 14px 18px;
  background: rgba(0, 0, 20, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  color: var(--text-light);
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  outline: none;
  transition: var(--transition);
}

.form-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 165, 168, 0.15);
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Checkbox */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 8px;
}

.checkbox-custom {
  position: relative;
  width: 22px;
  height: 22px;
  min-width: 22px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkbox-custom.checked {
  background: linear-gradient(135deg, var(--teal), var(--teal-light));
  border-color: var(--teal);
}

.checkbox-custom.checked::after {
  content: '✓';
  color: white;
  font-size: 14px;
  font-weight: 700;
}

.checkbox-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.5;
  cursor: pointer;
}

.checkbox-label a {
  color: var(--teal-light);
  text-decoration: none;
}

/* Error message */
.error-msg {
  color: var(--magenta-light);
  font-size: 12px;
  margin-top: 4px;
  min-height: 18px;
  transition: var(--transition);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 40px;
  border: none;
  border-radius: 50px;
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--teal), var(--teal-light));
  color: white;
  box-shadow: 0 4px 20px rgba(0, 165, 168, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(0, 165, 168, 0.5);
}

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

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-magenta {
  background: linear-gradient(135deg, var(--magenta), var(--magenta-light));
  color: white;
  box-shadow: 0 4px 20px rgba(232, 0, 111, 0.4);
}

.btn-magenta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(232, 0, 111, 0.5);
}

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

.btn-outline {
  background: rgba(10, 15, 40, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: var(--text-light);
}

.btn-outline:hover {
  border-color: var(--teal);
  color: var(--teal-light);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  padding: 10px 20px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.btn-ghost:hover {
  color: var(--magenta-light);
}

/* ============================================
   SCREEN 2: INTRO
   ============================================ */
#screen-intro {
  gap: 16px;
  text-align: center;
}

.intro-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  animation: fadeInDown 0.6s ease;
}

.intro-logo-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.intro-title {
  position: relative;
  font-size: 35px;
  font-weight: 800;
  color: #f2f1f6;
  -webkit-text-stroke: 6px #f2f1f6;
  text-align: center;
  margin-bottom: 8px;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.intro-title::after {
  content: "Koszyk\A Mediowy";
  white-space: pre;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  text-align: center;
  background: linear-gradient(135deg, var(--teal-light), var(--magenta-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  -webkit-text-stroke: 0px;
  pointer-events: none;
}

.intro-tagline {
  font-size: 21px;
  color: #009096;
  text-align: center;
  line-height: 1.5;
  margin-bottom: 8px;
  width: 100%;
  max-width: 400px;
  font-weight: 800;
  background: #f2f1f6;
  border-radius: 14px;
  padding: 10px 20px;
  box-sizing: border-box;
  animation: fadeInUp 0.6s ease 0.4s both;
}

.intro-instructions {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  max-width: 380px;
  text-align: left;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: fadeInUp 0.6s ease 0.6s both;
}

.intro-instructions p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.7;
  margin-bottom: 12px;
}

.intro-instructions p:last-child {
  margin-bottom: 0;
}

.icon-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 8px 0;
}

.icon-legend-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.icon-legend-item .icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.icon-circle.teal { background: var(--teal); }
.icon-circle.magenta { background: var(--magenta); }
.icon-circle.gray { background: var(--gray-icon); }

.icon-hex {
  width: 30px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: white;
  /* 4-point diamond (Sims style) */
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.icon-hex.teal { 
  background: var(--teal); 
  filter: drop-shadow(0 0 10px rgba(0, 165, 168, 0.6));
}
.icon-hex.magenta { 
  background: var(--magenta); 
  filter: drop-shadow(0 0 10px rgba(255, 45, 138, 0.6));
}
.icon-hex.gray { 
  background: var(--gray-icon); 
  filter: drop-shadow(0 0 10px rgba(119, 119, 119, 0.6));
}

.icon-legend-item span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
}

.intro-cta {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-light);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  animation: fadeInUp 0.6s ease 0.8s both;
}

.intro-btn {
  animation: fadeInUp 0.6s ease 1s both;
}

/* ============================================
   SCREEN 3: COUNTDOWN
   ============================================ */
#screen-countdown {
  z-index: 20;
}

.countdown-number {
  font-size: 120px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--teal-light), var(--magenta-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: countPop 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-shadow: none;
  filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.4));
}

.countdown-text {
  font-size: 60px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 8px;
  background: linear-gradient(135deg, var(--teal-light), var(--magenta-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes countPop {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ============================================
   SCREEN 4: GAME
   ============================================ */
#screen-game {
  padding: 0;
  justify-content: flex-start;
}

.game-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  z-index: 15;
  background: linear-gradient(to bottom, rgba(10, 10, 30, 0.85) 0%, transparent 100%);
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.hud-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.75);
}

.hud-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-light);
}

.hud-value.score {
  color: #FFFFFF;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.hud-value.timer {
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
}

.hud-value.timer.warning {
  color: var(--magenta-light);
  animation: timerBlink 0.5s ease infinite alternate;
}

@keyframes timerBlink {
  0% { opacity: 1; }
  100% { opacity: 0.5; }
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Score popup animation */
.score-popup {
  position: absolute;
  font-size: 20px;
  font-weight: 800;
  pointer-events: none;
  animation: scoreFloat 0.8s ease-out forwards;
  z-index: 20;
}

.score-popup.positive {
  color: var(--teal-light);
}

.score-popup.negative {
  color: var(--magenta-light);
}

@keyframes scoreFloat {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-60px) scale(1.3); opacity: 0; }
}

/* ============================================
   SCREEN 5: RESULTS
   ============================================ */
#screen-results {
  gap: 14px;
  text-align: center;
  padding-top: 40px;
  padding-bottom: 40px;
  justify-content: center;
  background: rgba(10, 15, 40, 0.35);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
}

.result-emoji {
  font-size: 52px;
  animation: bounceIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.result-title {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #FFFFFF, #E8006F);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
  animation: fadeInUp 0.5s ease 0.3s both;
}

.result-score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  animation: fadeInUp 0.5s ease 0.5s both;
}

.result-score-number {
  font-size: 48px;
  font-weight: 900;
  background: linear-gradient(135deg, #FFFFFF, #E8006F);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.result-score-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.8);
}

.result-message {
  font-size: 15px;
  color: #FFFFFF;
  line-height: 1.7;
  max-width: 340px;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  animation: fadeInUp 0.5s ease 0.7s both;
}

.result-stats {
  display: flex;
  gap: 20px;
  animation: fadeInUp 0.5s ease 0.9s both;
}

.result-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}

.result-stat .stat-icon {
  font-size: 20px;
}

.result-stat .stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-light);
}

.result-stat .stat-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.75);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.result-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 300px;
  animation: fadeInUp 0.5s ease 1.1s both;
}

/* ============================================
   SCREEN 6: LEADERBOARD
   ============================================ */
#screen-leaderboard {
  padding: 20px;
  padding-top: max(20px, env(safe-area-inset-top));
  justify-content: flex-start;
  gap: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(10, 15, 40, 0.35);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
}

.leaderboard-header {
  text-align: center;
  width: 100%;
  position: relative;
}

.lb-back-btn {
  position: absolute;
  left: 0;
  top: 4px;
  z-index: 1;
  background: none;
  border: none;
  color: #FFFFFF;
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  transition: var(--transition);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.lb-back-btn:hover {
  color: var(--teal-light);
}

.leaderboard-title {
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--teal-light), var(--magenta-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.5));
  margin-bottom: 4px;
}

.leaderboard-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.leaderboard-stats-bar {
  display: flex;
  justify-content: center;
  gap: 24px;
  width: 100%;
  background: rgba(10, 15, 40, 0.35);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  padding: 12px 16px;
}

.lb-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.lb-stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-light);
}

.lb-stat-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.7);
}

.leaderboard-list-container {
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  padding: 12px !important;
  -webkit-overflow-scrolling: touch;
}

.lb-empty {
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  padding: 40px 20px;
  font-size: 14px;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  transition: var(--transition);
  position: relative;
}

.lb-row:not(:last-child) {
  margin-bottom: 4px;
}

.lb-row.highlight {
  background: rgba(0, 165, 168, 0.2);
  border: 1px solid rgba(0, 165, 168, 0.35);
}

.lb-row:not(.highlight) {
  border: 1px solid transparent;
}

.lb-rank {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  background: rgba(10, 15, 40, 0.35);
  color: rgba(255, 255, 255, 0.7);
}

.lb-rank.gold {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #1a1a2e;
}

.lb-rank.silver {
  background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
  color: #1a1a2e;
}

.lb-rank.bronze {
  background: linear-gradient(135deg, #CD7F32, #A0522D);
  color: #1a1a2e;
}

.lb-info {
  flex: 1;
  min-width: 0;
}

.lb-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-email {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-score {
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--teal-light), var(--magenta-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.lb-date {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

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

@keyframes bounceIn {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.shake {
  animation: shakeX 0.4s ease;
}

/* ============================================
   PARTICLES (decorative)
   ============================================ */
.particle {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.15;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-15px) rotate(120deg); }
  66% { transform: translateY(10px) rotate(240deg); }
}

/* ============================================
   DESKTOP PILLARBOX – 9:16
   pointer:fine = mouse device (PC / Mac)
   ============================================ */
@media (pointer: fine) and (min-width: 600px) {
  html, body {
    background: #000;
    display: flex;
    justify-content: center;
    align-items: stretch;
  }

  #app {
    width: calc(100dvh * 9 / 16);
    height: 100dvh;
    flex-shrink: 0;
  }

  /* particles also contained inside #app */
  .particle {
    position: absolute;
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-height: 600px) {
  .intro-title { font-size: 35px; }
  .intro-instructions { padding: 14px; }
  .intro-instructions p { font-size: 13px; }
  .glass-card { padding: 20px 16px; }
  .countdown-number { font-size: 80px; }
}

@media (max-width: 360px) {
  .screen { padding: 16px; }
  .register-title { font-size: 29px; }
  .intro-title { font-size: 33px; }
  .result-score-number { font-size: 44px; }
}

.hud-multiplier {
  color: var(--magenta-light);
  font-size: 18px;
  font-weight: 800;
  margin-left: 8px;
  animation: pulse 0.5s infinite;
}

/* ============================================
   ADMIN PANEL
   ============================================ */
.admin-title {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--teal-light), var(--magenta-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.admin-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.admin-header {
  text-align: center;
  width: 100%;
  position: relative;
}

.admin-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 420px;
  margin-bottom: 12px;
}

.admin-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: var(--transition);
}

.admin-entry:not(:last-child) {
  margin-bottom: 4px;
}

.admin-entry:hover {
  background: rgba(255, 255, 255, 0.04);
}

.admin-entry-info {
  flex: 1;
  min-width: 0;
}

.admin-entry-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-entry-email {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-entry-date {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
}

.admin-entry-score {
  font-size: 16px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--teal-light), var(--magenta-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.admin-delete-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  border: 1px solid rgba(232, 0, 111, 0.3);
  background: rgba(232, 0, 111, 0.1);
  color: var(--magenta-light);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.admin-delete-btn:hover {
  background: rgba(232, 0, 111, 0.3);
  border-color: var(--magenta-light);
}

#screen-admin {
  padding: 20px;
  padding-top: max(20px, env(safe-area-inset-top));
  justify-content: flex-start;
  gap: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
