:root {
  --bg: #07060f;
  --card: rgba(16, 12, 32, .78);
  --card-solid: #120e24;
  --line: rgba(190, 140, 255, .18);
  --text: #f3eeff;
  --muted: #a99cc8;
  --pink: #ff2bd6;
  --purple: #9b5cff;
  --cyan: #22e6ff;
  --green: #3dff9a;
  --gold: #ffd34d;
  --silver: #d6dde8;
  --bronze: #e08a4c;
  --red: #ff4d6d;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}
.bg {
  position: fixed; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(7,6,15,.35) 0%, rgba(7,6,15,.75) 45%, rgba(7,6,15,.92) 100%),
    url('img/bg/bg-main.jpg') center bottom / cover no-repeat;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.error { color: var(--red); min-height: 1.2em; margin: .4rem 0 0; font-weight: 600; }

/* ---------- nagłówek ---------- */
.top { text-align: center; padding: 42px 16px 10px; }
.logo {
  font-family: Bungee, sans-serif; font-weight: 400;
  font-size: clamp(2rem, 6vw, 4.2rem); margin: 0; letter-spacing: 2px;
  text-shadow: 0 0 18px rgba(155, 92, 255, .8), 0 4px 0 #2a0f55;
}
.logo span { color: var(--pink); text-shadow: 0 0 22px var(--pink), 0 4px 0 #4a0640; }
.subtitle { color: var(--muted); margin: 6px 0 22px; font-size: 1.05rem; }
.tabs { display: inline-flex; gap: 6px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; backdrop-filter: blur(10px); }
.tab {
  font: 800 .95rem Inter, sans-serif; letter-spacing: 1px; color: var(--muted);
  background: none; border: 0; padding: 12px 24px; border-radius: 999px; cursor: pointer; transition: .2s;
}
.tab:hover { color: var(--text); }
.tab.active { color: #fff; background: linear-gradient(135deg, var(--purple), var(--pink)); box-shadow: 0 0 20px rgba(255, 43, 214, .45); }

main { max-width: 1280px; margin: 0 auto; padding: 24px 16px 80px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(12px); padding: 20px; }

/* ---------- bramki z hasłem ---------- */
.gate { max-width: 420px; margin: 30px auto; text-align: center; }
.gate h2 { margin: 0 0 6px; font-family: Bungee, sans-serif; font-weight: 400; }
.gate form { display: grid; gap: 10px; margin-top: 18px; }
input[type=text], input[type=password] {
  width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(0,0,0,.35); color: var(--text); font: 600 1rem Inter, sans-serif; outline: none; transition: .2s;
}
input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(155, 92, 255, .25); }
input:disabled { opacity: .45; }
.big-emoji { font-size: 3rem; }

.btn { font: 800 1rem Inter, sans-serif; letter-spacing: 1px; border: 0; border-radius: 12px; padding: 14px 22px; cursor: pointer; transition: .2s; color: #fff; }
.btn.primary { background: linear-gradient(135deg, var(--purple), var(--pink)); box-shadow: 0 6px 24px rgba(255, 43, 214, .3); }
.btn.primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(255, 43, 214, .5); }
.btn.ghost { background: rgba(255,255,255,.08); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.huge { width: 100%; padding: 20px; font-size: 1.25rem; font-family: Bungee, sans-serif; font-weight: 400; }

/* ---------- układ głosowania ---------- */
.vote-layout { display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 24px; align-items: start; }
.vote-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.vote-head h2 { margin: 0 0 4px; }
.vote-head p { margin: 0; }
.counter { font-family: Bungee, sans-serif; font-size: 2.2rem; color: var(--cyan); text-shadow: 0 0 14px var(--cyan); white-space: nowrap; }
.counter.full { color: var(--green); text-shadow: 0 0 14px var(--green); }
.neon-text { color: var(--pink); text-shadow: 0 0 8px var(--pink); }

.game-list, .results-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.game {
  display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 12px 16px 12px 12px; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  cursor: pointer; transition: .18s; backdrop-filter: blur(12px); position: relative;
}
.game:hover { border-color: rgba(155, 92, 255, .55); transform: translateX(3px); }
.game.selected { border-color: var(--pink); background: rgba(80, 20, 90, .7); box-shadow: 0 0 22px rgba(255, 43, 214, .35); }
.game.disabled { opacity: .45; cursor: not-allowed; transform: none; }
.game.locked { cursor: not-allowed; filter: grayscale(1); opacity: .75; border-color: #888; background: rgba(60, 60, 70, .7); box-shadow: none; transform: none; }
.game.locked .check { background: #777; border-color: #777; }
.game.flash { animation: flash 1.2s ease 2; }
@keyframes flash { 50% { box-shadow: 0 0 40px var(--gold); border-color: var(--gold); } }

.icon { width: 76px; height: 76px; border-radius: 12px; object-fit: cover; object-position: center; display: block; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
.g-title { font-weight: 800; font-size: 1.12rem; margin: 0 0 7px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .78rem; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: rgba(255,255,255,.07); border: 1px solid var(--line); color: #ddd2f7; white-space: nowrap; }
.chip.players { color: var(--cyan); border-color: rgba(34, 230, 255, .35); }
.chip.price { color: var(--green); border-color: rgba(61, 255, 154, .35); }
.chip.price s { color: var(--muted); margin-right: 4px; font-weight: 400; }
.chip.sale { background: var(--green); color: #052; border: 0; font-weight: 800; }
.chip.steam { text-decoration: none; }
.chip.steam:hover { background: rgba(255,255,255,.18); }
.badge-gamble { font-size: .72rem; font-weight: 800; letter-spacing: 1px; padding: 3px 8px; border-radius: 6px; background: #555; color: #fff; }

.check { width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 800; transition: .18s; }
.game.selected .check { background: var(--pink); border-color: var(--pink); }
.game.selected .check::after, .game.locked .check::after { content: '✓'; }
.game.locked .check::after { content: '🔒'; font-size: .8rem; }

.custom-row { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; margin-top: 10px; }
.custom-check { display: flex; align-items: center; gap: 10px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.custom-check input { display: none; }
.custom-check .box { width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--line); display: grid; place-items: center; }
.custom-check input:checked + .box { background: var(--pink); border-color: var(--pink); }
.custom-check input:checked + .box::after { content: '✓'; }
.custom-check input:disabled ~ * { opacity: .45; }

.submit-bar { position: sticky; bottom: 12px; margin-top: 16px; padding: 12px; background: rgba(7,6,15,.85); border-radius: var(--radius); backdrop-filter: blur(10px); text-align: center; border: 1px solid var(--line); }
.submit-bar .error:empty { display: none; }
.submit-bar .error { margin: 0 0 8px; }

/* ---------- obecność + notatka ---------- */
.attend { margin-bottom: 14px; }
.attend h3, .list-title { margin: 0 0 12px; }
.list-title { margin: 18px 0 10px 4px; }
.attend-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.attend-opt input { display: none; }
.attend-opt span { display: inline-block; padding: 11px 18px; border-radius: 999px; border: 2px solid var(--line); background: rgba(0,0,0,.3); font-weight: 800; cursor: pointer; transition: .18s; }
.attend-opt span:hover { border-color: var(--purple); }
.attend-opt input:checked + span { border-color: var(--cyan); background: rgba(34, 230, 255, .15); box-shadow: 0 0 16px rgba(34, 230, 255, .35); }
#attend-other { margin-top: 10px; }
.note { padding: 14px 18px; border-radius: var(--radius); background: rgba(34, 230, 255, .08); border: 1px dashed rgba(34, 230, 255, .45); color: #d9f9ff; line-height: 1.5; }

#attend-results { max-width: 900px; margin: 0 auto 16px; }
#attend-results h3 { margin: 0 0 12px; }
.attend-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.attend-cols p, .attend-cols ul { margin: 6px 0 0; color: var(--muted); padding-left: 0; list-style: none; }
.attend-cols li { margin-bottom: 4px; }
.attend-cols .ok { color: var(--green); } .attend-cols .no { color: var(--red); } .attend-cols .other { color: var(--gold); }
@media (max-width: 600px) { .attend-cols { grid-template-columns: 1fr; } }

/* ---------- GAMBLING ---------- */
.vote-side { position: sticky; top: 16px; display: grid; gap: 16px; }
.gamble-btn {
  font-family: Bungee, sans-serif; font-size: 2rem; letter-spacing: 3px; color: #fff;
  padding: 26px 16px; border-radius: 20px; cursor: pointer; border: 3px solid #fff;
  background: linear-gradient(135deg, #ff00c8, #7a00ff 50%, #00e5ff); background-size: 200% 200%;
  text-shadow: 0 0 8px #fff, 0 0 18px #ff00c8, 0 0 32px #ff00c8;
  animation: neonPulse 1.1s ease-in-out infinite, gradientMove 3s linear infinite;
}
.gamble-btn:hover { transform: scale(1.04) rotate(-1deg); }
.gamble-btn:disabled { animation: none; filter: grayscale(.8); opacity: .5; cursor: not-allowed; transform: none; }
@keyframes neonPulse {
  0%, 100% { box-shadow: 0 0 12px #ff00c8, 0 0 30px #ff00c8, 0 0 60px #7a00ff, inset 0 0 18px rgba(255,255,255,.5); transform: scale(1); }
  50% { box-shadow: 0 0 24px #00e5ff, 0 0 60px #ff00c8, 0 0 110px #7a00ff, inset 0 0 30px rgba(255,255,255,.8); transform: scale(1.035); }
}
@keyframes gradientMove { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }

.wheel-panel {
  border-radius: 24px; padding: 24px 16px 20px; text-align: center; overflow: hidden; position: relative;
  background: linear-gradient(180deg, rgba(7,6,15,.2), rgba(7,6,15,.85)), url('img/bg/bg-gamble.jpg') center 70% / cover;
  border: 2px solid rgba(255, 43, 214, .5); box-shadow: 0 0 40px rgba(155, 92, 255, .35);
  animation: popIn .5s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes popIn { from { transform: scale(.6) rotate(-8deg); opacity: 0; } }
.wheel-wrap { position: relative; width: 100%; max-width: 400px; margin: 0 auto; aspect-ratio: 1; }
#wheel { width: 100%; height: 100%; display: block; border-radius: 50%; filter: drop-shadow(0 0 22px rgba(255, 43, 214, .55)); }
.wheel-wrap.spinning #wheel { filter: drop-shadow(0 0 34px rgba(34, 230, 255, .8)); }
.pointer {
  position: absolute; top: -12px; left: 50%; width: 38px; height: 50px; z-index: 3;
  transform: translateX(-50%); transform-origin: 50% 20%;
  background: linear-gradient(180deg, #fff, var(--gold));
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  filter: drop-shadow(0 0 8px var(--gold)) drop-shadow(0 3px 2px rgba(0,0,0,.6));
}
.spin-hub {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2;
  width: 26%; aspect-ratio: 1; border-radius: 50%; border: 4px solid #fff; cursor: pointer;
  font-family: Bungee, sans-serif; font-size: 1.05rem; color: #fff;
  background: radial-gradient(circle at 35% 30%, #ff7ae9, #b100ff 60%, #4a0080);
  box-shadow: 0 0 20px #ff00c8, inset 0 -6px 14px rgba(0,0,0,.4); transition: .15s;
}
.spin-hub:hover:not(:disabled) { transform: translate(-50%, -50%) scale(1.08); }
.spin-hub:disabled { filter: grayscale(1); cursor: not-allowed; }
.wheel-info { margin: 14px 0 0; font-weight: 600; color: #e8dcff; text-shadow: 0 1px 4px #000; }
.win-banner {
  margin-top: 12px; padding: 14px; border-radius: 14px; font-family: Bungee, sans-serif; font-size: 1.2rem;
  background: linear-gradient(135deg, #ffd34d, #ff8a00); color: #2a1300; box-shadow: 0 0 30px rgba(255, 211, 77, .7);
  animation: popIn .5s cubic-bezier(.2, 1.6, .4, 1);
}
.win-banner small { display: block; font-family: Inter, sans-serif; font-weight: 600; font-size: .8rem; margin-top: 2px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.75); display: grid; place-items: center; padding: 16px; backdrop-filter: blur(4px); }
.modal-box {
  max-width: 440px; text-align: center; background: var(--card-solid); border: 2px solid var(--gold); border-radius: 20px; padding: 28px 24px;
  box-shadow: 0 0 50px rgba(255, 211, 77, .35); animation: popIn .4s cubic-bezier(.2, 1.5, .4, 1);
}
.modal-box h2 { font-family: Bungee, sans-serif; font-weight: 400; color: var(--gold); margin: 4px 0 10px; font-size: 2rem; }
.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

/* ---------- wyniki ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 900px; margin: 0 auto 10px; }
.stat { text-align: center; padding: 16px 10px; }
.stat b { display: block; font-family: Bungee, sans-serif; font-weight: 400; font-size: 2.2rem; color: var(--cyan); text-shadow: 0 0 12px var(--cyan); }
.stat span { color: var(--muted); font-size: .9rem; }
.results-list { max-width: 900px; margin: 16px auto; }
.res {
  display: grid; grid-template-columns: 44px 64px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 12px 16px 12px 12px; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(12px);
}
.res .icon { width: 64px; height: 64px; }
.rank { font-family: Bungee, sans-serif; font-size: 1.4rem; text-align: center; color: var(--muted); }
.res-name { font-weight: 800; font-size: 1.08rem; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.res-pct { font-family: Bungee, sans-serif; font-weight: 400; color: var(--cyan); }
.bar { height: 12px; border-radius: 999px; background: rgba(255,255,255,.08); margin: 8px 0 6px; overflow: hidden; position: relative; }
.bar::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), rgba(255,255,255,.12) calc(25% - 1px) 25%); }
.bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--purple), var(--pink)); transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.scale { display: flex; justify-content: space-between; font-size: .68rem; color: var(--muted); margin-top: -2px; }
.res-meta { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.res-meta b { color: var(--text); }
.steam-btn { text-decoration: none; color: #fff; font-weight: 800; font-size: .82rem; padding: 10px 14px; border-radius: 10px; background: linear-gradient(135deg, #1b2838, #2a475e); border: 1px solid #66c0f4; white-space: nowrap; }
.steam-btn:hover { box-shadow: 0 0 14px #66c0f4; }

.res.gold   { border-color: var(--gold);   background: linear-gradient(90deg, rgba(255, 211, 77, .22), var(--card) 60%); box-shadow: 0 0 26px rgba(255, 211, 77, .35); }
.res.silver { border-color: var(--silver); background: linear-gradient(90deg, rgba(214, 221, 232, .18), var(--card) 60%); box-shadow: 0 0 20px rgba(214, 221, 232, .25); }
.res.bronze { border-color: var(--bronze); background: linear-gradient(90deg, rgba(224, 138, 76, .2), var(--card) 60%); box-shadow: 0 0 20px rgba(224, 138, 76, .3); }
.res.gold .rank { color: var(--gold); } .res.gold .bar i { background: linear-gradient(90deg, #b8860b, var(--gold)); }
.res.silver .rank { color: var(--silver); } .res.silver .bar i { background: linear-gradient(90deg, #8a95a5, var(--silver)); }
.res.bronze .rank { color: var(--bronze); } .res.bronze .bar i { background: linear-gradient(90deg, #8a4b22, var(--bronze)); }

#custom-results { max-width: 900px; margin: 0 auto 16px; }
#custom-results h3 { margin: 0 0 10px; }
.custom-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.custom-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.05); }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; width: 100vw; height: 100vh; }

/* ---------- mobile ---------- */
@media (max-width: 1000px) {
  .vote-layout { grid-template-columns: 1fr; }
  .vote-side { position: static; order: -1; }
  .gamble-btn { font-size: 1.6rem; padding: 20px 12px; }
}
@media (max-width: 600px) {
  .top { padding-top: 26px; }
  .tab { padding: 10px 14px; font-size: .85rem; }
  .game { grid-template-columns: 58px minmax(0, 1fr) auto; gap: 10px; padding: 10px; }
  .icon { width: 58px; height: 58px; }
  .res { grid-template-columns: 34px 48px minmax(0, 1fr); gap: 8px; padding: 10px; }
  .rank { font-size: .95rem; }
  .res .icon { width: 48px; height: 48px; }
  .res .steam-btn { grid-column: 3; justify-self: start; }
  .stats { gap: 8px; }
  .stat b { font-size: 1.6rem; }
  .custom-row { grid-template-columns: 1fr; }
  .counter { font-size: 1.7rem; }
}
