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

:root {
  --bg: #0d2e2a;
  --bg2: #0a2420;
  --mint: #50e3c2;
  --white: #f0f0f0;
  --dim: rgba(255, 255, 255, 0.08);
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: "Fredoka", sans-serif;
  color: var(--white);
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ctext y='24' font-size='24'%3E🐾%3C/text%3E%3C/svg%3E")
      8 8,
    auto;
}

/* ── PAGES ── */
.page {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 90px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  transform: translateY(20px);
  overflow: hidden;
}
.page.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* ── HERO (PÜRR page) ── */
.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  z-index: 2;
  position: relative;
}

.glitch-title {
  font-size: clamp(5rem, 18vw, 14rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--white);
  text-shadow: 0 0 40px rgba(80, 227, 194, 0.3);
  position: relative;
  animation: titleBob 3s ease-in-out infinite;
}
.glitch-title::before,
.glitch-title::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}
.glitch-title::before {
  color: #ff6b6b;
  clip-path: polygon(0 0, 100% 0, 100% 38%, 0 38%);
  transform: translate(-3px, 0);
  animation: glitch1 4s infinite steps(1);
}
.glitch-title::after {
  color: var(--mint);
  clip-path: polygon(0 62%, 100% 62%, 100% 100%, 0 100%);
  transform: translate(3px, 0);
  animation: glitch2 4s infinite steps(1);
}

@keyframes glitch1 {
  0%,
  90%,
  100% {
    transform: translate(0);
    opacity: 0;
  }
  91% {
    transform: translate(-4px, 1px);
    opacity: 1;
  }
  93% {
    transform: translate(3px, -1px);
    opacity: 1;
  }
  95% {
    transform: translate(-2px);
    opacity: 0;
  }
}
@keyframes glitch2 {
  0%,
  88%,
  100% {
    transform: translate(0);
    opacity: 0;
  }
  89% {
    transform: translate(4px, -1px);
    opacity: 1;
  }
  92% {
    transform: translate(-3px);
    opacity: 1;
  }
  94% {
    transform: translate(0);
    opacity: 0;
  }
}
@keyframes titleBob {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-12px) rotate(1deg);
  }
}

.on-text {
  font-size: 1.4rem;
  color: rgba(255, 255, 255, 0.5);
  font-family: "Caveat", cursive;
  letter-spacing: 0.2em;
}
.chain-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 2rem;
  font-weight: 600;
  color: var(--mint);
}

/* cat on title stack */
.title-cat-stack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cat-on-title {
  width: clamp(180px, 32vw, 420px);
  position: relative;
  z-index: 3;
  margin-bottom: clamp(-120px, -13vw, -32px);
  filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.5));
  animation: none; /* static — always flush with letters */
  /*
   * Shift right so cat sits above the RR (right 30% of title width).
   * Title width = clamp(80px,18vw,224px) → 30% = clamp(24px,5.4vw,67px)
   */
  transform: translateX(clamp(24px, 5.4vw, 67px));
}
/* title stays perfectly still */
.drunk-title {
  animation: none !important;
  transform: none !important;
}

/* floating bg letters */
.floating-letters {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.fl {
  position: absolute;
  font-family: "Caveat", cursive;
  font-size: clamp(0.9rem, 2vw, 1.4rem);
  color: rgba(80, 227, 194, 0.12);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  animation: floatDrift 6s ease-in-out infinite;
}
@keyframes floatDrift {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-18px);
  }
}

/* ── DRUNK BUBBLES ── */
.drunk-bubbles {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 3;
}
.dbbl {
  position: absolute;
  bottom: 0;
  left: var(--x);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 35%,
    rgba(255, 255, 255, 0.55),
    rgba(80, 227, 194, 0.2)
  );
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(2px);
  animation: drunkFloat var(--dur) ease-in infinite var(--delay);
  opacity: 0;
}
@keyframes drunkFloat {
  0% {
    opacity: 0;
    transform: translateY(0) translateX(0) scale(0.6);
  }
  10% {
    opacity: 0.85;
  }
  30% {
    transform: translateY(-60px) translateX(12px) scale(1);
  }
  55% {
    transform: translateY(-120px) translateX(-10px) scale(0.9);
  }
  75% {
    transform: translateY(-180px) translateX(8px) scale(0.75);
  }
  90% {
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    transform: translateY(-240px) translateX(-6px) scale(0.5);
  }
}

/* ── GLOBAL BACKGROUND BUBBLES ── */
.bg-bubbles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-bbl {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 35%,
    rgba(255, 255, 255, 0.22),
    rgba(80, 227, 194, 0.07)
  );
  border: 1px solid rgba(80, 227, 194, 0.18);
  opacity: 0;
  animation: bgFloat var(--dur, 7s) ease-in-out infinite var(--delay, 0s);
}
@keyframes bgFloat {
  0% {
    opacity: 0;
    transform: translateY(0) translateX(0) scale(0.6);
  }
  10% {
    opacity: 0.45;
  }
  30% {
    transform: translateY(-22vh) translateX(var(--drift, 12px)) scale(1);
  }
  60% {
    transform: translateY(-52vh) translateX(calc(var(--drift, 12px) * -0.7))
      scale(0.85);
    opacity: 0.35;
  }
  88% {
    opacity: 0;
  }
  100% {
    opacity: 0;
    transform: translateY(-82vh) translateX(0) scale(0.5);
  }
}

/* drunk sway override — replaces the default titleBob */
.drunk-title {
  animation: drunkSway 2.4s ease-in-out infinite !important;
  transform-origin: center bottom;
}
@keyframes drunkSway {
  0% {
    transform: translateY(0) rotate(-2deg) skewX(0deg);
  }
  20% {
    transform: translateY(-8px) rotate(3deg) skewX(1deg);
  }
  40% {
    transform: translateY(-14px) rotate(-1deg) skewX(-1deg);
  }
  60% {
    transform: translateY(-6px) rotate(4deg) skewX(0.5deg);
  }
  80% {
    transform: translateY(-10px) rotate(-3deg) skewX(-1deg);
  }
  100% {
    transform: translateY(0) rotate(-2deg) skewX(0deg);
  }
}

/* ── ABOUT ── */
.section-title {
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 2rem;
  text-shadow: 0 0 30px rgba(80, 227, 194, 0.2);
}
.about-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(80, 227, 194, 0.15);
  border-radius: 16px;
  padding: 2rem 3rem;
  max-width: min(680px, 88vw);
  text-align: center;
  backdrop-filter: blur(6px);
  animation: boxShake 8s ease-in-out infinite;
}
@keyframes boxShake {
  0%,
  95%,
  100% {
    transform: rotate(0);
  }
  96% {
    transform: rotate(0.4deg);
  }
  97% {
    transform: rotate(-0.3deg);
  }
  98% {
    transform: rotate(0.2deg);
  }
}
.about-text {
  font-family: "Caveat", cursive;
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  line-height: 1.5;
  color: var(--white);
}
.floating-q span {
  position: absolute;
  color: rgba(255, 255, 255, 0.25);
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  animation: floatQ 4s ease-in-out infinite;
}
@keyframes floatQ {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-14px) scale(1.1);
  }
}
/* cat corners */
.cat-corner {
  position: absolute;
  bottom: 80px;
}
.cat-left {
  left: -20px;
}
.cat-right {
  right: -20px;
}
.cat-corner-img {
  width: clamp(120px, 16vw, 200px);
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
  animation: peekUp 4s ease-in-out infinite;
}
.cat-corner-img.flip {
  transform: scaleX(-1);
}
.cat-corner-img.flip:hover {
  transform: scaleX(-1) scale(1.05);
}
.cat-corner-img:hover {
  transform: scale(1.05);
}
@keyframes peekUp {
  0%,
  100% {
    transform: translateY(30px);
  }
  50% {
    transform: translateY(0);
  }
}
.cat-corner-img.flip {
  animation: peekUpFlip 4s ease-in-out infinite;
}
@keyframes peekUpFlip {
  0%,
  100% {
    transform: scaleX(-1) translateY(30px);
  }
  50% {
    transform: scaleX(-1) translateY(0);
  }
}

/* ── MEMES ── */
.memes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: min(600px, 88vw);
  width: 100%;
  margin-bottom: 1.5rem;
}
.meme-item {
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.meme-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* meme 3 (mirror) — shift to top so speech bubble is fully visible */
.meme-item:nth-child(3) img {
  object-position: top center;
}
.meme-item:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.memes-sub {
  font-family: "Caveat", cursive;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.1em;
}

/* ── MEME LIGHTBOX ── */
.meme-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 24px;
}
.meme-modal.open {
  opacity: 1;
  pointer-events: all;
}
.meme-modal-img {
  max-width: min(90vw, 560px);
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  transform: scale(0.88);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  object-fit: contain;
}
.meme-modal.open .meme-modal-img {
  transform: scale(1);
}
.meme-modal-close {
  position: absolute;
  top: 18px;
  right: 22px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.15s;
}
.meme-modal-close:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.1) rotate(90deg);
}

/* ── BUY ── */
.buy-vertical {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0;
  margin-bottom: 1.8rem;
  width: 100%;
}

/* inner anchor: sizes to the step-list width; cat is absolute relative to it */
.buy-center-wrap {
  position: relative;
  overflow: visible;
}

.buy-steps-v {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2;
}

.buy-step-v {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid rgba(80, 227, 194, 0.45);
  border-radius: 0 12px 12px 0;
  padding: 0.65rem 1.4rem 0.65rem 1rem;
  min-width: clamp(130px, 38vw, 300px);
  backdrop-filter: blur(6px);
  font-family: "Caveat", cursive;
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  color: var(--white);
  transition: transform 0.15s, border-left-color 0.15s;
}
.buy-step-v:hover {
  transform: translateX(4px);
  border-left-color: var(--mint);
}
.profit-step {
  border-left-color: rgba(255, 107, 107, 0.7) !important;
  color: var(--mint);
  font-weight: 700;
  font-size: clamp(1.3rem, 2.8vw, 1.7rem) !important;
  letter-spacing: 0.05em;
  animation: profitPulse 2s ease-in-out infinite;
}
@keyframes profitPulse {
  0%,
  100% {
    text-shadow: none;
  }
  50% {
    text-shadow: 0 0 16px rgba(80, 227, 194, 0.6);
  }
}
.step-v-num {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.95em;
  min-width: 1.6rem;
}
.step-v-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
}
.step-v-text a {
  color: var(--mint);
  text-decoration: none;
}
.step-v-text a:hover {
  text-decoration: underline;
}

.cat-drunk-buy {
  position: absolute;
  bottom: 0;
  /*
   * left: 100% = starts at the right edge of .buy-center-wrap (= steps right edge).
   * Negative margin-left pulls the cat left to overlap the steps border.
   * purrdrunk.png has 22.4% transparent on left side, so visible cat
   * left edge = cat image left + 22.4%. The overlap into the steps is small (~14px).
   */
  left: 100%;
  margin-left: clamp(-95px, -10.2vw, -45px);
  width: clamp(140px, 32vw, 360px);
  animation: none; /* static — no movement */
  z-index: 3; /* render above step cards */
}
@keyframes drunkStagger {
  0% {
    transform: rotate(-4deg) translateY(0) translateX(0);
  }
  15% {
    transform: rotate(3deg) translateY(-8px) translateX(6px);
  }
  30% {
    transform: rotate(-2deg) translateY(-4px) translateX(-4px);
  }
  50% {
    transform: rotate(5deg) translateY(-12px) translateX(8px);
  }
  65% {
    transform: rotate(-3deg) translateY(-6px) translateX(-6px);
  }
  80% {
    transform: rotate(2deg) translateY(-10px) translateX(4px);
  }
  100% {
    transform: rotate(-4deg) translateY(0) translateX(0);
  }
}

.buy-btn {
  display: inline-block;
  padding: 0.9rem 3rem;
  background: var(--mint);
  color: var(--bg);
  font-family: "Fredoka", sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  border-radius: 999px;
  text-decoration: none;
  letter-spacing: 0.1em;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 0 30px rgba(80, 227, 194, 0.3);
}
.buy-btn:hover {
  transform: scale(1.05) rotate(-1deg);
  box-shadow: 0 0 50px rgba(80, 227, 194, 0.5);
}

/* ── BOTTOM NAV ── */
/* ── SOCIAL HEADER ── */
.social-header {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 8px 12px;
  z-index: 200;
}
.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.social-btn:hover {
  background: rgba(255, 255, 255, 0.13);
  color: var(--mint);
  transform: scale(1.12);
}

.bottom-nav {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 8px 12px;
  z-index: 100;
}
.nav-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-family: "Fredoka", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 0.5rem 1.4rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.nav-btn:hover {
  color: var(--white);
}
.nav-btn.active {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
}

/* ══════════════════════════════════════════
   GAME SECTION
══════════════════════════════════════════ */

/* game screens — only one visible at a time inside the .page */
.game-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  gap: 1rem;
  animation: fadeSlideUp 0.3s ease;
  position: relative; /* allows get-ready-overlay to position inside */
}
.game-screen.active {
  display: flex;
}

/* ── GET READY bridge overlay ────────────────────────────
   Eliminates the 4-second frozen-lobby gap between countdown
   end and round_start arriving from the server.
   Activated by the local pre-round timer in game.js,
   dismissed immediately when round_start fires.
──────────────────────────────────────────────────────── */
.get-ready-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  background: rgba(13, 46, 42, 0.92);
  backdrop-filter: blur(4px);
  border-radius: 4px;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.get-ready-overlay.visible {
  opacity: 1;
  pointer-events: all;
}
.get-ready-txt {
  font-family: "Fredoka", sans-serif;
  font-size: clamp(2.2rem, 7vw, 3.5rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--mint);
  animation: grPulse 0.7s ease-in-out infinite;
}
@keyframes grPulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(0.95);
  }
}

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

/* shared text styles */
.game-desc {
  font-family: "Caveat", cursive;
  font-size: clamp(1.3rem, 3.5vw, 2rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
}
.game-note {
  font-family: "Caveat", cursive;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.08em;
}
.connect-error {
  font-family: "Caveat", cursive;
  font-size: 1.1rem;
  color: #ff6b6b;
  display: none;
  margin-top: -0.2rem;
}

/* ── GAME CONNECT — launch layout ── */
#game-screen-connect {
  gap: 0.4rem;
  justify-content: center;
  padding-top: 0;
}
#game-screen-connect .section-title {
  margin-bottom: 0;
  font-size: clamp(2.8rem, 10vw, 6rem);
}
.game-launch-row {
  display: flex;
  align-items: center;
  gap: clamp(0.4rem, 2vw, 1.2rem);
  width: 100%;
  max-width: 760px;
  flex-wrap: nowrap;
}
.table-launch-img {
  width: 56%;
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 8px 40px rgba(0, 0, 0, 0.6));
  margin-right: clamp(3.5rem, 15vw, 10rem);
}
.game-launch-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 0.5rem;
  flex: 1 1 0;
  min-width: 0;
}
.game-launch-text .game-desc {
  font-size: clamp(0.9rem, 2.6vw, 1.7rem);
  line-height: 1.55;
}
.game-launch-text .game-note {
  font-size: clamp(0.65rem, 1.4vw, 0.95rem);
}

/* ── SPINNER ── */
.spinner {
  width: 52px;
  height: 52px;
  border: 4px solid rgba(80, 227, 194, 0.2);
  border-top-color: var(--mint);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.game-verifying-txt {
  font-family: "Caveat", cursive;
  font-size: 1.4rem;
  color: rgba(255, 255, 255, 0.6);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* ── LOBBY ── */
.lobby-wallet-txt {
  font-family: "Caveat", cursive;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.35);
}
.lobby-wallet-txt span {
  color: var(--mint);
}
.lobby-count-wrap {
  width: min(320px, 80vw);
}
.lobby-count-num {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.lobby-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}
.lobby-bar-fill {
  height: 100%;
  background: var(--mint);
  border-radius: 999px;
  width: 0%;
  transition: width 0.5s ease;
  box-shadow: 0 0 12px rgba(80, 227, 194, 0.5);
}
.lobby-status-txt {
  font-family: "Caveat", cursive;
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ── ROUND ── */
.round-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}
.round-label {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--mint);
}
.round-alive {
  font-family: "Caveat", cursive;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.45);
}
.round-instruction {
  font-family: "Caveat", cursive;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.5rem;
}

/* timer circle */
.timer-wrap {
  margin: 0.5rem 0;
}
.timer-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid rgba(80, 227, 194, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 20px rgba(80, 227, 194, 0.15);
}
.timer-num {
  font-size: 2rem;
  font-weight: 700;
  transition: color 0.3s;
}

/* ── TABLE UI (spinning bottle table) ── */
.table-wrap {
  position: relative;
  width: min(420px, 90vw);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7);
  flex-shrink: 0;
}
.table-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
  /* spin animation targets the image, so invisible click zones stay aligned */
  transform-origin: center center;
}

/* spin animations */
@keyframes tableSpin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes tableSpinStop {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(120deg);
  } /* partial turn for "slowing down" feel */
}
.table-wrap.spinning .table-img {
  animation: tableSpin 1s linear infinite;
}
.table-wrap.spin-stop .table-img {
  animation: tableSpinStop 0.7s ease-out forwards;
}

/* 4 invisible quadrant buttons */
.table-btn {
  position: absolute;
  width: 50%;
  height: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.18s;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.table-tl {
  top: 0;
  left: 0;
}
.table-tr {
  top: 0;
  right: 0;
}
.table-bl {
  bottom: 0;
  left: 0;
}
.table-br {
  bottom: 0;
  right: 0;
}

.table-btn:hover:not(.locked) {
  background: rgba(255, 255, 255, 0.14);
}
/* chosen: tinted overlay matching quadrant colour */
.table-btn.chosen[data-color="yellow"] {
  background: rgba(245, 208, 32, 0.35);
}
.table-btn.chosen[data-color="red"] {
  background: rgba(180, 30, 30, 0.35);
}
.table-btn.chosen[data-color="green"] {
  background: rgba(20, 160, 120, 0.35);
}
.table-btn.chosen[data-color="blue"] {
  background: rgba(200, 200, 160, 0.25);
}
/* checkmark on chosen quadrant */
.table-btn.chosen::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}
.table-btn.locked:not(.chosen) {
  cursor: not-allowed;
  background: rgba(0, 0, 0, 0.12);
}

/* ── ROUND RESULTS ── */
.results-tally {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, 90vw);
}
.tally-row {
  display: grid;
  grid-template-columns: 9rem 1fr 3.5rem auto;
  align-items: center;
  gap: 8px;
  padding: 0.5rem 0.8rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  font-size: 0.95rem;
}
.tally-row.tally-winner {
  border-color: rgba(80, 227, 194, 0.4);
  background: rgba(80, 227, 194, 0.07);
}
.tally-emoji {
  font-size: 1.2rem;
}
.tally-label {
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}
.tally-bar-wrap {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  height: 7px;
  overflow: hidden;
}
.tally-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s ease;
}
.tally-pct {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  text-align: right;
}
.tally-pct small {
  font-size: 0.7rem;
}
.tally-crown {
  font-family: "Caveat", cursive;
  font-size: 0.85rem;
  color: var(--mint);
  white-space: nowrap;
}
/* ── SIM MODE NOTICE ─────────────────────────────────────── */
.sim-notice {
  font-family: "Caveat", cursive;
  font-size: 1.05rem;
  color: rgba(245, 208, 32, 0.75);
  background: rgba(245, 208, 32, 0.06);
  border: 1px solid rgba(245, 208, 32, 0.2);
  border-radius: 12px;
  padding: 0.45rem 1.1rem;
  text-align: center;
  max-width: min(440px, 90vw);
  line-height: 1.45;
  margin-top: 0.5rem;
}

/* ── HOW TO PLAY ─────────────────────────────────────────── */
.howto-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.45);
  font-family: "Fredoka", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.3rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  margin-top: 0.2rem;
  transition: border-color 0.2s, color 0.2s;
}
.howto-btn:hover {
  border-color: var(--mint);
  color: var(--mint);
}

.howto-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.howto-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.howto-card {
  background: rgba(8, 30, 26, 0.97);
  border: 1px solid rgba(80, 227, 194, 0.25);
  border-radius: 20px;
  padding: 2rem 2rem 1.6rem;
  max-width: 430px;
  width: 90vw;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.howto-close {
  position: absolute;
  top: 0.9rem;
  right: 1.1rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  font-size: 1.3rem;
  cursor: pointer;
  transition: color 0.2s;
  font-family: "Fredoka", sans-serif;
  line-height: 1;
}
.howto-close:hover {
  color: var(--white);
}

.howto-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--mint);
  letter-spacing: 0.06em;
}
.howto-rounds {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.howto-round-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.3;
}
.howto-badge {
  background: rgba(80, 227, 194, 0.1);
  border: 1px solid rgba(80, 227, 194, 0.3);
  border-radius: 7px;
  padding: 0.15rem 0.55rem;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--mint);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.05rem;
}
.howto-rule {
  color: rgba(255, 255, 255, 0.8);
}

.howto-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  margin: 0;
}

.howto-tip {
  font-family: "Caveat", cursive;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.4;
}

.results-survivors {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--mint);
  margin-top: 0.25rem;
}

/* ── ELIMINATED ── */
.elim-cat {
  margin-bottom: 0.5rem;
  animation: sadBob 2s ease-in-out infinite;
}
@keyframes sadBob {
  0%,
  100% {
    transform: rotate(-3deg);
  }
  50% {
    transform: rotate(3deg) translateY(-6px);
  }
}

/* ── GAME OVER ── */
.gameover-title {
  font-size: clamp(3rem, 12vw, 8rem) !important;
  animation: titleBob 2s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════════
   MOBILE  (≤ 640px) — desktop styles above are untouched
═══════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* ── Bottom nav: 5 buttons in 375px ── */
  .bottom-nav {
    padding: 6px 6px;
    gap: 1px;
    bottom: 14px;
  }
  .nav-btn {
    padding: 0.38rem 0.6rem;
    font-size: 0.78rem;
    letter-spacing: 0.03em;
  }

  /* ── Social header ── */
  .social-header {
    top: 12px;
    right: 12px;
    padding: 6px 10px;
  }
  .social-btn {
    width: 30px;
    height: 30px;
  }

  /* ── Pages: allow scroll if content overflows ── */
  .page {
    overflow-y: auto;
    justify-content: flex-start;
    padding-top: 4.5rem;
    padding-bottom: 80px;
  }

  /* ── PÜRR hero: keep centered ── */
  #purr {
    justify-content: center;
    padding-top: 0;
  }

  /* ── ABOUT ── */
  #about {
    justify-content: center;
    padding-top: 0;
  }

  /* ── MEMES ── */
  #memes {
    justify-content: flex-start;
    padding-top: 3.5rem;
  }

  /* ── BUY ── */
  #buy {
    justify-content: flex-start;
    padding-top: 3rem;
  }
  .cat-drunk-buy {
    width: clamp(100px, 24vw, 160px);
  }

  /* ── GAME connect: stack vertically ── */
  #game-screen-connect {
    padding: 0 1rem;
    gap: 0.5rem;
  }
  #game-screen-connect .section-title {
    font-size: clamp(2.4rem, 12vw, 4rem);
  }
  .game-launch-row {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  .game-launch-text {
    align-items: center;
    text-align: center;
  }
  .game-launch-text .game-desc {
    font-size: clamp(0.95rem, 4vw, 1.3rem);
  }
  .game-launch-text .game-note {
    font-size: clamp(0.75rem, 2.8vw, 0.9rem);
  }
  .table-launch-img {
    width: 68%;
    margin-right: 0;
  }

  /* ── GAME round: table & text ── */
  .table-wrap {
    width: min(290px, 84vw);
  }
  .round-instruction {
    font-size: clamp(0.85rem, 3.5vw, 1.1rem);
    padding: 0 0.5rem;
    text-align: center;
  }

  /* ── GAME results ── */
  .results-tally {
    width: 92vw;
  }
  .tally-emoji {
    font-size: 1.1rem;
  }
  .tally-label {
    font-size: 0.85rem;
  }
  .tally-pct {
    font-size: 0.8rem;
  }
}

/* ── SCANLINES overlay ── */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.04) 2px,
    rgba(0, 0, 0, 0.04) 4px
  );
  pointer-events: none;
  z-index: 999;
}
