/* ==== Neon Streets Theme Tokens ==== */
:root {
  --neon-bg-deep: #0a0618;
  --neon-bg-mid: #170f36;
  --neon-surface: rgba(21, 12, 46, 0.92);
  --neon-surface-solid: #170f34;
  --neon-border: rgba(255, 45, 149, 0.28);
  --neon-border-cyan: rgba(34, 211, 238, 0.35);
  --neon-pink: #ff2d95;
  --neon-pink-soft: #e879f9;
  --neon-cyan: #22d3ee;
  --neon-cyan-soft: #67e8f9;
  --brand-gold: #C5A059;
  --brand-gold-light: #e8c98a;
  --brand-gold-hover: #b08d4a;
  --brand-teal: #004A55;
  --brand-teal-light: #0a5c68;
  --text-light: #ece7fb;
  --text-muted: #b7b0d9;
  --text-dim: #8b84ad;
  --glow-pink: 0 0 24px rgba(255, 45, 149, 0.35);
  --glow-cyan: 0 0 24px rgba(34, 211, 238, 0.3);
  --glow-gold: 0 0 24px rgba(197, 160, 89, 0.4);
}

/* ==== Global Reset & Base ==== */
html, body {
    overscroll-behavior: none;
}
body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', Arial, sans-serif;
    color: var(--text-light);
    background: radial-gradient(ellipse 120% 90% at 50% -10%, #241540 0%, var(--neon-bg-deep) 55%, #050310 100%);
    overflow: hidden;
}
/* Allow game overlays and story/how-to modals to render */
body > div:not(#container):not(#leaderboardModal):not(#streakBanner):not(#howToPlayModal):not(#whoIsDennyModal):not(#rotateDeviceOverlay):not(#fullscreenPrompt) {
  display: none !important;
}

body.modal-active #streakBanner {
    pointer-events: none !important;
}
body.modal-active * {
    user-select: auto !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}



#container {
    max-width: 1080px;
    min-width: 340px;
    width: 1000px;
    min-height: 600px;
    box-sizing: border-box;
    background: linear-gradient(180deg, rgba(28, 16, 56, 0.97) 0%, rgba(14, 8, 30, 0.98) 100%);
    margin: 24px auto 0 auto;
    padding-bottom: 50px;
    border-radius: 30px;
    border: 1px solid var(--neon-border);
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.08), 0 8px 60px rgba(255, 45, 149, 0.18), 0 8px 48px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    padding: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
canvas {
    display: block;
    background: transparent;
    border-radius: 30px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
    margin: 0 auto;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}
canvas#game {
    display: block;
    background: transparent;
    border-radius: 30px;
    margin: 0 auto;
    margin-top: 0;
}
.copyright {
  margin-top: 40px !important;
  margin-bottom: 8px !important;
  flex-shrink: 0 !important;
  text-align: center;
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.03em;
  position: static !important;
  width: 100%;
}


#gameHeader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 64px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
    background: none;
    z-index: 21;
    pointer-events: none;
}
#hud {
    position: absolute;
    text-align: center;
    left: 50%;
    top: 12px;
    transform: translateX(-50%);
    background: rgba(21, 12, 46, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.4), var(--glow-pink);
    border-radius: 14px;
    padding: 8px 28px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-light);
    z-index: 22;
    min-width: 600px;
    max-width: 800px;
}
@supports (backdrop-filter: blur(10px)) {
  #hud { backdrop-filter: blur(10px) saturate(1.2); }
}
.hud-primary-row {
  font-size: 15px;
}
.hud-stats-row {
  font-size: 11px;
  display: block;
  margin: 10px auto 0 auto;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 6px 20px;
  max-width: 520px;
  text-align: center;
  color: var(--text-muted);
  white-space: nowrap;
}
#hearts {
    position: absolute;
    left: 50%;
    top: 92px;
    transform: translateX(-50%);
    font-size: 25px;
    letter-spacing: 2px;
    z-index: 12;
    width: auto;
    text-align: center;
    filter: drop-shadow(0 0 6px rgba(255, 45, 149, 0.5));
}
#leaderboard,
#headerRight,
#hud {
    pointer-events: auto;
}
#soundToggle, #musicToggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(21, 12, 46, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
    width: 26px;
    height: 26px;
    cursor: pointer;
    font-size: 16px;
    z-index: 120;
    margin: 0;
    transition: background 0.15s, box-shadow 0.15s;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}
#soundToggle:hover, #musicToggle:hover {
    background: rgba(255, 45, 149, 0.18);
    box-shadow: var(--glow-pink);
}
#soundIcon, #musicToggleIcon {
    font-size: 16px;
    color: var(--brand-gold-light);
    pointer-events: none;
}
.header-audio-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.speed-control {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 2px;
    box-sizing: border-box;
    min-width: 86px;
    width: 86px;
    padding: 3px 6px 4px;
    background: rgba(21, 12, 46, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
    cursor: default;
    z-index: 120;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}
.speed-control-title {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--brand-gold-light);
    text-align: center;
    line-height: 1;
    pointer-events: none;
}
.speed-slider-wrap {
    position: relative;
    width: 100%;
    padding: 1px 1px 0;
}
.speed-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 18px;
    margin: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
}
.speed-slider:focus {
    outline: none;
}
.speed-slider:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 2px var(--neon-cyan), 0 0 10px rgba(255, 45, 149, 0.65);
}
.speed-slider::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 999px;
    background:
        radial-gradient(circle at 0% 50%, rgba(34, 211, 238, 0.95) 0 3px, transparent 4px),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.55) 0 3px, transparent 4px),
        radial-gradient(circle at 100% 50%, rgba(255, 45, 149, 0.95) 0 3px, transparent 4px),
        linear-gradient(90deg, rgba(34, 211, 238, 0.35), rgba(255, 45, 149, 0.45));
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    margin-top: -6px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    background: radial-gradient(circle at 35% 35%, #ff7ec8, var(--neon-pink));
    box-shadow: 0 0 10px rgba(255, 45, 149, 0.65);
    transition: transform 0.12s ease;
}
.speed-slider:active::-webkit-slider-thumb {
    transform: scale(1.08);
}
.speed-slider::-moz-range-track {
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.35), rgba(255, 45, 149, 0.45));
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.speed-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    background: radial-gradient(circle at 35% 35%, #ff7ec8, var(--neon-pink));
    box-shadow: 0 0 10px rgba(255, 45, 149, 0.65);
}
.speed-slider-ticks {
    display: flex;
    justify-content: space-between;
    margin-top: 1px;
    font-size: 7px;
    font-weight: 700;
    color: var(--text-muted);
    line-height: 1;
    pointer-events: none;
}
.speed-slider-ticks span:nth-child(2) {
    text-align: center;
}
.intro-speed-control {
    min-width: 0;
    width: 100%;
    max-width: 230px;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}
.intro-speed-control .speed-slider-wrap {
    padding: 4px 2px 0;
}
.intro-speed-control .speed-slider {
    height: 28px;
}
.intro-speed-control .speed-slider-ticks {
    font-size: 10px;
    margin-top: 4px;
}
.speed-score-hint {
    margin: 6px 0 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.25;
    min-height: 2.5em;
}
#playerForm .choices {
    grid-column: 2;
    width: 100%;
    max-width: 230px;
    margin-bottom: 0;
}
#playerForm .choices__inner {
    width: 100% !important;
    max-width: 230px !important;
    min-height: auto;
    padding: 7px 16px;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-light);
}
#playerForm .choices__list--single .choices__item {
    color: var(--text-light);
}
#headerRight {
    position: absolute;
    right: max(32px, env(safe-area-inset-right, 0px));
    top: max(10px, env(safe-area-inset-top, 0px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 24;
    max-width: calc(100% - 44px);
    pointer-events: auto;
}
/* ==== Leaderboard Button (Unified Style) ==== */
.leaderboard-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(0, 74, 85, 0.92), rgba(10, 92, 104, 0.92));
  color: #fff;
  font-weight: 700;
  font-size: 1.18rem;
  border: 1px solid var(--neon-border-cyan);
  border-radius: 0.875em;
  padding: 10px 32px 10px 18px !important;
  min-width: 170px;
  box-sizing: border-box;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  margin-top: 0;
  margin-bottom: 0;
  cursor: pointer;
  outline: none;
  transition: background 0.16s, color 0.16s, box-shadow 0.16s;
  position: relative;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.leaderboard-link .icon,
.leaderboard-link .star {
  flex-shrink: 0;
  font-size: 1.15em;
  color: var(--brand-gold-light);
  margin: 0;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.leaderboard-link .icon {
  font-size: 1.35em;   /* Make emoji large and equal */
  margin-right: 2px;
  margin-left: 2px;
}

.leaderboard-link .text {
  font-size: 1.11em;
  font-weight: 700;
  text-decoration: none; /* Remove underline unless both need it */
  letter-spacing: 0.01em;
}

.leaderboard-link:active, .leaderboard-link:focus {
  background: linear-gradient(135deg, #013640, #024855);
}
.leaderboard-link:hover {
  background: linear-gradient(135deg, #0a5c68, #0d7484);
  color: var(--brand-gold-light);
  box-shadow: var(--glow-cyan);
}

#leaderboard {
    position: absolute;
    left: 28px;
    top: 12px;
    margin: 0;
    z-index: 23;
}

.gameover-actions {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 32px;
  margin-top: 35px;
  width: 100%;
}

.gameover-actions.leaderboard-alone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 10px 0 4px 0;
}
.gameover-actions.leaderboard-alone .leaderboard-link {
  width: auto;
  max-width: none;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
  font-size: 0.88rem;
  padding: 7px 14px;
}


/* Center all gameover content */
#gameover.game-screen {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 6px 10px 10px 10px !important;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Make scoreboard info row centered and inline */
.gameover-score-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font-size: 1.15rem;
  margin-bottom: 10px;
}

/* Style for small icons inside score row */
.gameover-score-row img,
.gameover-score-row .country-flag-name {
  margin: 0 4px;
  vertical-align: middle;
}

/* Social and button row */
.gameover-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin: 30px 0 0 0;
}

/* Center "Brag your score" and icons */


#gameover h3 {
  text-align: center;
  width: 100%;
}

#gameover h1 {
    margin-bottom: 0px;  /* Reduce from default (usually 20-30px) */
    margin-top: 16px;     /* Or even 12px if you want it tighter */
}


/* ==== TWO-COLUMN INTRO LAYOUT ==== */
#intro {
  position: absolute !important;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  min-height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  z-index: 3000 !important;
  background:
    radial-gradient(circle at 18% 15%, rgba(255, 45, 149, 0.14) 0%, transparent 45%),
    radial-gradient(circle at 85% 10%, rgba(34, 211, 238, 0.12) 0%, transparent 50%),
    linear-gradient(180deg, #170f34 0%, #0a0618 100%) !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.intro-header {
  width: 100%;
  text-align: center;
  margin-bottom: 20px;
}
.intro-header h2 {
  font-size: 2.3rem;
  font-weight: 900;
  font-family: 'Rajdhani', 'Inter', Arial, sans-serif;
  background: linear-gradient(90deg, var(--brand-gold-light), var(--brand-gold), #fb923c);
  -webkit-background-clip: text;
  background-clip: text;
  color: var(--brand-gold);
  margin: 10px 0 6px 0;
  letter-spacing: 0.02em;
}
.gosubtitle {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 18px;
  text-align: center;
}

.intro-main-wrapper {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Intro extra buttons */
.intro-btn-flex-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.how-to-play-btn,
.whois-btn {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-light);
  border: 1px solid var(--neon-border-cyan);
  border-radius: 12px;
  padding: 8px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
  transition: background 0.18s, box-shadow 0.18s, border-color 0.18s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.how-to-play-btn:hover,
.whois-btn:hover {
  background: rgba(34, 211, 238, 0.14);
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}
.how-to-play-btn:link,
.how-to-play-btn:visited,
.how-to-play-btn:hover,
.how-to-play-btn:focus,
.whois-btn:link,
.whois-btn:visited,
.whois-btn:hover,
.whois-btn:focus {
  color: var(--text-light);
  text-decoration: none;
}


.intro-layout {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  gap: 68px;
  width: 100%;
  margin-top: 18px;
}



.intro-columns {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: stretch;
  width: 100%;
  max-width: 800px;
  gap: 48px;
}
.intro-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.intro-col-img {
  align-items: center;
  flex: 1.1 1 0;
  min-width: 220px;
  max-width: 340px;
}
.intro-img {
  max-width: 90%;
  max-height: 420px;
  display: block;
  margin: 0 auto;
  border-radius: 18px;
  box-shadow: 0 0 0 3px rgba(255, 45, 149, 0.35), 0 0 40px 6px rgba(255, 45, 149, 0.22), 0 0 70px 16px rgba(34, 211, 238, 0.14);
  /* Remove caption from HTML, as per your instructions */
}

.intro-img-col {
  flex: 0 1 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;   /* Center the image in its half */
  min-width: 240px;
}
.intro-img-col img {
  max-width: 330px;
  width: 85%;
  height: auto;
  margin: 0 auto;
  display: block;
  border-radius: 18px;
  box-shadow: 0 0 0 3px rgba(255, 45, 149, 0.35), 0 0 44px 8px rgba(255, 45, 149, 0.25), 0 0 80px 18px rgba(34, 211, 238, 0.16);
}


.intro-col-form {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.intro-form-label {
  font-weight: 700;
  font-size: 1.2em;
  margin-bottom: 2px;
  display: block;
  text-align: left;
  color: var(--text-light);
}


.intro-caption {
  margin-top: 14px;
  text-align: center;
  color: var(--text-light);
  font-size: 1.1em;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.intro-img-caption {
  text-align: left;
  font-size: 1.13em;
  margin-top: 14px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--text-light);
  max-width: 280px;
}

.intro-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 950px;
  margin: 0 auto;
  gap: 0;
}

.intro-heading-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 12px;
}
.intro-title {
  font-size: 2.4rem;
  font-weight: 800;
  margin: 0 0 8px 0;
  text-align: center;
  font-family: 'Rajdhani', 'Inter', Arial, sans-serif;
  letter-spacing: 0.03em;
  background: linear-gradient(90deg, var(--brand-gold-light), var(--brand-gold) 55%, #fb923c);
  -webkit-background-clip: text;
  background-clip: text;
  color: var(--brand-gold);
  text-shadow: 0 0 30px rgba(197, 160, 89, 0.35);
}

.intro-form-col {
  flex: 1 1 420px;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* All children left-aligned */
  min-width: 260px;
}
.intro-col-form h2 {
  font-size: 2.8rem;
  font-weight: 900;
  margin: 0 0 10px 0;
  color: var(--text-light);
}

.intro-title-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 18px;
}
.intro-title-row h2 {
  font-size: 2.8em;
  font-weight: 900;
  margin: 12px 0 2px 0;
  color: var(--brand-gold-light);
  text-align: center;
}

.intro-col-form .intro-form-group {
  margin-bottom: 14px;
  width: 100%;
}
.intro-col-form input,
.intro-col-form select {
  width: 300px;
  max-width: 98%;
  font-size: 1.1em;
  padding: 10px 12px;
  border-radius: 7px;
  border: 1.2px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-light);
}
.intro-col-form input:focus,
.intro-col-form select:focus {
  border: 2px solid var(--neon-cyan);
  outline: none;
  box-shadow: var(--glow-cyan);
}


#playerForm {
  width: 100%;
}

.playerinfo {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.labelbox {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 2px;
}
.labelbox label {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-light);
}
.playerinfo input,
.playerinfo select {
  font-size: 16px;
  font-family: inherit;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 8px 16px;
  margin-left: 2px;
  max-width: 180px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-light);
  outline: none;
}
.playerinfo input:focus,
.playerinfo select:focus {
  border: 2px solid var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

.form-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  width: 100%;
  justify-content: flex-start; /* Left align fields */
}

.form-row label {
  font-size: 1.08em;
  font-weight: 700;
  min-width: 84px;
  text-align: left;
  color: var(--text-light);
}

.form-row input,
.form-row select {
  font-size: 1.07em;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  outline: none;
  min-width: 180px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-light);
  font-family: inherit;
  text-align: left;
  margin-left: 0;
}

#playerForm {
  width: 100%;
  max-width: 330px;
}

#playerForm .form-group {
  display: grid;
  grid-template-columns: 88px minmax(180px, 230px);
  column-gap: 14px;
  row-gap: 4px;
  align-items: center;
  margin-bottom: 14px;
}

.form-group {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.form-group label {
  font-size: 1.12rem;
  font-weight: 700;
  margin-right: 15px;
  min-width: 95px;
  text-align: left;
  color: var(--text-light);
}

#playerForm .form-group label {
  grid-column: 1;
  margin-right: 0;
  min-width: 0;
}

.form-group input,
.form-group select {
  font-size: 16px;
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  max-width: 230px;
  width: 230px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-light);
}

#playerForm .form-group > select,
#playerForm .form-group > .choices,
#playerForm .form-group input,
#playerForm .form-group .intro-speed-control {
  grid-column: 2;
  width: 100%;
  max-width: 230px;
}

#playerForm .field-error {
  grid-column: 2;
  font-size: 0.85rem;
  font-weight: 600;
  color: #ff8f8f;
  line-height: 1.25;
  min-height: 0;
}

#playerForm .form-group-speed {
  align-items: start;
}

#playerForm .form-group-speed label {
  margin-top: 8px;
}

.form-group input.input-invalid {
  border-color: #ff6b6b;
  box-shadow: 0 0 0 1px rgba(255, 107, 107, 0.35);
}
.form-group input:focus,
.form-group select:focus {
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
  outline: none;
}

.quote {
    margin: 12px auto 5px auto;
    font-size: 16px;
    font-style: italic;
    background: rgba(34, 211, 238, 0.08);
    border-left: 3px solid var(--neon-cyan);
    border-right: 3px solid var(--neon-cyan);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-light);
    font-weight: 600;
    max-width: 96%;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
}
#startBtn.small, .restart-btn.small {
  font-size: 1.3em;
  width: 270px;
  padding: 13px 0;
  border-radius: 12px;
  margin-top: 28px;
    margin-bottom: 18px;

}
/* ==== End Intro 2-column ==== */
#gameover:not(.hide-overlay) {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-align: center;
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 6px 10px 10px 10px !important;
  transform: none !important;
  background: transparent;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 9999;
}

#intro.hide-overlay,
#gameover.hide-overlay,
#gameover-actions.hide-overlay,
canvas#game.hide-overlay,
#hud.hide-overlay,
#hearts.hide-overlay,
#gameHeader.hide-overlay,
#headerRight.hide-overlay {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -1 !important;
}

#container:has(#gameover:not(.hide-overlay)) .copyright {
  display: none !important;
}
#gameover h2, #gameover .gosubtitle, #gameover h3, #gameover .go-inline, #gameover .quote, #gameover, #gameover .gameover-actions {
  width: 100%;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  justify-content: center;
  align-items: center;
}
.go-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font-size: 1.18rem;
  margin-bottom: 10px;
  text-align: center;
  flex-wrap: wrap; /* If mobile, wrap cleanly */
}
.go-inline span {
  white-space: nowrap;
}

#gameover-actions:not(.hide-overlay),
.gameover-actions:not(.hide-overlay) {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 30px !important;
  margin-top: 32px !important;
  width: 100% !important;
}
.restart-btn {
  margin: 16 !important;
}
#sharebar {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px;
  width: 100%;
  margin: 12px 0 18px 0;
}
#sharebar button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
}
#sharebar img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}




#startBtn {
    display: inline-block;
    margin-top: 0;
    margin-bottom: 0;
    padding: 12px 20px;
    width: auto;
    min-width: 0;
    max-width: none;
    background: linear-gradient(135deg, var(--brand-gold-light), var(--brand-gold) 60%, #b9853a);
    color: #241407;
    font-size: 1.15em;
    font-weight: 800;
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 16px rgba(197, 160, 89, 0.35), var(--glow-gold);
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
    cursor: pointer;
    align-self: center;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}
#startBtn:hover, .restart-btn:hover {
    background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-hover) 70%);
    box-shadow: 0 4px 24px rgba(197, 160, 89, 0.5), var(--glow-gold);
    transform: translateY(-1px);
}



.restart-btn {
    display: block;
    margin: 8px auto 2px auto;
    padding: 9px 16px;
    width: auto;
    min-width: 150px;
    max-width: 210px;
    background: linear-gradient(135deg, var(--brand-gold-light), var(--brand-gold) 60%, #b9853a);
    color: #241407;
    font-size: 1.15em;
    font-weight: 800;
    border-radius: 11px;
    border: none;
    box-shadow: 0 2px 16px rgba(197, 160, 89, 0.35), var(--glow-gold);
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
    cursor: pointer;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}
.restart-btn:hover {
    background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-hover) 70%);
    box-shadow: 0 4px 24px rgba(197, 160, 89, 0.5), var(--glow-gold);
    transform: translateY(-1px);
}

/* For the Restart button between quote and scorecard */
#restartBtn.restart-btn {
  margin: 4px auto 6px auto;
  display: block;
  flex-shrink: 0;
}

/* Make the Share/Leaderboard buttons row just above the card, tighter spacing */
#restartBtn.restart-btn {
  position: relative;
  z-index: 2;
}

.gameover-main-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

#gameover .gameover-actions.leaderboard-alone,
#gameover-actions.leaderboard-alone {
  margin-top: 8px;
  margin-bottom: 4px;
  gap: 10px;
  justify-content: center;
  flex-shrink: 0;
}

#gameover .gameover-actions.leaderboard-alone .leaderboard-link,
#gameover-actions.leaderboard-alone .leaderboard-link {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  font-size: 0.88rem !important;
  padding: 7px 14px !important;
  gap: 8px !important;
  border-radius: 10px !important;
}

#gameover .gameover-actions.leaderboard-alone .leaderboard-link .icon,
#gameover-actions.leaderboard-alone .leaderboard-link .icon {
  font-size: 1.05em !important;
}

#gameover .gameover-actions.leaderboard-alone .leaderboard-link .text,
#gameover-actions.leaderboard-alone .leaderboard-link .text {
  font-size: 0.95em !important;
}

#gameover .quote {
  margin: 4px auto 2px auto;
  padding: 6px 10px;
  font-size: 13px;
  flex-shrink: 0;
}

/* Space below the scorecard */
.playerinfo {
  margin-bottom: 6px;
  flex-shrink: 0;
}

#leaderboardIntroBtn {
  font-size: 1em;
  padding: 11px 16px !important;
  border-radius: 11px;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
}

.intro-btn-row #leaderboardIntroBtn {
  margin-top: 0 !important;
  width: auto !important;
  min-width: 0 !important;
  flex: 0 0 auto;
}

/* Leaderboard modal layout, table, and pagination styling live in leaderboard.css */

#fxLayer {
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 5000;
}
.domain-popup {
    position: absolute;
    transform: translate(-50%, -50%);
    padding: 8px 14px;
    border-radius: 14px;
    background: rgba(17, 17, 17, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
    font-family: Arial, sans-serif;
    font-weight: 700;
    font-size: clamp(14px, 1.6vw, 24px);
    line-height: 1.2;
    max-width: min(85vw, 420px);
    white-space: normal;
    text-align: center;
    pointer-events: none;
    animation: domainPopupFade 2s ease-out forwards;
}
@keyframes domainPopupFade {
    0%, 18% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -58%) scale(0.98); }
}
.sparkle-effect {
    width: 48px; height: 48px;
    background: url('assets/sparkle.gif'), radial-gradient(circle, #fff8 70%, #fff3 100%);
    background-size: cover;
    position: absolute;
    pointer-events: none;
    animation: pop 0.6s;
}
.bad-effect {
    width: 48px; height: 48px;
    background: url('assets/bad.gif'), radial-gradient(circle, #f33 70%, #f003 100%);
    background-size: cover;
    position: absolute;
    pointer-events: none;
    animation: pop 0.6s;
}
@keyframes pop {
    0%   { transform: scale(0.7); opacity: 0.7;}
    60%  { transform: scale(1.2); opacity: 1;}
    100% { transform: scale(1); opacity: 0;}
}
/* Lock the width of the Choices.js dropdown to match your input box */
.choices[data-type*='select-one'] {
  width: 180px !important;
  min-width: 140px !important;
  max-width: 220px !important;
}
.choices__list--dropdown, .choices__list[aria-expanded] {
  width: 100% !important;
  min-width: 100% !important;
  box-sizing: border-box;
  background: var(--neon-surface-solid) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

/* Choices.js accent overrides (dark theme) */
.choices__inner {
  border-color: rgba(255, 255, 255, 0.18) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--text-light) !important;
}
.choices.is-focused .choices__inner,
.choices.is-open .choices__inner {
  border-color: var(--neon-cyan) !important;
  box-shadow: var(--glow-cyan);
}
.choices__item--selectable.is-highlighted,
.choices__item--choice.is-highlighted {
  background-color: rgba(34, 211, 238, 0.16) !important;
  color: var(--text-light) !important;
}
.choices__item--selectable.is-highlighted.is-selected,
.choices__list--dropdown .choices__item--selectable.is-selected {
  background-color: var(--brand-teal) !important;
  color: #fff !important;
}
.choices__list--dropdown .choices__item,
.choices__list--single {
  color: var(--text-light) !important;
}
.choices[data-type*='select-one'] .choices__input {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-light) !important;
}
.choices[data-type*='select-one']::after {
  border-color: var(--text-light) transparent transparent transparent !important;
}


#comboFill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  height: 100%;
  width: 0%; /* JS sets this */
  background: linear-gradient(90deg, var(--neon-pink), var(--brand-gold-light));
  border-radius: 10px;
  transition: width 0.4s;
  z-index: 1;
  box-shadow: 0 0 12px rgba(255, 45, 149, 0.5);
}

/* Combo Meter Shake Animation */
.shake {
  animation: shake 0.4s;
}
@keyframes shake {
    0% { transform: translate(0px, 0px);}
    20% { transform: translate(-10px, 3px);}
    40% { transform: translate(8px, -6px);}
    60% { transform: translate(-5px, 5px);}
    80% { transform: translate(7px, -3px);}
    100% { transform: translate(0px, 0px);}
}
#flashOverlay {
  position:fixed;
  left:0; top:0;
  width:100vw; height:100vh; height:100dvh;
  background:rgba(197,160,89,0.3);
  pointer-events:none;
  z-index:9999;
  opacity:0;
  transition:opacity 0.2s;
}
.choices__inner {
    display: flex !important;
    align-items: center !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 1.3 !important;
    min-height: 34px !important;
    height: 34px !important;
}
.choices__item.choices__item--select-one {
    display: flex !important;
    align-items: center !important;
    line-height: 1.3 !important;
    font-size: 16px !important;
    padding: 0 !important;
}
.choices__item--choice {
    display: flex !important;
    align-items: center !important;
    font-size: 16px !important;
    padding: 7px 15px !important;
    line-height: 1.3 !important;
}
.choices__item,
.choices__item--choice,
.choices__item--select-one {
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', 'Inter', Arial, sans-serif !important;
    font-size: 17px !important;
    display: flex !important;
    align-items: center !important;
    line-height: 1.3 !important;
}
.country-flag-name {
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Inter', Arial, sans-serif !important;
    font-size: 1em;
     margin-left: 4px;  /* Adds a small gap to the right of the name */
  vertical-align: middle;
  font-size: 1.13em;
  display: inline-block;
}
.choices__list--dropdown, .choices__list--single, .choices__item, .country-flag-name, select, option {
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Twemoji', 'Noto Color Emoji', 'Segoe UI', Arial, sans-serif !important;
    font-size: 16px;
}
button, .leaderboard-link, #leaderboard {
    -webkit-tap-highlight-color: transparent;
}
::-webkit-scrollbar {
    width: 8px;
    background: rgba(255, 255, 255, 0.04);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 45, 149, 0.35);
    border-radius: 8px;
}


#streakBox {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-left: 28px;
  position: relative;
  z-index: 36;
  min-width: 200px;
}


#comboMeter {
  display: flex;
  align-items: center;
  position: relative;
  width: 180px; /* Adjust for your HUD */
}

.comboTrack {
  position: relative;
  width: 140px;      /* The visible bar length */
  height: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#streakLabel {
  position: relative;
  color: var(--text-light);
  font-weight: 700;
  font-size: 0.95em;
  z-index: 2;
  background: none;
  text-align: center;
  width: 100%;
  pointer-events: none; /* Ignore pointer so bar is clickable if needed */
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}



body.streak-active #streakBanner { display: block; }
canvas {
  image-rendering: auto;
  -webkit-font-smoothing: antialiased;
  font-smooth: always;
}

.streak-banner {
  display: none;
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3em;
  font-weight: 800;
  color: var(--brand-gold-light);
  text-shadow: 0 0 24px rgba(255, 45, 149, 0.6), 2px 2px 8px rgba(0, 0, 0, 0.5);
  background: rgba(10, 6, 24, 0.78);
  border: 1px solid rgba(255, 45, 149, 0.4);
  padding: 30px 80px;
  border-radius: 20px;
  z-index: 9999;
  pointer-events: none;
}

.hide-overlay {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -1 !important;
}


#scoreCard {
    margin-top: 5px;

  width: 350px;
  min-height: 350px;
  height: auto;
border-radius: 28px;
  box-shadow: 0 6px 36px rgba(0, 0, 0, 0.5), 0 0 40px rgba(255, 45, 149, 0.2);
  background: url('scoreb.png') center center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Inner card for opaque backdrop and padding for BG feel */
.scorecard-inner {
  width: 90%;
  height: auto;
  min-height: 88%;
  background: rgba(15, 9, 30, 0.9); /* modern, opaque */
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  margin: auto;
  padding: 22px 16px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.4);
  overflow: visible;
}


.scorecard-title {
  font-size: 1.2em; /* 30% smaller */
  font-weight: 600;
  font-family: 'Rajdhani', 'Inter', Arial, sans-serif;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.4);

  margin-bottom: 10px;
  text-align: center;
  line-height: 1.1;
}

.scorecard-subtitle {
  font-size: 0.95em; /* 20% smaller */
  font-weight: 400;
  color: var(--brand-gold-light);
  margin-bottom: 12px;
  text-align: center;
  letter-spacing: 0.01em;
}

.scorecard-playername {
  margin: 6px 0 0 0;
  font-size: 1.22em;
  font-weight: bold;
  text-align: center;
  color: var(--brand-gold-light);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  flex-shrink: 0;
  line-height: 1.35;
  white-space: nowrap;
}

.scorecard-playername #goCountry,
.scorecard-playername #goName {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.scorecard-playername #goCountry {
  margin-left: 0;
  margin-right: 0;
}

.scorecard-playername .scorecard-flag,
.scorecard-playername #goCountry img {
  position: static !important;
  top: auto !important;
  vertical-align: middle;
  line-height: 1;
  display: inline;
  font-size: 1.05em;
}

.scorecard-playername #goCountry img {
  height: 18px;
  width: 24px;
  object-fit: cover;
  border-radius: 2px;
  vertical-align: middle;
}


.scorecard-info-row {
  font-size: 1.11em;
  font-weight: 600;
  color: #d4dde0;
  margin: 10px 0 0 0;
  text-align: center;
}

.scorecard-motion-note {
  font-size: 0.78em;
  font-weight: 400;
  color: var(--brand-gold-light);
  margin: 4px 0 0 0;
  text-align: center;
  display: none;
  line-height: 1.35;
  opacity: 0.9;
}

.score-row {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin: 10px 0 0 0;
  gap: 8px;
  flex-shrink: 0;
}

.score-box {
  width: 46%;   /* Smaller boxes */
  min-width: 75px;
  min-height: 52px;
  border-radius: 12px;
  padding: 10px 8px 8px 8px;
  margin-bottom: 5px;
  background: rgba(0, 74, 85, 0.9);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  text-align: center;
  font-size: 0.7em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.score-box .label {
  font-size: 0.95em;
  margin-bottom: 3px;
  font-weight: 300;
}

.score-box.good { background: rgba(36, 202, 117, 0.9); color: #fff; }
.score-box.bad { background: rgba(244, 67, 54, 0.9); color: #fff; }
.score-box.time { background: rgba(47, 107, 116, 0.9); color: #fff; }
.score-box.learning { background: rgba(197, 160, 89, 0.9); color: #241407; font-weight: bold; }

.scorecard-footer {
  color: #241407;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  min-height: 44px;
  border-radius: 5px;
  padding: 11px 8px;
  margin: 18px 0 0 0;
  background-color: #e6c47a;
  box-shadow: 0 2px 10px rgba(197, 160, 89, 0.25);
  text-align: center;
  font-size: 0.95em;
  font-weight: 700;
  line-height: 1.3;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  flex-shrink: 0;
  overflow: visible;
}

.scorecard-share-btn {
  margin-top: 12px;
  width: 20%;
  padding: 10px 0;
  background: linear-gradient(90deg, var(--brand-gold), var(--brand-gold-hover) 70%);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 1.16em;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: background 0.16s, color 0.16s;
}
.scorecard-share-btn:hover {
  background: linear-gradient(90deg, var(--brand-gold-hover), #97753d 70%);
  color: #fff;
}
#scoreCard.screenshot-mode,
.screenshot-mode { /* Applies to both real and clone if needed */
  width: 700px !important;
  height: 700px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 48px !important;
  box-shadow: none !important;
  background-size: cover !important;
  font-size: 2.2em !important; /* Multiplies all inner text size */
}

.screenshot-mode .scorecard-inner {
  width: 92% !important;
  height: 92% !important;
  margin: auto !important;
  padding: 25px 32px 10px 32px !important;
  border-radius: 38px !important;
}

.screenshot-mode .scorecard-title {
  font-size: 1.2em !important;
}
.screenshot-mode .scorecard-subtitle {
  font-size: 0.8em !important;
}
.screenshot-mode .scorecard-info-row,
.screenshot-mode .score-row,
.screenshot-mode .scorecard-footer {
  font-size: 0.8em !important;
}
/* Adjust the scaling as needed for perfect balance */
.screenshot-mode {
  width: 700px !important;
  height: 700px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 48px !important;
  box-shadow: none !important;
  background-size: cover !important;
  font-size: 2em !important;
}
.screenshot-mode .scorecard-inner {
  width: 92% !important;
  height: 92% !important;
  margin: auto !important;
  padding: 25px 32px 10px 32px !important;
  border-radius: 38px !important;
}
.screenshot-mode .scorecard-share-btn {
  display: none !important; /* Hide if you don't want it in download */
}

.screenshot-padding {
  padding-top: 36px !important;
  /* You can adjust the value until download and browser match */
}



.gameover-actions.leaderboard-alone {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px !important;
  width: 100%;
  margin: 10px 0 4px 0;
}

/* Remove forced width, so buttons shrink to fit content! */
.gameover-actions.leaderboard-alone .leaderboard-link {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  font-size: 0.88rem !important;
  padding: 7px 14px !important;
  gap: 8px !important;
}


#rotateDeviceOverlay {
  display: none !important;
  filter: none !important;
  opacity: 1 !important;
  pointer-events: all !important;
  z-index: 99999 !important;
  position: fixed !important;
  top: 0 !important; left: 0 !important;
  width: 100vw !important; height: 100vh !important; height: 100dvh !important;
  background: radial-gradient(circle at 50% 30%, #1a0f3c 0%, #05030f 80%) !important;
  justify-content: center !important;
  align-items: center !important;
  padding-left: env(safe-area-inset-left) !important;
  padding-right: env(safe-area-inset-right) !important;
}
#rotateDeviceOverlay.is-visible {
  display: flex !important;
}
#rotateDeviceOverlay * {
  filter: none !important;
  opacity: 1 !important;
  pointer-events: all !important;
}
#rotateDeviceOverlay .rotate-msg-box {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  max-width: min(92vw, 420px) !important;
  margin: 0 16px !important;
  padding: 40px 28px 36px !important;
  background: rgba(21, 12, 46, 0.94) !important;
  border: 1px solid rgba(255, 45, 149, 0.35);
  color: var(--text-light) !important;
  border-radius: 22px;
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.5), var(--glow-pink);
  z-index: 100000 !important;
  gap: 10px !important;
}
#rotateDeviceOverlay .rotate-msg-icon {
  display: block !important;
  font-size: clamp(3.5rem, 18vw, 5rem) !important;
  line-height: 1 !important;
  margin: 0 0 6px 0 !important;
  animation: rotateDeviceHint 2.8s ease-in-out infinite;
}
#rotateDeviceOverlay .rotate-msg-title {
  font-family: 'Rajdhani', 'Inter', Arial, sans-serif !important;
  font-size: clamp(1.15rem, 4.8vw, 1.4rem) !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  margin: 0 !important;
  color: var(--text-light) !important;
}
#rotateDeviceOverlay .rotate-msg-sub {
  font-size: clamp(0.95rem, 3.8vw, 1.08rem) !important;
  line-height: 1.45 !important;
  margin: 0 !important;
  color: var(--text-muted) !important;
  font-weight: 400 !important;
}
#rotateDeviceOverlay .rotate-msg-desktop {
  width: 100% !important;
  margin: 10px 0 0 0 !important;
  padding-top: 16px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  font-size: clamp(0.9rem, 3.5vw, 1rem) !important;
  line-height: 1.45 !important;
  color: var(--brand-gold-light) !important;
  font-weight: 500 !important;
}
@keyframes rotateDeviceHint {
  0%, 100% { transform: rotate(0deg); }
  35% { transform: rotate(-90deg); }
  70% { transform: rotate(-90deg); }
}
@media (prefers-reduced-motion: reduce) {
  #rotateDeviceOverlay .rotate-msg-icon {
    animation: none !important;
  }
}

body.portrait-blocked #container,
body.portrait-blocked #gameHeader,
body.portrait-blocked #headerRight,
body.portrait-blocked #intro,
body.portrait-blocked #gameover,
body.portrait-blocked #leaderboardModal,
body.portrait-blocked #howToPlayModal,
body.portrait-blocked #whoIsDennyModal,
body.portrait-blocked #fullscreenPrompt,
body.portrait-blocked #streakBanner,
body.portrait-blocked #flashOverlay {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  user-select: none !important;
}
body.portrait-blocked {
  overflow: hidden !important;
}


.intro-btn-row {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  margin-top: 22px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.intro-btn-row #startBtn,
.intro-btn-row #leaderboardIntroBtn {
  flex: 0 0 auto;
  min-width: 0;
  max-width: none;
  font-size: 1.05em;
  padding: 12px 20px;
  border-radius: 12px;
  margin: 0;
  text-align: center;
  box-sizing: border-box;
}

.intro-btn-row #startBtn {
  width: 200px;
}

.intro-btn-row #leaderboardIntroBtn {
  width: auto;
  padding: 12px 16px !important;
  gap: 8px;
}

/* How to Play modal */
.how-to-play-modal {
  position: fixed;
  inset: 0;
  z-index: 11010 !important;
  background: rgba(10, 6, 24, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s;
}
.htp-content-card {
  background: linear-gradient(180deg, rgba(28, 16, 56, 0.98), rgba(14, 8, 30, 0.98));
  border-radius: 2.2em;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.5), var(--glow-pink);
  padding: 32px 42px 18px 42px;
  width: 680px;
  max-width: 97vw;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 0.97em;
  color: var(--text-light);
  position: relative;
  overflow-y: auto;
  max-height: 92vh;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: popUp .25s cubic-bezier(.47,2.02,.68,.92);
}
@keyframes popUp {
  0% { transform: scale(.84); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.htp-close-btn {
  position: absolute;
  top: 18px;
  right: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  font-size: 1.7em;
  font-weight: 800;
  color: var(--text-light);
  border-radius: 50%;
  padding: 2px 10px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  z-index: 2;
  transition: background .14s, color .14s;
}
.htp-close-btn:hover { color: var(--neon-pink); background: rgba(255, 45, 149, 0.15); }
.htp-heading {
  text-align: left;
  font-size: 1.34em;
  font-weight: 900;
  letter-spacing: -0.01em;
  font-family: 'Rajdhani', 'Inter', Arial, sans-serif;
  color: var(--brand-gold-light);
  margin-bottom: 6px;
}
.htp-joystick { margin-right: 6px; }
.htp-intro {
  text-align: left;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}
.htp-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.htp-step {
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.htp-step-icon { font-size: 1.2em; }
.htp-step-label { font-size: 0.98em; color: var(--text-light); }
.htp-key {
  background: var(--brand-teal);
  color: #fff;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.9em;
  margin: 0 2px;
}
.htp-table-wrap { overflow-x: auto; }
.htp-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 0.95em;
}
.htp-table th, .htp-table td {
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px;
  text-align: left;
  color: var(--text-light);
}
.htp-table th {
  background: rgba(255, 255, 255, 0.06);
  font-weight: 800;
  color: var(--brand-gold-light);
}
.htp-ico { text-align: center; width: 48px; }
.htp-good { color: #4ade80; font-weight: 700; }
.htp-risk { color: #f87171; font-weight: 700; }
.htp-extras {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}
.htp-extra {
  background: rgba(197, 160, 89, 0.1);
  border: 1px solid rgba(197, 160, 89, 0.35);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--brand-gold-light);
  font-size: 0.96em;
}
.htp-tipbar {
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--neon-cyan-soft);
  font-weight: 700;
}
@media (max-width: 950px) {
  .htp-content-card { width: 98vw; max-width: 99vw; border-radius: 1.3em; padding: 16px 2vw 12vw 2vw; font-size: 0.93em; }
}

/* Who is Denny modal */
.whois-modal {
  position: fixed;
  z-index: 20000;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(5, 3, 15, 0.88);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10px; /* gap from viewport edges */
  overflow: auto;
  font-family: 'Inter', Arial, sans-serif;
  animation: modalFadeIn 0.21s;
}
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
.whois-content {
  background: linear-gradient(180deg, rgba(28, 16, 56, 0.98), rgba(14, 8, 30, 0.98));
  border-radius: 18px;
  box-shadow: 0 6px 42px rgba(0, 0, 0, 0.55), var(--glow-cyan);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 94vw; max-width: 650px;
  padding: 22px 26px 30px 26px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-sizing: border-box;
  margin: 10px auto; /* gap top/bottom inside overlay */
  max-height: calc(100vh - 20px);
  overflow-y: auto;
}
.whois-close-btn {
  position: absolute;
  top: 14px; right: 18px;
  font-size: 2em;
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  z-index: 2;
  opacity: 0.88;
  transition: color 0.18s;
}
.whois-close-btn:hover { color: var(--neon-pink); }
.whois-header-row {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: -3px;
}
.whois-trophy { font-size: 2.1em; margin-right: 5px; margin-bottom: 2px; filter: drop-shadow(0 0 10px rgba(197, 160, 89, 0.5)); }
.whois-title {
  font-size: 1.6em;
  font-weight: 800;
  letter-spacing: -1px;
  font-family: 'Rajdhani', 'Inter', Arial, sans-serif;
  color: var(--brand-gold-light);
  text-shadow: 0 0 20px rgba(197, 160, 89, 0.35);
  text-align: left;
}
.whois-main-story {
  font-size: 1.14em;
  font-weight: 500;
  color: var(--text-light);
  line-height: 1.53;
  margin-bottom: 2px;
  margin-top: 3px;
  position: relative;
  text-align: justify;
}
.whois-highlight-tip {
  display: block;
  background: rgba(255, 45, 149, 0.1);
  border-left: 5px solid var(--neon-pink);
  border-radius: 7px;
  color: var(--text-light);
  padding: 10px 14px;
  margin: 13px 0 2px 0;
  font-size: 1em;
  font-weight: 600;
  box-shadow: 0 2px 14px rgba(255, 45, 149, 0.08);
  text-align: justify;
}
.whois-row.whois-big-avatar {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 18px;
  margin: 0;
  padding: 0;
}
.whois-story-col {
  width: calc(100% - 250px);
  padding-right: 14px;
  text-align: justify;
}
.whois-secondary-story {
  font-size: 0.90em;
  color: var(--text-muted);
  line-height: 1.49;
  text-align: justify;
}
.whois-avatar-col {
  width: 44%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 140px;
  min-height: 150px;
  text-align: center;
}
.whois-avatar-img {
  width: 120px;
  height: 148px;
  object-fit: contain;
  border-radius: 16px;
  border: 3.5px solid var(--brand-gold);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 2px 14px rgba(197, 160, 89, 0.15);
  display: block;
  margin-top: 8px;
}
.whois-avatar-hero-img {
  width: 160px;
  height: 200px;
  object-fit: contain;
  border-radius: 24px;
  border: 4px solid var(--brand-gold);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 4px 18px rgba(197, 160, 89, 0.3), 0 0 40px rgba(255, 45, 149, 0.18);
  margin-top: 10px;
  margin-bottom: 8px;
  transition: transform 0.22s cubic-bezier(.43,2.2,.19,.98);
}
.whois-avatar-hero-img:hover {
  transform: scale(1.06) rotate(-3deg);
  box-shadow: 0 8px 36px rgba(197, 160, 89, 0.45), 0 0 60px rgba(255, 45, 149, 0.3);
}
.whois-avatar-caption {
  font-size: 1em;
  color: var(--text-light);
  font-weight: bold;
  margin-top: 8px;
  text-shadow: 0 1.5px 6px rgba(0, 0, 0, 0.4);
}
.whois-punchline-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 13px;
  padding: 0;
  gap: 9px;
}
.whois-star { font-size: 1.5em; color: var(--brand-gold-light); filter: drop-shadow(0 0 8px rgba(197, 160, 89, 0.6)); }
.whois-punchline {
  font-size: 1.13em;
  font-weight: 700;
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 10px 20px;
  border-radius: 11px;
  box-shadow: 0 2px 16px rgba(34, 197, 94, 0.1);
  letter-spacing: -.2px;
  text-align: justify;
}
.whois-punchline a {
  color: #bbf7d0;
  text-decoration: underline;
}
@media (max-width: 950px) {
  .whois-modal { align-items: flex-start; overflow: auto; }
  .whois-content {
    width: 92vw;
    max-width: 98vw;
    min-height: 90vh;
    margin: 4vw auto 4vw auto;
    border-radius: 18px;
    padding: 5vw 4vw 6vw 4vw;
    box-sizing: border-box;
    overflow-y: auto;
    max-height: 97vh;
    -webkit-overflow-scrolling: touch;
  }
  .whois-row.whois-big-avatar {
    flex-direction: row !important;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
  }
  .whois-story-col {
    width: 55%;
    min-width: 120px;
    padding-right: 10px;
    text-align: left;
  }
  .whois-avatar-col {
    width: 45%;
    min-width: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
    text-align: center;
  }
  .whois-avatar-hero-img {
    width: 45vw;
    max-width: 120px;
    min-width: 100px;
    height: auto;
    margin: 0 auto 6px auto;
    object-fit: contain;
  }
  .whois-avatar-caption { font-size: 0.97em; margin-bottom: 6px; margin-top: 2px; }
  .whois-main-story,
  .whois-secondary-story { font-size: 0.86em; word-break: break-word; }
  .whois-header-row { font-size: 1.04em; }
  .whois-title { font-size: 1.11em; }
  .whois-highlight-tip { font-size: 0.92em; padding: 8px 10px; margin: 10px 0 2px 0; }
  .whois-punchline-row { font-size: 0.97em; margin-top: 3vw; gap: 7px; }
  .whois-punchline { padding: 7px 9px; font-size: 1em; }
}
/* DESKTOP: Start Game and Leaderboard in a balanced row */
@media (min-width: 701px) {
  .intro-btn-row {
    justify-content: flex-start;
    gap: 12px;
    margin-top: 20px !important;
  }

  .intro-btn-row #startBtn {
    width: 190px !important;
    min-width: 0 !important;
    max-width: 190px !important;
    font-size: 1.2rem !important;
    padding: 11px 18px !important;
    font-weight: 800 !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 14px rgba(197, 160, 89, 0.35), var(--glow-gold) !important;
  }

  .intro-btn-row #leaderboardIntroBtn {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    font-size: 1rem !important;
    padding: 11px 14px !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    gap: 8px !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35) !important;
  }

  .intro-btn-row #leaderboardIntroBtn .icon,
  .intro-btn-row #leaderboardIntroBtn .text {
    flex-shrink: 0;
  }
}

/* ==== Accessibility: focus-visible rings ==== */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--neon-cyan) !important;
  outline-offset: 2px !important;
}

/* ==== JS-injected overlays (fullscreen prompt, screenshot tip) ==== */
.fullscreen-prompt {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh; height: 100dvh;
  background: rgba(10, 6, 24, 0.9);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  text-align: center;
  font-size: 1.15em;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
.fullscreen-prompt-icon { font-size: 2.6em; }
.fullscreen-prompt-btn {
  margin-top: 28px;
  font-size: 1.2em;
  padding: 14px 36px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--brand-gold-light), var(--brand-gold));
  color: #241407;
  font-weight: 800;
  border: none;
  box-shadow: 0 4px 20px rgba(197, 160, 89, 0.4);
  cursor: pointer;
}

.screenshot-tip {
  margin: 2vw auto;
  color: var(--brand-gold-light);
  font-size: 4vw;
  font-weight: 600;
}
