/*
 * Maskaroo: vizuál inšpirovaný risografom (tlač doujinshi a zinov).
 * Dve tlačové farby, ružová a modrá, sa prekrývajú cez multiply ako pri posunutom sútlači.
 *
 * Rozloženie: horná lišta / plocha s avatarmi (+ panel nastavení vpravo) / spodná lišta.
 * Na mobile je panel nastavení vysúvací list zdola.
 */
:root {
  --paper: #ecebf2;
  --paper-2: #e1dfeb;
  --ink: #1c2452;
  --ink-soft: #4f5680;
  --pink: #ff48b0;
  --blue: #0078bf;
  --yellow: #ffe800;
  --on-accent: #1c2452;
  --blend: multiply;
  --radius-pill: 999px;
  --display: "Anybody", "Arial Black", system-ui, sans-serif;
  --text: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tile: clamp(84px, 19vmin, 170px);
  --drawer-w: 400px;
  --lvl: 0;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #17162b;
    --paper-2: #211f3a;
    --ink: #ecebf2;
    --ink-soft: #a9abc9;
    --pink: #ff5cba;
    --blue: #2f9be6;
    --blend: screen;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #17162b;
  --paper-2: #211f3a;
  --ink: #ecebf2;
  --ink-soft: #a9abc9;
  --pink: #ff5cba;
  --blue: #2f9be6;
  --blend: screen;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* v miestnosti nie: originálny hlas a nahrávka by išli ostatným */
body.in-room .lab-only { display: none !important; }

html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

button, select, input { font: inherit; color: inherit; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.hint { color: var(--ink-soft); }
.small { font-size: 0.82rem; line-height: 1.4; }

/* ---------- rozloženie aplikácie ---------- */
.app {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "top top"
    "stage drawer"
    "dock dock";
}

/* ---------- horná lišta ---------- */
.topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 0.4rem 1.25rem;
  min-height: 52px;
  padding: 0.5rem 1.1rem;
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
}
.brand {
  position: relative;
  flex: none;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 880;
  font-variation-settings: "wdth" 120;
  line-height: 1;
  color: var(--pink);
}
.brand::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: var(--blue);
  mix-blend-mode: var(--blend);
  transform: translate(2px, 1.5px);
  pointer-events: none;
}
.where { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* čas v miestnosti */
.session {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.6rem 0.15rem 0.45rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  font-family: var(--display);
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
  line-height: 1.2;
}
.session svg { width: 16px; height: 16px; color: var(--pink); }
.status { margin-left: auto; color: var(--ink-soft); font-size: 0.85rem; text-align: right; }

/* ---------- plocha s avatarmi ---------- */
.stage-wrap {
  grid-area: stage;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  min-width: 0;
  padding: 1.5rem 1rem;
  overflow-y: auto;
  background-color: var(--paper);
  background-image: radial-gradient(color-mix(in srgb, var(--pink) 30%, transparent) 1.2px, transparent 1.6px);
  background-size: 18px 18px;
}
.stage {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: clamp(1rem, 3vw, 2.5rem) clamp(1rem, 4vw, 3rem);
  max-width: 1100px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.stage-hint {
  max-width: 42ch;
  margin: 0;
  padding: 0.4rem 0.8rem;
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 0.9rem;
  text-align: center;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  width: calc(var(--tile) + 3rem);
  text-align: center;
}
.avatar {
  position: relative;
  width: var(--tile);
  aspect-ratio: 1;
  margin-bottom: 0.55rem;
}
.avatar::before,
.avatar::after {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 6px solid var(--av, var(--pink));
  mix-blend-mode: var(--blend);
  pointer-events: none;
}
/* Haló sa hýbe s hlasom: --lvl (0–1) nastavuje JS každý snímok.
   Tvoja dlaždica berie --lvl z :root, ostatní ho majú priamo na svojej dlaždici. */
.avatar::before,
.avatar::after {
  opacity: calc(0.18 + var(--lvl, 0) * 0.82);
  transform: scale(calc(1 + var(--lvl, 0) * 0.17));
}
/* modrý kruh sa pri hlasitejšej reči viac „rozostrí“ ako pri posunutom sútlači */
.avatar::after {
  border-color: var(--blue);
  translate: calc(3px + var(--lvl, 0) * 5px) calc(2px + var(--lvl, 0) * 4px);
}
/* avatar (avatars.js): farebný kruh (--av) a na ňom iniciála alebo nálepková postavička */
.avatar-art {
  position: absolute;
  inset: 0;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--av, var(--pink));
  container-type: inline-size;
  box-shadow: 0 0 0 calc(var(--lvl, 0) * var(--tile) * 0.11) color-mix(in srgb, var(--av, var(--pink)) 30%, transparent);
}
/* iniciála: biele písmeno s tmavým obrysom a posunutým tieňom (ako riso tlač) */
.av-initial {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-family: var(--display);
  font-size: 2rem;
  font-size: 50cqi;
  font-weight: 900;
  font-variation-settings: "wdth" 120;
  line-height: 1;
  color: #fff;
  -webkit-text-stroke: 0.035em #1c2452;
  text-shadow: 0.055em 0.055em 0 #1c2452;
  user-select: none;
}
/* nálepka: mierne natočená, trčí cez okraj kruhu, s bielym výsekom a tieňom */
.av-sticker {
  position: absolute;
  left: -5%;
  top: -11%;
  width: 110%;
  height: 110%;
  overflow: visible;
  transform: rotate(var(--tilt, 0deg));
  filter: drop-shadow(0 2px 2px rgba(28, 36, 82, 0.35));
}
.av-svg {
  display: block;
  color: #1c2452; /* obrys je tmavý aj v tmavom režime (nálepka je biela) */
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.av-die * { fill: #fff !important; stroke: #fff !important; stroke-width: 9px !important; opacity: 1 !important; }

/* nálepky (avatars.js): rovnaký obrys ako avatary, vlastné farby */
.st-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  color: #1c2452;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.st-svg .r { fill: #f15060; }
.st-svg .y { fill: #ffe800; }
.st-svg .o { fill: #ff6c2f; }
.st-svg .b { fill: #5ec8e5; }
.st-svg .p { fill: #ff48b0; }
.st-svg .pl { fill: #ffb3d9; }
.st-svg .g { fill: #00a95c; }
.st-svg .pu { fill: #9b7fd1; }
.st-svg .cr { fill: #f3dfc1; }
.st-svg .no { fill: #1f4d3a; }
.st-svg .w { fill: #fbfaff; }
.st-svg .k { fill: currentColor; stroke: none; }
.st-svg .n { fill: none; }
.st-svg .tx { font-family: var(--display); font-weight: 900; stroke-width: 4; paint-order: stroke; }

/* nálepka vyskočí nad avatarom, chvíľu ostane a odletí */
.sticker-pop {
  position: absolute;
  right: calc(-14% - var(--i, 0) * 12%);
  top: calc(-22% + var(--i, 0) * 10%);
  z-index: 3;
  width: 58%;
  aspect-ratio: 1;
  pointer-events: none;
  filter: drop-shadow(3px 3px 0 color-mix(in srgb, var(--ink) 25%, transparent));
  animation: sticker-pop 2.6s cubic-bezier(.2, .9, .3, 1.2) forwards;
}
@keyframes sticker-pop {
  0% { transform: scale(0.2) rotate(-25deg); opacity: 0; }
  12% { transform: scale(1.15) rotate(8deg); opacity: 1; }
  22% { transform: scale(1) rotate(-4deg); }
  80% { transform: translateY(-6%) rotate(3deg); opacity: 1; }
  100% { transform: translateY(-40%) scale(0.85) rotate(10deg); opacity: 0; }
}
.audience-list .sticker-pop { width: 80%; }

/* hovoríš, ale nepočujú ťa: pruh nad spodnou lištou */
.mic-notice {
  position: fixed;
  left: 50%;
  bottom: 88px;
  z-index: 44;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: min(34rem, calc(100vw - 1.5rem));
  padding: 0.55rem 0.55rem 0.55rem 0.9rem;
  border: 2px solid var(--on-accent);
  border-radius: 14px;
  background: var(--yellow);
  color: var(--on-accent);
  box-shadow: 4px 4px 0 var(--pink);
  transform: translateX(-50%);
  animation: notice-in 220ms ease-out;
}
.mic-notice > svg { flex: none; width: 22px; height: 22px; }
.mic-notice > svg use + use { display: inline; }
.mic-notice span { flex: 1; font-size: 0.92rem; line-height: 1.35; }
.mic-notice .btn-secondary { flex: none; background: #fff; color: var(--on-accent); }
/* na žltom pruhu je tlačidlo vždy svetlé (aj v tmavom režime), aj pri prejdení myšou */
.mic-notice .btn-secondary:hover:not(:disabled),
.unlock .btn-secondary:hover:not(:disabled) { background: #fff3fa; color: var(--on-accent); box-shadow: 3px 3px 0 var(--pink); }
.mic-notice .icon-btn { flex: none; width: 32px; height: 32px; background: transparent; border-color: var(--on-accent); color: var(--on-accent); }
/* hláška (toast) nad pruhom, nech sa neprekrývajú */
body.has-mic-notice .toast { bottom: 168px; }
@keyframes notice-in { from { transform: translate(-50%, 12px); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }

/* nastavenia OBS overlay (Devices) */
.ovl-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin: 0.4rem 0 0.7rem; }
.ovl-link { display: flex; gap: 0.5rem; }
.ovl-link .text-input { flex: 1; min-width: 0; font-size: 0.85rem; }
.ovl-link .btn-secondary { flex: none; }

/* LIVE: miestnosť ide cez OBS overlay do streamu (vidia všetci) */
.live-chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.6rem 0.15rem 0.5rem;
  border: 2px solid var(--on-accent);
  border-radius: var(--radius-pill);
  background: #f15060;
  color: #fff;
  font-family: var(--display);
  font-size: 0.85rem;
  font-weight: 860;
  letter-spacing: 0.06em;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: live-blink 1.4s ease-in-out infinite; }
@keyframes live-blink { 50% { opacity: 0.25; } }

/* názov (kód) miestnosti vpravo v hornej lište: len text, kopírovanie a skrytie */
.room-name {
  display: inline-flex;
  flex: 0 1 auto;
  margin-left: auto;
  align-items: center;
  gap: 0.1rem;
  min-width: 0;
  max-width: 24rem;
}
.code-text {
  min-width: 0;
  margin-right: 0.3rem;
  overflow: hidden;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 860;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status:not(:empty) + .room-name { margin-left: 0.4rem; }
.room-name.is-hidden .code-text { color: var(--ink-soft); letter-spacing: 0.08em; }
.code-btn {
  cursor: pointer;
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
}
.code-btn:hover { background: var(--yellow); color: var(--on-accent); }
.code-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; }
.code-btn svg { width: 19px; height: 19px; }

/* výber nálepiek nad spodnou lištou */
.sticker-tray {
  position: fixed;
  left: 50%;
  bottom: 88px;
  z-index: 45;
  display: grid;
  gap: 0.6rem;
  width: min(23rem, calc(100vw - 1.5rem));
  max-height: min(60vh, 26rem);
  overflow-y: auto;
  padding: 0.8rem 0.9rem 0.9rem;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 5px 5px 0 var(--pink);
  transform: translateX(-50%);
}
.sticker-tray-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; font-family: var(--display); }
.sticker-tray-head .hint { font-family: var(--text); }
.sticker-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.35rem; }
.sticker-pick,
.pack-sticker {
  cursor: pointer;
  aspect-ratio: 1;
  padding: 0.3rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  transition: transform 100ms ease, background-color 100ms ease;
}
.sticker-pick:hover, .sticker-pick:focus-visible { background: var(--paper-2); transform: scale(1.12); }
.sticker-tray .link-btn { justify-self: start; font-size: 0.88rem; }
.pack-preview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.15rem; }
.pack-sticker.is-bouncing, .pack-avatar.is-bouncing { animation: bounce 600ms ease; }
/* obchod: balík avatarov (4 nálepky na farebných kruhoch) */
.pack-avatars { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.4rem 0.1rem 0.2rem; }
.pack-avatars .pack-avatar { width: 64px; }
.pack-avatar {
  position: relative;
  cursor: pointer;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
}
.pack-avatar .avatar-art { inset: 12%; transition: transform 120ms ease; }
.pack-avatar:hover .avatar-art { transform: scale(1.06) rotate(3deg); }
.pack-avatar[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }
.avatar-pack:not(.is-owned) .pack-avatar { cursor: default; }
@keyframes bounce { 0% { transform: scale(1); } 35% { transform: scale(1.3) rotate(-8deg); } 70% { transform: scale(0.95) rotate(4deg); } 100% { transform: scale(1); } }
.shop-owned { font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); padding: 0.35rem 0; }
.shop-tabs { justify-self: start; }

/* značky na dlaždici: zdvihnutá ruka, hostiteľ */
.tile-hand {
  position: absolute;
  left: 2%;
  top: 2%;
  display: none;
  place-items: center;
  width: calc(var(--tile) * 0.3);
  min-width: 26px;
  aspect-ratio: 1;
  border: 2px solid var(--on-accent);
  border-radius: 50%;
  background: var(--yellow);
  color: var(--on-accent);
  animation: wave 1.2s ease-in-out infinite;
}
.tile-hand svg { width: 62%; height: 62%; }
.tile.has-hand .tile-hand { display: grid; }
@keyframes wave { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(12deg); } }
.tile-host {
  display: none;
  margin-left: 0.3rem;
  padding: 0 0.4rem;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--text);
  font-size: 0.66rem;
  font-weight: 600;
  vertical-align: 0.15em;
}
.tile.is-host .tile-host { display: inline-block; }
.tile-action {
  cursor: pointer;
  margin-top: 0.2rem;
  padding: 0.15rem 0.6rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--paper);
  font-size: 0.78rem;
  font-weight: 600;
}
.tile-action:hover { background: var(--yellow); color: var(--on-accent); }

/* pódium: publikum pod pódiom, menšie dlaždice */
.audience {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  width: min(100%, 1100px);
  padding-top: 0.9rem;
  border-top: 2px dashed color-mix(in srgb, var(--ink) 35%, transparent);
}
.audience-title { margin: 0; font-family: var(--display); font-size: 0.95rem; font-weight: 780; color: var(--ink-soft); }
.audience-list { --tile: clamp(46px, 8vmin, 72px); gap: 0.9rem 1.1rem; }
.audience-list .tile-name { font-size: 0.85rem; }
.audience-list .tile-voice { font-size: 0.72rem; }
.audience-list .avatar::before, .audience-list .avatar::after { inset: -6px; border-width: 4px; }
.stage-bar { display: flex; gap: 0.6rem; justify-content: center; }
.stage-bar .btn-secondary { display: inline-flex; align-items: center; gap: 0.45rem; }
.stage-bar svg { width: 20px; height: 20px; }
#handBtn[aria-pressed="true"] { background: var(--yellow); color: var(--on-accent); }

/* režim miestnosti v hornej lište (hostiteľ ho prepína) */
.mode-chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.65rem 0.15rem 0.45rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--paper);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.mode-chip svg { width: 17px; height: 17px; }
.mode-chip.is-stage { background: var(--ink); color: var(--paper); }
.mode-chip:disabled { cursor: default; opacity: 1; }
.mode-chip:not(:disabled):hover { box-shadow: 2px 2px 0 var(--pink); }

/* výber avatara a farby (Profile) */
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 0.6rem 0.5rem; }
.pick-avatar {
  position: relative;
  cursor: pointer;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
}
.pick-avatar .avatar-art { inset: 10%; transition: transform 120ms ease; }
/* mimo dlaždice v miestnosti kruh nesvieti s hlasom */
.pick-avatar .avatar-art, .pack-avatar .avatar-art, .gate-avatar .avatar-art { box-shadow: none; }
.pick-avatar:hover .avatar-art { transform: scale(1.06) rotate(-3deg); }
.pick-avatar[aria-checked="true"] { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }
.pick-avatar.is-locked .avatar-art { opacity: 0.55; filter: saturate(0.6); }
.pick-lock {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  color: var(--on-accent);
}
.pick-lock svg { width: 13px; height: 13px; }
.more-avatars { margin-top: 0.6rem; }
.color-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pick-color {
  cursor: pointer;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--av);
}
.pick-color[aria-checked="true"] { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }

/* vstupná obrazovka: náhodný avatar pri prezývke */
.nick-row { display: flex; align-items: center; gap: 0.55rem; }
.nick-row input { flex: 1; min-width: 0; }
/* prezývka s kockou na náhodné meno v poli (R-035) */
.nick-field { position: relative; display: block; flex: 1; min-width: 0; }
.nick-field input, .gate-card .nick-field input[type="text"] { width: 100%; padding-right: 2.8rem; }
.pane .nick-field .nick-dice { right: 0.25rem; width: 32px; height: 32px; }
.nick-dice svg { transition: transform 200ms ease; }
.nick-dice:hover svg { transform: rotate(-14deg); }
.nick-dice:active svg { transform: rotate(90deg) scale(0.9); }
@media (prefers-reduced-motion: reduce) { .nick-dice svg { transition: none; } }
.gate-avatar {
  position: relative;
  cursor: pointer;
  flex: none;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  transition: transform 120ms ease;
}
.gate-avatar:hover { transform: rotate(-8deg) scale(1.05); }

.tile-muted {
  position: absolute;
  right: 2%;
  bottom: 2%;
  display: none;
  place-items: center;
  width: calc(var(--tile) * 0.26);
  min-width: 28px;
  aspect-ratio: 1;
  border: 2px solid var(--on-accent);
  border-radius: 50%;
  background: var(--yellow);
  color: var(--on-accent);
}
.tile-muted svg { width: 60%; height: 60%; }
.tile.is-muted .tile-muted { display: grid; }

.tile-name {
  max-width: 100%;
  overflow: hidden;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 780;
  font-variation-settings: "wdth" 108;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tile-you {
  display: inline-block;
  padding: 0 0.4rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-pill);
  font-family: var(--text);
  font-size: 0.7rem;
  font-weight: 600;
  vertical-align: 0.15em;
}
.tile-voice { max-width: 100%; color: var(--ink-soft); font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.is-connecting .avatar { opacity: 0.55; }
.tile.is-connecting .avatar-art { border-style: dashed; }

.notice {
  position: absolute;
  top: 0.8rem;
  left: 50%;
  z-index: 3;
  width: min(36rem, calc(100% - 2rem));
  transform: translateX(-50%);
}
.notice > div {
  padding: 0.75rem 1rem;
  border: 2px solid var(--on-accent);
  border-radius: 10px;
  background: var(--yellow);
  color: var(--on-accent);
}

/* po obnovení stránky: zvuk čaká na kliknutie */
.unlock {
  position: absolute;
  top: 0.8rem;
  left: 50%;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: min(34rem, calc(100% - 2rem));
  padding: 0.7rem 0.8rem 0.7rem 1rem;
  border: 2px solid var(--on-accent);
  border-radius: 12px;
  background: var(--yellow);
  color: var(--on-accent);
  box-shadow: 4px 4px 0 var(--pink);
  transform: translateX(-50%);
}
.unlock svg { flex: none; }
.unlock span { flex: 1; font-size: 0.9rem; line-height: 1.35; }
.unlock .btn-secondary { flex: none; color: var(--on-accent); background: #fff; }
@media (max-width: 520px) {
  .unlock { flex-wrap: wrap; }
  .unlock .btn-secondary { width: 100%; }
}

/* ---------- spodná lišta ---------- */
.dock {
  grid-area: dock;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom));
  border-top: 2px solid var(--ink);
  background: var(--paper-2);
}
.dock-btn,
.icon-btn {
  cursor: pointer;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  transition: transform 80ms ease, background-color 120ms ease;
}
.dock-btn svg use + use { display: none; }
.dock-btn[aria-pressed="false"] { background: var(--yellow); color: var(--on-accent); border-color: var(--on-accent); }
.dock-btn[aria-pressed="false"] svg use + use { display: inline; }
.dock-btn[aria-expanded="true"] { background: var(--blue); color: #fff; box-shadow: 3px 3px 0 var(--pink); }
.dock-btn:hover { box-shadow: 3px 3px 0 var(--pink); }
.dock-btn:active, .dock-voice.is-ptt.is-live, .dock-leave:active, .dock-join:active { transform: translate(1px, 1px); }
.icon-btn { width: 38px; height: 38px; }
.icon-btn svg { width: 20px; height: 20px; }

.dock-voice,
.dock-leave,
.dock-join {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 50px;
  padding: 0 1.1rem 0 0.9rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  font-weight: 600;
}
/* stredné tlačidlo = hovor: modré, kým ťa ostatní počujú (drž ho alebo Space) */
.dock-voice {
  max-width: 15rem;
  background: var(--paper);
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  transition: background-color 80ms ease, box-shadow 80ms ease;
}
.dock-voice span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--display); font-weight: 780; font-variation-settings: "wdth" 108; }
.dock-voice:not(.is-ptt) { cursor: default; }
.dock-voice.is-ptt:hover { box-shadow: 3px 3px 0 var(--blue); }
.dock-voice.is-live { background: var(--blue); color: #fff; box-shadow: 3px 3px 0 var(--pink); }
.dock-voice.is-off { border-style: dashed; color: var(--ink-soft); }
.dock-leave { background: var(--pink); color: var(--on-accent); border-color: var(--on-accent); box-shadow: 3px 3px 0 var(--ink); }
.dock-join { background: var(--blue); color: #fff; box-shadow: 3px 3px 0 var(--pink); }

/* ---------- panel nastavení ---------- */
.drawer {
  grid-area: drawer;
  display: flex;
  flex-direction: column;
  width: var(--drawer-w);
  min-height: 0;
  border-left: 2px solid var(--ink);
  background: var(--paper);
}
.drawer-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.7rem 0.6rem 0.9rem;
  border-bottom: 2px solid var(--ink);
}
.tabs { display: flex; flex: 1; gap: 0.25rem; overflow-x: auto; }
.drawer-title {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 860;
  font-variation-settings: "wdth" 115;
}
.drawer-title svg { width: 22px; height: 22px; color: var(--pink); }
.tabs [role="tab"] {
  cursor: pointer;
  flex: none;
  padding: 0.4rem 0.75rem;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  background: none;
  font-weight: 600;
}
.tabs [role="tab"][aria-selected="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.tabs [role="tab"]:hover:not([aria-selected="true"]) { border-color: var(--ink-soft); }
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0.9rem 1rem 1.5rem; overscroll-behavior: contain; }
.pane { display: grid; gap: 0.75rem; align-content: start; }

.sub {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.9rem 0 0;
  padding-top: 0.8rem;
  border-top: 1.5px solid color-mix(in srgb, var(--ink) 25%, transparent);
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 800;
  font-variation-settings: "wdth" 110;
}
.sub.first { margin-top: 0; padding-top: 0; border-top: 0; }
.sub .hint { font-family: var(--text); font-weight: 400; text-align: right; }

/* ---------- presety ---------- */
.preset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.preset-wrap { position: relative; display: grid; }
.preset {
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  min-height: 3.6rem;
  padding: 0.45rem 0.55rem;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
  text-align: left;
}
.preset:hover { background-image: radial-gradient(var(--pink) 22%, transparent 26%); background-size: 7px 7px; }
.preset-name {
  max-width: 100%;
  overflow: hidden;
  padding-right: 0.2rem;
  background: var(--paper);
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 820;
  font-variation-settings: "wdth" 108;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preset-desc { padding-right: 0.2rem; background: var(--paper); color: var(--ink-soft); font-size: 0.72rem; line-height: 1.25; }
.preset[aria-pressed="true"] { background: var(--pink); background-image: none; box-shadow: 3px 3px 0 var(--blue); }
.preset[aria-pressed="true"] .preset-name,
.preset[aria-pressed="true"] .preset-desc { background: transparent; color: var(--on-accent); }
.preset-mod {
  position: absolute;
  top: -0.55rem;
  right: 0.4rem;
  padding: 0 0.4rem;
  border: 1.5px solid var(--on-accent);
  border-radius: var(--radius-pill);
  background: var(--yellow);
  color: var(--on-accent);
  font-size: 0.66rem;
  font-weight: 600;
}
.preset.is-shop::after {
  content: "";
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--blue);
}
.preset.is-shop[aria-pressed="true"]::after { background: var(--on-accent); }
.more-voices { display: inline-flex; align-items: center; gap: 0.35rem; justify-self: start; font-size: 0.9rem; }
.more-voices svg { width: 18px; height: 18px; }
.preset.is-mine { border-style: dashed; }
.preset.is-mine[aria-pressed="true"] { border-style: solid; }
.preset.is-mine .preset-name { padding-right: 1.6rem; }
.preset-del {
  cursor: pointer;
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  z-index: 1;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.35rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--paper);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}
.preset-del:hover, .preset-del.is-confirm { background: var(--yellow); color: var(--on-accent); }

#storeInfo { margin: -0.35rem 0 0; }
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
}
.stats b { color: var(--ink); font-variant-numeric: tabular-nums; }
.calib { display: flex; flex-wrap: wrap; gap: 0.2rem 0.6rem; margin: 0; }

/* ---------- tlačidlá ---------- */
.btn-primary,
.btn-secondary,
.btn-ab {
  cursor: pointer;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  font-weight: 600;
  transition: transform 80ms ease;
}
.btn-primary {
  padding: 0.75rem 1.5rem;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 780;
  font-variation-settings: "wdth" 112;
  background: var(--blue);
  color: #fff;
  box-shadow: 4px 4px 0 var(--pink);
}
.btn-primary:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--pink); }
.btn-secondary { padding: 0.45rem 0.95rem; background: var(--paper); box-shadow: 2px 2px 0 var(--blue); }
.btn-secondary:hover:not(:disabled) { background: var(--paper-2); }
.btn-secondary[aria-pressed="true"], .btn-secondary.is-recording { background: var(--pink); color: var(--on-accent); }
.btn-ab {
  justify-self: start;
  padding: 0.45rem 1rem;
  background: var(--yellow);
  color: var(--on-accent);
  box-shadow: 2px 2px 0 var(--pink);
  user-select: none;
  touch-action: none;
}
.btn-ab.is-held { transform: translate(2px, 2px); box-shadow: none; }
.btn-ghost {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.85rem;
  border: 2px dashed var(--ink-soft);
  border-radius: var(--radius-pill);
  background: transparent;
  font-weight: 500;
  white-space: nowrap;
}
.btn-ghost:hover:not(:disabled) { border-style: solid; border-color: var(--ink); }
.link-btn {
  cursor: pointer;
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
button:disabled, select:disabled { cursor: not-allowed; opacity: 0.45; }

/* ---------- polia ---------- */
.field { display: grid; gap: 0.3rem; }
.field-label { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-weight: 600; font-size: 0.9rem; }
.field-label output { font-family: var(--display); font-weight: 760; font-variant-numeric: tabular-nums; color: var(--blue); }
.field .hint, .pane > .hint { margin: 0; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 24px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--ink); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--ink); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -8px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--pink);
}
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border: 2px solid var(--ink); border-radius: 50%; background: var(--pink); }
input[type="range"]:disabled { opacity: 0.45; cursor: not-allowed; }

select,
.text-input,
.save-form input {
  width: 100%;
  min-width: 0;
  padding: 0.45rem 0.65rem;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
}

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  width: fit-content;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.seg span { display: block; padding: 0.3rem 0.8rem; border-left: 2px solid var(--ink); font-weight: 500; font-size: 0.9rem; }
.seg label:first-child span { border-left: 0; }
.seg input:checked + span { background: var(--blue); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--pink); outline-offset: -5px; }

.switch { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; font-weight: 500; font-size: 0.92rem; }
.switch input {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: none;
  width: 40px;
  height: 22px;
  margin: 0;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--paper-2);
  cursor: pointer;
}
.switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 120ms ease;
}
.switch input:checked { background: var(--pink); }
.switch input:checked::after { transform: translateX(18px); }

/* ---------- ekvalizér ---------- */
.eq-bands { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.25rem; justify-items: center; }
.band { display: grid; justify-items: center; gap: 0.2rem; text-align: center; }
.band output { font-family: var(--display); font-weight: 760; font-variant-numeric: tabular-nums; color: var(--blue); font-size: 0.85rem; }
.band input[type="range"] { writing-mode: vertical-lr; direction: rtl; width: 24px; height: 110px; }
.band input[type="range"]::-webkit-slider-runnable-track { width: 4px; height: 100%; }
.band input[type="range"]::-webkit-slider-thumb { margin-top: 0; margin-left: -8px; }
.band input[type="range"]::-moz-range-track { width: 4px; height: 100%; }
.band-name { font-weight: 600; font-size: 0.8rem; line-height: 1.2; }
.band-freq { color: var(--ink-soft); font-size: 0.7rem; }

/* ---------- zariadenia, moje hlasy, nahrávka, avatar ---------- */
.dev-row { display: flex; align-items: center; gap: 0.6rem; }
.dev-row select { flex: 1; }
.dev-row .btn-ghost { flex: none; }
.hint.warn { color: var(--ink); font-weight: 500; }
.hint.warn::before { content: "⚠ "; }
.meter {
  flex: none;
  position: relative;
  width: 72px;
  height: 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--paper);
  overflow: hidden;
}
.meter span { position: absolute; inset: 0 auto 0 0; width: 0%; background: var(--pink); }

.save-form { display: flex; gap: 0.5rem; }
.save-form input { flex: 1; }
.json-tools { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; font-size: 0.88rem; }
.file-link, .file-btn { position: relative; cursor: pointer; }
.file-link input, .file-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-link:focus-within, .file-btn:focus-within { outline: 3px solid var(--blue); outline-offset: 3px; }
.sample-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.avatar-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }

/* ---------- efekty postáv ---------- */
.fx-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem 1rem; }
.fx-grid .field-label { font-size: 0.84rem; gap: 0.5rem; }

/* ---------- obchod ---------- */
.shop-lede { margin: 0; }

/* samostatné okno (obchod, R-033): v strede nad aplikáciou, na mobile list zdola */
.modal { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; padding: 1.25rem; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(13, 15, 31, 0.55); backdrop-filter: blur(3px); }
.modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(62rem, 100%);
  height: min(88vh, 50rem); /* pevná výška: pri prepínaní záložiek okno neskáče */
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 8px 8px 0 var(--pink);
  animation: modal-in 200ms cubic-bezier(.2, .9, .3, 1.1);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.modal-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem 0.9rem 1.35rem;
  border-bottom: 2px solid var(--ink);
}
.modal-title { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-family: var(--display); font-size: 1.35rem; font-weight: 850; font-variation-settings: "wdth" 104; }
.modal-title svg { width: 24px; height: 24px; fill: none; stroke: var(--pink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.modal-head .shop-tabs { margin-right: auto; }
.modal-close { flex: none; width: 42px; height: 42px; }
.modal-body { display: grid; align-content: start; gap: 0.75rem; overflow-y: auto; padding: 1.1rem 1.35rem 1.6rem; overscroll-behavior: contain; }
.shop-modal .shop-grid { grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 0.75rem; }
.shop-modal .shop-grid.packs { grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); }
body.modal-open { overflow: hidden; }
.shop-group { margin-top: 0.4rem; }
.shop-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.shop-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.65rem 0.7rem 0.7rem;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
}
.shop-item.is-using { box-shadow: 4px 4px 0 var(--pink); }
.shop-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.4rem; }
.shop-name {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  font-family: var(--display);
  font-size: 1.02rem;
  font-weight: 840;
  font-variation-settings: "wdth" 108;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shop-price {
  flex: none;
  padding: 0 0.45rem;
  border: 1.5px solid var(--on-accent);
  border-radius: var(--radius-pill);
  background: var(--yellow);
  color: var(--on-accent);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.shop-item.is-owned .shop-price { background: var(--paper-2); color: var(--ink); border-color: var(--ink); }
.shop-desc { margin: 0; color: var(--ink-soft); font-size: 0.8rem; line-height: 1.35; }
.shop-tags { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
.shop-tags li {
  padding: 0 0.4rem;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  font-size: 0.68rem;
  font-weight: 500;
}
.shop-actions { display: flex; gap: 0.4rem; margin-top: auto; padding-top: 0.2rem; }
.shop-actions button { flex: 1; padding: 0.35rem 0.5rem; font-size: 0.85rem; }
.shop-try[aria-pressed="true"] { border-style: solid; border-color: var(--pink); background: color-mix(in srgb, var(--pink) 16%, transparent); }
.shop-soon .sub { margin-top: 0.5rem; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  z-index: 70; /* aj nad oknom obchodu */
  max-width: min(30rem, calc(100vw - 2rem));
  padding: 0.7rem 1rem;
  border: 2px solid var(--on-accent);
  border-radius: 10px;
  background: var(--yellow);
  color: var(--on-accent);
  box-shadow: 3px 3px 0 var(--pink);
  transform: translateX(-50%);
}

/* ---------- vstup do miestnosti ---------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 1.5rem 1rem;
  background-color: var(--paper);
  background-image: radial-gradient(var(--pink) 18%, transparent 21%);
  background-size: 14px 14px;
}
/* vstup (R-032): jedna hlavná vec (nadpis), tichší zvyšok, jednotná výška prvkov 48 px */
.gate-card {
  display: grid;
  gap: 0;
  width: min(24rem, 100%);
  padding: 1.6rem 1.6rem 1.35rem;
  border: 2px solid var(--ink);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 8px 8px 0 var(--blue);
}
/* logo = len nápis Maskaroo s riso posunom; kruhy sú len vo favikone a ikonách (R-031) */
.gate-logo { margin: 0 0 1.15rem; line-height: 1; }
.gate-logo .brand { font-size: 1.2rem; font-variation-settings: "wdth" 110; }
.brand-wrap { display: inline-flex; flex: none; align-items: center; }

/* pozvánka: avatar toho, kto volá, „zvoní“ */
.gate-caller { display: flex; justify-content: flex-start; margin: 0.15rem 0 1rem 0.15rem; }
.caller-ring { position: relative; width: 64px; aspect-ratio: 1; }
.caller-ring .avatar-art { inset: 0; box-shadow: none; }
.caller-ring::before, .caller-ring::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 4px solid var(--av, var(--pink));
  border-radius: 50%;
  animation: ring-pulse 1.6s ease-out infinite;
}
.caller-ring::after { border-color: var(--blue); animation-delay: 0.8s; mix-blend-mode: var(--blend); }
@keyframes ring-pulse { from { transform: scale(0.92); opacity: 0.9; } to { transform: scale(1.35); opacity: 0; } }
.gate-room { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.4rem; margin: 0 0 0.75rem; font-size: 0.95rem; }
.gate-room[hidden] { display: none; }
.gate-room b { font-family: var(--display); font-size: 1.05rem; font-weight: 820; overflow-wrap: anywhere; }
/* stav miestnosti z odkazu (R-034): koľko ľudí je dnu */
.room-state {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.2rem;
  padding: 0.12rem 0.55rem 0.14rem 0.45rem;
  border: 1.5px solid color-mix(in srgb, var(--ink) 30%, transparent);
  border-radius: var(--radius-pill);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}
.room-state[hidden] { display: none; }
.room-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-soft); }
.room-state.is-live { color: var(--ink); border-color: color-mix(in srgb, #00a95c 60%, transparent); }
.room-state.is-live i { background: #00a95c; box-shadow: 0 0 0 0 rgba(0, 169, 92, 0.5); animation: live-dot 1.8s ease-out infinite; }
.room-state.is-full { color: var(--ink); border-color: color-mix(in srgb, #f15060 65%, transparent); }
.room-state.is-full i { background: #f15060; }
@keyframes live-dot { 70% { box-shadow: 0 0 0 6px rgba(0, 169, 92, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 169, 92, 0); } }
@media (prefers-reduced-motion: reduce) { .room-state.is-live i { animation: none; } }

/* tlačidlá: Enter cez celú šírku, pod ním „or“ a obrysové Call a friend */
.gate-actions { display: grid; gap: 0.75rem; margin-top: 1.35rem; }
.gate-card .gate-actions .btn-primary {
  justify-self: stretch;
  height: 50px;
  margin: 0;
  padding: 0 1rem;
  font-size: 1.08rem;
  font-variation-settings: "wdth" 104;
}
.gate-or { display: flex; align-items: center; gap: 0.75rem; color: var(--ink-soft); font-size: 0.8rem; }
.gate-or::before, .gate-or::after { content: ""; flex: 1; border-top: 1.5px solid color-mix(in srgb, var(--ink) 22%, transparent); }
.gate-or[hidden] { display: none; }
.gate-call {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 48px;
  padding: 0 1rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  transition: box-shadow 120ms ease, transform 80ms ease;
}
.gate-call:hover { box-shadow: 3px 3px 0 var(--blue); }
.gate-call:active { transform: translate(1px, 1px); }
.gate-call[hidden] { display: none; }
.gate-call svg, .call-copy svg, .send-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Call a friend: odkaz a odoslanie */
.call-view { display: grid; gap: 0.45rem; margin-top: 1rem; padding-top: 1rem; border-top: 1.5px solid color-mix(in srgb, var(--ink) 22%, transparent); }
.call-link { display: flex; gap: 0.5rem; }
.call-link .text-input { flex: 1; min-width: 0; font-size: 0.88rem; }
.call-copy { flex: none; display: inline-flex; align-items: center; gap: 0.35rem; height: 48px; box-shadow: none; }
.call-send-label { margin: 0.35rem 0 0; }
.call-send { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.send-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.send-btn:hover, .send-btn:focus-visible { background: var(--yellow); color: var(--on-accent); }
.send-btn[hidden] { display: none; }
.send-btn.is-disabled { opacity: 0.45; pointer-events: none; }
.call-new { justify-self: start; font-size: 0.88rem; }
.gate-title {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: clamp(1.45rem, 5.4vw, 1.7rem);
  font-weight: 850;
  font-variation-settings: "wdth" 104;
  line-height: 1.1;
}
.gate-lede { margin: 0 0 1.25rem; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.45; }
.gate-card .field-label { margin: 0; font-size: 0.85rem; }
.gate-card input[type="text"],
.gate-card input[type="password"] {
  width: 100%;
  height: 48px;
  padding: 0 0.85rem;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
  font-size: 1.02rem;
}
.gate-card input::placeholder { color: color-mix(in srgb, var(--ink-soft) 70%, transparent); letter-spacing: 0; }
/* kód: oko na zobrazenie priamo v poli */
.code-row { position: relative; }
.code-row input { padding-right: 3rem; letter-spacing: 0.06em; }
.code-eye {
  cursor: pointer;
  position: absolute;
  top: 50%;
  right: 0.4rem;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  transform: translateY(-50%);
}
.code-eye:hover { background: var(--yellow); color: var(--on-accent); }
.code-eye:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; }
.code-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gate-card .hint { margin: 0.1rem 0 0; }
.gate-hint { font-size: 0.8rem; }
.gate-links { display: flex; flex-direction: column; align-items: center; gap: 0.55rem; margin-top: 1.15rem; }
.gate-links .gate-skip { margin: 0; font-size: 0.88rem; }
.gate-links .gate-skip[hidden] { display: none; }
.gate-error {
  margin: 0.9rem 0 0;
  padding: 0.55rem 0.75rem;
  border: 2px solid var(--on-accent);
  border-radius: 10px;
  background: var(--yellow);
  color: var(--on-accent);
  font-weight: 500;
}
.gate-fields { display: grid; gap: 0.4rem; }
.code-field { display: grid; gap: 0.4rem; margin-bottom: 0.6rem; }
.code-field[hidden], .call-view[hidden], .gate-caller[hidden], .gate-room[hidden] { display: none; }
.gate-busy { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.6rem; font-weight: 600; }
.dots { display: inline-flex; gap: 0.3rem; }
.dots i {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--pink);
  animation: dot 0.9s ease-in-out infinite;
}
.dots i:nth-child(2) { background: var(--blue); animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(-5px); opacity: 1; } }

/* ---------- menšie obrazovky ---------- */
@media (max-height: 640px) {
  :root { --tile: clamp(72px, 13vmin, 120px); }
  .stage-wrap { padding: 1rem; gap: 0.8rem; }
}

@media (max-width: 760px) {
  :root { --tile: clamp(72px, 22vw, 120px); }
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "top" "stage" "dock";
  }
  .topbar { min-height: 46px; padding: 0.45rem 0.8rem; gap: 0.75rem; }
  .brand { font-size: 1rem; }
  .status { display: none; }
  .dock { gap: 0.45rem; padding-left: 0.5rem; padding-right: 0.5rem; }
  .dock-btn { width: 46px; height: 46px; }
  .dock-voice, .dock-leave, .dock-join { height: 46px; }
  .dock-voice { max-width: 9.5rem; padding: 0 0.85rem 0 0.7rem; }
  .dock-leave span, .dock-join span { display: none; }
  .dock-leave, .dock-join { width: 46px; padding: 0; justify-content: center; }
  /* panel ako list zdola */
  .drawer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    width: auto;
    max-height: 82dvh;
    border-left: 0;
    border-top: 2px solid var(--ink);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -6px 0 var(--blue);
  }
  .drawer-body { padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); }
  .toast { bottom: 84px; }
}

@media (max-width: 440px) {
  /* v miestnosti na úzkom displeji radšej kód a počet ľudí ako logo; lišta má dva riadky */
  body.in-room .brand-wrap { display: none; }
  body.in-room .topbar { flex-wrap: wrap; row-gap: 0.35rem; }
  body.in-room .where { order: 3; flex: 1 1 auto; }
  body.in-room .mode-chip { order: 4; }
  .room-name { max-width: 62vw; }
  .code-text { font-size: 1.1rem; }
  .mic-notice { bottom: 76px; flex-wrap: wrap; }
  body.has-mic-notice .toast { bottom: 196px; }
  .mic-notice span { flex-basis: calc(100% - 3.2rem); }
  .dock { gap: 0.3rem; }
  .dock-btn { width: 40px; height: 40px; }
  .dock-btn svg { width: 21px; height: 21px; }
  .dock-voice, .dock-leave, .dock-join { height: 40px; }
  .dock-leave, .dock-join { width: 40px; }
  .dock-voice { max-width: 6.4rem; padding: 0 0.6rem 0 0.5rem; gap: 0.3rem; }
  .sticker-tray { bottom: 76px; }
  .sticker-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .shop-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .modal { place-items: end stretch; padding: 0; }
  .modal-card { width: 100%; height: 92dvh; border-width: 2px 0 0; border-radius: 18px 18px 0 0; box-shadow: 0 -6px 0 var(--pink); }
  .modal-head { flex-wrap: wrap; row-gap: 0.6rem; padding: 0.8rem 0.8rem 0.8rem 1rem; }
  .modal-head .shop-tabs { order: 3; width: 100%; }
  .modal-head .shop-tabs label { flex: 1; }
  .modal-head .shop-tabs span { text-align: center; }
  .modal-title { margin-right: auto; }
  .modal-body { padding: 1rem 1rem calc(1.5rem + env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
  /* úzky telefón: obchod je dostupný aj z výberu nálepiek a hlasov */
  #shopBtn { display: none; }
  .preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fx-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .avatar::before, .avatar::after { transform: none; }
  .avatar::after { translate: 3px 2px; }
  .avatar-art { box-shadow: none; }
  .pick-avatar .avatar-art, .pack-avatar .avatar-art { transition: none; }
  .tile-hand { animation: none; }
  .sticker-pop { animation: none; transform: none; opacity: 1; }
  .pack-sticker.is-bouncing, .pack-avatar.is-bouncing { animation: none; }
  .live-dot { animation: none; }
  .modal-card { animation: none; }
  .caller-ring::before, .caller-ring::after { animation: none; opacity: 0.6; }
  .dock-btn, .btn-primary, .switch input::after { transition: none; }
  .dots i { animation: none; opacity: 1; }
}
