:root {
  --poison: #39ff6a; --milk: #f4f1ea; --anti: #a64dff;
  --pink: #ff4dd2; --gold: #ffe14d; --cyan: #4dfff3;
  --bg1: #1b1233; --bg2: #2c1a4d; --ink: #120720;
  --display: "Bungee", "Arial Black", Impact, sans-serif;
  --pixel: "Silkscreen", ui-monospace, monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #07030d; color: #fff; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overscroll-behavior: none; }
body { position: fixed; inset: 0; overflow: hidden; user-select: none; -webkit-user-select: none; }
#app { position: relative; height: 100dvh; max-width: 520px; margin: 0 auto; background: linear-gradient(180deg, var(--bg1), var(--bg2)); overflow: hidden; }

.screen { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: calc(16px + env(safe-area-inset-top)) 20px calc(16px + env(safe-area-inset-bottom)); text-align: center; overflow-y: auto; }
.screen.active { display: flex; }
h2 { font-family: var(--display); font-weight: 400; font-size: 28px; margin: 0; letter-spacing: 1px; }

.btn { font-family: var(--display); font-size: 17px; color: var(--ink); background: var(--gold); border: 0; border-radius: 16px; padding: 14px 26px; min-width: 220px; box-shadow: 0 5px 0 #b09412, 0 0 24px rgba(255,225,77,.35); cursor: pointer; transition: transform .08s; touch-action: manipulation; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #b09412; }
.btn.big { font-size: 22px; padding: 18px 34px; background: linear-gradient(90deg, var(--poison), #b8ff4d); box-shadow: 0 6px 0 #0e7a30, 0 0 30px rgba(57,255,106,.45); animation: pulse 1.6s ease-in-out infinite; }
.btn.ghost { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.4); box-shadow: none; font-size: 15px; padding: 10px 20px; }
.btn:disabled { opacity: .45; animation: none; }
.link { background: none; border: 0; color: var(--cyan); font-size: 14px; text-decoration: underline; cursor: pointer; padding: 6px; }
@keyframes pulse { 50% { transform: scale(1.04); } }

/* ---- úvod ---- */
.title-bg { position: absolute; inset: -50%; background: repeating-conic-gradient(from 0deg, rgba(57,255,106,.06) 0 10deg, rgba(166,77,255,.08) 10deg 20deg); animation: spin 40s linear infinite; z-index: -1; }
@keyframes spin { to { transform: rotate(360deg); } }
.logo { display: flex; flex-direction: column; line-height: .9; font-family: var(--display); transform: rotate(-4deg); }
.logo span { text-shadow: 0 5px 0 var(--ink), 0 0 26px currentColor; }
.logo .l1 { font-size: 62px; color: #fff; }
.logo .l2 { font-size: 86px; color: var(--poison); animation: wobble 2.4s ease-in-out infinite; }
.logo .l3 { font-size: 30px; color: var(--anti); letter-spacing: 2px; }
@keyframes wobble { 50% { transform: scale(1.06) rotate(2deg); } }
.title-cup { position: relative; width: 74px; height: 92px; clip-path: polygon(0 0, 100% 0, 89% 100%, 11% 100%); background: rgba(255,255,255,.12); display: flex; flex-direction: column-reverse; animation: cupflip 3s ease-in-out infinite; }
.title-cup i { flex: 1; } .title-cup .g { background: var(--poison); } .title-cup .w { background: var(--milk); } .title-cup .p { background: var(--anti); }
.title-cup b { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%) rotate(-8deg); width: 50px; height: 50px; border-radius: 50%; background: #fff url(../assets/laura-logo.png) center / 134% no-repeat; color: transparent; border: 2px solid #fff; font: bold 13px Georgia, serif; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.title-cup b small { font: bold 6px system-ui; letter-spacing: 1px; }
@keyframes cupflip { 0%, 60% { transform: translateY(0) rotate(0); } 75% { transform: translateY(-40px) rotate(-200deg); } 90% { transform: translateY(0) rotate(-360deg); } 100% { transform: rotate(-360deg); } }
.tagline { margin: 0; font-size: 16px; opacity: .85; }
.mini-board { background: rgba(0,0,0,.35); border: 2px solid rgba(255,255,255,.12); border-radius: 14px; padding: 10px 16px; min-width: 240px; }
.mb-title { font-family: var(--pixel); font-size: 16px; color: var(--gold); margin-bottom: 6px; }
#top3 { margin: 0; padding: 0; list-style: none; font-family: var(--pixel); font-size: 15px; line-height: 1.6; }
#top3 li { display: flex; justify-content: space-between; gap: 12px; }
.toggles { display: flex; gap: 14px; font-size: 13px; opacity: .85; flex-wrap: wrap; justify-content: center; }
.toggles input { accent-color: var(--poison); }
.laura-big { display: block; border-radius: 50%; background: #fff; object-fit: cover; box-shadow: 0 0 0 4px #fff, 0 8px 30px rgba(0,0,0,.45); }
.laura-big.top { width: 96px; height: 96px; margin-bottom: -4px; }
.laura-big.nick { width: 130px; height: 130px; margin-bottom: 6px; }
.laura-big.small { width: 52px; height: 52px; box-shadow: 0 0 0 3px #fff; }
.share-head { display: flex; align-items: center; gap: 12px; text-align: left; font-family: var(--display); font-size: 15px; line-height: 1.15; }
.share-head small { font-family: system-ui, sans-serif; font-size: 13px; opacity: .75; }
.made-by { display: flex; align-items: center; gap: 6px; font-size: 11px; opacity: .45; margin-top: 4px; }
.made-by img { width: 22px; height: 22px; }

/* ---- jak hrát ---- */
.howto { display: flex; flex-direction: column; gap: 12px; text-align: left; max-width: 420px; font-size: 14.5px; line-height: 1.4; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.ico { flex: 0 0 38px; font-size: 26px; text-align: center; }
.chips { display: flex; flex-direction: column-reverse; gap: 2px; padding-top: 4px; }
.chips i { display: block; height: 8px; border-radius: 3px; }
.chips .g, .cg { background: var(--poison); color: var(--poison); } .chips .w { background: var(--milk); } .chips .p, .cp { background: var(--anti); color: var(--anti); }
em.cg, em.cp { background: none; font-style: normal; font-weight: 700; }
.shapes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 0 0 4px 50px; }
.shapes div { display: flex; flex-direction: column; align-items: center; font-size: 10px; gap: 2px; }
.shapes canvas { width: 40px; height: 40px; }
.shapes b { font-family: var(--display); font-weight: 400; font-size: 9px; }

/* ---- hra ---- */
#s-game { padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); background: #000; }
#cv { display: block; touch-action: none; }
#b-pause { position: absolute; top: calc(8px + env(safe-area-inset-top)); right: 8px; width: 38px; height: 34px; border-radius: 10px; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 13px; z-index: 5; }
.overlay { position: absolute; inset: 0; background: rgba(10,0,20,.85); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; z-index: 10; }
.hidden { display: none !important; }
#callouts { position: absolute; inset: 0; pointer-events: none; z-index: 4; overflow: hidden; }
#flash { position: absolute; inset: 0; pointer-events: none; z-index: 3; opacity: 0; }
#flash.hard { animation: flashhard .22s ease-out; background: var(--fc); }
#flash.soft { animation: flashsoft .4s ease-out; box-shadow: inset 0 0 60px 10px var(--fc); }
@keyframes flashhard { 0% { opacity: .3; } 100% { opacity: 0; } }
@keyframes flashsoft { 0% { opacity: .8; } 100% { opacity: 0; } }

/* ---- hlášky ---- */
.callout { position: absolute; left: 0; right: 0; top: calc(30% + var(--y)); display: flex; flex-direction: column; align-items: center; transform: rotate(var(--tilt)); }
.callout .main { position: relative; font-family: var(--display); font-size: clamp(34px, 11vw, 54px); line-height: 1; color: var(--c2); -webkit-text-stroke: 2px var(--ink); text-shadow: 0 4px 0 var(--ink), 0 0 18px var(--c1), 0 0 40px var(--c1); white-space: nowrap; }
.callout.big .main { font-size: clamp(40px, 13vw, 64px); }
.callout .sub { margin-top: 8px; font-family: var(--display); font-size: 14px; color: var(--ink); background: var(--c1); padding: 4px 12px; border-radius: 99px; animation: subin .3s .15s both; text-transform: uppercase; }
.callout.bad .main { color: #fff; }
@keyframes subin { from { transform: scale(0); } to { transform: scale(1); } }
.callout { animation: fadeout 1.25s forwards; }
.callout.big { animation-duration: 1.7s; }
@keyframes fadeout { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }

.a-punch .main { animation: punch .45s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes punch { from { transform: scale(3.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.a-spin .main { animation: spinin .55s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes spinin { from { transform: rotate(-540deg) scale(0); } to { transform: none; } }
.a-glitch .main { animation: glitch .5s steps(2) both; }
.a-glitch .main::before, .a-glitch .main::after { content: attr(data-text); position: absolute; inset: 0; opacity: .8; }
.a-glitch .main::before { color: var(--cyan); transform: translate(-4px, 0); clip-path: inset(0 0 55% 0); animation: gl1 .3s steps(3) 3; }
.a-glitch .main::after { color: var(--pink); transform: translate(4px, 0); clip-path: inset(50% 0 0 0); animation: gl2 .3s steps(3) 3; }
@keyframes glitch { 0% { transform: skewX(40deg) scale(1.4); opacity: 0; } 30% { transform: skewX(-20deg); opacity: 1; } 60% { transform: skewX(10deg); } 100% { transform: none; } }
@keyframes gl1 { 50% { transform: translate(6px, -3px); } }
@keyframes gl2 { 50% { transform: translate(-6px, 3px); } }
.a-wave .main span { display: inline-block; animation: wave .6s calc(var(--i) * 45ms) cubic-bezier(.3, 1.8, .5, 1) both, bob 0.5s calc(.6s + var(--i) * 45ms) ease-in-out 2 alternate; }
@keyframes wave { from { transform: translateY(80px) scale(0); } to { transform: none; } }
@keyframes bob { to { transform: translateY(-10px); } }
.a-drop .main { animation: drop .6s cubic-bezier(.3, 1.9, .5, 1) both; }
@keyframes drop { from { transform: translateY(-300px) rotate(-20deg); } to { transform: none; } }
.a-split .main span { display: inline-block; animation: split .55s calc(var(--i) * 25ms) cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes split { from { transform: translate(var(--rx), var(--ry)) rotate(200deg) scale(.2); opacity: 0; } to { transform: none; opacity: 1; } }
.a-rubber .main { animation: rubber .7s both; }
@keyframes rubber { 0% { transform: scale(0); } 30% { transform: scale(1.5, .6); } 45% { transform: scale(.7, 1.3); } 60% { transform: scale(1.2, .85); } 75% { transform: scale(.95, 1.05); } 100% { transform: none; } }
.a-warp .main { animation: warp .5s ease-out both; }
@keyframes warp { from { transform: perspective(300px) translateZ(-600px) rotateX(70deg); opacity: 0; filter: blur(8px); } to { transform: none; opacity: 1; filter: none; } }
.a-flip .main { animation: flip3d .6s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes flip3d { from { transform: perspective(400px) rotateY(-720deg) scale(.4); } to { transform: none; } }
.a-slide .main { animation: slide .5s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes slide { from { transform: translateX(-120%) skewX(-30deg); } to { transform: none; } }

/* efekty okolo */
.callout .fx { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.fx-ring .fx::before, .fx-ring .fx::after { content: ""; position: absolute; left: -40px; top: -40px; width: 80px; height: 80px; border-radius: 50%; border: 5px solid var(--c1); animation: ringout .7s ease-out both; }
.fx-ring .fx::after { animation-delay: .15s; border-color: var(--c2); }
@keyframes ringout { from { transform: scale(.2); opacity: 1; } to { transform: scale(5); opacity: 0; } }
.fx-rays .fx::before { content: ""; position: absolute; left: -220px; top: -220px; width: 440px; height: 440px; border-radius: 50%; background: repeating-conic-gradient(var(--c1) 0 8deg, transparent 8deg 22deg); -webkit-mask: radial-gradient(circle, transparent 18%, #000 30%, transparent 70%); mask: radial-gradient(circle, transparent 18%, #000 30%, transparent 70%); opacity: .55; animation: rays 1.2s linear both; z-index: -1; }
@keyframes rays { from { transform: scale(.3) rotate(0); } to { transform: scale(1.1) rotate(90deg); opacity: 0; } }
.fx-halo .fx::before { content: ""; position: absolute; left: -170px; top: -70px; width: 340px; height: 140px; border-radius: 50%; background: radial-gradient(var(--c1), transparent 70%); animation: halo .9s ease-out both; z-index: -1; }
@keyframes halo { from { transform: scale(0); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
.fx i { position: absolute; left: 0; top: 0; font-style: normal; animation: burstout .8s ease-out both; }
@keyframes burstout { from { transform: translate(-50%, -50%) scale(.3); opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.2) rotate(var(--r)); opacity: 0; } }
.fx-stars .fx i { color: var(--c1); font-size: 24px; text-shadow: 0 0 10px var(--c1); }
.fx-emoji .fx i { font-size: 28px; }
.fx-shards .fx i { width: 10px; height: 22px; background: var(--c1); clip-path: polygon(50% 0, 100% 100%, 0 80%); }
.fx-bolts .fx i { width: 6px; height: 60px; background: linear-gradient(var(--c2), var(--c1)); clip-path: polygon(40% 0, 100% 0, 60% 45%, 100% 45%, 0 100%, 35% 55%, 0 55%); transform-origin: center; animation-name: bolt; }
@keyframes bolt { 0% { transform: translate(-50%, -50%) rotate(var(--r)) scale(.2); opacity: 1; } 60% { opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--r)) scale(1.3); opacity: 0; } }

/* ---- konec ---- */
.score-big { font-family: var(--display); font-size: clamp(54px, 16vw, 80px); background: linear-gradient(90deg, var(--poison), var(--anti)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 var(--ink)); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; max-width: 360px; }
.stats div { background: rgba(0,0,0,.3); border-radius: 12px; padding: 10px; font-size: 12px; opacity: .9; }
.stats b { display: block; font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--gold); }
.as-nick { margin: 0; font-size: 15px; } .as-nick b { font-family: var(--pixel); color: var(--gold); font-size: 20px; }
.close-call { font-family: var(--display); color: var(--pink); font-size: 15px; margin: 4px 0; min-height: 20px; }

/* ---- přezdívka ---- */
.arcade-input { position: relative; width: 100%; max-width: 340px; }
#nick { width: 100%; font-family: var(--pixel); font-size: 28px; text-transform: uppercase; text-align: center; color: var(--gold); background: #000; border: 3px solid var(--poison); border-radius: 10px; padding: 18px 8px; outline: none; box-shadow: 0 0 20px rgba(57,255,106,.4) inset, 0 0 20px rgba(57,255,106,.3); caret-color: var(--poison); }
#nick::placeholder { color: #444; }
#nick-count { position: absolute; right: 10px; bottom: -22px; font-family: var(--pixel); font-size: 13px; opacity: .6; }
.err { color: #ff6b6b; min-height: 20px; margin: 10px 0 0; font-weight: 600; }
.hint { font-size: 12px; opacity: .6; margin: 0; }

/* ---- sdílení ---- */
#s-share { gap: 10px; }
.banner-wrap { height: min(52dvh, 480px); aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; box-shadow: 0 0 0 3px rgba(255,255,255,.15), 0 12px 40px rgba(0,0,0,.5); }
#banner { width: 100%; height: 100%; display: block; }
.rec { margin: 0; font-size: 13px; opacity: .8; min-height: 18px; }
.share-row { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 340px; }
.btn.share { min-width: 0; width: 100%; color: #fff; animation: none; font-size: 16px; }
.btn.ig { background: linear-gradient(45deg, #f9ce34, #ee2a7b 45%, #6228d7); box-shadow: 0 5px 0 #6d1440; }
.btn.tt { background: #111; box-shadow: 0 5px 0 #000, -3px 0 0 #25f4ee inset, 3px 0 0 #fe2c55 inset; }
.sico { font-size: 18px; margin-right: 6px; }
.toast { font-size: 13px; color: var(--cyan); min-height: 18px; margin: 0; max-width: 340px; }

/* ---- síň slávy (retro automat) ---- */
#s-board { background: #000; justify-content: flex-start; padding-top: calc(28px + env(safe-area-inset-top)); }
.arcade-title { font-family: var(--pixel); font-size: 30px; color: var(--gold); text-shadow: 3px 3px 0 #b02a8a; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { color: var(--poison); } }
.board { width: 100%; max-width: 380px; font-family: var(--pixel); font-size: 17px; line-height: 1; }
.board .row { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; padding: 7px 4px; color: #ddd; }
.board .row:nth-child(1) { color: var(--gold); } .board .row:nth-child(2) { color: #d9d9d9; } .board .row:nth-child(3) { color: #e0a060; }
.board .row .n { text-align: left; }
.board .row .s { text-align: right; }
.board .row.me { background: var(--poison); color: #000; animation: meblink .5s steps(2) infinite; }
@keyframes meblink { 50% { background: var(--anti); color: #fff; } }
.board .sep { color: #555; padding: 4px; }
.record { font-family: var(--display); color: var(--poison); font-size: 14px; margin: 0 0 8px; text-align: center; }
.offline { font-size: 11px; opacity: .5; margin: 0; }

@media (prefers-reduced-motion: reduce) { .btn.big, .logo .l2, .title-bg, .title-cup { animation: none; } }

/* ---- QR na Forbidden Potion ---- */
.btn.voucher { background: linear-gradient(90deg, var(--poison), var(--anti)); color: #fff; font-size: 14px; padding: 12px 18px; box-shadow: 0 4px 0 #3a1466; animation: none; }
.v-badge { font-family: var(--display); font-size: 15px; letter-spacing: 2px; color: var(--ink); background: linear-gradient(90deg, var(--poison), var(--anti)); padding: 6px 14px; border-radius: 99px; }
.v-text { max-width: 330px; margin: 0; line-height: 1.45; }
.v-qr { background: #fff; padding: 10px; border-radius: 16px; box-shadow: 0 0 0 4px var(--poison), 0 0 40px rgba(166,77,255,.6); }
.v-qr canvas { display: block; width: min(62vw, 250px); height: auto; image-rendering: pixelated; }
.v-qr.used { opacity: .25; filter: grayscale(1); }
.v-code { font-family: var(--pixel); font-size: 26px; letter-spacing: 4px; color: var(--gold); }
.v-status { margin: 0; min-height: 20px; font-family: var(--display); color: var(--poison); }
.v-steps { text-align: left; max-width: 330px; margin: 0; padding-left: 22px; line-height: 1.45; font-size: 15px; }
.v-steps li { margin: 3px 0; }
.share-voucher { margin: 0; max-width: 340px; font-size: 13px; color: var(--poison); }
