@property --aura-core {
  syntax: "<color>";
  inherits: true;
  initial-value: rgba(255, 45, 73, 0.14);
}

@property --aura-mid {
  syntax: "<color>";
  inherits: true;
  initial-value: rgba(8, 8, 11, 0.56);
}

@property --aura-tint {
  syntax: "<color>";
  inherits: true;
  initial-value: rgba(255, 45, 73, 0.03);
}

:root {
  color-scheme: dark;
  --bg: #08080b;
  --surface: rgba(255, 255, 255, 0.032);
  --surface-strong: rgba(255, 255, 255, 0.068);
  --border: rgba(255, 255, 255, 0.075);
  --text: #f5f5f7;
  --muted: #8b8d99;
  --accent: #ff2d49;
  --accent-soft: rgba(255, 45, 73, 0.11);
  --accent-glow: rgba(255, 45, 73, 0.34);
  --bump: #ff7a8f;
  --tier-accent: #ff2d49;
  --aura-core: rgba(255, 45, 73, 0.14);
  --aura-mid: rgba(8, 8, 11, 0.56);
  --aura-tint: rgba(255, 45, 73, 0.03);
  --font-sans: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

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

html,
body {
  height: 100dvh;
  margin: 0;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  padding-bottom: env(safe-area-inset-bottom);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus,
a:focus,
button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Smooth GPU-interpolated Dario wallpaper + atmospheric tier aura */
.dario-wallpaper {
  position: fixed;
  inset: -260px;
  pointer-events: none;
  z-index: 0;
  background-image: url("/assets/dario-tile.webp");
  background-size: 240px 240px;
  background-repeat: repeat;
  opacity: 0.11;
  filter: contrast(1.06) brightness(0.95);
  /* Constant animation-duration prevents wallpaper jumping across tier changes */
  animation: dario-drift 48s linear infinite;
  transition: opacity 1400ms cubic-bezier(0.22, 1, 0.36, 1), filter 1400ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}

.dario-wallpaper.is-hit {
  opacity: 0.25;
  filter: contrast(1.22) brightness(1.12) drop-shadow(0 0 12px rgba(255, 45, 73, 0.4));
  transition: opacity 80ms ease, filter 80ms ease;
}

@keyframes dario-drift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(240px, 240px, 0);
  }
}

.ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 42%, var(--aura-core) 0%, var(--aura-mid) 45%, rgba(7, 7, 10, 0.92) 90%),
    radial-gradient(circle at 22% 24%, var(--aura-tint) 0%, transparent 55%),
    linear-gradient(to bottom, rgba(8, 8, 11, 0.72), transparent 22%, transparent 78%, rgba(8, 8, 11, 0.88));
  transition:
    --aura-core 1400ms cubic-bezier(0.22, 1, 0.36, 1),
    --aura-mid 1400ms cubic-bezier(0.22, 1, 0.36, 1),
    --aura-tint 1400ms cubic-bezier(0.22, 1, 0.36, 1),
    --tier-accent 900ms ease;
}

/* Smooth cumulative milestone background themes (0 / 10 / 50 / 200 / 500 / 1000 / 5000+) */
body[data-tier="crimson"] {
  --tier-accent: #ff4d67;
  --aura-core: rgba(255, 45, 73, 0.24);
  --aura-mid: rgba(22, 7, 12, 0.62);
  --aura-tint: rgba(255, 45, 73, 0.09);
}
body[data-tier="crimson"] .dario-wallpaper {
  opacity: 0.14;
  filter: sepia(0.24) hue-rotate(312deg) saturate(1.35) contrast(1.12);
}

body[data-tier="ember"] {
  --tier-accent: #fb923c;
  --aura-core: rgba(251, 146, 60, 0.24);
  --aura-mid: rgba(24, 10, 8, 0.66);
  --aura-tint: rgba(255, 45, 73, 0.14);
}
body[data-tier="ember"] .dario-wallpaper {
  opacity: 0.15;
  filter: sepia(0.45) hue-rotate(340deg) saturate(1.55) contrast(1.15);
}

body[data-tier="rift"] {
  --tier-accent: #c084fc;
  --aura-core: rgba(168, 85, 247, 0.24);
  --aura-mid: rgba(14, 8, 24, 0.68);
  --aura-tint: rgba(56, 189, 248, 0.14);
}
body[data-tier="rift"] .dario-wallpaper {
  opacity: 0.16;
  filter: sepia(0.42) hue-rotate(235deg) saturate(1.8) contrast(1.17);
}

body[data-tier="solar"] {
  --tier-accent: #fbbf24;
  --aura-core: rgba(251, 191, 36, 0.24);
  --aura-mid: rgba(20, 12, 6, 0.68);
  --aura-tint: rgba(255, 45, 73, 0.16);
}
body[data-tier="solar"] .dario-wallpaper {
  opacity: 0.17;
  filter: sepia(0.6) hue-rotate(8deg) saturate(1.85) contrast(1.2);
}

body[data-tier="astral"] {
  --tier-accent: #fde047;
  --aura-core: rgba(253, 224, 71, 0.24);
  --aura-mid: rgba(24, 9, 22, 0.7);
  --aura-tint: rgba(168, 85, 247, 0.18);
}
body[data-tier="astral"] .dario-wallpaper {
  opacity: 0.19;
  filter: sepia(0.55) hue-rotate(290deg) saturate(2.0) contrast(1.24);
}

body[data-tier="singularity"] {
  --tier-accent: #ffffff;
  --aura-core: rgba(255, 255, 255, 0.22);
  --aura-mid: rgba(16, 10, 30, 0.72);
  --aura-tint: rgba(56, 189, 248, 0.2);
}
body[data-tier="singularity"] .dario-wallpaper {
  opacity: 0.21;
  filter: sepia(0.5) hue-rotate(195deg) saturate(2.15) contrast(1.28);
}

.vfx-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 25;
}

.pop-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
}

.pop-delta {
  position: fixed;
  left: 0;
  top: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(20, 10, 14, 0.92);
  border: 1px solid rgba(255, 92, 117, 0.48);
  color: var(--bump);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  pointer-events: none;
  animation: pop-delta-rise 1350ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pop-delta-rise {
  0% {
    opacity: 0;
    transform: translate(-15%, 4px) scale(0.75);
  }
  18% {
    opacity: 1;
    transform: translate(0, -4px) scale(1.06);
  }
  72% {
    opacity: 1;
    transform: translate(2px, -14px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(4px, -22px) scale(0.92);
  }
}

/* Inconspicuous upper-left corner skin tone selector */
.tone-corner {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 30;
  opacity: 0.42;
  transition: opacity 180ms ease;
}

.tone-corner:hover,
.tone-corner:focus-within {
  opacity: 0.96;
}

.tone-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(14, 14, 19, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.tone-btn {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: var(--font-emoji);
  font-size: 15px;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  touch-action: manipulation;
  filter: grayscale(0.45);
  transition: transform 120ms ease, background 120ms ease, filter 120ms ease;
  -webkit-tap-highlight-color: transparent;
}

.tone-btn:hover {
  transform: scale(1.14);
  filter: grayscale(0);
  background: rgba(255, 255, 255, 0.08);
}

.tone-btn[aria-pressed="true"] {
  filter: grayscale(0);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

/* Upper-right controls: Global Language Toggle + Personal Counter */
.top-right-controls {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lang-switcher {
  position: relative;
}

.lang-toggle,
.personal-badge {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(14, 14, 20, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 150ms ease, background 150ms ease, transform 120ms ease;
}

.lang-toggle {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(245, 245, 247, 0.86);
}

.lang-globe-icon {
  opacity: 0.78;
  flex-shrink: 0;
}

.lang-caret {
  font-size: 0.62rem;
  opacity: 0.65;
  transition: transform 180ms ease;
}

.lang-toggle[aria-expanded="true"] .lang-caret {
  transform: rotate(180deg);
}

.lang-toggle[aria-expanded="true"] {
  border-color: var(--tier-accent);
  background: rgba(24, 22, 30, 0.94);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 172px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(13, 13, 19, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px) scale(0.96);
  transform-origin: top right;
  transition:
    opacity 160ms ease,
    transform 190ms cubic-bezier(0.16, 1, 0.3, 1),
    visibility 160ms ease;
}

.lang-menu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.lang-option {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: rgba(245, 245, 247, 0.8);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, transform 90ms ease;
}

.lang-option:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.lang-option:active {
  transform: scale(0.98);
}

.lang-option.is-active {
  background: rgba(255, 45, 73, 0.16);
  color: #ffffff;
  font-weight: 700;
}

.lang-option-code {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(245, 245, 247, 0.42);
}

.lang-option.is-active .lang-option-code {
  color: #ff7a8f;
}

.lang-toggle:hover,
.personal-badge:hover {
  border-color: var(--tier-accent);
  background: rgba(24, 22, 30, 0.9);
  transform: translateY(-1px);
}

.lang-toggle:active,
.personal-badge:active {
  transform: scale(0.96);
}

.personal-tier-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tier-accent);
  box-shadow: 0 0 10px var(--tier-accent);
  flex-shrink: 0;
  transition: background 900ms ease, box-shadow 900ms ease;
}

.personal-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.personal-count {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
}

.personal-share-icon {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Single-screen centered stage + impact shake on release */
.stage {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 28px 14px;
}

.stage.is-shake-sm {
  animation: stage-shake-sm 180ms ease-out;
}
.stage.is-shake-md {
  animation: stage-shake-md 260ms ease-out;
}
.stage.is-shake-lg {
  animation: stage-shake-lg 360ms ease-out;
}

@keyframes stage-shake-sm {
  0%, 100% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(-2px, 2px, 0); }
  50% { transform: translate3d(2px, -1px, 0); }
  75% { transform: translate3d(-1px, -1px, 0); }
}

@keyframes stage-shake-md {
  0%, 100% { transform: translate3d(0, 0, 0); }
  20% { transform: translate3d(-4px, 3px, 0); }
  45% { transform: translate3d(4px, -3px, 0); }
  70% { transform: translate3d(-3px, 2px, 0); }
}

@keyframes stage-shake-lg {
  0%, 100% { transform: translate3d(0, 0, 0); }
  15% { transform: translate3d(-7px, 5px, 0); }
  30% { transform: translate3d(7px, -5px, 0); }
  45% { transform: translate3d(-5px, -4px, 0); }
  65% { transform: translate3d(5px, 3px, 0); }
  85% { transform: translate3d(-2px, 2px, 0); }
}

.hero {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.5vh, 16px);
  padding-bottom: 10px;
  text-align: center;
}

.hero-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.hero-title {
  margin: 0;
  font-size: clamp(2.4rem, 6.2vw, 4.4rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.96;
  color: var(--text);
}

.title-dario {
  color: var(--accent);
  text-shadow: 0 0 38px rgba(255, 45, 73, 0.42);
}

.hero-subtitle {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.finger-zone {
  position: relative;
  display: grid;
  place-items: center;
}

.hold-hud {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(14, 14, 20, 0.92);
  border: 1px solid var(--hud-color, var(--accent));
  color: var(--hud-color, var(--text));
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
  pointer-events: none;
  z-index: 12;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.65);
}

.finger-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 12px;
  cursor: pointer;
  border-radius: 50%;
  position: relative;
  touch-action: manipulation;
  transition: transform 110ms cubic-bezier(0.22, 1, 0.36, 1);
  -webkit-tap-highlight-color: transparent;
}

.finger-btn::before {
  content: "";
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 68%);
  opacity: 0.42;
  transition: opacity 150ms ease, transform 150ms ease;
  pointer-events: none;
}

.finger-btn:hover {
  transform: scale(1.05) rotate(-2deg);
}

.finger-btn:hover::before {
  opacity: 0.72;
  transform: scale(1.08);
}

.finger-btn.is-firing {
  animation: finger-recoil 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.finger-btn.is-holding {
  transform: scale(0.92) rotate(var(--tilt, 3deg));
}

.finger-btn.is-holding::before,
.finger-btn.is-firing::before {
  opacity: 1;
  transform: scale(1.26);
}

@keyframes finger-recoil {
  0% {
    transform: scale(1) rotate(0deg);
  }
  30% {
    transform: scale(0.87) rotate(var(--tilt, 4deg));
  }
  70% {
    transform: scale(1.04) rotate(calc(var(--tilt, 4deg) * -0.4));
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

.fuck-cta:focus-visible,
.tone-btn:focus-visible,
.lang-toggle:focus-visible,
.lang-option:focus-visible,
.personal-badge:focus-visible,
.leaderboard-close:focus-visible,
.region-all-btn:focus-visible,
.leaderboard-row:focus-visible,
.share-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.24);
}

.finger-emoji {
  display: block;
  font-family: var(--font-emoji);
  font-size: clamp(5.8rem, 19vmin, 10.5rem);
  line-height: 1;
  filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.72));
}

.fuck-cta {
  appearance: none;
  border: 1px solid rgba(255, 45, 73, 0.56);
  background: linear-gradient(135deg, #ff3350 0%, #cf112a 100%);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  padding: 12px 36px;
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow:
    0 12px 34px rgba(255, 45, 73, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 100ms ease, box-shadow 150ms ease, filter 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.fuck-cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.07);
  box-shadow:
    0 16px 38px rgba(255, 45, 73, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.fuck-cta:active,
.fuck-cta.is-firing,
.fuck-cta.is-holding {
  transform: translateY(2px) scale(0.96);
}

/* Stats bar */
.stats-bar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.032);
  border: 1px solid rgba(255, 255, 255, 0.075);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  max-width: 100%;
}

.stat-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.stat-sep {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.1);
}

.stat-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.num-slot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

number-flow {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  --number-flow-char-height: 1.05em;
  transition: color 650ms ease, text-shadow 650ms ease;
}

number-flow.is-bumped {
  color: var(--bump) !important;
  text-shadow: 0 0 14px rgba(255, 122, 143, 0.45);
  transition: color 80ms ease, text-shadow 80ms ease;
}

.stat-value {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
}

.country-flag {
  font-family: var(--font-emoji);
  font-size: 1.04rem;
}

.country-name {
  font-weight: 500;
  color: rgba(245, 245, 247, 0.86);
}

.country-count {
  font-size: 0.98rem;
  font-weight: 700;
  color: #ff5c72;
}

/* Architectural Swiss-grid bottom scoreboard */
.region-dock {
  flex-shrink: 0;
  width: 100%;
  min-width: 0;
  max-width: 1160px;
  margin: 0 auto;
  padding-top: 6px;
}

.region-dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 8px;
}

.region-dock-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245, 245, 247, 0.46);
}

.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(255, 45, 73, 0.75);
}

.region-all-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(245, 245, 247, 0.62);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  touch-action: manipulation;
  transition: color 140ms ease, background 140ms ease;
}

.region-all-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.region-matrix-frame {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  background: rgba(255, 255, 255, 0.075);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.region-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
}

.region-cell {
  appearance: none;
  position: relative;
  margin: 0;
  padding: 11px 12px;
  border: 0;
  background: rgba(11, 11, 16, 0.9);
  color: var(--text);
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 150ms ease, box-shadow 150ms ease;
}

.region-cell:hover {
  background: rgba(24, 24, 32, 0.94);
}

.region-cell:focus-visible,
.region-outside-bar:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.36);
}

.region-cell.is-you {
  z-index: 1;
  background: linear-gradient(135deg, rgba(64, 15, 25, 0.96) 0%, rgba(28, 10, 16, 0.96) 100%);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 58, 86, 0.92),
    inset 0 1px 0 rgba(255, 165, 178, 0.24),
    0 0 22px rgba(255, 45, 73, 0.22);
}

.region-cell.is-you:hover {
  background: linear-gradient(135deg, rgba(78, 18, 30, 0.98) 0%, rgba(34, 12, 19, 0.98) 100%);
}

.region-cell.is-bumped {
  background: rgba(32, 15, 21, 0.96);
}

.region-cell.is-you.is-bumped {
  background: linear-gradient(135deg, rgba(96, 22, 36, 0.98) 0%, rgba(42, 14, 22, 0.98) 100%);
}

.region-cell-left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.region-cell-rank {
  font-size: 0.65rem;
  color: rgba(245, 245, 247, 0.34);
  flex-shrink: 0;
}

.region-cell-flag {
  font-family: var(--font-emoji);
  font-size: 0.98rem;
  line-height: 1;
  flex-shrink: 0;
}

.region-cell-name {
  font-size: 0.76rem;
  font-weight: 500;
  color: rgba(245, 245, 247, 0.8);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.region-cell-code {
  display: none;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(245, 245, 247, 0.82);
}

.region-you-pill[hidden] {
  display: none;
}

.region-you-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 45, 73, 0.94);
  color: #ffffff;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.1;
  text-transform: uppercase;
  box-shadow: 0 2px 10px rgba(255, 45, 73, 0.42);
  flex-shrink: 0;
}

.region-you-pill::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.92);
}

.region-cell.is-you .region-cell-rank {
  color: rgba(255, 138, 154, 0.95);
  font-weight: 700;
}

.region-cell.is-you .region-cell-name,
.region-cell.is-you .region-cell-code {
  color: #ffffff;
  font-weight: 700;
}

.region-cell-count {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

.region-cell.is-you .region-cell-count,
.region-outside-bar .region-cell-count {
  color: #fff2f4;
}

.region-outside-bar[hidden] {
  display: none;
}

.region-outside-bar {
  appearance: none;
  position: relative;
  width: 100%;
  margin: 0;
  padding: 10px 14px;
  border: 0;
  border-radius: 0 0 13px 13px;
  border-top: 1px solid rgba(255, 58, 86, 0.34);
  background: linear-gradient(90deg, rgba(64, 15, 25, 0.96) 0%, rgba(28, 10, 16, 0.96) 55%, rgba(64, 15, 25, 0.92) 100%);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 58, 86, 0.85),
    inset 0 1px 0 rgba(255, 165, 178, 0.22);
  color: var(--text);
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 150ms ease, box-shadow 150ms ease;
}

.region-outside-bar:hover {
  background: linear-gradient(90deg, rgba(78, 18, 30, 0.98) 0%, rgba(34, 12, 19, 0.98) 55%, rgba(78, 18, 30, 0.96) 100%);
}

.region-outside-bar.is-bumped {
  background: linear-gradient(90deg, rgba(96, 22, 36, 0.98) 0%, rgba(44, 15, 24, 0.98) 100%);
}

.region-outside-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.region-outside-bar .region-cell-rank {
  color: rgba(255, 138, 154, 0.95);
  font-weight: 700;
}

.region-outside-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.region-outside-sub {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255, 194, 203, 0.8);
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px dashed rgba(255, 122, 143, 0.36);
  background: rgba(255, 45, 73, 0.08);
  white-space: nowrap;
  flex-shrink: 0;
}

@media (min-width: 921px) {
  .region-strip > .region-cell:nth-child(1) {
    border-top-left-radius: 13px;
  }

  .region-strip > .region-cell:nth-child(5) {
    border-top-right-radius: 13px;
  }

  .region-matrix-frame:has(.region-outside-bar[hidden]) .region-strip > .region-cell:nth-child(6) {
    border-bottom-left-radius: 13px;
  }

  .region-matrix-frame:has(.region-outside-bar[hidden]) .region-strip > .region-cell:nth-child(10) {
    border-bottom-right-radius: 13px;
  }
}

/* Smooth Slide-over Rankings drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 38;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 240ms ease, visibility 240ms ease;
}

.drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.leaderboard-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 90vw);
  z-index: 40;
  display: flex;
  flex-direction: column;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  background: rgba(12, 12, 17, 0.94);
  border-left: 1px solid var(--border);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  transform: translateX(105%);
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.leaderboard-panel.is-open {
  transform: translateX(0);
}

.leaderboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.leaderboard-header h2 {
  margin: 0 0 2px;
  font-size: 1.05rem;
  font-weight: 700;
}

.leaderboard-sub {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.leaderboard-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.country-total-badge {
  font-size: 0.72rem;
  color: var(--muted);
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.leaderboard-close {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.8rem;
  cursor: pointer;
}

.leaderboard-close:hover {
  color: var(--text);
  background: var(--surface-strong);
}

.route-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid rgba(255, 45, 73, 0.35);
  font-size: 0.74rem;
  flex-shrink: 0;
}

.route-banner-clear {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.route-banner-clear:hover {
  text-decoration: underline;
}

.leaderboard-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}

.leaderboard-list::-webkit-scrollbar {
  width: 4px;
}

.leaderboard-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.leaderboard-row {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 10px 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
  transition: border-color 140ms ease, background 140ms ease;
}

.leaderboard-row:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

.leaderboard-row.is-you {
  border-color: rgba(255, 45, 73, 0.45);
  background: rgba(255, 45, 73, 0.08);
}

.leaderboard-row.is-selected {
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.row-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), #ff7a8a);
  opacity: 0.78;
  pointer-events: none;
  z-index: 0;
  transition: width 240ms ease;
}

.row-rank,
.row-country,
.row-count-wrap {
  position: relative;
  z-index: 1;
}

.row-rank {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.row-country {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.row-flag {
  font-family: var(--font-emoji);
  font-size: 1.05rem;
  flex-shrink: 0;
}

.row-name {
  font-weight: 600;
  font-size: 0.83rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.you-tag {
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
  border: 1px solid rgba(255, 45, 73, 0.45);
  border-radius: 999px;
  padding: 1px 5px;
  flex-shrink: 0;
}

.row-count-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.row-count {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text);
}

.leaderboard-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  border-radius: 10px;
  border: 1px dashed var(--border);
}

/* Smooth animated Share Card Modal */
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.share-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.share-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.share-dialog {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(14, 14, 20, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.75);
  transform: translateY(18px) scale(0.95);
  opacity: 0;
  transition:
    transform 280ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 220ms ease;
}

.share-modal.is-open .share-dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.share-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.share-dialog-head h2 {
  margin: 0 0 2px;
  font-size: 1.05rem;
  font-weight: 700;
}

.share-tier-sub {
  margin: 0;
  font-size: 0.74rem;
  color: var(--muted);
}

.share-preview-wrap {
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #08080c;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.share-canvas {
  display: block;
  width: 100%;
  max-height: 54dvh;
  object-fit: contain;
}

.share-actions {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
}

.share-btn {
  appearance: none;
  border-radius: 12px;
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    transform 110ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 140ms ease,
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.share-btn:active {
  transform: translateY(1px) scale(0.96);
}

.share-btn.is-confirmed {
  border-color: rgba(52, 211, 153, 0.72) !important;
  background: rgba(16, 185, 129, 0.2) !important;
  color: #ecfdf5 !important;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.26);
}

.share-btn-primary {
  border: 1px solid rgba(255, 45, 73, 0.55);
  background: linear-gradient(135deg, #ff3350 0%, #cf112a 100%);
  color: #ffffff;
}

.share-btn-secondary {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.share-btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: var(--muted);
}

.share-btn:hover {
  filter: brightness(1.08);
}

.share-feedback-slot {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-feedback {
  margin: 0;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1.3;
  text-align: center;
  border: 1px solid transparent;
  background: transparent;
  opacity: 0;
  transform: translateY(4px) scale(0.97);
  transition: opacity 180ms ease, transform 200ms cubic-bezier(0.22, 1, 0.36, 1), background 180ms ease, border-color 180ms ease;
}

.share-feedback.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.share-feedback.is-success {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(52, 211, 153, 0.32);
}

.share-feedback.is-error {
  color: #fda4af;
  background: rgba(255, 45, 73, 0.14);
  border-color: rgba(255, 45, 73, 0.36);
}

@media (max-width: 920px) {
  .region-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .region-strip > .region-cell:nth-child(1) {
    border-top-left-radius: 13px;
  }

  .region-strip > .region-cell:nth-child(2) {
    border-top-right-radius: 13px;
  }

  .region-matrix-frame:has(.region-outside-bar[hidden]) .region-strip > .region-cell:nth-child(9) {
    border-bottom-left-radius: 13px;
  }

  .region-matrix-frame:has(.region-outside-bar[hidden]) .region-strip > .region-cell:nth-child(10) {
    border-bottom-right-radius: 13px;
  }
}

@media (max-width: 640px) {
  .tone-corner {
    top: 12px;
    left: 12px;
  }

  .top-right-controls {
    top: 12px;
    right: 12px;
    gap: 6px;
  }

  .lang-toggle,
  .personal-badge {
    height: 34px;
    padding: 0 9px;
    gap: 5px;
    font-size: 0.72rem;
  }

  .stage {
    padding: 46px 12px 10px;
  }

  .hero-title {
    font-size: clamp(2.05rem, 10.5vw, 3rem);
  }

  .hero-subtitle {
    font-size: 0.64rem;
    letter-spacing: 0.12em;
  }

  .finger-emoji {
    font-size: clamp(4.9rem, 23vmin, 8.2rem);
  }

  .fuck-cta {
    padding: 11px 30px;
    font-size: 0.85rem;
  }

  .stats-bar {
    gap: 8px;
    padding: 8px 14px;
    border-radius: 14px;
  }

  .stat-item {
    font-size: 0.78rem;
    gap: 6px;
  }

  .stat-sep {
    display: none;
  }

  .region-dock-head {
    padding: 0 2px 6px;
  }

  .region-matrix-frame {
    width: 100%;
    max-width: 100%;
  }

  .region-cell {
    padding: 8px 10px;
    gap: 6px;
  }

  .region-cell-left {
    gap: 5px;
  }

  .region-you-pill {
    padding: 1.5px 5px;
    font-size: 0.52rem;
  }

  .region-cell-name {
    display: none;
  }

  .region-cell-code {
    display: inline;
  }

  .region-outside-bar {
    padding: 8px 10px;
    gap: 6px;
  }

  .region-outside-sub {
    padding: 1.5px 5px;
    font-size: 0.58rem;
  }

  .corner-contact {
    justify-content: center;
    text-align: center;
    padding: 7px 2px 0;
    gap: 4px 8px;
    font-size: 0.62rem;
  }

  .leaderboard-panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: min(74dvh, 560px);
    border-left: 0;
    border-top: 1px solid var(--border);
    border-radius: 20px 20px 0 0;
    transform: translateY(105%);
  }

  .leaderboard-panel.is-open {
    transform: translateY(0);
  }

  .share-actions {
    grid-template-columns: 1fr 1fr;
  }

  .share-btn-ghost {
    grid-column: span 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dario-wallpaper {
    animation: none;
  }
}

.corner-contact {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 8px 2px 0;
  font-size: 0.68rem;
  line-height: 1.3;
  color: rgba(245, 245, 247, 0.42);
}

.corner-contact-links {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.67rem;
}

.corner-contact-link {
  color: rgba(245, 245, 247, 0.68);
  text-decoration: none;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.corner-contact-link:hover {
  color: #ffffff;
  background: rgba(255, 45, 73, 0.14);
  border-color: rgba(255, 45, 73, 0.45);
}

.corner-contact-dot {
  opacity: 0.38;
}
