:root {
  --night: #1B2063;
  --night-2: #141852;
  --night-deep: #0E1240;
  --night-ink: #080B2E;
  --moon: #F2F3FF;
  --moon-2: rgba(226, 230, 255, .74);
  --paper: #FCFDFF;
  --grid: #E0E5F2;
  --ink: #1C2133;
  --ink-2: #4E5570;
  --ink-3: #868CA3;
  --line: #C6CCDD;
  --you: #2B47D4;
  --you-soft: #E2E7FC;
  --them: #DD3D46;
  --them-soft: #FCE5E6;
  --hl: #FFE14A;
  --coral: #FF7B6B;
  --sky: #93A5FF;
  --ok: #1B8F5E;
  --top-h: 64px;
  --font: 'Bricolage Grotesque', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  min-height: 100dvh;
  background-color: var(--night);
  background-image:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 32px 32px, 32px 32px;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--hl); outline-offset: 2px; }

/* ---------------------------------------------------------- Zastave */

.fi { width: 1.34em; height: 1em; border-radius: 3px; flex: none; background-size: cover; background-position: center; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); display: inline-block; }
.fi-xx { background: repeating-linear-gradient(45deg, #D7DBEA 0 4px, #EDEFF7 4px 8px); }
.flag-stack { display: inline-flex; flex: none; }
.flag-stack .fi { margin-right: -.55em; box-shadow: 0 0 0 1.5px #fff; }
.flag-stack .fi:last-child { margin-right: 0; }
.ico-globe { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* ------------------------------------------------------ Doodle nebo */

.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }

/* Aurora: velike meke obojene mrlje koje polako plove i mijenjaju oblik */
.aurora { position: absolute; inset: -25%; transition: opacity .8s ease; }
.aurora i {
  position: absolute; width: 62vmax; height: 62vmax; border-radius: 50%;
  background: radial-gradient(circle at center, var(--c) 0%, transparent 64%);
  mix-blend-mode: screen; opacity: .9;
  animation: var(--a) var(--t) ease-in-out infinite alternate;
  will-change: transform;
}
.aurora i:nth-child(1) { --c: rgba(255, 123, 107, .42); left: 0%; top: 50%; --t: 24s; --a: aur-1; }
.aurora i:nth-child(2) { --c: rgba(156, 123, 255, .5); left: 52%; top: 0%; --t: 30s; --a: aur-2; }
.aurora i:nth-child(3) { --c: rgba(70, 130, 255, .45); left: 18%; top: 8%; --t: 36s; --a: aur-3; }
.aurora i:nth-child(4) { --c: rgba(255, 95, 162, .34); left: 58%; top: 52%; --t: 28s; --a: aur-4; }
@keyframes aur-1 { to { transform: translate(22vw, -26vh) scale(1.25); } }
@keyframes aur-2 { to { transform: translate(-26vw, 22vh) scale(.8); } }
@keyframes aur-3 { to { transform: translate(14vw, 24vh) scale(1.2); } }
@keyframes aur-4 { to { transform: translate(-20vw, -18vh) scale(1.1); } }
body[data-view="room"] .aurora { opacity: .55; }

.grain {
  position: absolute; inset: 0; opacity: .09; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Oblici iz igara blago prate miš (paralaksa) */
.doodles {
  position: absolute; inset: 0;
  transform: translate3d(calc(var(--px, 0) * -18px), calc(var(--py, 0) * -14px), 0);
  transition: transform .5s cubic-bezier(.2, .8, .3, 1);
}
.doodle {
  position: absolute; left: var(--x); top: var(--y);
  width: 54px; height: 54px;
  transform: rotate(var(--r));
  animation: drift var(--dur) ease-in-out var(--d) infinite alternate;
  transition: opacity .6s ease;
}
.doodle svg {
  width: 100%; height: 100%; overflow: visible;
  fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0;
  animation: pop .7s cubic-bezier(.2, 1.6, .4, 1) calc(var(--d) + .2s) forwards;
}
.c-hl { stroke: var(--hl); }
.c-coral { stroke: var(--coral); }
.c-sky { stroke: var(--sky); }
.c-moon { stroke: rgba(242, 243, 255, .75); }
@keyframes drift {
  from { transform: translate(0, 0) rotate(var(--r)); }
  to { transform: translate(var(--dx), var(--dy)) rotate(calc(var(--r) + 14deg)); }
}
@keyframes pop {
  from { opacity: 0; transform: scale(.3); }
  to { opacity: .8; transform: scale(1); }
}
body[data-view="room"] .doodle { opacity: .2; }

/* ------------------------------------------------------------ Header */

.top {
  position: relative; z-index: 2;
  height: var(--top-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
}
.brand {
  font-size: 30px; font-weight: 800; letter-spacing: -0.045em;
  color: var(--moon); text-decoration: none; line-height: 1;
  padding: 2px 2px 6px;
  background: linear-gradient(transparent 84%, var(--hl) 84%) no-repeat;
  transition: opacity .3s ease;
}
.brand span { color: var(--coral); }
body[data-view="intro"] .brand { opacity: 0; pointer-events: none; }
.online {
  margin: 0; display: flex; align-items: center; gap: 8px;
  padding: 6px 14px 7px; border-radius: 999px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14);
  color: var(--moon); font-size: 14px; font-weight: 600;
}
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: #3DDC97; box-shadow: 0 0 0 4px rgba(61, 220, 151, .2); }

/* ---------------------------------------------------------- Dugmad */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px;
  border: 2px solid var(--ink); border-radius: 12px;
  background: #fff; color: var(--ink);
  font-weight: 650; font-size: 16px;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.controls .btn-go:disabled { opacity: 1; background: #2E347E; color: var(--moon-2); border-color: var(--night-ink); box-shadow: none; }
.btn-primary { background: var(--you); color: #fff; font-size: 18px; min-height: 54px; }
.btn-go { background: var(--hl); color: var(--ink); font-size: 19px; font-weight: 800; min-height: 56px; letter-spacing: -0.01em; }
.btn-danger { background: var(--them); color: #fff; }
.btn-small { min-height: 40px; padding: 0 14px; font-size: 15px; }
.btn-quiet {
  border-color: transparent; box-shadow: none; background: transparent;
  color: var(--them); text-decoration: underline; text-underline-offset: 3px;
  padding: 0 6px; min-height: 40px;
}
.btn-quiet:hover:not(:disabled) { transform: none; box-shadow: none; background: var(--them-soft); }
.btn-quiet:active:not(:disabled) { transform: none; box-shadow: none; }
.link-btn { border: 0; background: none; padding: 0; color: var(--you); text-decoration: underline; text-underline-offset: 3px; }

/* ====================================================== Ulazni ekran */

.intro {
  position: relative; z-index: 1;
  min-height: calc(100dvh - var(--top-h));
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 430px);
  align-items: center;
  gap: 40px 64px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 32px 56px;
  transition: opacity .35s ease, transform .35s ease;
}
.intro.is-leaving { opacity: 0; transform: scale(.97) translateY(-10px); }
.intro-hero { color: var(--moon); }

.wordmark { position: relative; margin: 0 0 18px; display: inline-block; line-height: .9; }
.wm-letters {
  display: inline-flex;
  font-size: clamp(72px, 8.6vw, 136px);
  font-weight: 800; letter-spacing: -0.055em;
  color: #fff;
}
.wm-letters span { display: inline-block; opacity: 0; transform: translateY(-60px) rotate(-8deg); animation: drop .62s cubic-bezier(.2, 1.5, .45, 1) forwards; }
.wm-letters span:nth-child(1) { animation-delay: .05s; }
.wm-letters span:nth-child(2) { animation-delay: .12s; }
.wm-letters span:nth-child(3) { animation-delay: .19s; }
.wm-letters span:nth-child(4) { animation-delay: .26s; }
.wm-letters span:nth-child(5) { animation-delay: .33s; }
.wm-letters span:nth-child(6) { animation-delay: .4s; }
.wm-letters span:nth-child(7) { animation-delay: .47s; }
/* Zadnje "o" je kao objektiv kamere: koraljno i blago "trepne" */
.wm-letters .lens { position: relative; color: var(--coral); animation: drop .62s cubic-bezier(.2, 1.5, .45, 1) .56s forwards, blink 1.4s ease-in-out 1.6s 2; }
@keyframes drop { to { opacity: 1; transform: translateY(0) rotate(0); } }
@keyframes blink { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.12, .82); } 60% { transform: scale(.94, 1.06); } }
.wm-underline {
  position: absolute; left: 2%; right: 4%; bottom: -10px;
  width: 94%; height: 28px; overflow: visible;
  fill: none; stroke: var(--hl); stroke-width: 9; stroke-linecap: round;
}
.wm-underline path { stroke-dasharray: 420; stroke-dashoffset: 420; animation: draw .55s ease-out .9s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.intro-title, .intro-lead, .intro-games, .intro-card, .credit {
  opacity: 0; transform: translateY(18px);
  animation: rise .6s cubic-bezier(.2, .9, .3, 1) forwards;
}
.intro-title { animation-delay: .75s; }
.intro-lead { animation-delay: .85s; }
.intro-games { animation-delay: .95s; }
.intro-card { animation-delay: .7s; }
.credit { animation-delay: 1.2s; }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

.intro-title { margin: 22px 0 10px; font-size: clamp(26px, 2.6vw, 36px); font-weight: 750; letter-spacing: -0.025em; line-height: 1.1; }
.intro-lead { margin: 0; font-size: 18px; color: var(--moon-2); max-width: 40ch; }
.intro-games { list-style: none; margin: 30px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.intro-games li {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px 8px 10px;
  border: 2px solid var(--night-ink); border-radius: 12px;
  background: var(--paper); color: var(--ink);
  font-weight: 700; font-size: 15px;
  box-shadow: 3px 3px 0 var(--night-ink);
}
.intro-games li:nth-child(1) { transform: rotate(-2deg); }
.intro-games li:nth-child(2) { transform: rotate(1.5deg); }
.intro-games li:nth-child(3) { transform: rotate(-1deg); }
.intro-games svg { width: 26px; height: 26px; fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

.intro-card {
  display: flex; flex-direction: column; gap: 16px;
  padding: 26px 26px 28px;
  background: var(--paper);
  border: 2px solid var(--night-ink);
  border-radius: 22px;
  box-shadow: 8px 8px 0 var(--night-ink);
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field-value { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.field-value .fi { font-size: 22px; }

.picker-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 56px; padding: 0 14px;
  border: 2px solid var(--ink); border-radius: 14px;
  background: #fff; text-align: left;
  font-size: 17px; font-weight: 700;
  transition: background .12s ease;
}
.picker-btn:hover { background: #F4F6FF; }
.pb-flag { display: inline-flex; font-size: 20px; color: var(--you); }
.pb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-count { font-size: 13px; font-weight: 650; color: var(--ok); background: #DDF3E8; padding: 2px 8px 3px; border-radius: 999px; }
.pb-count:empty { display: none; }
.pb-chev { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.seg { display: flex; gap: 4px; padding: 4px; border: 2px solid var(--ink); border-radius: 14px; background: #fff; }
.seg button {
  flex: 1; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 44px; padding: 0 8px;
  border: 0; border-radius: 10px; background: transparent;
  font-weight: 700; font-size: 16px; color: var(--ink);
  transition: background .12s ease, color .12s ease;
}
.seg button:hover { background: #EEF1FF; }
.seg button[aria-checked="true"] { background: var(--ink); color: #fff; }
.seg.is-error { border-color: var(--them); box-shadow: 0 0 0 3px var(--them-soft); }
.seg-error { margin: 0; font-size: 14px; font-weight: 600; color: var(--them); }
.ico-g { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tag .ico-g { width: 15px; height: 15px; stroke-width: 2.6; }
.sheet-seek .picker-list { padding-top: 4px; }
.sheet-seek .picker-opt .ico-g { width: 22px; height: 22px; color: var(--you); }

.intro-stats { margin: -6px 0 0; font-size: 14px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 16px; }
.intro-stats:empty { display: none; }
.intro-stats b { color: var(--ink); font-weight: 750; }

.gate { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.gate input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--you); flex: none; }
.gate.is-error { color: var(--them); font-weight: 600; }
.gate.is-error input { outline: 2px solid var(--them); outline-offset: 2px; }

.intro-error { padding: 14px; border-radius: 12px; background: var(--them-soft); border: 2px solid var(--them); }
.intro-error p { margin: 0 0 12px; font-size: 15px; color: #8E1F26; font-weight: 600; }
.intro-error-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.intro-error .btn { box-shadow: 2px 2px 0 var(--ink); }

.intro-card .btn-go { width: 100%; min-height: 62px; font-size: 22px; border-radius: 14px; box-shadow: 4px 4px 0 var(--ink); }

.credit { grid-column: 1 / -1; margin: 0; text-align: center; font-size: 12px; }
.credit a { color: rgba(226, 230, 255, .5); }

/* ============================================================== Soba */

.room {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) 252px;
  grid-template-areas:
    "them stage"
    "controls chat";
  gap: 18px 22px;
  height: calc(100dvh - var(--top-h));
  min-height: 620px;
  padding: 4px 24px 24px;
}
.room.is-entering > * { animation: rise-in .45s cubic-bezier(.2, .9, .3, 1) both; }
.room.is-entering > .frame-you { animation-delay: .08s; }
.room.is-entering > .controls { animation-delay: .14s; }
.room.is-entering > .chat { animation-delay: .2s; }
.frame-them { grid-area: them; }
.frame-you { grid-area: stage; }
.table { grid-area: stage; }
.controls { grid-area: controls; }
.chat { grid-area: chat; }

/* Kad igra traje, igra zauzme mjesto tvoje kamere, a tvoja kamera ode u ugao. */
.room.has-game .frame-you {
  grid-area: them;
  align-self: end; justify-self: end;
  width: 26%; height: auto; aspect-ratio: 4 / 3;
  margin: 0 14px 14px 0;
  z-index: 4;
  border-radius: 14px;
  box-shadow: 4px 4px 0 var(--night-ink);
}
.room.has-game .frame-you .tag { left: 8px; bottom: 8px; font-size: 11px; padding: 2px 8px 3px; }
.room.has-game .frame-you .frame-empty { font-size: 12px; padding: 8px; }

/* ------------------------------------------------------------ Video */

.frame {
  position: relative;
  min-height: 0;
  border: 2px solid var(--night-ink);
  border-radius: 20px;
  background: var(--night-deep);
  overflow: hidden;
  box-shadow: 6px 6px 0 var(--night-ink);
}
.frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.frame-you video { transform: scaleX(-1); }
.frame-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 20px; text-align: center;
  color: var(--moon-2); font-size: 15px;
  background:
    radial-gradient(circle at 50% 45%, rgba(147, 165, 255, .16), transparent 60%),
    var(--night-deep);
}
.frame-empty p { margin: 0; max-width: 30ch; }
#remoteMsg { color: var(--moon); font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.frame-sub { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.frame-sub:empty { display: none; }
.widen-btn { margin-top: 8px; box-shadow: 3px 3px 0 var(--night-ink); }
.frame-empty.is-loading #remoteMsg::after {
  content: ''; display: inline-block; width: 1.2em; text-align: left;
  animation: dots 1.2s steps(4) infinite;
}
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

.radar { position: relative; width: 110px; height: 110px; margin-bottom: 8px; }
.radar i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--sky); opacity: 0; }
.frame-empty.is-searching .radar i { animation: ping 2.4s ease-out infinite; }
.frame-empty.is-searching .radar i:nth-child(2) { animation-delay: .8s; }
.frame-empty.is-searching .radar i:nth-child(3) { animation-delay: 1.6s; }
.frame-empty.is-idle .radar i:nth-child(1) { opacity: .35; transform: scale(.75); }
.frame-empty.is-idle .radar i:nth-child(2) { opacity: .18; transform: scale(1); }
.frame-empty:not(.is-searching):not(.is-idle) .radar { display: none; }
@keyframes ping { 0% { transform: scale(.35); opacity: .9; } 100% { transform: scale(1.25); opacity: 0; } }
.radar-core {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper); color: var(--you);
  border: 2px solid var(--night-ink);
  font-size: 24px;
}
.radar-core .flag-stack { font-size: 15px; }

.tag {
  position: absolute; left: 14px; bottom: 14px; z-index: 5;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 12px 5px; border-radius: 999px;
  font-size: 14px; font-weight: 650; color: #fff;
}
.tag .fi { font-size: 15px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .5); }
.tag-them { background: var(--them); bottom: auto; top: 14px; box-shadow: 0 2px 10px rgba(8, 11, 46, .35); }
.tag-you { background: var(--you); }

.invite-bar {
  position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 6;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  padding: 12px 14px;
  border: 2px solid var(--ink); border-radius: 14px;
  background: var(--hl); color: var(--ink);
  box-shadow: 4px 4px 0 var(--night-ink);
  animation: rise-in .3s cubic-bezier(.2, .9, .3, 1) both;
}
.invite-bar p { margin: 0; flex: 1 1 200px; font-weight: 650; font-size: 16px; }
.invite-bar .actions { display: flex; gap: 8px; }
.invite-bar .btn { box-shadow: 2px 2px 0 var(--ink); }
.invite-bar.is-hot { background: #FFD0C9; border-color: #8E1F26; }
.notice {
  position: absolute; top: 62px; left: 50%; transform: translateX(-50%); z-index: 7;
  max-width: calc(100% - 28px);
  padding: 9px 14px;
  border: 2px solid var(--ink); border-radius: 12px;
  background: var(--paper); color: var(--ink);
  font-weight: 600; font-size: 15px;
  box-shadow: 3px 3px 0 var(--night-ink);
}

/* ---------------------------------------------------------- Kontrole */

.controls {
  display: flex; flex-direction: column; gap: 12px; min-height: 0;
  padding: 16px;
  border: 1.5px solid rgba(255, 255, 255, .12); border-radius: 20px;
  background: var(--night-2);
}
.controls-main { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px; }
.controls-main .btn { min-height: 58px; font-size: 21px; font-weight: 800; border-color: var(--night-ink); box-shadow: 4px 4px 0 var(--night-ink); }
.btn-skip { background: #fff; }
.btn-stop { background: var(--them); color: #fff; }
.controls-main .btn:disabled { opacity: 1; background: #2B3178; color: rgba(226, 230, 255, .45); border-color: var(--night-ink); box-shadow: none; }
.controls-side { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.controls-side .btn-quiet { margin-left: auto; color: #FF9A8F; }
.controls-side .btn-quiet:hover:not(:disabled) { background: rgba(255, 123, 107, .14); }
.status { margin: auto 0 0; font-size: 14px; color: var(--moon-2); }

.icon-btn {
  width: 46px; height: 46px; display: grid; place-items: center;
  border: 2px solid var(--night-ink); border-radius: 12px;
  background: #fff;
}
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.icon-btn .off-line { display: none; }
.icon-btn[aria-pressed="false"] { background: var(--them-soft); border-color: var(--them); }
.icon-btn[aria-pressed="false"] svg { stroke: var(--them); }
.icon-btn[aria-pressed="false"] .off-line { display: block; }
.icon-btn:disabled { opacity: .45; cursor: not-allowed; }

.want-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 14px;
  border: 1.5px solid rgba(255, 255, 255, .28); border-radius: 12px;
  background: rgba(255, 255, 255, .08); color: var(--moon);
  font-size: 14px; font-weight: 650;
  max-width: 100%;
}
.want-chip:hover { background: rgba(255, 255, 255, .14); }
.want-chip > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.want-chip .fi { font-size: 15px; }

.games-btn {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 52px; padding: 0 16px 0 10px;
  border: 2px solid var(--night-ink); border-radius: 14px;
  background: rgba(255, 255, 255, .06); color: rgba(226, 230, 255, .5);
  font-size: 16px; font-weight: 750; text-align: left;
  transition: background .2s ease, color .2s ease;
}
.gb-dice { display: grid; place-items: center; width: 36px; height: 36px; flex: none; }
.gb-dice svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.gb-dice circle { fill: currentColor; stroke: none; }
.gb-text { flex: 1; min-width: 0; }
.gb-icons { display: flex; gap: 6px; }
.gb-icons svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.games-btn:disabled { cursor: default; }

/* Kad ste spojeni, dugme "oživi": kocka se klati, sjaj prelazi preko, a oko dugmeta pulsira krug. */
.games-btn:not(:disabled) {
  background: linear-gradient(100deg, #FF7B6B, #FF5FA2 55%, #9C7BFF);
  color: #fff;
  box-shadow: 4px 4px 0 var(--night-ink);
  animation: games-pulse 2.2s ease-out infinite;
}
.games-btn:not(:disabled) .gb-dice { animation: dice 2.6s ease-in-out infinite; }
.games-btn:not(:disabled)::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: skewX(-18deg);
  animation: shine 3.2s ease-in-out infinite;
}
.games-btn:not(:disabled):hover { filter: brightness(1.06); }
.games-btn:not(:disabled):active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--night-ink); }
.room.has-game .games-btn:not(:disabled) { animation: none; }
.room.has-game .games-btn:not(:disabled) .gb-dice { animation: none; }
.room.has-game .games-btn:not(:disabled)::after { display: none; }
@keyframes games-pulse {
  0% { box-shadow: 4px 4px 0 var(--night-ink), 0 0 0 0 rgba(255, 95, 162, .55); }
  70% { box-shadow: 4px 4px 0 var(--night-ink), 0 0 0 12px rgba(255, 95, 162, 0); }
  100% { box-shadow: 4px 4px 0 var(--night-ink), 0 0 0 0 rgba(255, 95, 162, 0); }
}
@keyframes dice {
  0%, 60%, 100% { transform: rotate(0) translateY(0); }
  68% { transform: rotate(-22deg) translateY(-4px); }
  76% { transform: rotate(16deg) translateY(-2px); }
  84% { transform: rotate(-8deg) translateY(0); }
  92% { transform: rotate(4deg); }
}
@keyframes shine { 0%, 55% { left: -40%; } 100% { left: 130%; } }

/* ---------------------------------------------- Alati na videu sagovornika */

.vtools { position: absolute; top: 12px; right: 12px; z-index: 6; display: flex; gap: 8px; align-items: center; }
.vt-btn {
  height: 38px; min-width: 38px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 0; border-radius: 999px;
  background: rgba(8, 11, 46, .66); color: #fff;
  font-size: 14px; font-weight: 700;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background .15s ease, color .15s ease;
}
.vt-btn:hover { background: rgba(8, 11, 46, .85); }
.vt-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.vol { display: flex; align-items: center; gap: 2px; padding-right: 12px; border-radius: 999px; background: rgba(8, 11, 46, .66); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.vol .vt-btn { background: transparent; padding: 0 8px 0 10px; -webkit-backdrop-filter: none; backdrop-filter: none; }
.vol input[type="range"] { width: 96px; accent-color: var(--hl); cursor: pointer; }
.vol.no-range { padding-right: 0; }
.vol.no-range input { display: none; }
#volBtn .mute-x { display: none; }
#volBtn[aria-pressed="true"] .mute-x { display: inline; }
#volBtn[aria-pressed="true"] .wave { display: none; }
#volBtn[aria-pressed="true"] { color: #FF9A8F; }
.vt-cover[aria-pressed="true"] { background: var(--hl); color: var(--ink); }

.cover {
  position: absolute; inset: 0; z-index: 4; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 20px; text-align: center;
  background:
    radial-gradient(circle at 20% 25%, rgba(255, 123, 107, .35), transparent 45%),
    radial-gradient(circle at 80% 75%, rgba(156, 123, 255, .4), transparent 50%),
    radial-gradient(circle at 70% 15%, rgba(70, 130, 255, .3), transparent 40%),
    var(--night-2);
  color: var(--moon);
  animation: fade-in .2s ease both;
}
.cover::before {
  content: ''; position: absolute; inset: -20%;
  background:
    radial-gradient(circle at 30% 60%, rgba(255, 95, 162, .28), transparent 40%),
    radial-gradient(circle at 70% 40%, rgba(255, 225, 74, .14), transparent 35%);
  animation: cover-drift 9s ease-in-out infinite alternate;
  pointer-events: none;
}
.cover > * { position: relative; }
@keyframes cover-drift { to { transform: translate(6%, -5%) rotate(8deg) scale(1.08); } }
.cover-logo { line-height: .9; margin-bottom: 6px; }
.cl-word {
  display: inline-block;
  font-size: clamp(44px, 6.4vw, 84px); font-weight: 800; letter-spacing: -0.055em;
  color: #fff;
  padding: 0 4px 10px;
  background: linear-gradient(transparent 86%, var(--hl) 86%, var(--hl) 96%, transparent 96%) no-repeat;
}
.cl-o { display: inline-block; color: var(--coral); animation: blink 2.6s ease-in-out infinite; }
.cover p { margin: 0; font-weight: 750; font-size: 18px; }
.cover-sub { font-size: 14px; color: var(--moon-2); max-width: 32ch; }
.cover-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.cover .btn { box-shadow: 3px 3px 0 var(--night-ink); border-color: var(--night-ink); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Kratki "spojeni ste" trenutak na okviru sagovornika */
.frame-them.just-connected { animation: connected 1.3s cubic-bezier(.2, .9, .3, 1); }
@keyframes connected {
  0% { box-shadow: 6px 6px 0 var(--night-ink), 0 0 0 0 rgba(61, 220, 151, .8); transform: scale(.985); }
  40% { transform: scale(1); }
  100% { box-shadow: 6px 6px 0 var(--night-ink), 0 0 0 22px rgba(61, 220, 151, 0); }
}

/* Dugme cijeli ekran */
#fullBtn[aria-pressed="false"] { background: #fff; border-color: var(--night-ink); }
#fullBtn[aria-pressed="false"] svg { stroke: var(--ink); }
#fullBtn .ex-out { display: none; }
#fullBtn[aria-pressed="true"] .ex-in { display: none; }
#fullBtn[aria-pressed="true"] .ex-out { display: inline; }
#fullBtn[aria-pressed="true"] { background: var(--hl); border-color: var(--night-ink); }
#fullBtn[aria-pressed="true"] svg { stroke: var(--ink); }

/* Cijeli ekran: bez zaglavlja, videi što veći */
body.is-full .top { display: none; }
body.is-full .room { height: 100vh; height: 100dvh; padding: 12px; gap: 12px 14px; }

/* Plutajući mini video sagovornika (telefon, dok igraš ispod) */
.float-them {
  position: fixed; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 30;
  width: 28vw; max-width: 140px; aspect-ratio: 3 / 4;
  padding: 0; border: 2px solid var(--night-ink); border-radius: 14px; overflow: hidden;
  background: var(--night-deep);
  box-shadow: 4px 4px 0 var(--night-ink), 0 8px 30px rgba(8, 11, 46, .5);
  animation: rise-in .3s cubic-bezier(.2, .9, .3, 1) both;
}
.float-them video { width: 100%; height: 100%; object-fit: cover; display: block; }
.float-cover { position: absolute; inset: 0; display: none; place-items: center; background: radial-gradient(circle at 30% 30%, rgba(255, 123, 107, .4), transparent 55%), radial-gradient(circle at 70% 75%, rgba(156, 123, 255, .45), transparent 55%), var(--night-2); }
.float-cover b { color: #fff; font-size: 17px; font-weight: 800; letter-spacing: -0.04em; }
.float-cover i { font-style: normal; color: var(--coral); }
.float-them.is-covered .float-cover { display: grid; }
body.is-typing .float-them { display: none; }

/* ------------------------------------------------------------- Chat */

.chat {
  display: flex; flex-direction: column; min-height: 0;
  border: 2px solid var(--night-ink); border-radius: 20px;
  background: #fff; overflow: hidden;
  box-shadow: 6px 6px 0 var(--night-ink);
}
.chat-log { list-style: none; margin: 0; padding: 14px; flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.chat-log li { max-width: 85%; padding: 7px 12px 8px; border-radius: 14px; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.chat-log .me { align-self: flex-end; background: var(--you); color: #fff; border-bottom-right-radius: 4px; }
.chat-log .them { align-self: flex-start; background: var(--them-soft); color: var(--ink); border-bottom-left-radius: 4px; }
.chat-log .sys { align-self: center; max-width: 100%; background: none; color: var(--ink-3); font-size: 13px; text-align: center; padding: 2px 0; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 2px solid var(--ink); background: var(--paper); }
.chat-form input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 2px solid var(--line); border-radius: 10px; background: #fff; }
.chat-form input:focus { border-color: var(--you); outline: none; }
.chat-form .btn { box-shadow: none; }

/* ------------------------------------------------------------ Igra (sto) */

.table {
  position: relative; min-height: 0; overflow-y: auto;
  border: 2px solid var(--night-ink); border-radius: 20px;
  box-shadow: 6px 6px 0 var(--night-ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
  animation: rise-in .35s cubic-bezier(.2, .9, .3, 1) both;
}
.table-body { min-height: 100%; padding: 22px 26px 24px; display: flex; flex-direction: column; }
.table :focus-visible, .chat :focus-visible, .sheet :focus-visible, .intro-card :focus-visible { outline-color: var(--you); }
.wait-want { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: #fff; border: 2px solid var(--line); font-weight: 650; font-size: 15px; }
.wait-want .ico-globe, .wait-want .ico-g { color: var(--you); }

.sheet-games { width: min(720px, calc(100vw - 24px)); }
.games-sub { margin: -6px 0 16px; color: var(--ink-2); font-size: 15px; }
.sheet-games .tiles { margin-top: 0; grid-template-columns: repeat(2, 1fr); }
.tile.is-hot { background: #FFF1EE; border-color: #8E1F26; box-shadow: 4px 4px 0 #8E1F26; }
.tile.is-hot strong { color: #A3222B; }
.hot-badge { display: inline-block; margin-left: 6px; padding: 1px 7px 2px; border-radius: 999px; background: var(--them); color: #fff; font-size: 12px; font-weight: 750; vertical-align: 2px; }

/* ========================================================= Dijalozi */

.sheet {
  width: min(440px, calc(100vw - 32px));
  border: 2px solid var(--ink); border-radius: 20px;
  box-shadow: 8px 8px 0 var(--night-ink);
  padding: 24px; background: var(--paper); color: var(--ink);
}
.sheet::backdrop { background: rgba(8, 11, 46, .6); }
.sheet h2 { margin: 0 0 14px; font-size: 22px; letter-spacing: -0.01em; }
.rules { margin: 0 0 20px; padding-left: 20px; display: grid; gap: 6px; }
.reasons { border: 0; margin: 0 0 20px; padding: 0; display: grid; gap: 10px; }
.reasons label { display: flex; gap: 10px; align-items: center; font-size: 16px; }
.reasons input { width: 18px; height: 18px; accent-color: var(--them); margin: 0; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

.sheet-picker { width: min(520px, calc(100vw - 24px)); padding: 0; overflow: hidden; }
.sheet-picker[open] { display: flex; flex-direction: column; max-height: min(720px, calc(100dvh - 40px)); }
.picker-top { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 12px; }
.picker-top h2 { margin: 0; }
.close-btn { width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; display: grid; place-items: center; }
.close-btn:hover { background: var(--grid); }
.close-btn svg { width: 22px; height: 22px; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; fill: none; }
.picker-search {
  margin: 0 20px 12px; height: 48px; padding: 0 14px;
  border: 2px solid var(--ink); border-radius: 12px; background: #fff; font-size: 16px;
}
.picker-search:focus { outline: 3px solid var(--you); outline-offset: 1px; }
.picker-list { overflow-y: auto; padding: 0 12px 16px; flex: 1; min-height: 0; }
.picker-group { margin: 12px 8px 6px; font-size: 13px; font-weight: 650; color: var(--ink-3); }
.picker-opt {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 48px; padding: 0 12px;
  border: 0; border-radius: 12px; background: transparent;
  text-align: left; font-size: 16px; font-weight: 600;
}
.picker-opt:hover, .picker-opt:focus-visible { background: #EEF1FF; outline: none; }
.picker-opt[aria-selected="true"] { background: var(--hl); }
.picker-opt .fi { font-size: 20px; }
.picker-opt .ico-globe { color: var(--you); font-size: 20px; }
.po-name { flex: 1; min-width: 0; }
.po-sub { display: block; font-size: 13px; font-weight: 500; color: var(--ink-3); }
.po-count { font-size: 13px; font-weight: 650; color: var(--ok); }
.picker-empty { padding: 24px 12px; text-align: center; color: var(--ink-2); }

/* =========================================================== Igre */

.center-msg { margin: auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.center-msg h2 { margin: 0; font-size: 26px; letter-spacing: -0.02em; line-height: 1.1; }
.center-msg p { margin: 0; color: var(--ink-2); max-width: 36ch; }

/* -------------------------------------------------------- Game picker */

.picker { margin: auto 0; }
.picker-head h2, .game-head h2 { margin: 0; font-size: 24px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.1; }
.picker-head p { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 22px; }
.tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 14px 14px 16px;
  text-align: left;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .1s ease, box-shadow .1s ease;
}
.tile:nth-child(1) { transform: rotate(-1.2deg); }
.tile:nth-child(2) { transform: rotate(0.8deg); }
.tile:nth-child(3) { transform: rotate(-0.4deg); }
.tile:hover:not(:disabled) { transform: rotate(0) translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.tile:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.tile:disabled { cursor: default; opacity: .55; }
.tile svg { width: 76px; height: 58px; margin-bottom: 8px; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tile strong { font-size: 17px; line-height: 1.15; color: var(--ink); }
.tile-desc { font-size: 14px; color: var(--ink-2); line-height: 1.3; }
.tiles.is-preview { margin-top: 4px; }
.tiles.is-preview .tile { box-shadow: 2px 2px 0 var(--ink); padding: 10px 12px 12px; }
.tiles.is-preview .tile svg { width: 60px; height: 46px; margin-bottom: 4px; }

.invite-card {
  margin-top: 22px;
  padding: 16px 18px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--hl);
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
}
.invite-card p { margin: 0; font-weight: 650; font-size: 17px; flex: 1 1 220px; }
.invite-card .actions { display: flex; gap: 10px; }

/* ---------------------------------------------------------- Game head */

.game-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.game-head .btn-quiet { color: var(--ink-2); flex: none; margin: -6px -6px 0 0; }
.scoreline { margin: 4px 0 0; font-size: 15px; color: var(--ink-2); }
.scoreline b { font-weight: 750; }
.scoreline .you { color: var(--you); }
.scoreline .them { color: var(--them); }

.turn {
  align-self: center;
  margin: 20px 0 14px;
  padding: 4px 14px 6px;
  font-size: 20px; font-weight: 750; letter-spacing: -0.01em;
  border-radius: 8px;
}
.turn.is-you { background: var(--hl); }
.turn.is-win { background: var(--hl); }

/* ---------------------------------------------------------- Iks-oks */

.ttt { position: relative; width: min(100%, 330px); aspect-ratio: 1; align-self: center; }
.ttt-grid { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; fill: none; }
.ttt-cells { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }
.ttt-cell { border: 0; background: transparent; padding: 14%; border-radius: 10px; }
.ttt-cell:not(:disabled):hover { background: rgba(43, 71, 212, .07); }
.ttt-cell:disabled { cursor: default; }
.ttt-cell svg { width: 100%; height: 100%; fill: none; stroke-width: 9; stroke-linecap: round; overflow: visible; }
.mark-you { stroke: var(--you); }
.mark-them { stroke: var(--them); }
.mark-new path, .mark-new circle { stroke-dasharray: 160; stroke-dashoffset: 160; animation: ink .28s ease-out forwards; }
.mark-new path:nth-child(2) { animation-delay: .14s; }
@keyframes ink { to { stroke-dashoffset: 0; } }
.ttt-win { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ttt-win line { stroke: var(--hl); stroke-width: 30; stroke-linecap: round; stroke-dasharray: 600; stroke-dashoffset: 600; animation: ink .4s ease-out .15s forwards; }
.ttt-win { mix-blend-mode: multiply; }
.after { align-self: center; margin-top: 18px; }
.ttt-you { margin: 14px 0 0; text-align: center; font-size: 14px; color: var(--ink-2); }
.mark-label-you { color: var(--you); }
.mark-label-them { color: var(--them); }

/* ------------------------------------------------- Crtaj i pogađaj */

.draw-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 16px; }
.draw-role { margin: 0; font-size: 15px; color: var(--ink-2); }
.draw-word { display: block; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); line-height: 1.1; text-transform: lowercase; }
.draw-hint { display: block; font-size: 28px; font-weight: 700; letter-spacing: 0.22em; color: var(--ink); line-height: 1.15; }
.draw-time { font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; min-width: 2.6ch; text-align: right; }
.draw-time.is-low { color: var(--them); }
.timebar { height: 6px; margin: 10px 0 12px; background: var(--grid); border-radius: 3px; overflow: hidden; }
.timebar i { display: block; height: 100%; width: 100%; background: var(--ink); transform-origin: left; }
.canvas-wrap { position: relative; }
.canvas-wrap canvas {
  display: block; width: 100%; aspect-ratio: 4 / 3;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 12px;
  touch-action: none;
}
.canvas-wrap.can-draw canvas { cursor: crosshair; }
.reveal {
  position: absolute; inset: 0;
  display: grid; place-content: center; text-align: center; gap: 6px;
  background: rgba(252, 253, 255, .9);
  border-radius: 12px;
  padding: 20px;
}
.reveal h3 { margin: 0; font-size: 28px; letter-spacing: -0.02em; }
.reveal p { margin: 0; color: var(--ink-2); }
.reveal strong { color: var(--ink); }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.swatch {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--c);
  padding: 0;
}
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }
.swatch.eraser { background: #fff; display: grid; place-items: center; }
.swatch.eraser svg { width: 16px; height: 16px; stroke: var(--ink); fill: none; stroke-width: 2; }
.tool-sep { width: 1px; height: 26px; background: var(--line); margin: 0 4px; }
.size-btn { height: 34px; padding: 0 10px; border: 2px solid var(--line); border-radius: 9px; background: #fff; font-size: 14px; }
.size-btn[aria-pressed="true"] { border-color: var(--ink); background: var(--hl); }
.tools .push { margin-left: auto; }
.guess-form { display: flex; gap: 8px; margin-top: 12px; }
.guess-form input {
  flex: 1; min-width: 0; height: 48px; padding: 0 14px;
  border: 2px solid var(--ink); border-radius: 12px; background: #fff; font-size: 17px;
}
.guess-form input:focus { outline: 3px solid var(--you); outline-offset: 1px; }
.guesses { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.guesses li { padding: 3px 10px 4px; border-radius: 999px; background: #fff; border: 1.5px solid var(--line); font-size: 14px; }
.guesses li.close { border-color: var(--ink); background: var(--hl); }
.guesses li.correct { border-color: var(--ok); background: #DDF3E8; color: #0F5C3B; font-weight: 650; }
.guesses-label { margin: 12px 0 0; font-size: 13px; color: var(--ink-3); }

/* -------------------------------------------------- Da li bi radije */

.wyr-q { margin: 22px 0 14px; font-size: 18px; color: var(--ink-2); }
.wyr-options { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 12px; }
.wyr-or { align-self: center; font-weight: 750; color: var(--ink-3); }
.wyr-opt {
  position: relative;
  min-height: 150px;
  padding: 18px 16px 40px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 20px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em;
  text-align: left;
  transition: transform .1s ease, box-shadow .1s ease;
}
.wyr-opt::first-letter { text-transform: uppercase; }
.wyr-opt:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.wyr-opt:disabled { cursor: default; }
.wyr-opt.is-mine { border-color: var(--you); box-shadow: 4px 4px 0 var(--you); background: var(--you-soft); }
.wyr-opt.is-dim { opacity: .55; }
.who { position: absolute; left: 14px; bottom: 12px; display: flex; gap: 6px; }
.who span { padding: 1px 9px 2px; border-radius: 999px; color: #fff; font-size: 12.5px; font-weight: 650; }
.who .w-you { background: var(--you); }
.who .w-them { background: var(--them); }
.wyr-result { margin-top: 20px; text-align: center; }
.wyr-result p { margin: 0; }
.wyr-verdict { font-size: 22px; font-weight: 750; letter-spacing: -0.01em; }
.wyr-wait { margin-top: 18px; text-align: center; color: var(--ink-2); }

/* ===================================================== Telefon/tablet */

@media (max-width: 1079px) {
  :root { --top-h: 58px; }
  .top { padding: 0 16px; }
  .brand { font-size: 26px; }

  .intro { grid-template-columns: 1fr; gap: 28px; padding: 0 18px 40px; align-items: start; }
  .wm-letters { font-size: clamp(56px, 17vw, 96px); }
  .intro-title { margin-top: 18px; }
  .intro-lead { font-size: 17px; }
  .intro-games { margin-top: 22px; }
  .intro-card { padding: 22px 20px 24px; }

  .room {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas:
      "them"
      "controls"
      "stage"
      "chat";
    gap: 12px; height: auto;
    min-height: calc(100dvh - var(--top-h));
    padding: 0 12px 16px;
  }
  .frame { border-radius: 18px; box-shadow: 4px 4px 0 var(--night-ink); }
  .frame-them { aspect-ratio: 4 / 5; max-height: 72dvh; width: 100%; }
  /* Na telefonu je tvoja kamera uvijek mala, u donjem desnom uglu. */
  .frame-you, .room.has-game .frame-you {
    grid-area: them;
    align-self: end; justify-self: end;
    width: 30%; height: auto; aspect-ratio: 3 / 4;
    margin: 0 10px 10px 0;
    z-index: 4;
    border-radius: 14px;
    box-shadow: 3px 3px 0 var(--night-ink);
  }
  .frame-you .tag { left: 6px; bottom: 6px; font-size: 11px; padding: 2px 8px 3px; }
  .frame-you .frame-empty { font-size: 12px; padding: 6px; }
  .radar { width: 84px; height: 84px; }
  .radar-core { width: 42px; height: 42px; font-size: 19px; }
  #remoteMsg { font-size: 17px; }
  .frame-sub { font-size: 13px; }
  .tag { left: 10px; bottom: 10px; font-size: 13px; }
  .tag-them { top: 10px; bottom: auto; max-width: calc(100% - 218px); }
  .tag-them #partnerName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .vtools { top: 10px; right: 10px; gap: 6px; }
  .vt-btn { height: 36px; padding: 0 10px; font-size: 13px; }
  .vol { padding-right: 0; }
  .vol input[type="range"] { display: none; }
  .vt-cover { padding: 0 12px 0 10px; }
  .invite-bar { left: 10px; right: calc(30% + 20px); bottom: 10px; padding: 10px 12px; }
  .invite-bar .actions { flex-wrap: wrap; }
  /* Sadržaj pokrivača ide gore, da ga ne prekrije tvoja mala kamera dolje desno */
  .cover { justify-content: flex-start; padding: 62px 14px 0; gap: 8px; }
  .cl-word { font-size: 44px; padding-bottom: 8px; }
  .cover-logo { margin-bottom: 2px; }
  .cover p { font-size: 16px; }
  .cover-sub { display: none; }
  body.is-full .room { height: auto; padding: 0 0 14px; gap: 10px; }
  body.is-full .frame-them { aspect-ratio: auto; height: calc(100vh - 210px); height: calc(100svh - 210px); max-height: none; border-radius: 0 0 18px 18px; border-top: 0; }
  body.is-full .controls, body.is-full .table, body.is-full .chat { margin: 0 12px; }
  .invite-bar p { font-size: 15px; }

  .table { box-shadow: 4px 4px 0 var(--night-ink); overflow: visible; }
  .table-body { padding: 18px 16px 20px; }
  .chat { height: 300px; box-shadow: 4px 4px 0 var(--night-ink); }

  .controls { padding: 12px; gap: 10px; }
  .controls-main { gap: 8px; }
  .controls-main .btn { min-height: 54px; font-size: 18px; padding: 0 8px; }
  .controls { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .controls-main, .games-btn { flex: 1 1 100%; }
  .controls-side { display: contents; }
  .controls-side .icon-btn { order: 1; }
  .controls-side .btn-quiet { order: 1; margin-left: auto; min-height: 40px; }
  .controls-side::after { content: ''; order: 1; flex: 0 0 100%; height: 0; margin-top: -10px; }
  .want-chip { order: 2; flex: 1 1 calc(50% - 6px); min-width: 0; padding: 0 10px; justify-content: center; }
  .status { order: 3; flex: 1 1 100%; margin: 0; font-size: 13px; }
  .games-btn { font-size: 15px; }
  .gb-icons { display: none; }
  .controls-side .btn-quiet { margin-left: auto; }

  .tiles { grid-template-columns: 1fr; gap: 12px; }
  .sheet-games .tiles { grid-template-columns: 1fr; }
  .tile { flex-direction: row; align-items: center; gap: 14px; flex-wrap: wrap; }
  .tile svg { margin: 0; width: 60px; height: 46px; }
  .tile .tile-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
  .tile:nth-child(1) { transform: rotate(-0.5deg); }
  .tile:nth-child(2) { transform: rotate(0.4deg); }
  .tile:nth-child(3) { transform: rotate(-0.2deg); }
  .wyr-options { grid-template-columns: 1fr; }
  .wyr-or { justify-self: center; }
  .wyr-opt { min-height: 96px; font-size: 18px; }
  .draw-word { font-size: 26px; }
  .draw-hint { font-size: 22px; letter-spacing: 0.16em; }
  .doodle { width: 34px; height: 34px; left: var(--mx, var(--x)); top: var(--my, var(--y)); }
  .doodle:not(.m) { display: none; }
}

@media (min-width: 1080px) {
  .tile .tile-text { display: contents; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; animation-delay: 0s !important; transition: none !important; }
  .doodle { animation: none !important; }
  .aurora i { animation: none !important; }
  .doodles { transform: none !important; }
  .mark-new path, .mark-new circle, .ttt-win line, .wm-underline path { stroke-dashoffset: 0; }
}
