:root {
  --void: #0b0704;
  --dirt: #1a120c;
  --blood: #6b1210;
  --fresh: #c81f1f;
  --bone: #e6d3b8;
  --cream: #c4b08a;
  --gold: #d45a1a;
  --rust: #8a3a18;
  --wood: #3a2416;
  --sick: #5c6b32;
  --stripe-a: #4a1410;
  --stripe-b: #c9b48a;
  --font-creep: Creepster, cursive;
  font-size: 16px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--void);
  color: var(--bone);
  font-family: var(--font-creep);
  letter-spacing: 0.04em;
  line-height: 1.35;
  overflow-x: hidden;
}

body {
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

.stripes,
.bigtop,
.grain,
.vignette {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
}

.stripes {
  background:
    repeating-linear-gradient(
      90deg,
      var(--stripe-a) 0 22px,
      #2a120e 22px 24px,
      var(--stripe-b) 24px 46px,
      #1a0e08 46px 48px
    );
  opacity: 0.08;
  filter: contrast(1.2) saturate(0.6);
}

.grain {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.15  0 0 0 0 0.08  0 0 0 0 0.04  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.22;
  mix-blend-mode: overlay;
}

.vignette {
  background:
    radial-gradient(ellipse at 50% 40%, transparent 30%, #000 92%),
    linear-gradient(#000, transparent 18%, transparent 82%, #000);
}

.bigtop {
  overflow: hidden;
}

.bigtop-canopy {
  position: absolute;
  left: 50%;
  top: -42vmax;
  width: 118vmax;
  height: 118vmax;
  margin-left: -59vmax;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    #4a100e 0deg 8deg,
    #140604 8deg 9.5deg,
    #7a1c14 9.5deg 17.5deg,
    #080302 17.5deg 19deg,
    #2a0c0a 19deg 27deg,
    #0c0504 27deg 28.5deg
  );
  opacity: 0.2;
  filter: saturate(0.65) contrast(1.2);
  transform-origin: 50% 50%;
  animation: tent-spin 84s linear infinite;
  mask-image: radial-gradient(
    circle at 50% 50%,
    #000 0 34%,
    rgba(0, 0, 0, 0.55) 46%,
    transparent 58%
  );
  -webkit-mask-image: radial-gradient(
    circle at 50% 50%,
    #000 0 34%,
    rgba(0, 0, 0, 0.55) 46%,
    transparent 58%
  );
}

.bigtop-canopy.inner {
  top: -28vmax;
  width: 78vmax;
  height: 78vmax;
  margin-left: -39vmax;
  opacity: 0.12;
  animation-duration: 120s;
  animation-direction: reverse;
  filter: saturate(0.5) contrast(1.3) blur(0.4px);
  mask-image: radial-gradient(circle at 50% 50%, #000 0 28%, transparent 52%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0 28%, transparent 52%);
}

@keyframes tent-spin {
  to {
    transform: rotate(360deg);
  }
}

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

.topbar,
main,
.foot {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem 0.7rem;
  background: linear-gradient(#2a1a10, #140c08);
  border-bottom: 6px solid #1a0c08;
  box-shadow: 0 8px 0 #0a0503;
}

.brand {
  margin: 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.82rem;
  color: var(--cream);
  text-align: center;
}

button {
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font-creep);
}

.ghost {
  background: #1a100c;
  border: 1px solid var(--rust);
  color: var(--bone);
  font-family: var(--font-creep);
  font-size: 0.85rem;
  padding: 0.4rem 0.55rem;
  border-radius: 3px;
}

.screen {
  display: none;
  padding: 1.1rem 1.05rem 2.5rem;
  max-width: 520px;
  margin: 0 auto;
}

.screen.active {
  display: block;
  animation: flicker-in 0.5s ease;
}

@keyframes flicker-in {
  0% {
    opacity: 0;
    filter: contrast(2) saturate(0.2);
  }
  35% {
    opacity: 0.35;
  }
  100% {
    opacity: 1;
    filter: none;
  }
}

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

.wordmark-wrap {
  position: relative;
  z-index: 2;
  width: min(92vw, 420px);
  margin: 0 auto 0.15rem;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border: 0;
}

.wordmark {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  background: transparent;
  border: 0;
}

.poster-frame {
  position: relative;
  z-index: 2;
  isolation: isolate;
  width: min(92vw, 420px);
  margin: 0 auto;
  padding: 8px;
  background: #2a1a12;
  box-shadow:
    0 0 0 2px #5a3a22,
    0 18px 40px rgba(0, 0, 0, 0.7);
  transform: rotate(-0.6deg);
}

.hero {
  display: block;
  width: 100%;
  background: #000;
  filter: contrast(1.08) saturate(1.05);
}

.tagline,
.location,
.copy,
.status,
.scoreline,
.hud,
.foot {
  text-align: center;
}

.tagline {
  font-size: 1.08rem;
  margin: 0.85rem 0 0.2rem;
}

.location {
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-actions,
.game-grid {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.25rem;
}

.btn {
  font-family: var(--font-creep);
  font-size: 1.15rem;
  padding: 0.95rem 1rem;
  border-radius: 3px;
  border: 2px solid var(--rust);
  background: #24140e;
  color: var(--bone);
  width: 100%;
  box-shadow: 3px 3px 0 #050302;
}

.btn.primary {
  background: #9a1814;
  border-color: #e07030;
  color: #fff8ee;
}

.btn.roast {
  font-family: var(--font-creep);
  font-size: clamp(0.92rem, 3.6vw, 1.08rem);
  line-height: 1.28;
  letter-spacing: 0.02em;
  background:
    linear-gradient(180deg, #5a2414 0%, #3a1810 48%, #24100a 100%);
  border-color: #c81f1f;
  color: #fff4e4;
  text-shadow: 1px 2px 0 #000;
  box-shadow:
    3px 3px 0 #050302,
    inset 0 1px 0 rgba(232, 192, 112, 0.18);
  margin: 0.75rem auto 0;
  max-width: 420px;
  display: block;
}

.btn.roast:active {
  filter: brightness(1.08);
}

.bucko-speech {
  margin: 0.7rem auto 0;
  max-width: 420px;
  padding: 0.72rem 0.9rem 0.8rem;
  background: #160e0a;
  border: 2px solid var(--rust);
  color: var(--bone);
  text-align: center;
  font-size: 1.02rem;
  line-height: 1.45;
  min-height: 3.2em;
  box-shadow: 3px 3px 0 #050302;
  transform: rotate(0.35deg);
}

.bucko-speech::before {
  content: "BUCKO SAYS";
  display: block;
  font-family: var(--font-creep);
  font-size: 0.68rem;
  color: var(--gold);
  letter-spacing: 0.14em;
  margin-bottom: 0.3rem;
}

#games .btn.roast {
  margin: 0.55rem auto 0.85rem;
}

#games .bucko-speech {
  margin-top: 0.15rem;
  transform: none;
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #050302;
}

h2 {
  font-family: var(--font-creep);
  font-size: clamp(1.55rem, 7vw, 2.15rem);
  text-align: center;
  color: var(--fresh);
  margin: 0.15rem 0 0.7rem;
  text-shadow: 2px 3px 0 #000;
  letter-spacing: 0.02em;
}

.copy {
  line-height: 1.55;
  font-size: 1rem;
}

.meet-pic {
  width: 86%;
  max-width: 340px;
  display: block;
  margin: 0 auto 1rem;
  border: 8px solid #2a1a12;
  outline: 2px solid var(--rust);
  background: #000;
  transform: rotate(0.8deg);
}

.game-card {
  text-align: left;
  padding: 0.95rem 1rem;
  border: 2px solid #6a3a20;
  background:
    linear-gradient(180deg, rgba(90, 20, 16, 0.35), transparent 40%),
    #1e120c;
  color: var(--bone);
  font-family: var(--font-creep);
  border-radius: 2px;
  box-shadow: 4px 5px 0 #050302;
  clip-path: polygon(0 8px, 8px 0, 100% 0, 100% 92%, 96% 100%, 0 100%);
}

.game-card strong {
  display: block;
  font-family: var(--font-creep);
  font-size: 1.12rem;
  color: #f0d8b0;
}

.game-card em {
  display: block;
  font-style: normal;
  opacity: 0.78;
  margin-top: 0.28rem;
  font-size: 0.88rem;
}

.game-icon {
  font-size: 1.25rem;
  color: var(--gold);
}

.status {
  min-height: 2.5em;
  margin: 0 0 0.75rem;
}

.scoreline,
.hud {
  display: flex;
  justify-content: space-around;
  gap: 0.5rem;
  margin: 0.75rem 0;
  font-size: 0.88rem;
  color: var(--gold);
}

.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  aspect-ratio: 1;
  max-width: 360px;
  margin: 0 auto;
  padding: 8px;
  background: #2a1c12;
  box-shadow: inset 0 0 20px #000;
}

.ttt-cell {
  background: #120a07;
  border: 2px solid #6a3a1c;
  font-family: var(--font-creep);
  font-size: clamp(2.4rem, 12vw, 3.4rem);
  color: var(--cream);
  display: grid;
  place-items: center;
}

.ttt-cell.o {
  color: var(--fresh);
}

.ttt-cell.win {
  background: #3a1010;
  box-shadow: inset 0 0 18px var(--fresh);
}

.chk-wrap {
  overflow: hidden;
  border: 8px solid #2a1a10;
  outline: 2px solid var(--rust);
  max-width: 420px;
  margin: 0 auto 1rem;
}

.chk-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  aspect-ratio: 1;
}

.chk-sq {
  display: grid;
  place-items: center;
  position: relative;
}

.chk-sq.dark {
  background: #3a2014;
}

.chk-sq.light {
  background: #cbb48c;
}

.chk-sq.valid {
  outline: 3px solid var(--sick);
  outline-offset: -3px;
}

.chk-sq.selected {
  outline: 3px solid var(--gold);
  outline-offset: -3px;
}

.piece {
  position: relative;
  width: 72%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid #111;
}

.piece.red {
  background: radial-gradient(circle at 35% 30%, #e85c20, #8a1010);
}

.piece.black {
  background: radial-gradient(circle at 35% 30%, #6a4a32, #0a0a0a);
}

.piece.king::after {
  content: "☠";
  position: absolute;
  font-size: 0.65rem;
  color: var(--gold);
}

.alley {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 8px;
  padding: 14px 10px 16px;
  background:
    radial-gradient(ellipse at 50% 35%, #24100c, #050202 72%);
  border: 8px solid #24160e;
  box-shadow: inset 0 24px 36px rgba(0, 0, 0, 0.55);
  margin-bottom: 1rem;
}

.hole {
  position: relative;
  aspect-ratio: 3 / 4;
  min-height: 156px;
  background: #000;
  border-radius: 16px 16px 48% 48%;
  border: 3px solid #4a2218;
  box-shadow:
    inset 0 22px 28px rgba(0, 0, 0, 0.88),
    0 2px 0 #140a06;
  overflow: hidden;
}

.hole::after {
  content: "";
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: -4px;
  height: 16px;
  background: linear-gradient(#2a1610, #140a08);
  border-radius: 0 0 48% 48%;
  z-index: 2;
  pointer-events: none;
  box-shadow: 0 -8px 10px rgba(0, 0, 0, 0.45);
}

.clown-target {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 12px 12px 8px 8px;
  background: #000;
  overflow: hidden;
  transform: translateY(112%);
  transition: transform 0.28s cubic-bezier(0.18, 1.25, 0.32, 1);
}

.clown-target img {
  display: block;
  width: 128%;
  height: 128%;
  margin-left: -14%;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
  user-select: none;
}

.clown-target.up {
  transform: translateY(5%);
}

.clown-target.hit {
  filter: grayscale(1) brightness(0.35) sepia(0.35);
  transform: translateY(112%);
}

.balloon-wall {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  min-height: 240px;
  margin-bottom: 1rem;
}

.balloon {
  aspect-ratio: 0.78;
  border: 0;
  border-radius: 50% 50% 46% 46%;
  background: radial-gradient(circle at 30% 25%, #ffb3b3, #9a1010);
  box-shadow: inset -8px -10px 0 rgba(0, 0, 0, 0.2);
  position: relative;
}

.balloon.bite {
  background: radial-gradient(circle at 30% 25%, #444, #090909);
}

.balloon.popped {
  visibility: hidden;
}

.balloon::after {
  content: "";
  position: absolute;
  left: 46%;
  bottom: -10px;
  width: 2px;
  height: 14px;
  background: #cbb48c;
}

.striker {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.striker-tower {
  width: 64px;
  height: 280px;
  background: repeating-linear-gradient(#2a1a10 0 18px, #1a100c 18px 20px);
  border: 4px solid #5a3a20;
  position: relative;
  overflow: hidden;
}

.striker-fill {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 0;
  background: linear-gradient(#e8c070, #c81f1f);
  transition: height 0.12s linear;
}

.striker-bell {
  position: absolute;
  top: 4px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 1.4rem;
}

.wheel-wrap {
  position: relative;
  width: min(82vw, 340px);
  margin: 0.2rem auto 1rem;
}

.wheel-pointer {
  text-align: center;
  color: #e8c070;
  font-size: 1.8rem;
  line-height: 0.6;
  position: relative;
  z-index: 3;
  text-shadow: 0 0 10px #c81f1f;
}

.wheel {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: block;
  background: #120808;
  border: 10px solid #1a0c08;
  transform-origin: 50% 50%;
  box-shadow:
    0 0 0 4px #5a1010,
    0 0 0 7px #2a0a08,
    0 18px 36px #000,
    inset 0 0 40px rgba(80, 0, 0, 0.45);
  transition: transform 3.4s cubic-bezier(0.12, 0.72, 0.08, 1);
}

.wheel-hub {
  position: absolute;
  left: 50%;
  top: calc(50% + 10px);
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #5a1510, #120404);
  border: 3px solid #e8c070;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  z-index: 2;
  box-shadow: 0 0 16px #c81f1f;
  pointer-events: none;
}

.wheel-label {
  font-family: var(--font-creep);
  letter-spacing: 0.02em;
}

.ring-alley {
  position: relative;
  height: 340px;
  margin: 0.4rem 0 1rem;
  touch-action: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(90, 20, 16, 0.35), transparent 50%),
    linear-gradient(#1a100c, #070403);
  border: 8px solid #2a1a10;
  box-shadow: inset 0 -18px 0 #24160e;
}

.bottles {
  display: flex;
  justify-content: space-around;
  align-items: end;
  height: 190px;
  padding: 18px 10px 0;
  pointer-events: none;
}

.bottle {
  width: 58px;
  height: 140px;
  border: 0;
  padding: 0;
  background: linear-gradient(90deg, #1a3324, #3a6b4a 40%, #0c1a12);
  clip-path: polygon(32% 0, 68% 0, 84% 16%, 84% 100%, 16% 100%, 16% 16%);
  box-shadow: inset 8px 0 0 rgba(255, 255, 255, 0.1);
  position: relative;
}

.bottle::before {
  content: "";
  position: absolute;
  left: 28%;
  right: 28%;
  top: -8px;
  height: 14px;
  background: #2a4a32;
  border-radius: 4px 4px 0 0;
}

.bottle.ringed::after {
  content: "";
  position: absolute;
  top: 10%;
  left: 6%;
  right: 6%;
  height: 16px;
  border: 5px solid #c9a227;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px #5a3a10;
}

.swipe-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100px;
  margin: 0;
  font-size: 0.78rem;
  color: #e8c070;
  text-align: center;
  pointer-events: none;
  letter-spacing: 0.06em;
}

.ring-stash {
  position: absolute;
  left: 12px;
  bottom: 14px;
  display: flex;
  gap: 6px;
  pointer-events: none;
}

.ring-stash span {
  width: 28px;
  height: 28px;
  border: 5px solid #a07820;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px #3a2408;
}

.throw-ring {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 76px;
  height: 76px;
  margin-left: -38px;
  border-radius: 50%;
  border: 12px solid #d4a017;
  box-shadow:
    inset 0 0 0 5px #5c3a0c,
    0 6px 0 #3a2408,
    0 10px 16px rgba(0, 0, 0, 0.55);
  background: radial-gradient(circle, transparent 48%, rgba(212, 160, 23, 0.15) 49%, transparent 52%);
  z-index: 4;
  pointer-events: none;
}

.throw-ring.held {
  border-color: #f0d060;
  box-shadow:
    inset 0 0 0 5px #5c3a0c,
    0 0 18px rgba(232, 92, 32, 0.55);
}

.throw-ring.flying {
  transition: left 0.55s cubic-bezier(0.2, 0.8, 0.2, 1), top 0.55s cubic-bezier(0.15, 0.9, 0.4, 1);
}

.foot {
  padding: 0.8rem 1rem 1.4rem;
  font-size: 0.7rem;
  opacity: 0.55;
}
