/* ============================================================
   DON'T BLINK — Premium cyberpunk UI
   ============================================================ */

:root {
  --pink: #ff2d95;
  --cyan: #00f5ff;
  --purple: #b026ff;
  --green: #39ff14;
  --red: #ff1744;
  --bg: #06060f;
  --glass: rgba(10, 10, 28, 0.72);
  --glass-border: rgba(255, 255, 255, 0.09);
  --radius: 1.25rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  min-height: 100dvh;
  background: var(--bg);
  color: #e8e8f0;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: var(--cyan);
  color: #000;
  font-weight: 700;
  border-radius: 0.5rem;
  transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.hidden { display: none !important; }

/* ---- Background layers ---- */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(176, 38, 255, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(0, 245, 255, 0.12), transparent 50%),
    radial-gradient(ellipse 50% 30% at 50% 50%, rgba(255, 45, 149, 0.06), transparent 60%),
    var(--bg);
}

.scanlines {
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  opacity: 0.4;
  mix-blend-mode: overlay;
}

/* ---- App shell ---- */
.app-shell {
  position: relative;
  z-index: 10;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.7s var(--ease);
}
.app-shell.ready { opacity: 1; }

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: max(0.75rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) 0 max(1rem, env(safe-area-inset-left));
}

.glass-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.nav-brand { display: flex; align-items: center; gap: 0.6rem; }

.brand-icon {
  font-size: 1.25rem;
  color: var(--cyan);
  filter: drop-shadow(0 0 8px var(--cyan));
  animation: pulse-glow 2s ease-in-out infinite;
}

.brand-text {
  font-size: clamp(0.95rem, 3vw, 1.15rem);
  font-weight: 900;
  letter-spacing: 0.06em;
}

.text-gradient-pink {
  background: linear-gradient(90deg, var(--pink), #ff6eb4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-cyan {
  background: linear-gradient(90deg, var(--cyan), #7af8ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-actions { display: flex; gap: 0.5rem; }

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 0.75rem;
  color: #ccc;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.icon-btn:hover {
  color: var(--cyan);
  border-color: rgba(0, 245, 255, 0.4);
  box-shadow: 0 0 20px rgba(0, 245, 255, 0.25);
  transform: translateY(-2px);
}
.icon-btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.icon-svg { width: 1.15rem; height: 1.15rem; }

.lang-badge {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* ---- Live HUD ---- */
.game-hud {
  position: fixed;
  top: 4.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1.25rem;
  background: var(--glass);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 245, 255, 0.25);
  border-radius: 999px;
  box-shadow: 0 0 30px rgba(0, 245, 255, 0.15), 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: hud-slide-in 0.5s var(--ease);
}

@keyframes hud-slide-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.hud-timer-block { text-align: center; }
.hud-label {
  display: block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.45);
}
.hud-timer {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 900;
  color: var(--cyan);
  text-shadow: 0 0 20px rgba(0, 245, 255, 0.6);
  font-variant-numeric: tabular-nums;
  min-width: 5ch;
}

.hud-rank {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--pink);
  padding: 0.25rem 0.65rem;
  background: rgba(255, 45, 149, 0.12);
  border: 1px solid rgba(255, 45, 149, 0.3);
  border-radius: 999px;
  white-space: nowrap;
}

.hud-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--green);
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse-dot 1.2s ease infinite;
}

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

/* ---- Main content ---- */
.main-content {
  flex: 1;
  width: 100%;
  max-width: 32rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}

.screen { animation: fade-up 0.5s var(--ease); }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Glass cards ---- */
.glass-card {
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
}

/* ---- Start screen ---- */
.hero-card {
  padding: clamp(1.5rem, 5vw, 2.5rem);
  text-align: center;
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,45,149,0.5), transparent 40%, rgba(0,245,255,0.5));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  color: var(--cyan);
  margin-bottom: 0.75rem;
}

.hero-title {
  font-size: clamp(1.75rem, 6vw, 2.75rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 0.75rem;
  text-shadow: 0 0 40px rgba(0, 245, 255, 0.2);
}

.hero-desc {
  color: rgba(255, 255, 255, 0.65);
  font-size: 1.05rem;
  max-width: 22rem;
  margin: 0 auto 1.5rem;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  margin-bottom: 1.5rem;
  background: rgba(57, 255, 20, 0.08);
  border: 1px solid rgba(57, 255, 20, 0.25);
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--green);
}
.score-pill strong { font-size: 1.15rem; color: #fff; }
.score-pill-icon { color: var(--green); }

.fine-print {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
}

/* ---- Buttons ---- */
.btn-primary,
.btn-secondary {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 0.85rem;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  width: 100%;
  position: relative;
  overflow: hidden;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 50%, #6b21ff 100%);
  box-shadow: 0 4px 24px rgba(255, 45, 149, 0.45), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.2) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.6s;
}
.btn-primary:hover::after { transform: translateX(100%); }
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 40px rgba(255, 45, 149, 0.55);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-secondary {
  color: var(--cyan);
  background: rgba(0, 245, 255, 0.08);
  border: 1px solid rgba(0, 245, 255, 0.35);
  margin-bottom: 0.75rem;
}
.btn-secondary:hover {
  background: rgba(0, 245, 255, 0.15);
  box-shadow: 0 0 24px rgba(0, 245, 255, 0.2);
}

/* ---- Leaderboard ---- */
.leaderboard-card { padding: 1.25rem 1.5rem; }

.lb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.lb-title {
  font-size: 1rem;
  color: var(--cyan);
  letter-spacing: 0.05em;
}
.lb-badge {
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  background: rgba(176, 38, 255, 0.2);
  border-radius: 0.35rem;
  color: var(--purple);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.lb-list { list-style: none; }
.lb-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
  border-radius: 0.65rem;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  transition: background 0.2s;
}
.lb-list li:hover { background: rgba(255, 255, 255, 0.04); }
.lb-list li.lb-you {
  background: rgba(57, 255, 20, 0.08);
  border: 1px solid rgba(57, 255, 20, 0.2);
}
.lb-rank {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  color: var(--cyan);
  width: 2rem;
}
.lb-score {
  font-family: 'Orbitron', sans-serif;
  color: var(--green);
  font-weight: 700;
}
.lb-empty {
  text-align: center;
  color: rgba(255,255,255,0.35);
  padding: 1rem;
  font-size: 0.9rem;
}

/* ---- Circular webcam ---- */
.cam-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.cam-ring {
  position: relative;
  width: min(85vw, 320px);
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, var(--pink), var(--cyan), var(--purple), var(--pink));
  background-size: 300% 300%;
  animation: ring-rotate 4s linear infinite;
  box-shadow: 0 0 60px rgba(255, 45, 149, 0.25), 0 0 80px rgba(0, 245, 255, 0.15);
  transition: box-shadow 0.4s ease;
}

/* Face detected — green glow confirms AI sees you */
.cam-ring.face-ok {
  box-shadow: 0 0 50px rgba(57, 255, 20, 0.45), 0 0 80px rgba(0, 245, 255, 0.2);
}

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

.cam-ring-glow {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,245,255,0.15) 0%, transparent 70%);
  animation: pulse-glow 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}

.cam-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: #000;
}

.cam-video,
.cam-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mirror { transform: scaleX(-1); }

.cam-vignette {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.countdown-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 10;
}
.countdown-layer.hidden { display: none; }

.countdown-num {
  font-size: clamp(4rem, 20vw, 6rem);
  font-weight: 900;
  color: var(--cyan);
  text-shadow: 0 0 40px var(--cyan);
  animation: count-pop 0.55s var(--ease);
}

@keyframes count-pop {
  0% { transform: scale(0.2); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.no-face-warn {
  position: absolute;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.35rem 0.75rem;
  font-size: 0.7rem;
  background: rgba(255, 23, 68, 0.85);
  border-radius: 999px;
  white-space: nowrap;
  z-index: 5;
  animation: pulse-warn 1s ease infinite;
}

@keyframes pulse-warn {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.side-stats {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.stat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.4rem 0.85rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 0.65rem;
  min-width: 4rem;
}
.stat-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.4);
}
.stat-value { font-size: 0.95rem; color: var(--green); }

.ear-value-live.ear-live {
  color: var(--cyan);
  animation: ear-pulse 0.8s ease infinite;
}
.ear-value-live.ear-blink {
  color: var(--red);
  animation: none;
}
@keyframes ear-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.game-warning {
  text-align: center;
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  color: var(--pink);
  margin-top: 0.5rem;
  animation: warn-pulse 1.5s ease infinite;
  text-shadow: 0 0 20px rgba(255, 45, 149, 0.5);
}

@keyframes warn-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* TikTok-style play mode */
.screen-game.tiktok-mode .cam-ring {
  animation: ring-rotate 2s linear infinite, cam-pulse 0.8s ease infinite alternate;
}
@keyframes cam-pulse {
  from { box-shadow: 0 0 40px rgba(255,45,149,0.3); }
  to { box-shadow: 0 0 80px rgba(0,245,255,0.4); }
}

/* ---- Loading screen ---- */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}
.loading-screen.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-inner { text-align: center; padding: 2rem; }

.loading-eye-ring {
  width: 5.5rem;
  height: 5.5rem;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  border: 2px solid rgba(0, 245, 255, 0.2);
  border-top-color: var(--cyan);
  animation: spin 0.9s linear infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 40px rgba(0, 245, 255, 0.2);
}

.loading-eye-core { font-size: 2rem; animation: float-eye 2s ease infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float-eye {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.loading-title {
  font-size: 1.25rem;
  letter-spacing: 0.2em;
  color: var(--cyan);
  margin-bottom: 0.5rem;
}

.loading-sub {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.4);
  margin-bottom: 1.5rem;
}

.loading-track {
  width: min(280px, 80vw);
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
  margin: 0 auto;
}
.loading-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--pink), var(--cyan), var(--purple));
  border-radius: 999px;
  transition: width 0.25s var(--ease);
  box-shadow: 0 0 12px var(--cyan);
}

.loading-percent {
  margin-top: 0.75rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
}

/* ---- Blink red flash ---- */
.blink-flash {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--red);
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}
.blink-flash.active {
  animation: flash-blink 0.45s ease-out 3;
}
@keyframes flash-blink {
  0% { opacity: 0.7; }
  100% { opacity: 0; }
}

/* ---- Cinematic fail ---- */
.fail-cinematic {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  padding: 2rem;
  pointer-events: none;
}
.fail-cinematic.active { display: flex; animation: fail-bg-in 0.3s ease; }

@keyframes fail-bg-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fail-glitch-wrap { position: relative; }

.fail-title {
  font-size: clamp(2.5rem, 12vw, 5rem);
  font-weight: 900;
  color: var(--red);
  text-align: center;
  text-shadow: 0 0 30px var(--red), 0 0 80px rgba(255, 23, 68, 0.6);
  animation: fail-glitch 0.5s steps(3) 2, fail-scale 0.6s var(--ease);
}

@keyframes fail-scale {
  0% { transform: scale(0.3); opacity: 0; }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes fail-glitch {
  0% { transform: translate(0); }
  33% { transform: translate(-4px, 2px); }
  66% { transform: translate(4px, -2px); }
  100% { transform: translate(0); }
}

.fail-meme {
  margin-top: 1.25rem;
  font-size: clamp(1rem, 4vw, 1.25rem);
  color: var(--pink);
  text-align: center;
  max-width: 22rem;
  font-style: italic;
}

.fail-sub {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: rgba(255, 23, 68, 0.8);
  text-transform: uppercase;
}

/* Screen shake */
.shake { animation: shake 0.55s ease-in-out; }
@keyframes shake {
  0%, 100% { transform: translate(0); }
  15% { transform: translate(-10px, 4px) rotate(-1deg); }
  30% { transform: translate(10px, -4px) rotate(1deg); }
  45% { transform: translate(-6px, 6px); }
  60% { transform: translate(6px, -6px); }
  75% { transform: translate(-3px, 3px); }
}

/* ---- Modal ---- */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-root.show { display: flex; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  animation: fade-in 0.35s ease;
}

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 22rem;
  padding: 2rem 1.5rem;
  text-align: center;
  transform: scale(0.85) translateY(20px);
  opacity: 0;
  transition: transform 0.45s var(--ease), opacity 0.45s var(--ease);
}
.modal-root.show .modal-panel {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-skull { font-size: 3rem; margin-bottom: 0.5rem; }

.modal-title {
  font-size: 1.35rem;
  color: var(--red);
  margin-bottom: 0.5rem;
}

.modal-meme {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  font-style: italic;
}

.modal-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.modal-stat {
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 0.75rem;
}
.modal-stat-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 0.25rem;
}
.modal-stat-value { font-size: 1.35rem; font-weight: 700; }
.text-cyan { color: var(--cyan); }
.text-green { color: var(--green); }

.rank-badge {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, rgba(176,38,255,0.2), rgba(255,45,149,0.2));
  border: 1px solid rgba(176, 38, 255, 0.4);
  border-radius: 999px;
  font-size: 1rem;
  color: #fff;
}

.modal-actions { display: flex; flex-direction: column; }

.share-toast {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--green);
  animation: fade-up 0.3s ease;
}

/* ---- Footer ---- */
.site-footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.25);
}

/* ---- Fullscreen ---- */
body.fullscreen-active .cam-ring {
  width: min(70vmin, 400px);
}

/* ---- RTL (Kurdish) ---- */
html[dir="rtl"] .hero-card,
html[dir="rtl"] .modal-panel,
html[dir="rtl"] .lb-list li {
  text-align: right;
}
html[dir="rtl"] .lb-list li {
  flex-direction: row-reverse;
}
html[dir="rtl"] .game-hud {
  flex-direction: row-reverse;
}

/* HTTPS warning banner */
.https-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding: 0.75rem 1rem;
  padding-top: max(0.75rem, env(safe-area-inset-top));
  background: rgba(255, 23, 68, 0.95);
  color: #fff;
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.4;
}

/* Safe areas (notch phones) */
.main-content {
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
}

.site-footer {
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

/* Touch-friendly buttons */
.btn-primary,
.btn-secondary,
.icon-btn {
  min-height: 44px;
  min-width: 44px;
  -webkit-tap-highlight-color: transparent;
}

/* ---- Responsive ---- */
@media (min-width: 640px) {
  .main-content { max-width: 28rem; }
  .game-hud { gap: 1.5rem; padding: 0.6rem 1.75rem; }
}

@media (max-width: 640px) {
  .site-header { padding: 0.5rem 0.75rem 0; padding-top: max(0.5rem, env(safe-area-inset-top)); }

  .glass-nav { padding: 0.5rem 0.75rem; border-radius: 1rem; }

  .brand-text { font-size: 0.85rem; }

  .main-content { padding-top: 0.75rem; max-width: 100%; }

  .hero-card { padding: 1.25rem 1rem; margin-bottom: 1rem; }

  .hero-title { font-size: 1.65rem; }

  .hero-desc { font-size: 0.95rem; margin-bottom: 1rem; }

  .cam-ring {
    width: min(78vw, 260px);
  }

  .game-hud {
    top: auto;
    bottom: max(5.5rem, calc(5rem + env(safe-area-inset-bottom)));
    left: 0.75rem;
    right: 0.75rem;
    transform: none;
    width: auto;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 1rem;
  }

  .hud-timer { font-size: 1.35rem; }

  .hud-status { font-size: 0.55rem; }

  .side-stats {
    width: 100%;
    justify-content: center;
    gap: 0.5rem;
  }

  .stat-chip { min-width: 4.5rem; padding: 0.35rem 0.6rem; }

  .game-warning {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    margin-top: 0.25rem;
  }

  .modal-root { padding: 0.75rem; align-items: flex-end; }

  .modal-panel {
    max-height: 90dvh;
    overflow-y: auto;
    border-radius: 1.25rem 1.25rem 0 0;
    margin-bottom: 0;
  }

  .fail-title { font-size: 2.25rem; }

  .countdown-num { font-size: 4.5rem; }

  .leaderboard-card { padding: 1rem; }

  .lb-list li { font-size: 0.85rem; padding: 0.5rem; }
}

@media (max-width: 380px) {
  .hud-status { display: none; }
  .cam-ring { width: min(82vw, 240px); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .cam-ring { animation: none; }
}
