/* ============================================================
   SUPER BASS BONANZA - arcade.css
   Retro 8-bit arcade skin: deep space blue, arcade red, pixel
   yellow and cyan. Square corners, stepped pixel corners made
   with clip-path, hard pixel drop shadows, CRT glow on the
   game screen. Shared by every page (layout, header, wheel,
   game, footer). Page-specific blocks live in pages.css.
   ============================================================ */

:root {
  --bg: #0d0b2b;
  --bg-2: #17144a;
  --bg-3: #221d63;
  --bg-4: #2c2580;
  --night: #05041a;
  --red: #ff3d57;
  --red-dark: #c4223b;
  --yellow: #ffe156;
  --cyan: #2de2e6;
  --green: #3ddc6e;
  --magenta: #ff4fd8;
  --white: #ffffff;
  --muted: #a5a3d6;
  --ink: #0d0b2b;

  --font-pixel: 'Press Start 2P', 'Noto Sans Bengali', ui-monospace, 'Courier New', monospace;
  --font-body: 'Chakra Petch', 'Noto Sans Bengali', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

  /* stepped "pixel" corners: two 4px steps */
  --px-clip: polygon(
    0 8px, 4px 8px, 4px 4px, 8px 4px, 8px 0,
    calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, 100% 8px,
    100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px), calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%,
    8px 100%, 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 0 calc(100% - 8px)
  );
  /* smaller single-step corners for chips and buttons */
  --px-clip-sm: polygon(
    0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px,
    100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%,
    4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px)
  );
}

/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--white);
  background: var(--bg);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}
main { flex: 1; position: relative; z-index: 1; }
img { max-width: 100%; }
ul { list-style: none; }

a { color: var(--cyan); text-decoration: none; transition: color .15s, background-color .15s; }
a:link, a:visited, a:hover, a:active, a:focus { text-decoration: none; }
a:hover { color: var(--yellow); }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--font-pixel); font-weight: 400; line-height: 1.5; letter-spacing: 0; }

.skip-link {
  position: absolute; left: 12px; top: -80px; z-index: 900;
  padding: 10px 14px; background: var(--yellow); color: var(--ink);
  font-weight: 700;
}
.skip-link:focus { top: 12px; color: var(--ink); }

/* ── STAR FIELD BACKGROUND (dots only) ────────────────────── */
.page-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(circle, rgba(255,255,255,.55) 1px, transparent 1.6px) 0 0 / 97px 89px,
    radial-gradient(circle, rgba(45,226,230,.55) 1px, transparent 1.6px) 40px 60px / 131px 113px,
    radial-gradient(circle, rgba(255,225,86,.5) 1.2px, transparent 1.8px) 70px 20px / 173px 157px,
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(255,61,87,.12), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

/* ── PIXEL BOX TOOLKIT ────────────────────────────────────────
   A pixel box paints its fill on ::before and its hard shadow on
   ::after, both cut with the stepped clip-path. Set --fill,
   --shade and --sh (shadow offset) on the element.            */
.pixel-btn,
.age-badge,
.crt-bezel,
.wheel-box,
.wheel-pointer {
  position: relative;
  isolation: isolate;
}
.pixel-btn::before, .pixel-btn::after,
.age-badge::before, .age-badge::after,
.crt-bezel::before, .crt-bezel::after,
.wheel-box::before, .wheel-box::after {
  content: '';
  position: absolute;
  inset: 0;
  clip-path: var(--clip, var(--px-clip));
  pointer-events: none;
}
.pixel-btn::before, .age-badge::before, .crt-bezel::before, .wheel-box::before {
  background: var(--fill, var(--bg-2));
  z-index: -1;
}
.pixel-btn::after, .age-badge::after, .crt-bezel::after, .wheel-box::after {
  background: var(--shade, var(--night));
  transform: translate(var(--sh, 5px), var(--sh, 5px));
  z-index: -2;
}

/* ── CHUNKY PIXEL BUTTONS ─────────────────────────────────── */
.pixel-btn {
  --fill: var(--red);
  --shade: var(--night);
  --sh: 5px;
  --clip: var(--px-clip-sm);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-pixel);
  font-size: .78rem;
  line-height: 1.5;
  color: var(--white);
  background: none;
  border: 0;
  padding: 16px 26px;
  cursor: pointer;
  text-align: center;
  transition: transform .08s;
}
.pixel-btn:hover { --fill: #ff5c72; color: var(--white); }
.pixel-btn:active { transform: translate(3px, 3px); --sh: 2px; }
.pixel-btn:disabled { opacity: .5; cursor: default; transform: translate(3px, 3px); --sh: 2px; }
.btn-yellow { --fill: var(--yellow); color: var(--ink); }
.btn-yellow:hover { --fill: #fff08f; color: var(--ink); }
.btn-cyan { --fill: var(--cyan); color: var(--ink); }
.btn-cyan:hover { --fill: #7ff0f2; color: var(--ink); }
.btn-small { font-size: .6rem; padding: 12px 16px; }

/* ── HEADER (arcade marquee) ──────────────────────────────── */
.marquee {
  position: sticky; top: 0; z-index: 100;
  background: var(--red);
  box-shadow: 0 6px 0 var(--night);
}
.marquee-inner {
  max-width: 1180px; margin: 0 auto;
  min-height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--yellow);
  font-family: var(--font-pixel);
  font-size: clamp(.62rem, 1.6vw, .86rem);
  line-height: 1.5;
  text-shadow: 3px 3px 0 var(--ink);
  min-width: 0;
}
.brand:hover { color: var(--white); }
.brand-icon {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; flex-shrink: 0;
  background: var(--ink);
  font-size: 1.15rem;
  text-shadow: none;
  clip-path: var(--px-clip-sm);
}

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav > a {
  font-weight: 700; font-size: .9rem;
  color: var(--white);
  padding: 7px 11px;
}
.main-nav > a:hover,
.main-nav > a[aria-current="page"] { background: var(--ink); color: var(--yellow); }

#lang-switcher { position: relative; margin-left: 6px; }
#lang-btn {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-body); font-weight: 700; font-size: .88rem;
  color: var(--white); background: var(--ink);
  border: 0; padding: 8px 12px; cursor: pointer;
  box-shadow: 3px 3px 0 var(--night);
}
#lang-btn:hover { color: var(--yellow); }
#lang-btn .arrow { font-size: .7rem; transition: transform .15s; }
#lang-btn.open .arrow { transform: rotate(180deg); }
#lang-dropdown {
  display: none;
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 200;
  min-width: 176px; padding: 6px;
  background: var(--bg-2);
  box-shadow: 5px 5px 0 var(--night);
}
#lang-dropdown.open { display: grid; gap: 2px; }
.lang-option {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 12px;
  font: 600 .92rem var(--font-body);
  color: var(--white); background: transparent;
  border: 0; cursor: pointer; text-align: left;
}
.lang-option:hover { background: var(--bg-4); color: var(--cyan); }
.lang-option.active { background: var(--yellow); color: var(--ink); }
.lang-flag { font-size: 1.1rem; }

/* ══════════════════════════════════════════════════════════
   WELCOME WHEEL OVERLAY
══════════════════════════════════════════════════════════ */
#wheel-overlay {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(5,4,26,.9);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .3s, visibility .3s;
  overflow-y: auto;
}
#wheel-overlay.show { opacity: 1; visibility: visible; pointer-events: all; }

.wheel-box {
  --fill: var(--bg-2);
  --shade: var(--red);
  --sh: 8px;
  width: 100%; max-width: 480px;
  padding: 30px 26px 32px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  text-align: center;
  filter: drop-shadow(0 0 26px rgba(45,226,230,.35));
  margin: auto;
}
.wheel-title {
  font-size: clamp(.85rem, 3.4vw, 1.15rem);
  color: var(--yellow);
  text-shadow: 3px 3px 0 var(--red);
}
.wheel-subtitle { color: var(--muted); font-size: .95rem; }

.wheel-wrap { position: relative; width: 320px; height: 320px; flex-shrink: 0; margin-top: 8px; }
#wheel-canvas {
  display: block; width: 320px; height: 320px;
  filter: drop-shadow(0 0 16px rgba(255,225,86,.35));
  transition: filter .3s;
}
#wheel-canvas.spinning { filter: drop-shadow(0 0 26px rgba(255,225,86,.7)); }

/* Stepped pixel arrow pointing down at the wheel */
.wheel-pointer {
  position: absolute; top: -16px; left: 50%; z-index: 5;
  width: 32px; height: 32px;
  transform: translateX(-50%);
  filter: drop-shadow(3px 3px 0 var(--night));
}
.wheel-pointer::before {
  content: ''; position: absolute; inset: 0;
  background: var(--yellow);
  clip-path: polygon(0 0, 100% 0, 100% 25%, 87.5% 25%, 87.5% 50%, 75% 50%, 75% 75%, 62.5% 75%, 62.5% 100%,
                     37.5% 100%, 37.5% 75%, 25% 75%, 25% 50%, 12.5% 50%, 12.5% 25%, 0 25%);
}

.wheel-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 40px; height: 40px; z-index: 6; pointer-events: none;
}
.wheel-center img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }

#wheel-spin-btn, #wheel-play-btn { width: 100%; max-width: 300px; }
#wheel-play-btn { display: none; }
#wheel-play-btn.show { display: inline-flex; }

#bonus-result {
  display: none;
  width: 100%;
  padding: 16px 18px;
  background: var(--bg-3);
  box-shadow: 4px 4px 0 var(--night);
}
#bonus-result.show { display: block; }
.bonus-icon { font-size: 2.4rem; line-height: 1.1; margin-bottom: 6px; }
.bonus-name { font-family: var(--font-pixel); font-size: .8rem; color: var(--yellow); margin-bottom: 6px; line-height: 1.6; }
.bonus-desc { color: var(--white); font-size: .98rem; }

/* ══════════════════════════════════════════════════════════
   GAME
══════════════════════════════════════════════════════════ */
#game-section {
  position: relative; z-index: 1;
  width: 100%; max-width: 760px;
  margin: 0 auto;
  padding: 26px 16px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}

.intro { text-align: center; display: grid; gap: 8px; justify-items: center; }
.kicker {
  font-family: var(--font-pixel);
  font-size: .6rem;
  color: var(--cyan);
  line-height: 1.6;
}
.home .kicker::after { content: '▮'; margin-left: 4px; color: var(--yellow); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.intro h1 {
  font-size: clamp(1.05rem, 4.4vw, 2rem);
  color: var(--yellow);
  text-shadow: 4px 4px 0 var(--red);
}
.intro-text { color: var(--muted); max-width: 560px; }

/* HUD: separate pixel tiles instead of divided cells */
#hud {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr 1fr 1.6fr;
  gap: 8px;
}
.hud-cell {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-width: 0;
  padding: 10px 6px;
  background: var(--bg-2);
  box-shadow: 4px 4px 0 var(--night);
}
.hud-label {
  font-family: var(--font-pixel);
  font-size: .5rem; line-height: 1.4;
  color: var(--cyan);
  text-transform: uppercase;
  text-align: center;
}
.hud-val { font-family: var(--font-pixel); font-size: .95rem; color: var(--yellow); line-height: 1.4; }
.hearts-row { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; align-items: center; min-height: 18px; }
.heart-icon { width: 20px; height: 18px; image-rendering: auto; }
.heart-icon.lost { opacity: .2; filter: grayscale(1); }
.bonus-tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; min-height: 18px; }
.bonus-tag {
  font-weight: 700; font-size: .8rem; line-height: 1.3;
  padding: 2px 7px;
  background: var(--yellow); color: var(--ink);
  white-space: nowrap;
}

/* CRT cabinet bezel around the screen */
.crt-bezel {
  --fill: var(--bg-3);
  --shade: var(--night);
  --sh: 7px;
  width: 100%;
  padding: 14px;
}
#game-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 700 / 420;
  overflow: hidden;
  cursor: pointer;
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
  background: var(--bg);
  box-shadow:
    0 0 18px 2px rgba(45,226,230,.55),
    0 0 46px rgba(255,61,87,.28);
}
/* inner CRT glow + soft vignette (no scanlines) */
#game-wrap::after {
  content: '';
  position: absolute; inset: 0; z-index: 10; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 58%, rgba(5,4,26,.5) 100%);
  box-shadow: inset 0 0 34px rgba(45,226,230,.35);
}
#bg-canvas, #game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#bg-canvas { z-index: 0; }
#game-canvas { z-index: 1; }

#catch-flash {
  position: absolute; left: 50%; top: 16%; z-index: 20;
  width: max-content; max-width: 92%;
  transform: translateX(-50%);
  font-family: var(--font-pixel);
  font-size: clamp(.7rem, 2.4vw, 1.1rem);
  line-height: 1.5;
  text-align: center;
  color: var(--yellow);
  text-shadow: 3px 3px 0 var(--red);
  pointer-events: none;
  opacity: 0;
}
#catch-flash.show { animation: flashRise 1.2s ease-out forwards; }
@keyframes flashRise {
  0%   { opacity: 1; transform: translateX(-50%) scale(.8); }
  15%  { opacity: 1; transform: translateX(-50%) scale(1.1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-60px); }
}

#cast-btn { width: 100%; max-width: 300px; font-size: .85rem; padding: 18px 24px; }

/* Game over screen inside the CRT */
#gameover-overlay {
  position: absolute; inset: 0; z-index: 30;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 18px;
  background: rgba(13,11,43,.9);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .3s, visibility .3s;
  text-align: center;
}
#gameover-overlay.show { opacity: 1; visibility: visible; pointer-events: all; }
.go-icon { font-size: 3rem; line-height: 1; animation: bob 2.4s steps(4) infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.go-title { font-family: var(--font-pixel); font-size: clamp(.85rem, 3vw, 1.3rem); color: var(--yellow); text-shadow: 3px 3px 0 var(--red); line-height: 1.5; }
.go-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.go-chip {
  display: flex; flex-direction: column; align-items: center;
  min-width: 76px; padding: 8px 12px;
  background: var(--bg-3);
  box-shadow: 3px 3px 0 var(--night);
}
.chip-l { font-family: var(--font-pixel); font-size: .45rem; color: var(--cyan); text-transform: uppercase; line-height: 1.6; }
.chip-v { font-family: var(--font-pixel); font-size: .9rem; color: var(--yellow); line-height: 1.6; }
.go-new-best { font-family: var(--font-pixel); font-size: .6rem; padding: 6px 10px; background: var(--red); color: var(--white); line-height: 1.6; }
.go-btn { font-size: .7rem; }

/* ══════════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════════ */
.site-footer {
  position: relative; z-index: 1;
  margin-top: 72px;
  background: #0a0824;
}
.footer-grid {
  max-width: 1180px; margin: 0 auto;
  padding: 44px 16px 36px;
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.5fr;
  gap: 32px;
}
.footer-brand { display: grid; gap: 12px; align-content: start; justify-items: start; }
.footer-logo { font-family: var(--font-pixel); font-size: .72rem; color: var(--yellow); line-height: 1.6; }
.footer-tagline { color: var(--muted); font-size: .95rem; }
.age-badge {
  --fill: var(--red);
  --shade: var(--night);
  --sh: 4px;
  --clip: var(--px-clip-sm);
  display: inline-grid; place-items: center;
  min-width: 64px; height: 52px; padding: 0 10px;
  font-family: var(--font-pixel); font-size: .8rem;
  color: var(--white);
}
.footer-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  align-content: start;
}
.footer-nav a {
  display: block;
  padding: 8px 10px;
  background: var(--bg-2);
  color: var(--white);
  font-weight: 600; font-size: .92rem;
}
.footer-nav a:hover, .footer-nav a[aria-current="page"] { background: var(--cyan); color: var(--ink); }
.footer-notices { display: grid; gap: 10px; align-content: start; }
.footer-notices p { color: var(--muted); font-size: .88rem; line-height: 1.65; }
.footer-base {
  background: var(--night);
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px;
  padding: 16px max(16px, calc((100% - 1180px) / 2 + 16px));
}
.footer-owner { color: var(--white); font-weight: 600; font-size: .9rem; }
.footer-copy { color: var(--muted); font-size: .85rem; }

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .main-nav > a { font-size: .82rem; padding: 7px 8px; }
}
@media (max-width: 860px) {
  .main-nav > a { display: none; }
  .main-nav > a.always { display: block; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-notices { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .brand-name { max-width: 10.5em; }
  .brand-icon { width: 30px; height: 30px; font-size: 1rem; }
  .wheel-box { padding: 24px 16px 26px; }
  .wheel-wrap, #wheel-canvas { width: 280px; height: 280px; }
  #game-section { padding: 20px 12px 16px; gap: 14px; }
  #hud { grid-template-columns: repeat(6, 1fr); gap: 6px; }
  #hud .hud-cell { grid-column: span 2; padding: 8px 4px; }
  #hud #hud-hearts-cell, #hud #hud-bonus-cell { grid-column: span 3; }
  #hud-hearts-cell { order: 4; }
  #hud-bonus-cell { order: 5; }
  .crt-bezel { padding: 8px; --sh: 5px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-base { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 400px) {
  .wheel-wrap, #wheel-canvas { width: 240px; height: 240px; }
  .main-nav > a.always { padding: 7px 6px; }
  #lang-btn { padding: 8px 8px; }
}

/* Decorative motion off when the system asks for it */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .home .kicker::after, .go-icon { animation: none; }
  .pixel-btn, #lang-btn .arrow, #wheel-overlay, #gameover-overlay, #wheel-canvas { transition: none; }
}
