/* ===== ZNK Soundboard — grimy panelák chlast-deck ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:      #0e0b08;   /* greasy near-black */
  --ink2:     #16110c;
  --booze:    #b9842f;   /* dirty amber / beer */
  --booze-hi: #f0c24a;   /* foamy highlight */
  --acid:     #b6d34b;   /* fet green */
  --blood:    #7a1f17;   /* stylized stain red */
  --cream:    #e9e2d0;   /* grimy paper */
  --neon:     #ff3d6e;   /* automat neon */
  --neon2:    #36e0ff;
  --tile-shadow: 0 6px 0 #000, 0 10px 22px rgba(0,0,0,.55);
}

html, body { height: 100%; }

body {
  min-height: 100%;
  font-family: 'Oswald', system-ui, sans-serif;
  color: var(--cream);
  background:
    radial-gradient(120% 90% at 50% -10%, #2a1f14 0%, #150f0a 45%, #0a0705 100%),
    var(--ink);
  background-attachment: fixed;
  overflow-x: hidden;
  position: relative;
}

/* ---- background grime / stains / vignette ---- */
.grime, .stains, .vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
}
.grime {
  opacity: .5; mix-blend-mode: overlay;
  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.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/></svg>");
}
.stains {
  opacity: .8;
  background:
    radial-gradient(closest-side, rgba(185,132,47,.30), rgba(185,132,47,0) 70%) 12% 78% / 320px 280px no-repeat,
    radial-gradient(closest-side, rgba(122,31,23,.22), rgba(122,31,23,0) 70%) 84% 22% / 260px 240px no-repeat,
    radial-gradient(closest-side, rgba(182,211,75,.16), rgba(182,211,75,0) 70%) 70% 88% / 300px 220px no-repeat,
    radial-gradient(closest-side, rgba(0,0,0,.55), rgba(0,0,0,0) 70%) 22% 18% / 220px 160px no-repeat;
  filter: blur(1px);
}
.vignette {
  background: radial-gradient(120% 100% at 50% 40%, transparent 55%, rgba(0,0,0,.65) 100%);
  z-index: 1;
}

/* ---- stage layout ---- */
.stage {
  position: relative; z-index: 2;
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem) 4rem;
  display: flex; flex-direction: column; align-items: center;
  min-height: 100%;
}

/* ---- hero ---- */
.hero { text-align: center; margin-bottom: clamp(1.5rem, 4vw, 2.8rem); }

.title { line-height: .92; filter: drop-shadow(0 5px 0 #000); }
.title-top {
  display: block;
  font-family: 'Bungee Shade', cursive;
  font-size: clamp(1.4rem, 5vw, 2.4rem);
  letter-spacing: .25em;
  color: var(--booze-hi);
  margin-left: .25em;
}
.title-main {
  display: block;
  font-family: 'Bungee', cursive;
  font-size: clamp(2.6rem, 11vw, 5.4rem);
  letter-spacing: .02em;
  color: var(--cream);
  text-shadow:
    3px 3px 0 var(--blood),
    6px 6px 0 #000,
    0 0 28px rgba(240,194,74,.25);
  transform: rotate(-1.5deg);
}
.subtitle {
  margin-top: .6rem;
  font-weight: 500; text-transform: uppercase; letter-spacing: .22em;
  font-size: clamp(.7rem, 2.4vw, .95rem);
  color: var(--booze);
}

/* ---- STOP button ---- */
.btn-stop {
  margin-top: 1.4rem;
  font-family: 'Bungee', cursive;
  font-size: clamp(1rem, 3.5vw, 1.35rem);
  letter-spacing: .05em;
  color: #fff;
  background: linear-gradient(#a3261c, #6f160f);
  border: none;
  border-radius: 14px;
  padding: .7em 1.5em;
  cursor: pointer;
  box-shadow: 0 6px 0 #3c0a06, 0 10px 20px rgba(0,0,0,.5);
  transform: rotate(.6deg);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s ease;
}
.btn-stop .stop-glyph { color: var(--booze-hi); }
.btn-stop:hover { filter: brightness(1.12); transform: rotate(.6deg) translateY(-2px); }
.btn-stop:active { transform: rotate(.6deg) translateY(4px); box-shadow: 0 2px 0 #3c0a06, 0 4px 10px rgba(0,0,0,.5); }
.btn-stop.armed { animation: stopFlash .5s ease; }
@keyframes stopFlash { 0%{ filter: brightness(2); } 100%{ filter: brightness(1); } }

/* ---- the board: 12 chunky buttons ---- */
.board {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(.5rem, 1.6vw, .85rem);
}

/* tile = big tactile sticker button */
.tile {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .25rem;
  aspect-ratio: 1 / 1;
  padding: .55rem;
  cursor: pointer;
  user-select: none;
  border: 2px solid #000;
  border-radius: 13px;
  background:
    linear-gradient(150deg, rgba(255,255,255,.14), rgba(255,255,255,0) 38%),
    linear-gradient(#2a1d10, #1a1209);
  box-shadow: var(--tile-shadow);
  color: var(--cream);
  text-align: center;
  overflow: hidden;
  transform: rotate(var(--tilt, 0deg));
  transition: transform .09s cubic-bezier(.34,1.56,.64,1), box-shadow .09s ease, filter .15s ease;
}
/* greasy sheen sweep */
.tile::before {
  content: ""; position: absolute; inset: 0; border-radius: 11px;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.10) 50%, transparent 60%);
  transform: translateX(-120%);
  pointer-events: none;
}
.tile:hover {
  filter: brightness(1.12);
  transform: rotate(0deg) translateY(-3px) scale(1.02);
  box-shadow: 0 9px 0 #000, 0 16px 30px rgba(0,0,0,.6);
}
.tile:hover::before { transition: transform .6s ease; transform: translateX(120%); }
.tile:active { transform: rotate(var(--tilt,0deg)) translateY(5px) scale(.97); box-shadow: 0 2px 0 #000, 0 6px 14px rgba(0,0,0,.55); }

.tile-num {
  position: absolute; top: .35rem; left: .42rem;
  font-family: 'Bungee', cursive; font-size: .5rem;
  color: rgba(240,194,74,.35);
}
.tile-icon {
  font-size: clamp(1rem, 3.4vw, 1.4rem);
  color: var(--booze-hi);
  filter: drop-shadow(0 2px 0 #000);
  line-height: 1;
}
.tile-name {
  font-family: 'Bungee', cursive;
  font-size: clamp(.6rem, 2.2vw, .9rem);
  line-height: 1.05;
  text-shadow: 1px 1px 0 #000;
  word-break: break-word;
}
.tile-dur {
  position: absolute; bottom: .32rem; right: .42rem;
  font-size: .48rem; font-weight: 700; letter-spacing: .05em;
  color: rgba(233,226,208,.45);
}

/* splatter ripple injected on press */
.splat {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(240,194,74,.55), rgba(185,132,47,.25) 55%, transparent 70%);
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none; mix-blend-mode: screen;
  animation: splat .55s ease-out forwards;
}
@keyframes splat {
  to { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* playing state — clearly alive */
.tile.playing {
  border-color: var(--booze-hi);
  background:
    linear-gradient(150deg, rgba(255,255,255,.20), rgba(255,255,255,0) 40%),
    linear-gradient(#5a3a12, #3a2409);
  animation: tilePulse .7s ease-in-out infinite;
}
.tile.playing .tile-icon { color: #fff; animation: iconWobble .7s ease-in-out infinite; }
@keyframes tilePulse {
  0%,100% { box-shadow: 0 6px 0 #000, 0 0 0 0 rgba(240,194,74,.55), 0 10px 22px rgba(0,0,0,.55); }
  50%     { box-shadow: 0 6px 0 #000, 0 0 0 8px rgba(240,194,74,0), 0 10px 28px rgba(0,0,0,.6); }
}
@keyframes iconWobble {
  0%,100% { transform: scale(1) rotate(0); }
  50%     { transform: scale(1.18) rotate(-6deg); }
}
/* equalizer bars on the playing tile */
.tile .eq { display: none; gap: 2px; height: 10px; align-items: flex-end; margin-top: 1px; }
.tile.playing .eq { display: flex; }
.tile .eq i { width: 3px; background: var(--booze-hi); border-radius: 2px; animation: eq .6s ease-in-out infinite; }
.tile .eq i:nth-child(2){ animation-delay: .15s; }
.tile .eq i:nth-child(3){ animation-delay: .3s; }
.tile .eq i:nth-child(4){ animation-delay: .45s; }
@keyframes eq { 0%,100%{ height: 3px; } 50%{ height: 10px; } }

/* error / empty */
.empty-state {
  grid-column: 1 / -1;
  text-align: center; padding: 3rem 1rem;
  font-family: 'Bungee', cursive; color: var(--blood);
  text-shadow: 1px 1px 0 #000;
}

/* ---- footer ---- */
.site-footer {
  margin-top: auto; padding-top: 2.5rem;
  font-size: .75rem; letter-spacing: .06em;
  color: rgba(233,226,208,.4); text-align: center;
}
.site-footer strong { color: var(--booze); }

/* ============================================================
   AUTOMAT — decorative slot machine in the corner
   ============================================================ */
.automat {
  position: fixed; z-index: 3;
  right: 14px; bottom: 14px;
  width: 132px;
  filter: drop-shadow(0 12px 24px rgba(0,0,0,.7));
  animation: automatGlow 3s ease-in-out infinite;
}
@keyframes automatGlow {
  0%,100% { filter: drop-shadow(0 12px 24px rgba(0,0,0,.7)) drop-shadow(0 0 6px rgba(255,61,110,.0)); }
  50%     { filter: drop-shadow(0 12px 24px rgba(0,0,0,.7)) drop-shadow(0 0 14px rgba(255,61,110,.45)); }
}
.automat-cab {
  position: relative;
  background: linear-gradient(#3a2a16, #20160c);
  border: 3px solid #000; border-radius: 16px 16px 10px 10px;
  padding: 26px 10px 12px;
}
.automat-bulbs {
  position: absolute; top: 6px; left: 8px; right: 8px;
  display: flex; justify-content: space-between;
}
.automat-bulbs span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--neon); box-shadow: 0 0 6px var(--neon);
  animation: chase 1s steps(1) infinite;
}
.automat-bulbs span:nth-child(2n) { background: var(--neon2); box-shadow: 0 0 6px var(--neon2); animation-delay: .1s; }
.automat-bulbs span:nth-child(3n) { animation-delay: .2s; }
.automat-bulbs span:nth-child(4n) { animation-delay: .3s; }
.automat-bulbs span:nth-child(5n) { animation-delay: .4s; }
@keyframes chase { 0%,49%{ opacity: 1; } 50%,100%{ opacity: .15; } }

.automat-head {
  font-family: 'Bungee', cursive; font-size: .72rem; line-height: 1;
  text-align: center; color: var(--booze-hi);
  text-shadow: 1px 1px 0 #000; margin-bottom: 8px; letter-spacing: .04em;
}
.automat-window {
  display: flex; gap: 4px; justify-content: center;
  background: #0a0705; border: 2px solid #000; border-radius: 8px;
  padding: 6px; overflow: hidden;
}
.reel {
  width: 30px; height: 38px; overflow: hidden;
  background: linear-gradient(#1c1209, #0c0805);
  border-radius: 4px; box-shadow: inset 0 6px 8px rgba(0,0,0,.8), inset 0 -6px 8px rgba(0,0,0,.8);
}
.reel-strip {
  display: flex; flex-direction: column; align-items: center;
  font-size: 22px; line-height: 38px;
  animation: spin 1.1s linear infinite;
}
.reel-strip.strip2 { animation-duration: .85s; }
.reel-strip.strip3 { animation-duration: 1.4s; }
.reel-strip span { height: 38px; }
@keyframes spin { from { transform: translateY(0); } to { transform: translateY(-228px); } }

.automat-payline {
  height: 2px; margin: 4px 6px 0;
  background: var(--neon); box-shadow: 0 0 8px var(--neon);
  opacity: .85;
}
.automat-foot {
  margin-top: 6px; text-align: center;
  font-size: .5rem; letter-spacing: .08em; color: var(--acid);
  text-transform: uppercase;
}
.automat-lever {
  position: absolute; top: 30px; right: -12px;
  width: 12px;
  transform-origin: bottom center;
  animation: pull 4s ease-in-out infinite;
}
.automat-lever .lever-arm { display: block; width: 5px; height: 38px; margin: 0 auto; background: linear-gradient(#999,#444); border-radius: 3px; }
.automat-lever .lever-ball { display: block; width: 14px; height: 14px; margin: -4px auto 0; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #ff8aa6, var(--neon)); box-shadow: 0 0 8px var(--neon); }
@keyframes pull {
  0%,82%,100% { transform: rotate(0deg); }
  88% { transform: rotate(38deg); }
  94% { transform: rotate(0deg); }
}

/* ---- responsive ---- */
@media (max-width: 560px) {
  .board { grid-template-columns: repeat(2, 1fr); max-width: 420px; gap: .6rem; }
  .tile { padding: .7rem; border-radius: 15px; }
  .tile-icon { font-size: clamp(1.5rem, 8vw, 2rem); }
  .tile-name { font-size: clamp(.85rem, 4.5vw, 1.15rem); }
  .tile-num { font-size: .65rem; top: .45rem; left: .55rem; }
  .tile-dur { font-size: .6rem; bottom: .42rem; right: .55rem; }
  .automat { width: 104px; right: 8px; bottom: 8px; opacity: .92; }
}
@media (max-width: 360px) {
  .automat { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
