:root {
  --bg: #03050f;
  --gold: #e8c547;
  --gold-2: #f6e7b0;
  --blue: #4d86ff;
  --ok: #3dffb0;
  --muted: #9aa6d4;
  --text: #f5f7ff;
  --line: rgba(232, 197, 71, 0.24);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body, #app {
  min-height: 100%;
}

body {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(74, 108, 210, 0.38), transparent 58%),
    radial-gradient(ellipse 40% 40% at 0% 100%, rgba(120, 62, 12, 0.28), transparent 50%),
    radial-gradient(ellipse 35% 35% at 100% 90%, rgba(28, 48, 130, 0.32), transparent 48%),
    var(--bg);
  color: var(--text);
  font-family: Outfit, sans-serif;
}

button, input, textarea, select { font-family: inherit; }

.logo {
  font-family: Cinzel, serif;
  letter-spacing: 0.16em;
  text-align: center;
  color: var(--gold);
  text-shadow: 0 0 28px rgba(232, 197, 71, 0.4);
}

.logo small {
  display: block;
  margin-top: 8px;
  letter-spacing: 0.38em;
  font-size: 0.68rem;
  color: var(--gold-2);
  font-family: Outfit, sans-serif;
  font-weight: 500;
}

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.setup {
  max-width: 1240px;
  margin: 0 auto;
  padding: 36px 22px 72px;
}

.setup-hero {
  text-align: center;
  margin-bottom: 32px;
}

.setup-hero .logo { font-size: clamp(1.6rem, 3vw, 2.4rem); }

.setup-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 22px;
}

.panel {
  background: linear-gradient(180deg, rgba(22, 32, 74, 0.88), rgba(9, 14, 36, 0.9));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.32);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel h2 {
  font-family: Cinzel, serif;
  font-size: 1.02rem;
  color: var(--gold);
  margin-bottom: 14px;
}

.panel-head h2 { margin-bottom: 0; }

.count-pill {
  min-width: 32px;
  height: 28px;
  padding: 0 10px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(232, 197, 71, 0.12);
  border: 1px solid var(--line);
  color: var(--gold-2);
  font-weight: 700;
  font-size: 0.85rem;
}

.player-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

@media (min-width: 981px) {
  .setup-grid { grid-template-columns: 380px 1fr; }
}

.player-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.seat {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #1a2554;
  color: var(--gold);
  font-weight: 700;
  font-size: 0.82rem;
  border: 1px solid rgba(232, 197, 71, 0.28);
  flex-shrink: 0;
}

input[type="text"], textarea {
  width: 100%;
  background: rgba(6, 10, 28, 0.85);
  border: 1px solid #2c3a72;
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232, 197, 71, 0.15);
}

.q-form {
  display: grid;
  grid-template-columns: 150px 1fr 1fr auto;
  gap: 8px;
  margin-bottom: 12px;
}

.bulk-label {
  display: block;
  color: var(--gold-2);
  font-size: 0.82rem;
  font-weight: 600;
  margin: 4px 0 8px;
}

#q-bulk {
  min-height: 110px;
  margin-bottom: 10px;
  resize: vertical;
  line-height: 1.45;
}

code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.84em;
  color: var(--gold-2);
}

.q-list {
  max-height: 400px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.q-item {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 10px;
  align-items: start;
  background: rgba(8, 14, 36, 0.8);
  border-radius: 14px;
  padding: 12px;
  border: 1px solid #243260;
}

.q-item .cat { color: var(--gold); font-weight: 700; font-size: 0.82rem; }
.q-item .meta { color: var(--muted); font-size: 0.84rem; margin-top: 4px; }

.btn {
  border: 0;
  border-radius: 14px;
  padding: 11px 16px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.07); }
.btn-xl { padding: 14px 26px; font-size: 1.05rem; }
.btn-gold {
  background: linear-gradient(180deg, #f6dc78, #c49a1e);
  color: #1a1403;
  box-shadow: 0 10px 22px rgba(196, 154, 30, 0.32);
}
.btn-blue {
  background: linear-gradient(180deg, #5b7ef0, #2a4bb8);
  color: white;
  box-shadow: 0 10px 22px rgba(42, 75, 184, 0.32);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--gold-2);
  border: 1px solid rgba(232, 197, 71, 0.32);
}
.btn-ok {
  background: linear-gradient(180deg, #22c58a, #12885c);
  color: white;
  min-width: 150px;
  box-shadow: 0 10px 22px rgba(18, 136, 92, 0.28);
}
.btn-bad {
  background: linear-gradient(180deg, #e04466, #a11d3a);
  color: white;
  min-width: 200px;
  box-shadow: 0 10px 22px rgba(161, 29, 58, 0.28);
}
.btn-danger {
  background: #4e142c;
  color: #ffd0da;
  padding: 8px 12px;
}
.btn:disabled { opacity: 0.42; cursor: not-allowed; transform: none; }

.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.hint { color: var(--muted); font-size: 0.9rem; margin-top: 10px; line-height: 1.5; }

.setup-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 28px;
  text-align: center;
}

.setup-cta .hint { max-width: 720px; }

.studio {
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 9, 22, 0.78);
  backdrop-filter: blur(14px);
}

.brand .logo {
  text-align: left;
  font-size: 0.92rem;
}

.brand-sub {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 2px;
}

.stage-block { text-align: center; }

.stage-chip {
  font-family: Cinzel, serif;
  color: var(--gold);
  font-size: 0.95rem;
  padding: 6px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(232, 197, 71, 0.1);
  display: inline-block;
}

.stage-detail {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 6px;
}

.stats {
  color: var(--muted);
  font-weight: 600;
  text-align: right;
}

.studio-stage {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 16px 18px 8px;
  gap: 8px;
}

.board-wrap {
  min-height: 0;
  display: grid;
  place-items: stretch center;
}

.board {
  width: min(1040px, 100%);
  background:
    linear-gradient(180deg, rgba(18, 28, 68, 0.96), rgba(7, 11, 30, 0.96));
  border: 1px solid rgba(232, 197, 71, 0.38);
  border-radius: 28px;
  padding: 28px 36px;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  box-shadow:
    0 0 0 8px rgba(10, 14, 36, 0.65),
    0 28px 60px rgba(0, 0, 0, 0.42),
    inset 0 0 90px rgba(61, 124, 255, 0.08);
  animation: boardIn 0.35s ease;
}

.board-category { justify-content: center; }
.board-answer { }
.board-buzz .question-text,
.board-question .question-text { max-width: 920px; margin: 0 auto; }

.cat-label {
  font-family: Cinzel, serif;
  color: var(--gold);
  letter-spacing: 0.32em;
  font-size: 0.76rem;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.category-big {
  font-family: Cinzel, serif;
  font-size: clamp(2rem, 5vw, 3.6rem);
  color: var(--gold-2);
  text-shadow: 0 0 30px rgba(232, 197, 71, 0.25);
}

.question-text {
  font-size: clamp(1.45rem, 3.1vw, 2.25rem);
  line-height: 1.32;
  font-weight: 500;
}

.who-chip {
  display: inline-flex;
  align-self: center;
  margin: 20px auto 0;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(232, 197, 71, 0.14);
  border: 1px solid var(--line);
  color: var(--gold-2);
  font-weight: 700;
}

.answer-box {
  margin: 22px auto 0;
  max-width: 740px;
  width: 100%;
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(20, 138, 94, 0.22), rgba(12, 20, 48, 0.92));
  border: 1px solid rgba(61, 255, 176, 0.4);
  font-size: 1.4rem;
  animation: pop 0.28s ease;
}

.answer-box span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ok);
  margin-bottom: 6px;
}

.desks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 2% 6px;
}

.desk-row {
  display: grid;
  grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr));
  gap: 10px;
}

.desk-row.back { padding: 0; }

.desk {
  appearance: none;
  background:
    linear-gradient(180deg, #24356f 0%, #121a42 72%, #0c1230 100%);
  border: 1px solid #3a4d8a;
  border-radius: 18px 18px 12px 12px;
  padding: 10px 8px 12px;
  text-align: center;
  color: inherit;
  min-width: 0;
  width: 100%;
  min-height: 96px;
  box-shadow:
    0 12px 20px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.desk-plate {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 22px;
  margin-bottom: 6px;
}

.desk .num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(8, 12, 32, 0.6);
  color: var(--gold-2);
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid rgba(232, 197, 71, 0.2);
}

.desk-badge {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1a1403;
  background: var(--gold);
  border-radius: 999px;
  padding: 2px 7px;
}

.desk-badge.mute {
  background: rgba(244, 226, 160, 0.14);
  color: var(--gold-2);
}

.desk.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 0 28px rgba(232, 197, 71, 0.38);
  transform: translateY(-6px);
  background: linear-gradient(180deg, #314890 0%, #1a2c68 100%);
}

.desk.nominator {
  border-color: #8fb0ff;
  box-shadow: 0 0 18px rgba(77, 134, 255, 0.32);
}

.desk.clickable { cursor: pointer; }
.desk.clickable:hover {
  border-color: var(--gold-2);
  transform: translateY(-4px);
}

.view-buzz .desk.clickable,
.view-nominate .desk.clickable {
  animation: pulseDesk 1.6s ease-in-out infinite;
}

.desk.out {
  opacity: 0.28;
  filter: grayscale(0.8);
}

.desk .name {
  font-weight: 700;
  font-size: 1.02rem;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desk .pts {
  color: var(--gold-2);
  font-size: 0.8rem;
  margin-top: 7px;
  font-weight: 700;
}

.lights { display: flex; justify-content: center; gap: 7px; }
.light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #242c48;
  box-shadow: inset 0 0 4px #000;
}
.light.on {
  background: #5dffb6;
  box-shadow: 0 0 11px #3dffb0;
}

.hostbar {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: 84px;
  padding: 12px 18px 16px;
  background: linear-gradient(180deg, rgba(8, 12, 28, 0.96), rgba(4, 7, 18, 0.98));
  border-top: 1px solid var(--line);
}

.host-main {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.host-hint {
  color: var(--gold-2);
  font-weight: 600;
}

.winner {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.winner-card {
  width: min(720px, 100%);
  background: linear-gradient(180deg, rgba(22, 32, 74, 0.96), rgba(8, 12, 30, 0.96));
  border: 1px solid rgba(232, 197, 71, 0.35);
  border-radius: 28px;
  padding: 40px 36px;
  text-align: center;
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.4);
}

.winner-score {
  margin-top: 10px;
  color: var(--gold-2);
  font-size: 1.5rem;
  font-weight: 700;
}

.rank { margin: 22px 0 8px; text-align: left; }
.rank-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 4px;
  border-bottom: 1px solid #243260;
}
.rank-row:first-child {
  color: var(--gold);
  font-weight: 700;
}

@keyframes boardIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes pop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes pulseDesk {
  0%, 100% { box-shadow: 0 12px 20px rgba(0, 0, 0, 0.32), 0 0 0 0 rgba(232, 197, 71, 0.35); }
  50% { box-shadow: 0 12px 20px rgba(0, 0, 0, 0.32), 0 0 0 4px rgba(232, 197, 71, 0.12); }
}

@media (max-width: 980px) {
  .setup-grid, .q-form { grid-template-columns: 1fr; }
  .studio { height: auto; min-height: 100vh; overflow: visible; }
  .topbar { grid-template-columns: 1fr; text-align: left; }
  .brand .logo, .stats { text-align: left; }
  .stage-block { text-align: left; }
  .desk-row, .desk-row.back { padding: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hostbar { grid-template-columns: 1fr; }
}


/* =====================================================
   POLISH LAYER — dopracowanie wyglądu
   ===================================================== */

:root {
  --gold-grad: linear-gradient(180deg, #fbe9a0 0%, #e8c547 48%, #b8891a 100%);
  --glass: linear-gradient(180deg, rgba(30, 44, 98, 0.78), rgba(8, 13, 34, 0.9));
  --ease: cubic-bezier(0.22, 0.8, 0.3, 1);
}

html { scroll-behavior: smooth; }

body {
  position: relative;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* delikatne gwiazdy w tle */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 22%, rgba(255,255,255,0.8), transparent 60%),
    radial-gradient(1px 1px at 78% 12%, rgba(246,231,176,0.9), transparent 60%),
    radial-gradient(1.4px 1.4px at 38% 68%, rgba(255,255,255,0.6), transparent 60%),
    radial-gradient(1px 1px at 88% 58%, rgba(255,255,255,0.7), transparent 60%),
    radial-gradient(1.2px 1.2px at 56% 36%, rgba(246,231,176,0.7), transparent 60%),
    radial-gradient(1px 1px at 22% 88%, rgba(255,255,255,0.6), transparent 60%),
    radial-gradient(1px 1px at 94% 90%, rgba(255,255,255,0.5), transparent 60%);
  background-size: 420px 420px;
}
#app { position: relative; z-index: 1; }

::selection { background: rgba(232, 197, 71, 0.35); color: #fff; }

/* scrollbary */
* { scrollbar-width: thin; scrollbar-color: #3a4d8a transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #34457f; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #4a60a8; }

/* logo */
.logo {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 18px rgba(232, 197, 71, 0.35));
}
.logo small { -webkit-text-fill-color: var(--gold-2); }

.setup-hero .logo { position: relative; padding-bottom: 18px; }
.setup-hero .logo::after {
  content: "";
  display: block;
  width: 140px;
  height: 2px;
  margin: 16px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* panele */
.panel {
  position: relative;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  box-shadow:
    0 24px 54px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.panel::before {
  content: "";
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232,197,71,0.7), transparent);
}
.panel h2 { letter-spacing: 0.08em; }

.seat {
  background: radial-gradient(circle at 30% 30%, #2b3b80, #141d49);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

input[type="text"], textarea {
  background: rgba(4, 8, 24, 0.9);
  border-color: #2f3e78;
}
input::placeholder, textarea::placeholder { color: #6673a6; }

.q-item {
  transition: border-color 0.18s ease, transform 0.18s var(--ease), background 0.18s ease;
}
.q-item:hover {
  border-color: rgba(232, 197, 71, 0.45);
  background: rgba(14, 22, 54, 0.9);
  transform: translateX(2px);
}

/* przyciski */
.btn {
  position: relative;
  overflow: hidden;
  transition: transform 0.15s var(--ease), filter 0.15s ease, box-shadow 0.15s ease;
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.28) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.55s ease;
  pointer-events: none;
}
.btn:hover:not(:disabled)::after { transform: translateX(120%); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.98); }
.btn:focus-visible, .desk:focus-visible {
  outline: 2px solid var(--gold-2);
  outline-offset: 3px;
}
.btn-gold {
  background: var(--gold-grad);
  box-shadow: 0 10px 26px rgba(196, 154, 30, 0.38), inset 0 1px 0 rgba(255,255,255,0.5);
}
.btn-xl { letter-spacing: 0.06em; text-transform: uppercase; font-family: Cinzel, serif; }
.btn-ghost:hover:not(:disabled) { background: rgba(232, 197, 71, 0.1); }

/* pasek górny */
.topbar {
  background: linear-gradient(180deg, rgba(8, 13, 32, 0.92), rgba(5, 9, 22, 0.8));
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
}
.stage-chip {
  background: linear-gradient(180deg, rgba(232,197,71,0.2), rgba(232,197,71,0.06));
  box-shadow: 0 0 22px rgba(232, 197, 71, 0.18), inset 0 1px 0 rgba(255,255,255,0.12);
  letter-spacing: 0.06em;
}

/* plansza */
.board {
  position: relative;
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(77, 134, 255, 0.16), transparent 70%),
    linear-gradient(180deg, rgba(20, 31, 74, 0.97), rgba(6, 10, 28, 0.98));
  border: 1px solid rgba(232, 197, 71, 0.5);
  box-shadow:
    0 0 0 8px rgba(10, 14, 36, 0.65),
    0 0 0 9px rgba(232, 197, 71, 0.14),
    0 30px 70px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(61, 100, 255, 0.12),
    inset 0 0 100px rgba(61, 124, 255, 0.09);
}
.board::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(232, 197, 71, 0.16);
  border-radius: 20px;
  pointer-events: none;
}
.cat-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.cat-label::before, .cat-label::after {
  content: "";
  height: 1px;
  width: 54px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.cat-label::after { transform: scaleX(-1); }

.category-big {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 22px rgba(232, 197, 71, 0.3));
}
.question-text { text-wrap: balance; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45); }

.who-chip {
  background: linear-gradient(180deg, rgba(232,197,71,0.22), rgba(232,197,71,0.08));
  box-shadow: 0 0 20px rgba(232, 197, 71, 0.15);
}
.answer-box {
  box-shadow: 0 0 30px rgba(61, 255, 176, 0.14), inset 0 1px 0 rgba(255,255,255,0.08);
}

/* pulpity graczy */
.desk {
  position: relative;
  width: 100%;
  min-height: 96px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), transparent 36%),
    linear-gradient(180deg, #27397a 0%, #131c46 70%, #0a1029 100%);
  border-color: #3f5294;
  transition: transform 0.22s var(--ease), border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}
.desk::after {
  content: "";
  position: absolute;
  left: 14%; right: 14%; bottom: 5px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(232,197,71,0.45), transparent);
  opacity: 0.6;
}
.desk .num {
  background: radial-gradient(circle at 30% 30%, #f6dc78, #b8891a);
  color: #1a1403;
  border: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.desk .name { letter-spacing: 0.02em; text-shadow: 0 1px 6px rgba(0,0,0,0.5); }
.desk .pts { letter-spacing: 0.06em; }

.light {
  width: 14px;
  height: 14px;
  background: radial-gradient(circle at 35% 30%, #3a4570, #141a34);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
.light.on {
  background: radial-gradient(circle at 35% 30%, #c8ffe6, #3dffb0 55%, #12a870);
  box-shadow: 0 0 14px #3dffb0, 0 0 28px rgba(61, 255, 176, 0.35);
}

.desk.active {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.1), transparent 40%),
    linear-gradient(180deg, #3a52a2 0%, #1c2f72 100%);
  box-shadow: 0 0 0 1px var(--gold), 0 0 34px rgba(232, 197, 71, 0.5), 0 16px 26px rgba(0,0,0,0.4);
  animation: activeGlow 2.2s ease-in-out infinite;
}
.desk.active::after { opacity: 1; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.desk.out { opacity: 0.3; }
.desk.out .name { text-decoration: line-through; text-decoration-color: rgba(255,255,255,0.35); }
.desk-badge { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }

/* pasek prowadzącego */
.hostbar {
  background: linear-gradient(180deg, rgba(10, 15, 36, 0.96), rgba(4, 7, 18, 0.99));
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
}
.host-hint { text-shadow: 0 0 14px rgba(232, 197, 71, 0.25); }

/* ekran zwycięzcy */
.winner-card {
  position: relative;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(232,197,71,0.16), transparent 65%),
    linear-gradient(180deg, rgba(24, 35, 82, 0.97), rgba(7, 11, 28, 0.98));
  border-color: rgba(232, 197, 71, 0.55);
  box-shadow: 0 0 0 8px rgba(10,14,36,0.6), 0 34px 80px rgba(0,0,0,0.5), 0 0 90px rgba(232,197,71,0.12);
  animation: pop 0.5s var(--ease);
}
.winner-score {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: Cinzel, serif;
}
.rank-row { transition: background 0.15s ease; border-radius: 8px; padding: 12px 10px; }
.rank-row:hover { background: rgba(255,255,255,0.03); }
.rank-row:nth-child(2) { color: #dfe6ff; }
.rank-row:nth-child(3) { color: #e0b48a; }

@keyframes activeGlow {
  0%, 100% { box-shadow: 0 0 0 1px var(--gold), 0 0 28px rgba(232,197,71,0.4), 0 16px 26px rgba(0,0,0,0.4); }
  50%      { box-shadow: 0 0 0 1px var(--gold), 0 0 44px rgba(232,197,71,0.65), 0 16px 26px rgba(0,0,0,0.4); }
}

@media (max-width: 980px) {
  .cat-label::before, .cat-label::after { width: 28px; }
  .board { padding: 24px 20px; }
}

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


/* --- skróty, cofanie, zapis gry --- */
.host-left { display: flex; gap: 8px; flex-wrap: wrap; }
.btn kbd {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 6px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.68em;
  font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: middle;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12);
}
.host-hint kbd {
  padding: 1px 6px;
  border-radius: 6px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.8em;
  background: rgba(232, 197, 71, 0.12);
  border: 1px solid var(--line);
}
.resume-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  width: min(720px, 100%);
  margin-bottom: 22px;
  padding: 16px 20px;
  text-align: left;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(20, 138, 94, 0.2), rgba(12, 20, 48, 0.9));
  border: 1px solid rgba(61, 255, 176, 0.38);
  box-shadow: 0 0 28px rgba(61, 255, 176, 0.1);
}
.resume-box strong { display: block; color: var(--ok); letter-spacing: 0.04em; }
.resume-box span { color: var(--muted); font-size: 0.9rem; }
.resume-box .row-actions { margin-top: 0; }
.winner-card #undo-win { margin-top: 12px; }
@media (hover: none) { .btn kbd { display: none; } }


/* --- widok dla publiczności, edycja pytań --- */
.q-actions { display: flex; flex-direction: column; gap: 6px; }
.btn-sm { padding: 8px 12px; }
.q-item.editing { border-color: rgba(232, 197, 71, 0.5); background: rgba(14, 22, 54, 0.95); }
.q-edit-fields { display: grid; gap: 8px; }
.audio-hint {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60;
  padding: 8px 18px; border-radius: 999px; font-size: 0.85rem; color: var(--gold-2);
  background: rgba(12, 18, 44, 0.92); border: 1px solid var(--line);
}
body.audience { cursor: none; }
body.audience #sound-toggle,
body.audience .brand-sub,
body.audience .stats,
body.audience #again,
body.audience #undo-win { display: none; }
body.audience .studio { grid-template-rows: auto minmax(0, 1fr); }
body.audience .desks { padding-bottom: 18px; }

.setup-cta .audience-row { justify-content: center; margin: 0 0 20px; }


/* --- licznik czasu --- */
.timer { width: min(620px, 90%); margin: 24px auto 0; display: flex; align-items: center; gap: 16px; }
.timer-bar {
  flex: 1; height: 14px; border-radius: 999px; overflow: hidden;
  background: rgba(4, 8, 24, 0.85); border: 1px solid rgba(232, 197, 71, 0.35);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5);
}
.timer-fill {
  width: 100%; height: 100%; border-radius: 999px;
  background: linear-gradient(180deg, #fbe9a0, #e8c547 55%, #b8891a);
  box-shadow: 0 0 14px rgba(232, 197, 71, 0.5);
}
.timer-sec {
  min-width: 2ch; text-align: center; font-family: Cinzel, serif; font-weight: 700;
  font-size: 1.9rem; color: var(--gold-2);
}
.timer.low .timer-fill { background: linear-gradient(180deg, #ff8fa6, #e04466 55%, #a11d3a); box-shadow: 0 0 16px rgba(224, 68, 102, 0.6); }
.timer.low .timer-sec { color: #ff8fa6; }
.timer.done .timer-sec { animation: timeupPulse 0.6s ease-in-out infinite; }
@keyframes timeupPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }


/* --- obrazki w pytaniach, efekty pulpitów --- */
.q-image {
  display: block;
  max-width: min(560px, 100%);
  max-height: 34vh;
  margin: 18px auto 0;
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid rgba(232, 197, 71, 0.35);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}
.q-img-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.q-img-row input[type="text"] { flex: 1; min-width: 200px; }
.q-edit-fields .q-img-row { margin-bottom: 0; }
.file-btn { cursor: pointer; display: inline-flex; align-items: center; }

.studio .desk.flash-ok { animation: flashOk 1s ease-out; }
.studio .desk.flash-bad { animation: flashBad 1s ease-out; }
.light.just-lost { animation: lightOut 1s ease-out; }

@keyframes flashOk {
  0%   { box-shadow: 0 0 0 3px #3dffb0, 0 0 54px rgba(61, 255, 176, 0.9), inset 0 0 40px rgba(61, 255, 176, 0.45); transform: translateY(-8px) scale(1.04); }
  100% { box-shadow: 0 12px 20px rgba(0, 0, 0, 0.32), inset 0 0 0 rgba(61, 255, 176, 0); transform: none; }
}
@keyframes flashBad {
  0%   { box-shadow: 0 0 0 3px #ff4d6d, 0 0 54px rgba(255, 77, 109, 0.9), inset 0 0 40px rgba(255, 77, 109, 0.45); transform: translateX(0); }
  15%  { transform: translateX(-9px); }
  30%  { transform: translateX(9px); }
  45%  { transform: translateX(-6px); }
  60%  { transform: translateX(6px); }
  75%  { transform: translateX(-3px); }
  100% { box-shadow: 0 12px 20px rgba(0, 0, 0, 0.32), inset 0 0 0 rgba(255, 77, 109, 0); transform: none; }
}
@keyframes lightOut {
  0%   { box-shadow: 0 0 18px #ff5c7a, 0 0 32px rgba(255, 92, 122, 0.7); transform: scale(1.7); filter: brightness(2.2); }
  100% { box-shadow: inset 0 0 4px #000; transform: scale(1); filter: none; }
}


/* ---------- pytania muzyczne ---------- */
.num-in { width: 78px; margin: 0 4px; padding: 6px 8px; text-align: center; }
.music-chip {
  display: inline-flex; align-items: center; gap: 8px; margin: 10px 0 4px;
  padding: 6px 16px; border-radius: 999px; font-weight: 600; letter-spacing: .04em;
  color: #f6e7b0; background: rgba(232, 197, 71, 0.12); border: 1px solid rgba(232, 197, 71, 0.45);
  animation: musicPulse 2.4s ease-in-out infinite;
}
@keyframes musicPulse { 0%, 100% { box-shadow: 0 0 0 rgba(232,197,71,0); } 50% { box-shadow: 0 0 18px rgba(232,197,71,0.35); } }
@media (prefers-reduced-motion: reduce) { .music-chip { animation: none; } }

/* gość: duży przycisk zgłoszenia */
.guest-buzz { min-width: min(78vw, 360px); min-height: 84px; font-size: 1.5rem; }
.guest-buzz:disabled { opacity: 0.4; }

/* ---------- lobby / dołączanie ---------- */
.lobby-grid { display: grid; grid-template-columns: 1fr 380px; gap: 22px; max-width: 1100px; margin: 0 auto; padding: 0 20px 40px; align-items: start; }
.lobby-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.lobby-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px;
  background: rgba(8, 13, 36, 0.8); border: 1px solid rgba(232, 197, 71, 0.18); }
.lobby-row .name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-row .meta { color: var(--ok); font-size: 0.82rem; }
.lobby-row.off { opacity: 0.5; }
.lobby-row.off .meta { color: var(--muted); }
.room-code { font-family: Cinzel, serif; font-weight: 800; font-size: clamp(2.4rem, 7vw, 3.6rem); letter-spacing: 0.25em;
  text-align: center; color: var(--gold); padding: 14px 0 14px 0.25em; margin: 14px 0 8px; border-radius: 14px;
  background: rgba(4, 8, 24, 0.9); border: 1px dashed var(--line); }
.break-all { word-break: break-all; text-align: center; }
.join-panel { max-width: 460px; margin: 0 auto; }
.join-panel input[type="text"] { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid #2f3e78; color: var(--text); margin-top: 6px; }
.net-cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-bottom: 14px; }
@media (max-width: 820px) { .lobby-grid { grid-template-columns: 1fr; } }

/* ---------- ekran startowy ---------- */
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; max-width: 820px; margin: 10px auto 40px; padding: 0 20px; }
.home-card { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; cursor: pointer;
  padding: 38px 24px; border-radius: 22px; color: var(--text); font-size: 1rem; line-height: 1.5;
  background: linear-gradient(160deg, rgba(26, 37, 84, 0.92), rgba(10, 16, 42, 0.95)); border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35); transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease; }
.home-card:hover { transform: translateY(-4px); border-color: var(--gold); box-shadow: 0 22px 48px rgba(232, 197, 71, 0.16); }
.home-card strong { font-family: Cinzel, serif; font-size: 1.5rem; color: var(--gold); }
.home-card span:last-child { color: var(--muted); font-size: 0.95rem; }
.home-ico { font-size: 2.6rem; }
@media (max-width: 640px) { .home-grid { grid-template-columns: 1fr; } }

/* ---------- lista pokoi, hasło, widzowie ---------- */
.join-panel input[type="password"] { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid #2f3e78; color: var(--text); margin-top: 6px; background: transparent; }
.room-opts { margin-bottom: 18px; text-align: left; }
.check-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; color: var(--muted); font-size: 0.92rem; line-height: 1.4; cursor: pointer; }
.check-row input { margin-top: 3px; accent-color: #e8c547; }
.room-list-panel { max-width: 720px; margin: 18px auto 0; }
.room-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.room-row { flex-wrap: wrap; row-gap: 8px; }
.room-row .name { min-width: 150px; }
.room-code-sm { margin-left: 8px; font-family: Cinzel, serif; letter-spacing: 0.15em; font-size: 0.78rem; color: var(--muted); }
.room-row .meta { font-size: 0.82rem; }
.room-row .meta.live { color: #e8c547; }
.room-btns { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 560px) { .room-row .meta { flex-basis: 100%; order: 3; } .room-btns { margin-left: auto; } }

/* ---------- okienko dołączania z listy pokoi ---------- */
.modal-back { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(4, 8, 24, 0.78); backdrop-filter: blur(3px); }
.modal-box { width: 100%; max-width: 400px; padding: 22px 22px 18px; border-radius: 16px; background: #0f1738;
  border: 1px solid rgba(232, 197, 71, 0.45); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); text-align: left; }
.modal-box h2 { margin: 0 0 4px; }
.modal-sub { margin: 0 0 12px; color: var(--muted); font-size: 0.95rem; }
.modal-box input[type="text"], .modal-box input[type="password"] { width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid #2f3e78; color: var(--text); margin-top: 6px; background: transparent; box-sizing: border-box; }
.modal-err { min-height: 1.2em; margin: 10px 0 0; color: #ff8a8a; font-size: 0.9rem; }

/* ---------- powrót do pokoju po odświeżeniu ---------- */
.session-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  max-width: 720px; margin: 0 auto 18px; border-color: rgba(232, 197, 71, 0.45); }
.session-banner strong { display: block; }
.session-banner span { display: block; color: var(--muted); font-size: 0.92rem; margin-top: 2px; }
