@font-face { font-family: 'Poppins'; src: url('fonts/Poppins-Regular.ttf') format('truetype'); font-weight: 400; font-display: block; }
@font-face { font-family: 'Poppins'; src: url('fonts/Poppins-Medium.ttf') format('truetype'); font-weight: 500; font-display: block; }
@font-face { font-family: 'Poppins'; src: url('fonts/Poppins-Bold.ttf') format('truetype'); font-weight: 600 900; font-display: block; }

:root {
  --blue-0: #1838b8;
  --blue-1: #2456e6;
  --blue-2: #3b7bff;
  --navy: #141b4d;
  --navy-2: #0d1440;
  --ink: #161e4e;
  --muted: #6b739c;
  --line: #e4e8f6;
  --soft: #f1f4fd;
  --yellow: #ffd23f;
  --yellow-d: #e2a90a;
  --orange: #ff9a1f;
  --green: #22c873;
  --green-d: #13995a;
  --red: #ff4d6a;
  --red-d: #d42b49;
  --panel: rgba(11, 20, 78, .74);
  --font: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  --ease-back: cubic-bezier(.2, 1.45, .4, 1);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-weight: 500;
  color: #fff;
  background-color: var(--blue-1);
  background-image:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(120, 170, 255, .55), transparent 70%),
    radial-gradient(ellipse 120% 90% at 50% 40%, var(--blue-1) 40%, var(--blue-0) 100%);
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}
input, textarea, select { user-select: text; font-family: var(--font); }
button { font-family: var(--font); cursor: pointer; }
.hidden { display: none !important; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ───────── tło ───────── */
#sky { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
#sky::before, #sky::after {
  content: ''; position: absolute; width: 140vmax; height: 26vmax; left: -20vmax;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent);
  transform: rotate(-24deg); top: 18%;
  animation: band 22s ease-in-out infinite alternate;
}
#sky::after { top: 62%; height: 18vmax; animation-duration: 28s; animation-direction: alternate-reverse; opacity: .8; }
@keyframes band { from { translate: -12vmax 0; } to { translate: 12vmax 0; } }
#sky .st {
  position: absolute; width: var(--s); height: var(--s);
  background: #fff;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  opacity: 0;
  animation: twinkle var(--d) ease-in-out var(--dl) infinite;
}
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.4) rotate(0); } 50% { opacity: var(--o); transform: scale(1) rotate(45deg); } }

/* ───────── fancy tekst (SVG) ───────── */
.ft { display: block; overflow: visible; }
.ft text { font-family: var(--font); font-weight: 700; paint-order: stroke fill; }

/* ───────── górny pasek ───────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 104px; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 24px; pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.tb-left { display: flex; gap: 8px; align-items: center; justify-self: start; }
.tb-right { display: flex; gap: 8px; align-items: center; justify-self: end; }
.pill {
  height: 38px; display: inline-flex; align-items: center;
  background: rgba(10, 18, 70, .5); color: #fff; font-weight: 700; font-size: 15px;
  padding: 0 15px; border-radius: 10px;
}
.pill b { font-weight: 700; color: var(--yellow); margin-left: 5px; }
.pill.bump { animation: pillBump .6s var(--ease-back); }
@keyframes pillBump { 40% { transform: scale(1.18); } }
.pill-soft { background: rgba(255, 255, 255, .14); font-size: 13px; }

.icon-btn {
  height: 42px; min-width: 42px; padding: 0 11px; border: 0; border-radius: 12px;
  background: rgba(10, 18, 70, .5); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 14px; text-decoration: none; transition: background .15s, transform .15s var(--ease-back);
}
.icon-btn:hover { background: rgba(10, 18, 70, .78); transform: translateY(-2px); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn svg { width: 21px; height: 21px; }
#muteBtn.muted .ic-on { display: none; }
#muteBtn.muted .ic-off { display: block; }
#muteBtn.muted { background: var(--red); }

/* logo */
.logo { position: relative; display: flex; flex-direction: column; align-items: center; animation: logoBob 5s ease-in-out infinite; }
.logo .ft { margin: -6px 0; }
.logo .lg-sub { margin-top: -14px; }
@keyframes logoBob { 0%, 100% { transform: rotate(-2deg) translateY(0); } 50% { transform: rotate(-1deg) translateY(-3px); } }
.logo .spark { position: absolute; width: 22px; height: 22px; animation: sparkSpin 3.2s ease-in-out infinite; }
.logo .spark svg { width: 100%; height: 100%; stroke: none; }
.logo .spark.s1 { left: -20px; top: 4px; }
.logo .spark.s2 { right: -16px; top: -4px; width: 16px; height: 16px; animation-delay: -1.1s; }
.logo .spark.s3 { right: -26px; bottom: 6px; width: 13px; height: 13px; animation-delay: -2.2s; }
@keyframes sparkSpin { 0%, 100% { transform: scale(.75) rotate(0); } 50% { transform: scale(1.1) rotate(35deg); } }
.logo-big .spark.s1 { left: -38px; top: 12px; width: 40px; height: 40px; }
.logo-big .spark.s2 { right: -30px; top: 0; width: 28px; height: 28px; }
.logo-big .spark.s3 { right: -48px; bottom: 18px; width: 22px; height: 22px; }
.logo-big .lg-sub { margin-top: -26px; }

/* ───────── scena ───────── */
#stage { position: fixed; left: 0; right: 0; top: 104px; bottom: 120px; }
.tile {
  position: absolute;
  transition: left .6s var(--ease-out), top .6s var(--ease-out), width .6s var(--ease-out), transform .45s var(--ease-back);
  animation: tileIn .6s var(--ease-back) both;
  animation-delay: var(--in-delay, 0s);
}
@keyframes tileIn { from { opacity: 0; transform: scale(.7) translateY(30px) rotate(-3deg); } to { opacity: 1; transform: none; } }
#stage.spot .tile:not(.active):not(.slot) .tile-frame > video, #stage.spot .tile:not(.active):not(.slot) .tile-avatar { filter: brightness(.7) saturate(.85); }
.tile.active { transform: translateY(-8px) scale(1.035); z-index: 2; }
.tile.offline .tile-frame { filter: grayscale(.9) brightness(.55); }

.tile-frame {
  position: relative; width: 100%; aspect-ratio: var(--ar, 1.6);
  border: 4px solid var(--c); border-radius: 14px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 35%, #2a3c8f, #121c55 75%);
  box-shadow: 0 14px 28px rgba(5, 12, 60, .38);
  transition: filter .4s;
}
.tile-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; }
.tile.has-video .tile-frame video { opacity: 1; }
.tile.self .tile-frame video { transform: scaleX(-1); }
.tile-avatar {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: calc(var(--w) * .25); height: calc(var(--w) * .25); border-radius: 50%;
  background: var(--c); color: var(--navy); display: grid; place-items: center;
  font-weight: 700; font-size: calc(var(--w) * .085); letter-spacing: .5px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, .18);
  transition: opacity .3s, transform .4s var(--ease-back);
}
.tile.has-video .tile-avatar { opacity: 0; transform: translate(-50%, -50%) scale(.6); }
.tile-status {
  position: absolute; left: 10px; bottom: 10px; font-size: 12px; font-weight: 700;
  background: rgba(10, 18, 70, .78); padding: 3px 9px; border-radius: 8px;
}
.tile-status::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); margin-right: 6px; vertical-align: 1px; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }

.tile-badge {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  background: #fff; color: var(--ink); border-radius: 10px;
  min-width: calc(var(--w) * .1 + 20px); padding: 4px 8px 4px;
  display: flex; flex-direction: column; align-items: center; line-height: 1;
  box-shadow: 0 3px 0 rgba(10, 20, 70, .22);
}
.tile-badge b { font-weight: 700; font-size: calc(var(--w) * .045 + 8px); line-height: 1.05; }
.tile-badge span { font-size: 10px; font-weight: 600; color: var(--muted); }
.tile-badge.bump { animation: bump .6s var(--ease-back); }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.45) rotate(-6deg); background: var(--yellow); } 100% { transform: scale(1); } }

.tile-crown {
  position: absolute; z-index: 4; top: -22px;
  right: calc(10px + (var(--w) * .05 + 10px) - 18px);
  width: 36px; height: 30px; opacity: 0; transform: translateY(-30px) rotate(-20deg) scale(.5);
  transition: opacity .3s, transform .6s var(--ease-back);
}
.tile.leader .tile-crown { opacity: 1; transform: rotate(8deg); animation: crownIdle 2.6s ease-in-out .6s infinite; }
@keyframes crownIdle { 0%, 100% { transform: rotate(8deg) translateY(0); } 50% { transform: rotate(4deg) translateY(-3px); } }
.tile-crown svg, .pod .crown svg { width: 100%; height: 100%; stroke: none; overflow: visible; }

.tile-plate {
  position: absolute; left: 50%; bottom: calc(var(--plate-h) / -2); transform: translateX(-50%);
  height: var(--plate-h); width: 78%; z-index: 3;
  background: #fff; color: var(--ink); border-radius: 12px;
  display: flex; align-items: center; justify-content: center; padding: 0 14px;
  font-weight: 700; font-size: calc(var(--w) * .036 + 6px);
  box-shadow: 0 4px 0 rgba(10, 20, 70, .2), 0 8px 16px rgba(5, 12, 60, .18);
  white-space: nowrap; overflow: hidden;
}
.tile-plate .nm { overflow: hidden; text-overflow: ellipsis; }
.tile-plate .host-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow-d); margin-left: 8px; flex-shrink: 0; }

.tile-tag {
  position: absolute; z-index: 4; left: 50%; top: -17px; transform: translate(-50%, -20px) scale(.4);
  background: #fff; color: var(--ink); font-weight: 700; font-size: 14px;
  height: 30px; display: flex; align-items: center; padding: 0 14px; border-radius: 9px; opacity: 0;
  box-shadow: 0 3px 0 rgba(10, 20, 70, .22);
  transition: opacity .25s, transform .5s var(--ease-back);
}
.tile.active .tile-tag { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* miejsca na graczy w lobby */
.tile.slot .tile-frame { border-color: rgba(255, 255, 255, .16); background: rgba(10, 18, 70, .22); box-shadow: none; }
.tile.slot .tile-plate { background: rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .7); box-shadow: none; font-weight: 600; }
.slot-in { position: absolute; inset: 0; display: grid; place-items: center; }
.slot-in i {
  width: calc(var(--w) * .22); height: calc(var(--w) * .22); border-radius: 50%;
  background: rgba(255, 255, 255, .1); display: grid; place-items: center;
  animation: slotPulse 2.4s ease-in-out infinite; animation-delay: var(--in-delay, 0s);
}
.slot-in svg { width: 40%; height: 40%; color: rgba(255, 255, 255, .55); stroke-width: 2.4; }
@keyframes slotPulse { 0%, 100% { transform: scale(1); opacity: .7; } 50% { transform: scale(1.08); opacity: 1; } }

/* karta na czole */
.tile-card {
  position: absolute; z-index: 2; left: 50%; top: calc(var(--w) * .045 + 30px);
  transform: translateX(-50%); perspective: 900px; pointer-events: none;
  width: min(80%, calc(var(--w) * .6));
}
.card-swing { animation: swing 3.6s ease-in-out infinite; transform-origin: 50% 0; }
@keyframes swing { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(-1deg); } }
.card-inner { position: relative; transform-style: preserve-3d; transition: transform .8s var(--ease-back); }
.card-inner.drop { animation: cardDrop .75s var(--ease-back) both; }
@keyframes cardDrop { from { transform: translateY(-140%) rotate(-18deg); opacity: 0; } to { transform: none; opacity: 1; } }
.card-inner.flipped { transform: rotateY(180deg); }
.card-inner.pop { animation: cardPop .6s var(--ease-back); }
@keyframes cardPop { 40% { transform: scale(1.15) rotate(3deg); } }
.card-face {
  background: #fff; color: var(--ink); border-radius: 12px; overflow: hidden;
  text-align: center; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 6px 0 rgba(10, 20, 70, .28), 0 14px 26px rgba(4, 10, 50, .3);
}
.card-face.back { position: absolute; inset: 0; transform: rotateY(180deg); }
.card-band {
  background: var(--c); color: var(--navy); font-weight: 700; text-transform: uppercase; letter-spacing: .8px;
  font-size: calc(var(--w) * .02 + 5px); padding: calc(var(--w) * .006 + 2px) 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-name {
  display: block; font-weight: 700; letter-spacing: -.2px;
  font-size: calc(var(--w) * .062 + 5px); line-height: 1.12;
  padding: calc(var(--w) * .014 + 3px) calc(var(--w) * .03) calc(var(--w) * .018 + 4px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-face.mystery { background: var(--yellow); }
.card-face.mystery .card-band { background: var(--navy); color: var(--yellow); }
.card-face.mystery .card-name { letter-spacing: 8px; color: var(--navy); }
.card-face.mystery .card-name span { display: inline-block; animation: qBounce 1.4s ease-in-out infinite; }
.card-face.mystery .card-name span:nth-child(2) { animation-delay: .15s; }
.card-face.mystery .card-name span:nth-child(3) { animation-delay: .3s; }
@keyframes qBounce { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-14%); } }

.tile-stamp {
  position: absolute; z-index: 5; left: 50%; top: 74%;
  transform: translate(-50%, -50%) rotate(-8deg);
  font-weight: 700; font-size: calc(var(--w) * .07 + 6px); letter-spacing: 1px;
  padding: 2px 20px; border-radius: 12px; color: #fff;
  animation: stamp .5s var(--ease-back) both;
  box-shadow: 0 5px 0 rgba(0, 0, 0, .22);
  white-space: nowrap;
}
.tile-stamp.ok { background: var(--green); }
.tile-stamp.bad { background: var(--red); }
.tile-stamp.meh { background: #5b66a3; }
@keyframes stamp { from { transform: translate(-50%, -50%) rotate(-20deg) scale(2.6); opacity: 0; } to { transform: translate(-50%, -50%) rotate(-8deg) scale(1); opacity: 1; } }

.tile-rays {
  position: absolute; z-index: 1; inset: -40%; pointer-events: none; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .22) 0 8deg, transparent 8deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 15%, transparent 62%); mask: radial-gradient(circle, #000 15%, transparent 62%);
  animation: raysIn 2.2s ease-out forwards;
}
@keyframes raysIn { 0% { opacity: 0; transform: rotate(0) scale(.5); } 20% { opacity: 1; } 100% { opacity: 0; transform: rotate(60deg) scale(1.1); } }

.float-pts {
  position: absolute; z-index: 6; top: -10px; right: 6px;
  font-weight: 700; font-size: 34px; color: var(--yellow);
  -webkit-text-stroke: 7px var(--navy); paint-order: stroke fill;
  animation: floatUp 1.5s ease-out forwards; pointer-events: none;
}
@keyframes floatUp { 0% { transform: translateY(10px) scale(.4); opacity: 0; } 20% { transform: translateY(-8px) scale(1.25); opacity: 1; } 100% { transform: translateY(-70px) scale(1); opacity: 0; } }

.tile-tools { position: absolute; z-index: 5; left: 10px; top: 10px; display: flex; gap: 5px; opacity: 0; transition: opacity .15s; }
@media (hover: hover) { .tile:hover .tile-tools { opacity: 1; } }
.tile.tools-open .tile-tools { opacity: 1; }
.tile-tools { pointer-events: none; }
.tile.tools-open .tile-tools, .tile:hover .tile-tools { pointer-events: auto; }
.tile-tools button {
  width: 28px; height: 28px; border-radius: 8px; border: 0; background: rgba(255, 255, 255, .94);
  color: var(--ink); display: grid; place-items: center; padding: 0;
}
.tile-tools button:hover { background: #fff; }
.tile-tools button.kick { color: var(--red-d); }
.tile-tools svg { width: 15px; height: 15px; stroke-width: 2.6; }

/* ───────── dolny panel ───────── */
#dock {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 15;
  width: min(1040px, calc(100vw - 32px)); min-height: 88px;
  background: var(--panel); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-radius: 20px; padding: 14px 16px 14px 24px;
  display: flex; align-items: center; gap: 20px;
  box-shadow: 0 16px 40px rgba(5, 10, 50, .3);
  animation: dockIn .5s var(--ease-back);
}
#dock.swap > * { animation: dockSwap .45s var(--ease-out) both; }
@keyframes dockIn { from { transform: translate(-50%, 30px); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
@keyframes dockSwap { from { transform: translateY(10px); opacity: 0; } }
.dock-info { flex: 1; min-width: 0; }
.dock-info .lbl { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .9px; color: rgba(255, 255, 255, .58); }
.dock-info .big { font-size: 22px; font-weight: 700; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-info .big .who { color: var(--yellow); }
.dock-info .sub { font-size: 13.5px; font-weight: 500; color: rgba(255, 255, 255, .75); margin-top: 2px; }
.dock-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

.timer { position: relative; width: 74px; height: 74px; flex-shrink: 0; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer .tr-bg { stroke: rgba(255, 255, 255, .14); stroke-width: 7; }
.timer .tr-fg { stroke: var(--green); stroke-width: 7; transition: stroke .3s; }
.timer .digits { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 21px; }
.timer.inf .digits { font-size: 28px; }
.timer.warn .tr-fg { stroke: var(--yellow); }
.timer.crit .tr-fg { stroke: var(--red); }
.timer.crit { animation: pulse 1s infinite; }
.timer.crit .digits { color: #ffb3c0; }
.timer.paused { opacity: .55; }
@keyframes pulse { 50% { transform: scale(1.1); } }

.invite { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .1); border-radius: 12px; padding: 6px 6px 6px 14px; min-width: 0; margin-top: 4px; }
.invite code { font-family: var(--font); font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; flex: 1; }
.invite.wait code { color: rgba(255, 255, 255, .65); }
.invite.wait code::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 8px; border-radius: 50%; background: var(--yellow); animation: blink 1s infinite; }
.invite.err code { color: #ffb3c0; white-space: normal; }

/* ───────── przyciski ───────── */
.btn {
  border: 0; border-radius: 12px; height: 48px; padding: 0 18px; font-weight: 700; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .25); transition: transform .12s, filter .15s, box-shadow .12s;
  color: var(--ink); background: #fff;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-2px); box-shadow: 0 6px 0 rgba(0, 0, 0, .25); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn svg { width: 19px; height: 19px; stroke-width: 2.6; }
.btn-yellow { background: var(--yellow); color: var(--navy); box-shadow: 0 4px 0 var(--yellow-d); }
.btn-yellow:hover { box-shadow: 0 6px 0 var(--yellow-d); }
.btn-yellow:active { box-shadow: 0 1px 0 var(--yellow-d); }
.btn-green { background: var(--green); color: #fff; box-shadow: 0 4px 0 var(--green-d); }
.btn-green:hover { box-shadow: 0 6px 0 var(--green-d); }
.btn-red { background: var(--red); color: #fff; box-shadow: 0 4px 0 var(--red-d); }
.btn-red:hover { box-shadow: 0 6px 0 var(--red-d); }
.btn-ghost { background: rgba(255, 255, 255, .13); color: #fff; box-shadow: none; }
.btn-ghost:hover, .btn-ghost:active { box-shadow: none; background: rgba(255, 255, 255, .2); }
.btn-ghost-dark { background: #eef1fb; color: var(--ink); box-shadow: none; }
.btn-ghost-dark:hover, .btn-ghost-dark:active { box-shadow: none; background: #e3e8f8; }
.btn-sm { height: 38px; padding: 0 13px; font-size: 14px; border-radius: 10px; }
.btn-lg { height: 58px; font-size: 19px; width: 100%; border-radius: 14px; }
.btn-icon { width: 48px; padding: 0; }
.btn-start { height: 56px; padding: 0 30px; font-size: 19px; letter-spacing: 1px; animation: startPulse 2s ease-in-out infinite; }
.btn-start:disabled { animation: none; }
@keyframes startPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/* ───────── nakładki ───────── */
#overlay { position: fixed; inset: 0; z-index: 30; pointer-events: none; display: grid; place-items: center; overflow: hidden; }
#overlay.dim { background: rgba(8, 14, 60, .6); pointer-events: auto; animation: fadeIn .35s; }
#overlay.intro-bg::before {
  content: ''; position: absolute; inset: 0; background: rgba(8, 14, 60, .55);
  animation: introBg var(--dur, 3s) both;
}
#overlay > * { position: relative; }
#overlay > .rays, #overlay > .intro-stars { position: absolute; }
@keyframes introBg { 0% { opacity: 0; } 10% { opacity: 1; } 84% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } }

.rays {
  position: absolute; left: 50%; top: 50%; width: 170vmax; height: 170vmax; margin: -85vmax 0 0 -85vmax;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .09) 0 7deg, transparent 7deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 0, transparent 55%); mask: radial-gradient(circle, #000 0, transparent 55%);
  animation: raysSpin 26s linear infinite, raysFade var(--dur, 3s) both;
  pointer-events: none;
}
#overlay.dim .rays { animation: raysSpin 40s linear infinite, fadeIn .8s both; }
@keyframes raysSpin { to { transform: rotate(360deg); } }
@keyframes raysFade { 0% { opacity: 0; transform: scale(.4); } 14% { opacity: 1; transform: scale(1); } 84% { opacity: 1; } 100% { opacity: 0; } }

.intro { text-align: center; display: flex; flex-direction: column; align-items: center; }
.intro .ft { max-width: 92vw; height: auto; }
.intro.round .intro-big { animation: slam 3.1s var(--ease-back) both; }
.intro.round .intro-sub { animation: popIn 3.1s .28s both; }
.intro-sub {
  display: inline-block; margin-top: 10px; background: #fff; color: var(--ink);
  font-weight: 700; font-size: 22px; height: 46px; line-height: 46px; padding: 0 24px; border-radius: 12px;
  box-shadow: 0 5px 0 rgba(10, 20, 70, .3);
}
@keyframes slam {
  0% { transform: scale(3) rotate(-12deg); opacity: 0; }
  13% { transform: scale(1) rotate(-3deg); opacity: 1; }
  17% { transform: scale(1.06) rotate(-3deg); }
  21% { transform: scale(1) rotate(-3deg); }
  84% { transform: scale(1.03) rotate(-3deg); opacity: 1; }
  100% { transform: scale(.6) rotate(-3deg); opacity: 0; }
}
@keyframes popIn {
  0% { transform: translateY(24px) scale(.5); opacity: 0; }
  12% { transform: none; opacity: 1; }
  84% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(10px); }
}
.intro-stars { position: absolute; inset: 0; pointer-events: none; }
.intro-stars i {
  position: absolute; left: 50%; top: 50%; width: var(--s); height: var(--s); background: var(--yellow);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  animation: starFly 1.4s var(--ease-out) var(--dl) both;
}
@keyframes starFly { 0% { transform: translate(-50%, -50%) scale(0) rotate(0); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1) rotate(180deg); opacity: 0; } }

.intro.turn .intro-tag {
  display: inline-block; background: #fff; color: var(--ink); font-weight: 700; font-size: 22px;
  height: 44px; line-height: 44px; padding: 0 22px; border-radius: 11px; box-shadow: 0 4px 0 rgba(10, 20, 70, .3);
  animation: popIn 2.7s both;
}
.intro.turn .intro-big { margin-top: 6px; animation: slideName 2.7s var(--ease-out) both; }
.intro.turn .intro-hint {
  margin-top: 12px; font-weight: 600; font-size: 19px; animation: popIn 2.7s .2s both;
  background: rgba(10, 18, 70, .6); padding: 8px 18px; border-radius: 12px;
}
@keyframes slideName {
  0% { transform: translateX(-70vw) skewX(14deg); opacity: 0; }
  16% { transform: translateX(2vw) skewX(-5deg); opacity: 1; }
  23% { transform: none; }
  84% { transform: none; opacity: 1; }
  100% { transform: translateX(70vw) skewX(14deg); opacity: 0; }
}

.panel {
  background: #fff; color: var(--ink); border-radius: 24px; padding: 26px 28px 24px;
  width: min(580px, calc(100vw - 32px)); box-shadow: 0 10px 0 rgba(10, 20, 70, .3), 0 30px 60px rgba(4, 10, 50, .4);
  animation: panelIn .6s var(--ease-back) both;
  max-height: calc(100vh - 110px); margin-top: 40px; display: flex; flex-direction: column;
}
.panel .rank { overflow-y: auto; min-height: 0; flex: 0 1 auto; padding-right: 2px; }
@keyframes panelIn { from { transform: translateY(60px) scale(.85) rotate(-2deg); opacity: 0; } }
.panel-title { display: flex; justify-content: center; margin: -62px 0 6px; }
.panel-sub { text-align: center; color: var(--muted); font-weight: 600; margin-bottom: 18px; }
.rank { display: flex; flex-direction: column; gap: 8px; }
.rank-row {
  position: relative; display: grid; grid-template-columns: 34px 1fr 72px; align-items: center; gap: 12px;
  background: var(--soft); border-radius: 12px; padding: 0 16px; height: 50px; overflow: hidden;
  animation: rowIn .5s var(--ease-back) both;
}
.rank-row .bar { position: absolute; left: 0; top: 0; bottom: 0; width: var(--pct); background: var(--c); opacity: .2; transform-origin: left; animation: barGrow .9s var(--ease-out) both; animation-delay: inherit; }
@keyframes barGrow { from { transform: scaleX(0); } }
@keyframes rowIn { from { transform: translateX(-40px); opacity: 0; } }
.rank-row > * { position: relative; }
.rank-row .pos { font-weight: 700; font-size: 20px; color: var(--muted); text-align: center; }
.rank-row .nm { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.rank-row .nm i { width: 12px; height: 12px; border-radius: 4px; background: var(--c); flex-shrink: 0; }
.rank-row .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .pt { font-weight: 700; font-size: 22px; text-align: right; }
.rank-row .pt small { font-weight: 600; font-size: 12px; color: var(--muted); margin-left: 3px; }
.rank-row.first { background: #fff4c7; }
.rank-row.first .pos { color: var(--yellow-d); }
.panel-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.panel-actions .btn { flex: 1; }
.panel-wait { text-align: center; color: var(--muted); font-weight: 600; margin-top: 18px; }

.podium { display: flex; justify-content: center; align-items: flex-end; gap: 12px; margin: 14px 0 16px; min-height: 260px; }
.pod { width: 150px; display: flex; flex-direction: column; align-items: center; }
.pod .pod-name { font-weight: 700; font-size: 17px; margin-bottom: 2px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod .pod-pts { font-weight: 600; color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.pod .pod-block {
  width: 100%; border-radius: 14px 14px 6px 6px; background: var(--c);
  display: grid; place-items: start center; padding-top: 12px;
  font-weight: 700; font-size: 42px; color: var(--navy);
  box-shadow: inset 0 -10px 0 rgba(0, 0, 0, .1);
  animation: grow .9s var(--ease-back) both; transform-origin: bottom;
}
.pod.p1 .pod-block { height: 150px; animation-delay: 1s; }
.pod.p2 .pod-block { height: 108px; animation-delay: .55s; }
.pod.p3 .pod-block { height: 78px; animation-delay: .2s; }
.pod.p1 .pod-name, .pod.p1 .pod-pts { animation: popIn2 .45s 1.6s both; }
.pod.p2 .pod-name, .pod.p2 .pod-pts { animation: popIn2 .45s 1.15s both; }
.pod.p3 .pod-name, .pod.p3 .pod-pts { animation: popIn2 .45s .8s both; }
.pod .crown { width: 46px; height: 38px; margin-bottom: 2px; animation: crownDrop .7s var(--ease-back) 1.9s both; }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes popIn2 { from { transform: scale(.3); opacity: 0; } }
@keyframes crownDrop { from { transform: translateY(-80px) rotate(-30deg); opacity: 0; } }

/* ───────── ekran dołączania ───────── */
body.joining .topbar .logo, body.joining .tb-left { visibility: hidden; }
.screen { padding-top: 70px; }
.screen { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; overflow: auto; padding: 24px 16px; }
.join-wrap { display: flex; flex-direction: column; align-items: center; gap: 30px; width: min(580px, 100%); }
.join-wrap .logo { animation: logoBob 5s ease-in-out infinite, joinLogo .9s var(--ease-back) both; }
@keyframes joinLogo { from { transform: scale(.4) rotate(-12deg); opacity: 0; } }
.card { background: #fff; color: var(--ink); border-radius: 24px; box-shadow: 0 10px 0 rgba(10, 20, 70, .28), 0 30px 60px rgba(4, 10, 50, .35); }
.join-card { width: 100%; padding: 24px; display: flex; flex-direction: column; gap: 16px; animation: panelIn .7s .15s var(--ease-back) both; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 700; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; }
.field input, .field textarea, .modal-card input, select {
  border: 2px solid var(--line); background: #f6f8fe; border-radius: 12px; height: 50px; padding: 0 14px;
  font-size: 16px; font-weight: 600; color: var(--ink); outline: none; transition: border-color .15s, background .15s;
  width: 100%;
}
.field textarea { height: auto; padding: 12px 14px; }
.field input:focus, .field textarea:focus, .modal-card input:focus, select:focus { border-color: var(--blue-2); background: #fff; }
select { font-size: 14px; height: 44px; cursor: pointer; }

.cam-box { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
.cam-preview { position: relative; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: #e9edf9; border: 4px solid var(--yellow); }
.cam-preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.cam-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 13px; text-align: center; padding: 8px; }
.cam-empty svg { width: 30px; height: 30px; }
.cam-preview.live .cam-empty { display: none; }
.cam-info { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cam-detected { font-weight: 700; font-size: 15px; line-height: 1.35; }
.cam-detected small { display: block; color: var(--muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .7px; }
.cam-detected.ok small { color: var(--green-d); }
.cam-detected.err { color: var(--red-d); }
.cam-actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink); }
.switch input { display: none; }
.switch i { width: 42px; height: 24px; border-radius: 20px; background: #d5dbef; position: relative; transition: background .2s; flex-shrink: 0; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease-back); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(18px); }

.check-row { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; cursor: pointer; }
.check-row input { width: 20px; height: 20px; accent-color: var(--blue-1); }
.join-note { background: var(--soft); border-radius: 12px; padding: 12px 14px; font-weight: 500; font-size: 14px; line-height: 1.5; color: #39426e; }
.join-note b { font-weight: 700; }
.join-note a { display: inline-block; margin-top: 6px; color: var(--blue-1); font-weight: 700; text-decoration: none; }

/* ───────── modal ───────── */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(8, 14, 60, .55); display: grid; place-items: center; padding: 20px; animation: fadeIn .2s; }
.modal-card { width: min(900px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; overflow: hidden; animation: panelIn .45s var(--ease-back); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 0 20px; }
.tabs { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 14px; height: 40px; padding: 0 14px; border-radius: 10px; }
.tabs button.active { background: #eef1fb; color: var(--ink); }
.x-btn { border: 0; background: #eef1fb; color: var(--ink); width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; }
.x-btn svg { width: 18px; height: 18px; stroke-width: 2.6; }
.tab-body { padding: 18px 20px 22px; overflow: auto; }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.set-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.set-col h4 { margin: 6px 0 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.set-col h4 small { text-transform: none; letter-spacing: 0; font-weight: 600; }
.slider { display: grid; grid-template-columns: 70px 1fr 40px; align-items: center; gap: 12px; font-weight: 600; font-size: 15px; }
.slider b { text-align: right; font-size: 14px; color: var(--muted); font-weight: 600; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 8px; border-radius: 6px; background: var(--line); outline: none; padding: 0; border: 0; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--blue-1); cursor: pointer; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--blue-1); cursor: pointer; border: 3px solid #fff; }
.mini-preview { aspect-ratio: 16 / 10; width: 100%; max-width: 280px; border-radius: 12px; overflow: hidden; background: #e9edf9; }
.mini-preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.row { display: flex; gap: 8px; align-items: center; }
.row input { flex: 1; }
.grow { flex: 1; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 0; background: #eef1fb; color: var(--ink); font-weight: 700; font-size: 14px; height: 38px; padding: 0 13px; border-radius: 10px; transition: transform .15s var(--ease-back); }
.seg button:hover { transform: translateY(-2px); }
.seg button.on { background: var(--blue-1); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 0; background: #eef1fb; color: var(--ink); font-weight: 700; font-size: 13.5px; height: 38px; padding: 0 12px; border-radius: 10px; display: inline-flex; gap: 8px; align-items: center; transition: transform .15s var(--ease-back); }
.chip:hover { transform: translateY(-2px); }
.chip em { font-style: normal; font-weight: 600; color: var(--muted); font-size: 12px; }
.chip.on { background: var(--yellow); }
.chip.on em { color: rgba(20, 28, 79, .6); }
.pool-info { font-weight: 600; color: var(--muted); font-size: 14px; }
.locked-note { background: #fff4c7; border-radius: 12px; padding: 10px 14px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.locked .seg, .locked .chips, .locked .switch { pointer-events: none; opacity: .55; }

.ed-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 18px; min-height: 400px; }
.ed-list { display: flex; flex-direction: column; gap: 6px; max-height: 470px; overflow: auto; }
.ed-list button { border: 0; background: var(--soft); color: var(--ink); text-align: left; min-height: 40px; padding: 0 12px; border-radius: 10px; font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-shrink: 0; }
.ed-list button em { font-style: normal; color: var(--muted); font-weight: 600; }
.ed-list button.sel { background: var(--blue-1); color: #fff; }
.ed-list button.sel em { color: rgba(255, 255, 255, .7); }
.ed-list button.add { background: transparent; color: var(--blue-1); justify-content: center; }
.ed-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ed-main .field.grow { flex: 1; }
.ed-main textarea { flex: 1; min-height: 280px; resize: vertical; font-size: 15px; line-height: 1.55; font-weight: 500; }
.field em { font-style: normal; text-transform: none; letter-spacing: 0; }

/* ───────── różne ───────── */
#confetti { position: fixed; inset: 0; z-index: 35; pointer-events: none; width: 100%; height: 100%; }
#toasts { position: fixed; top: 112px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #fff; color: var(--ink); font-weight: 600; padding: 10px 18px; border-radius: 12px; box-shadow: 0 4px 0 rgba(10, 20, 70, .25); animation: toastIn .4s var(--ease-back); }
.toast.out { animation: toastOut .3s forwards; }
@keyframes toastIn { from { transform: translateY(-18px) scale(.85); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(-10px); opacity: 0; } }
#connBanner { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 70; background: var(--red); color: #fff; font-weight: 700; padding: 8px 18px; border-radius: 0 0 12px 12px; }

@media (max-width: 760px) {
  .cam-box, .set-grid, .ed-wrap { grid-template-columns: 1fr; }
  #dock { flex-wrap: wrap; }
  .pill-soft { display: none; }
}

/* ═════════ CZÓŁKO ONLINE ═════════ */
#home .logo-big .lg-sub { margin-top: -22px; }
.home-wrap { width: min(1080px, 100%); display: flex; flex-direction: column; align-items: center; gap: 18px; padding-bottom: 70px; }
.home-wrap .logo { animation: logoBob 5s ease-in-out infinite, joinLogo .9s var(--ease-back) both; }
.tagline { margin: -4px 0 6px; font-weight: 600; font-size: 17px; color: rgba(255, 255, 255, .88); text-align: center; }
.home-grid { width: 100%; display: grid; grid-template-columns: 400px 1fr; gap: 20px; align-items: start; }
.home-card, .rooms-card { padding: 22px; display: flex; flex-direction: column; gap: 14px; animation: panelIn .7s .1s var(--ease-back) both; }
.rooms-card { animation-delay: .2s; min-height: 330px; }
.home-actions { display: flex; flex-direction: column; gap: 10px; }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; height: 48px; border: 2px solid var(--line); background: #f6f8fe; border-radius: 12px; padding: 0 14px; font-size: 16px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: var(--ink); outline: none; min-width: 0; }
.code-row input:focus { border-color: var(--blue-2); background: #fff; }
.code-row input::placeholder { letter-spacing: 1px; font-weight: 600; color: #a3a9c6; }
.create-box { display: flex; flex-direction: column; gap: 12px; background: var(--soft); border-radius: 14px; padding: 14px; animation: panelIn .4s var(--ease-back); }
.legal-check { font-size: 13px; font-weight: 500; line-height: 1.45; align-items: flex-start; }
.legal-check input { margin-top: 2px; flex-shrink: 0; }
.legal-check a { color: var(--blue-1); font-weight: 700; }
.legal-check.bad, .field input.bad { animation: shakeX .4s; }
.field input.bad { border-color: var(--red); }
.legal-check.bad span { color: var(--red-d); }
@keyframes shakeX { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.rooms-head { display: flex; align-items: center; justify-content: space-between; }
.rooms-head h3 { margin: 0; font-size: 18px; font-weight: 700; }
.live-dot { font-size: 12px; font-weight: 700; color: var(--green-d); text-transform: uppercase; letter-spacing: .7px; }
.live-dot::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 6px; animation: blink 1.4s infinite; }
.rooms-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow: auto; }
.rooms-empty { color: var(--muted); font-weight: 600; text-align: center; padding: 50px 10px; line-height: 1.6; }
.room-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px; background: var(--soft); border-radius: 12px; padding: 10px 10px 10px 16px; animation: rowIn .4s var(--ease-back) both; }
.rr-main { min-width: 0; }
.rr-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-meta { font-size: 12.5px; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-meta b { font-weight: 700; }
.st-lobby { color: var(--green-d); } .st-game { color: #c27b00; } .st-end { color: var(--muted); }
.rr-count { font-weight: 700; font-size: 15px; color: var(--ink); min-width: 34px; text-align: right; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: rgba(255, 255, 255, .8); font-weight: 600; font-size: 13.5px; text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }

.join-title { font-weight: 700; font-size: 22px; text-align: center; background: rgba(10, 18, 70, .5); padding: 10px 22px; border-radius: 14px; animation: panelIn .5s var(--ease-back) both; }
.mic-box { display: flex; flex-direction: column; gap: 10px; background: var(--soft); border-radius: 14px; padding: 14px; }
.meter { height: 10px; border-radius: 6px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--green), var(--yellow) 75%, var(--red)); transform-origin: left; transform: scaleX(0); transition: transform .08s linear; border-radius: 6px; }
.seg-sm button { height: 32px; font-size: 12.5px; padding: 0 10px; }
.hint { font-size: 13px; color: var(--muted); font-weight: 500; line-height: 1.5; margin: 0; }
.hint b { color: var(--ink); }

/* przyciski mikrofonu / kamerki */
.icon-btn .ic-off { display: none; }
.icon-btn.media.muted .ic-on { display: none; }
.icon-btn.media.muted .ic-off { display: block; }
.icon-btn.media.muted { background: var(--red); }
#micBtn { position: relative; }
#micBtn .ptt-badge { display: none; position: absolute; right: -4px; bottom: -4px; background: var(--yellow); color: var(--navy); font-size: 10px; font-weight: 700; width: 17px; height: 17px; border-radius: 5px; align-items: center; justify-content: center; }
#micBtn.ptt .ptt-badge { display: flex; }
#micBtn.ptt:not(.live) { background: rgba(10, 18, 70, .5); }
#micBtn.live { background: var(--green); }
.icon-btn:disabled { opacity: .45; pointer-events: none; }

/* wskaźnik mówienia i mikrofonu na tabliczce */
.tile-plate .mic-off, .tile-plate .voice { display: inline-flex; align-items: center; margin-right: 7px; flex-shrink: 0; }
.tile-plate .mic-off svg { width: 15px; height: 15px; color: var(--red-d); stroke-width: 2.4; }
.tile-plate .voice { gap: 2px; height: 14px; }
.tile-plate .voice i { width: 3px; height: 5px; border-radius: 2px; background: #c3c9de; transition: background .2s; }
.tile.talking .tile-plate .voice i { background: var(--green); animation: vbar .5s ease-in-out infinite; }
.tile.talking .tile-plate .voice i:nth-child(2) { animation-delay: .12s; }
.tile.talking .tile-plate .voice i:nth-child(3) { animation-delay: .24s; }
@keyframes vbar { 0%, 100% { height: 4px; } 50% { height: 14px; } }
.tile.talking .tile-frame { border-width: 6px; }
.tile.talking .tile-plate { transform: translateX(-50%) scale(1.04); }
.tile-plate { transition: transform .2s var(--ease-back); }
.tile-frame { transition: filter .4s, border-width .15s; }
.tile-hidden { position: absolute; z-index: 3; left: 50%; top: 42%; transform: translate(-50%, -50%); background: rgba(10, 18, 70, .85); color: #fff; font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 9px; pointer-events: none; }
.tile.blocked .tile-avatar { opacity: .25; }
.tile-tools button.on { background: var(--red); color: #fff; }
.dock-info .lbl .code { color: var(--yellow); letter-spacing: 1.5px; }

/* zgłoszenia */
.report-card { width: min(520px, 100%); }
.report-card h3 { margin: 0; font-size: 18px; }
.reasons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-bottom: 14px; }
.reasons .check-row { font-size: 14px; font-weight: 600; }
.report-card textarea { height: auto; min-height: 80px; }

.storage-note { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 80; background: #fff; color: var(--ink); border-radius: 14px; padding: 10px 10px 10px 18px; display: flex; align-items: center; gap: 14px; font-size: 13.5px; font-weight: 500; box-shadow: 0 8px 30px rgba(4, 10, 50, .35); width: min(760px, calc(100vw - 24px)); animation: toastIn .5s var(--ease-back); }
.storage-note span { flex: 1; }
.storage-note a { color: var(--blue-1); font-weight: 700; white-space: nowrap; }
body:not(.joining) .storage-note { display: none; }
.banned { max-width: 560px; margin: 18vh auto; background: #fff; color: var(--ink); border-radius: 20px; padding: 30px; text-align: center; font-family: var(--font); }
.banned a { color: var(--blue-1); }
#audios { display: none; }

@media (max-width: 900px) { .home-grid { grid-template-columns: 1fr; } }
#home { place-items: start center; }
#join:not(.hidden) ~ .storage-note { display: none; }

.discord-home { width: 100%; height: 44px; font-size: 14px; }
.discord-home svg { width: 18px; height: 18px; }


/* ═════════ TELEFON ═════════ */
button, a, .chip, .seg button, .switch, .check-row { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
#micBtn { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.ft { max-width: 100%; height: auto; }

@media (max-width: 760px), (max-height: 500px) {
  .topbar { height: 58px; padding: 0 10px; grid-template-columns: auto 1fr auto; padding-top: env(safe-area-inset-top); }
  .topbar .logo { display: none; }
  .tb-left { gap: 6px; }
  .tb-right { gap: 6px; grid-column: 3; }
  .pill { height: 34px; font-size: 13px; padding: 0 11px; border-radius: 9px; }
  #roomPill, #specPill { display: none !important; }
  .icon-btn { height: 40px; min-width: 40px; padding: 0 9px; border-radius: 11px; }
  .icon-btn svg { width: 20px; height: 20px; }
  .icon-btn.discord-link span { display: none; }
  body:not(.joining) #discordBtn { display: none; }
  #stage { top: 58px; }
  #toasts { top: 64px; width: calc(100vw - 24px); }
  .toast { font-size: 14px; text-align: center; }

  .tile-tag { font-size: 12px; height: 24px; padding: 0 10px; top: -13px; }
  .tile-badge { top: 6px; right: 6px; padding: 3px 6px; border-radius: 8px; min-width: 34px; }
  .tile-badge b { font-size: calc(var(--w) * .05 + 7px); }
  .tile-badge span { font-size: 9px; }
  .tile-crown { width: 28px; height: 24px; top: -17px; right: 10px; }
  .tile-frame { border-width: 3px; border-radius: 12px; }
  .tile.talking .tile-frame { border-width: 5px; }
  .tile-plate { border-radius: 10px; padding: 0 8px; font-size: calc(var(--w) * .045 + 6px); width: 86%; }
  .tile-plate .voice, .tile-plate .mic-off { margin-right: 5px; }
  .tile-status { font-size: 10px; left: 6px; bottom: 6px; padding: 2px 7px; }
  .tile-tools { left: 6px; top: 6px; gap: 4px; flex-wrap: wrap; max-width: calc(100% - var(--w) * .1 - 48px); }
  .tile-tools button { width: 34px; height: 34px; border-radius: 9px; }
  .tile-tools svg { width: 17px; height: 17px; }
  .tile-card { top: calc(var(--w) * .06 + 26px); width: min(88%, calc(var(--w) * .8)); }
  .card-band { font-size: calc(var(--w) * .03 + 5px); }
  .card-name { font-size: calc(var(--w) * .08 + 5px); }
  .tile-stamp { font-size: calc(var(--w) * .09 + 5px); padding: 2px 12px; }
  .float-pts { font-size: 26px; }

  #dock {
    left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); width: auto; transform: none;
    padding: 10px 12px; gap: 8px 10px; flex-wrap: wrap; border-radius: 16px; min-height: 0;
    animation: dockInM .45s var(--ease-back);
  }
  @keyframes dockInM { from { transform: translateY(24px); opacity: 0; } }
  .dock-info { flex: 1 1 100%; }
  .dock-info .lbl { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dock-info .big { font-size: 18px; }
  .dock-info .sub { font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .dock-actions { flex: 1 1 auto; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
  .dock-actions .btn { height: 44px; padding: 0 12px; font-size: 14px; flex: 1 1 auto; }
  .dock-actions .btn-icon { flex: 0 0 44px; width: 44px; padding: 0; }
  .dock-actions .btn-start { height: 48px; font-size: 16px; padding: 0 18px; animation: none; }
  .timer { width: 54px; height: 54px; }
  .timer .digits { font-size: 16px; }
  .timer .tr-bg, .timer .tr-fg { stroke-width: 8; }
  .invite { padding: 4px 4px 4px 10px; }
  .invite code { font-size: 12px; }
  .invite .btn { height: 34px; font-size: 12px; padding: 0 10px; }

  .intro-sub { font-size: 17px; height: 38px; line-height: 38px; padding: 0 16px; }
  .intro.turn .intro-tag { font-size: 16px; height: 34px; line-height: 34px; }
  .intro.turn .intro-hint { font-size: 14px; margin: 10px 16px 0; text-align: center; }
  .panel { padding: 18px 16px 16px; border-radius: 20px; margin-top: 30px; }
  .panel-title { margin: -48px 0 4px; }
  .rank-row { height: 44px; padding: 0 12px; grid-template-columns: 26px 1fr 60px; gap: 8px; }
  .rank-row .nm { font-size: 15px; }
  .rank-row .pt { font-size: 18px; }
  .podium { min-height: 210px; gap: 8px; }
  .pod { width: 31%; }
  .pod .pod-name { font-size: 14px; max-width: 100%; }
  .pod .pod-block { font-size: 30px; }
  .pod.p1 .pod-block { height: 120px; } .pod.p2 .pod-block { height: 88px; } .pod.p3 .pod-block { height: 64px; }
  .panel-actions .btn { height: 46px; font-size: 14px; }

  .screen { padding: 64px 12px 24px; }
  .home-wrap { gap: 14px; padding-bottom: 110px; }
  .tagline { font-size: 14px; margin: 0; padding: 0 6px; }
  .home-grid { grid-template-columns: 1fr; gap: 14px; }
  .home-card, .rooms-card { padding: 16px; border-radius: 20px; }
  .rooms-card { min-height: 0; }
  .rooms-list { max-height: none; }
  .room-row { grid-template-columns: 1fr auto; gap: 6px 10px; padding: 10px 12px; }
  .rr-count { grid-row: 1; grid-column: 2; }
  .room-row .btn { grid-column: 1 / -1; width: 100%; }
  .rr-meta { white-space: normal; }
  .btn-lg { height: 52px; font-size: 17px; }
  .storage-note { flex-wrap: wrap; font-size: 12.5px; padding: 12px; gap: 8px 12px; bottom: calc(10px + env(safe-area-inset-bottom)); }
  .storage-note span { flex: 1 1 100%; }
  .storage-note .btn { margin-left: auto; }
  .footer-links { gap: 14px; }

  .join-wrap { gap: 14px; }
  .join-title { font-size: 16px; padding: 8px 14px; }
  .join-card { padding: 16px; gap: 12px; }
  .cam-box { grid-template-columns: 1fr; gap: 10px; }
  .cam-preview { max-width: 320px; width: 100%; margin: 0 auto; }
  .mic-box .row { flex-wrap: wrap; }
  .join-card > .row .btn-lg { flex: 1; }

  .modal { padding: 0; place-items: stretch; }
  .modal-card { width: 100%; max-height: none; height: 100%; border-radius: 0; box-shadow: none; }
  .modal-head { padding: calc(10px + env(safe-area-inset-top)) 10px 0 12px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { white-space: nowrap; font-size: 13px; padding: 0 12px; }
  .tab-body { padding: 14px 14px calc(30px + env(safe-area-inset-bottom)); }
  .set-grid { grid-template-columns: 1fr; gap: 18px; }
  .slider { grid-template-columns: 62px 1fr 34px; }
  .reasons { grid-template-columns: 1fr; }
  .report-card { height: auto; margin: auto 0 0; border-radius: 20px 20px 0 0; }
  #reportModal { place-items: end stretch; }
  .locked-note { flex-wrap: wrap; }
}

/* telefon poziomo: mało wysokości */
@media (max-height: 500px) {
  .dock-info { flex: 1 1 40%; }
  .dock-info .sub { display: none; }
  .dock-info .big { font-size: 16px; }
  .timer { width: 46px; height: 46px; }
  .dock-actions .btn { height: 40px; }
  #dock { flex-wrap: nowrap; }
}

.home-grid > *, .home-card > *, .home-actions > * { min-width: 0; }
.discord-home { white-space: normal; text-align: center; line-height: 1.25; height: auto; min-height: 44px; padding: 8px 14px; }
body.touch .hint-keys { display: none; }
@media (max-width: 760px) {
  .card-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.08; }
  .cam-preview { max-width: 260px; }
  .tagline { overflow-wrap: anywhere; }
}
@media (max-height: 500px) {
  .topbar { height: 48px; }
  #stage { top: 48px; }
  .pill { height: 30px; }
  .icon-btn { height: 36px; min-width: 36px; }
  .tile-card { top: calc(var(--w) * .03 + 16px); width: min(70%, calc(var(--w) * .62)); }
  .card-band { font-size: calc(var(--w) * .025 + 4px); padding: 1px 6px; }
  .card-name { font-size: calc(var(--w) * .065 + 3px); padding: 2px 6px 4px; -webkit-line-clamp: 1; }
  .tile-plate { width: 80%; }
  #dock { padding: 8px 12px; }
}
@media (max-width: 760px), (max-height: 500px) { .dock-actions .btn { max-width: 300px; } }

/* ═════════ klasyczne czółko: karta u każdego, pytania po kolei ═════════ */
.tile.done .card-band { background: var(--green); color: #fff; }
.tile.gaveup .card-band { background: #8a93c2; color: #fff; }
.tile.gaveup .card-face:not(.mystery) { opacity: .92; }
.tile.next .tile-tag { opacity: 1; transform: translate(-50%, 0) scale(.86); background: rgba(255, 255, 255, .78); color: var(--muted); }
.tile-badge span { white-space: nowrap; }

.dock-info .big .q { color: #fff; }
.dock-info .a-yes, .note-row .a-yes { color: var(--green); }
.dock-info .a-no, .note-row .a-no { color: var(--red); }
.dock-info .a-idk, .note-row .a-idk { color: #b7bde0; }
.dock-info .a-correct, .note-row .a-correct { color: var(--yellow-d); }
.notes-inline b { font-weight: 700; }
.ask { display: flex; gap: 8px; margin: 8px 0 4px; max-width: 560px; }
.ask input {
  flex: 1; min-width: 0; height: 38px; border-radius: 10px; border: 0; padding: 0 12px;
  background: rgba(255, 255, 255, .14); color: #fff; font: inherit; font-size: 14px; font-weight: 500; outline: none;
}
.ask input::placeholder { color: rgba(255, 255, 255, .5); }
.ask input:focus { background: rgba(255, 255, 255, .22); }
.ask .btn { height: 38px; flex-shrink: 0; }
.btn em { font-style: normal; font-size: 12px; font-weight: 700; background: rgba(255, 255, 255, .2); border-radius: 6px; padding: 1px 6px; margin-left: 2px; }
.dock-next { flex-shrink: 0; text-align: right; line-height: 1.15; }
.dock-next small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; color: rgba(255, 255, 255, .58); }
.dock-next b { font-size: 22px; color: var(--yellow); }

.intro.rules .intro-big { animation: popIn2 .6s var(--ease-back) both; }
.rules-list { display: flex; gap: 14px; margin-top: 18px; padding: 0 16px; justify-content: center; flex-wrap: wrap; }
.rule {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 250px;
  background: #fff; color: var(--ink); border-radius: 16px; padding: 14px 16px;
  box-shadow: 0 6px 0 rgba(10, 20, 70, .3); animation: popIn2 .5s var(--ease-back) both;
}
.rule > b { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--yellow); color: var(--navy); display: grid; place-items: center; font-size: 16px; }
.rule strong { display: block; font-size: 16px; line-height: 1.2; }
.rule span { display: block; font-size: 13.5px; color: var(--muted); font-weight: 600; margin-top: 3px; line-height: 1.3; }

.rank-row .nm span small { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.rank-row .nm span { line-height: 1.15; }
.rank-row { height: 54px; }

.notes-card { width: min(520px, 100%); }
.notes-card h3 { margin: 0; font-size: 18px; }
.notes-list { display: flex; flex-direction: column; gap: 6px; max-height: 55vh; overflow-y: auto; }
.note-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; background: var(--soft); border-radius: 10px; padding: 10px 12px; font-weight: 600; }
.note-row .n { color: var(--muted); font-size: 13px; }
.note-row .q { min-width: 0; overflow-wrap: anywhere; }
.note-row .q i { color: var(--muted); font-weight: 500; }
.note-row b { font-size: 14px; letter-spacing: .4px; }
.note-row .a-idk { color: var(--muted); }
.note-row.sep { display: block; background: transparent; color: var(--muted); font-size: 13px; text-align: center; padding: 4px; }

@media (max-width: 760px), (max-height: 500px) {
  .rules-list { gap: 8px; margin-top: 10px; }
  .rule { width: min(330px, 100%); padding: 10px 12px; border-radius: 12px; }
  .rule strong { font-size: 15px; }
  .rule span { font-size: 12.5px; }
  .ask { margin: 6px 0 2px; }
  .ask input { height: 36px; font-size: 13px; }
  .ask .btn { height: 36px; }
  .dock-next b { font-size: 18px; }
  .rank-row { height: 48px; }
  .rank-row .nm span small { font-size: 11.5px; }
  #notesModal { place-items: end stretch; }
  .notes-card { height: auto; margin: auto 0 0; border-radius: 20px 20px 0 0; }
}
@media (max-height: 500px) {
  .rules-list { flex-wrap: nowrap; }
  .rule span { display: none; }
  .ask { display: none; }
}

@media (max-width: 760px) {
  #dock.judge .timer { position: absolute; top: 10px; right: 12px; width: 46px; height: 46px; }
  #dock.judge .timer .digits { font-size: 14px; }
  #dock.judge .dock-info { padding-right: 54px; }
  #dock.judge .dock-actions { flex: 1 1 100%; justify-content: flex-start; }
  #dock.judge .dock-actions .btn { max-width: none; }
  #dock.judge .dock-actions .ans { flex: 1 1 28%; padding: 0 8px; }
}

.card-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.08; overflow-wrap: anywhere; }
@media (max-height: 500px) { .card-name { -webkit-line-clamp: 1; } }
#verBanner { position: fixed; left: 50%; top: 0; transform: translateX(-50%); z-index: 80; width: min(640px, calc(100vw - 24px)); background: var(--red); color: #fff; font-weight: 700; font-size: 14px; text-align: center; padding: 10px 16px; border-radius: 0 0 12px 12px; }
