@font-face {
  font-family: "Pixelify";
  src: url("/fonts/PixelifySans.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

/* Minecraft text colours (§ codes) and GUI greys */
:root {
  --green: #55ff55;
  --dark-green: #00aa00;
  --yellow: #ffff55;
  --gold: #ffaa00;
  --red: #ff5555;
  --dark-red: #aa0000;
  --aqua: #55ffff;
  --gray: #aaaaaa;
  --dark-gray: #555555;
  --label: #404040;
  --gui: #c6c6c6;
  --shadow: #3f3f3f;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --bounce: cubic-bezier(.3, 1.6, .5, 1);
  --tex-dirt: none;
  --tex-stone: none;
  --tex-gold: none;
  --tex-grass: none;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Pixelify", "Courier New", monospace;
  font-size: 18px;
  line-height: 1.25;
  color: #fff;
  background: #1b1b1b;
  overflow: hidden;
  text-shadow: 2px 2px 0 var(--shadow);
  -webkit-font-smoothing: none;
  user-select: none;
  -webkit-user-select: none;
}
input, button, select { font: inherit; color: inherit; }
img { image-rendering: pixelated; }
::selection { background: #3a5fcd; color: #fff; }

/* ---------- background ---------- */
#panorama {
  position: fixed; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px);
  image-rendering: pixelated;
  transition: filter .6s var(--ease);
}
body.dim #panorama { filter: blur(3px) brightness(.8); }
#vignette {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,0) 45%, rgba(0,0,0,.5) 100%),
    linear-gradient(rgba(0,0,0,.12), rgba(0,0,0,.12));
  transition: background .5s var(--ease);
}
body.dim #vignette {
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,.2) 30%, rgba(0,0,0,.65) 100%),
    linear-gradient(rgba(16,16,16,.4), rgba(16,16,16,.55));
}

/* ---------- scrollbars (Minecraft list style) ---------- */
* { scrollbar-width: thin; scrollbar-color: #c0c0c0 #000; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #808080; box-shadow: inset -3px -3px 0 #4f4f4f, inset 3px 3px 0 #c0c0c0; }
::-webkit-scrollbar-thumb:hover { background: #a0a0a0; }

#app { position: fixed; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.screen {
  min-height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(24px + var(--safe-t)) 16px calc(24px + var(--safe-b));
  opacity: 0; transform: translateY(16px) scale(.98);
  transition: opacity .3s var(--ease), transform .35s var(--ease);
}
.screen.in { opacity: 1; transform: none; }
.screen.leaving { opacity: 0; transform: translateY(-12px) scale(1.01); position: absolute; inset: 0; pointer-events: none; transition-duration: .18s; }

/* ---------- logo / splash ---------- */
.logo { text-align: center; margin: 0 0 30px; position: relative; display: inline-block; }
.logo h1 {
  --px: clamp(1.1px, .34vw, 2.4px);
  margin: 0; line-height: 0; font-size: 0;
  filter: drop-shadow(0 calc(var(--px) * 5) calc(var(--px) * 3) rgba(0,0,0,.4));
}
.logo h1 .w { display: flex; justify-content: center; gap: var(--px); }
.logo h1 .w + .w { margin-top: calc(var(--px) * 4); }
.logo h1 img {
  width: calc(var(--w) * var(--px)); height: auto; image-rendering: pixelated;
  animation: drop .7s var(--bounce) backwards; animation-delay: calc(var(--i) * 45ms + 80ms);
}
@keyframes drop { from { transform: translateY(-60px); opacity: 0; } 40% { opacity: 1; } }
.logo .edition {
  display: inline-block; margin-top: 10px; font-size: clamp(.8rem, 2.6vw, 1rem); color: #fff; letter-spacing: .3em;
  text-transform: uppercase; padding: 4px 4px 4px 10px; background: rgba(0,0,0,.45);
}
.splash {
  position: absolute; right: 0; bottom: 22%;
  color: var(--yellow); font-weight: 500; font-size: clamp(.95rem, 3.4vw, 1.3rem); white-space: nowrap;
  transform: rotate(-20deg); transform-origin: center;
  animation: splash .55s ease-in-out infinite alternate;
  text-shadow: 2px 2px 0 #3f3f00;
  pointer-events: none;
}
@keyframes splash { from { transform: translateX(var(--sx, 50%)) rotate(-20deg) scale(.92); } to { transform: translateX(var(--sx, 50%)) rotate(-20deg) scale(1.06); } }

/* ---------- panels: the light-grey container GUI ---------- */
.panel {
  position: relative;
  width: 100%;
  border: 9px solid transparent;
  border-image: url("/img/panel.svg") 3 fill / 9px / 0 stretch;
  image-rendering: pixelated;
  padding: 10px 12px 12px;
  color: var(--label);
  text-shadow: none;
  filter: drop-shadow(0 12px 0 rgba(0,0,0,.25));
  animation: panel-in .45s var(--ease) backwards;
}
@keyframes panel-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.cols > .panel:nth-child(2) { animation-delay: .08s; }
.panel h2 {
  margin: 0 0 12px; font-size: 1.2rem; font-weight: 500; letter-spacing: .02em; color: var(--label);
  display: flex; align-items: center; gap: 8px;
}
.panel h2 svg { width: 18px; height: 18px; color: #6b6b6b; }
.panel h2.center { justify-content: center; text-align: center; }
.panel h2 small { color: #6b6b6b; font-weight: 400; font-size: .85em; }

/* ---------- buttons (modern Minecraft: white outline on hover) ---------- */
.mc-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 48px; padding: 2px 10px;
  border: 6px solid transparent;
  border-image: url("/img/btn.svg") 2 fill / 6px stretch;
  image-rendering: pixelated;
  background: none;
  color: #fff; cursor: pointer; text-align: center;
  text-shadow: 2px 2px 0 var(--shadow);
  transition: transform .08s var(--ease);
  touch-action: manipulation;
}
.mc-btn > * { pointer-events: none; }
.mc-btn:hover:not(:disabled), .mc-btn:focus-visible {
  border-image-source: url("/img/btn-hover.svg");
  color: var(--yellow);
  text-shadow: 2px 2px 0 #3f3f15;
  outline: none;
}
.mc-btn:active:not(:disabled), .mc-btn.held {
  border-image-source: url("/img/btn-press.svg");
  transform: translateY(2px);
}
.mc-btn:disabled { border-image-source: url("/img/btn-off.svg"); color: #a0a0a0; text-shadow: none; cursor: not-allowed; }
.mc-btn.green { border-image-source: url("/img/btn-green.svg"); }
.mc-btn.green:hover:not(:disabled), .mc-btn.green:focus-visible { border-image-source: url("/img/btn-green-hover.svg"); color: #fff; text-shadow: 2px 2px 0 #1d3d0c; }
.mc-btn.red, .mc-btn.state-off { border-image-source: url("/img/btn-red.svg"); }
.mc-btn.red:hover:not(:disabled), .mc-btn.red:focus-visible,
.mc-btn.state-off:hover:not(:disabled), .mc-btn.state-off:focus-visible { border-image-source: url("/img/btn-red-hover.svg"); color: #fff; text-shadow: 2px 2px 0 #3d0c0c; }
.mc-btn.green:active:not(:disabled), .mc-btn.red:active:not(:disabled), .mc-btn.state-off:active:not(:disabled) { filter: brightness(.85); }
.mc-btn.small { min-height: 38px; font-size: .92rem; padding: 0 8px; width: auto; gap: 6px; }
.mc-btn svg { width: 20px; height: 20px; flex: none; filter: drop-shadow(2px 2px 0 rgba(0,0,0,.45)); }
.mc-btn.small svg { width: 16px; height: 16px; }
.mc-btn .state { margin-left: auto; padding-left: 8px; }
.mc-btn .state.on { color: var(--green); }
.mc-btn .state.off { color: #ffd0d0; }

.stack { display: flex; flex-direction: column; gap: 8px; }
.row-gap { display: flex; gap: 8px; }
.row-gap > * { flex: 1; min-width: 0; }

/* ---------- text inputs (black edit box) ---------- */
.mc-input {
  width: 100%; min-height: 48px; padding: 6px 12px;
  border: 3px solid transparent;
  border-image: url("/img/edit.svg") 1 fill / 3px stretch;
  background: none; outline: none; border-radius: 0;
  color: #e0e0e0; text-shadow: 2px 2px 0 #383838; user-select: text; -webkit-user-select: text;
  caret-color: #fff;
}
.mc-input:hover { border-image-source: url("/img/edit-focus.svg"); }
.mc-input:focus { border-image-source: url("/img/edit-focus.svg"); color: #fff; }
.mc-input::placeholder { color: #5f5f5f; text-shadow: none; }
.mc-input.code { text-align: center; font-size: 2rem; letter-spacing: .5em; padding-left: calc(12px + .5em); font-weight: 500; min-height: 64px; color: var(--yellow); text-shadow: 3px 3px 0 #3f3f15; }
select.mc-input { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 40px; text-overflow: ellipsis; }
.select-wrap { position: relative; }
.select-wrap::after { content: ""; position: absolute; right: 14px; top: 50%; width: 15px; height: 9px; margin-top: -4px; background: url("/img/arrow.svg") 0 0 / 100% 100%; pointer-events: none; image-rendering: pixelated; }
select.mc-input option { background: #1d1d1d; color: #fff; }
.mc-label { display: block; margin: 0 0 6px; color: var(--label); font-size: .95rem; }
.field { margin-bottom: 12px; }
.hint { color: #5a5a5a; font-size: .85rem; margin-top: 6px; text-shadow: none; line-height: 1.35; }
.error-text { color: var(--dark-red); text-shadow: none; min-height: 1.3em; text-align: center; margin: 4px 0 8px; }
.error-text:empty { margin: 0; min-height: 0; }
.shake { animation: shake .35s; }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }

/* ---------- code boxes (5 slots behind one input) ---------- */
.code-wrap { position: relative; }
.code-slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; pointer-events: none; }
.code-slots i {
  display: grid; place-items: center; height: 64px; font-style: normal;
  border: 3px solid transparent; border-image: url("/img/edit.svg") 1 fill / 3px stretch;
  font-size: 2rem; font-weight: 500; color: var(--yellow); text-shadow: 3px 3px 0 #3f3f15;
  transition: transform .15s var(--bounce);
}
.code-slots i.filled { animation: slot-pop .22s var(--bounce); }
@keyframes slot-pop { from { transform: scale(.7); } }
.code-wrap.focus .code-slots i.cur { border-image-source: url("/img/edit-focus.svg"); }
.code-wrap.focus .code-slots i.cur::after { content: "_"; color: #fff; text-shadow: 2px 2px 0 #383838; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.code-wrap input {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0;
  font-size: 16px; color: transparent; caret-color: transparent; cursor: text; user-select: text;
}

/* ---------- slider ---------- */
.mc-slider { position: relative; height: 48px; border: 3px solid transparent; border-image: url("/img/edit.svg") 1 fill / 3px stretch; touch-action: none; }
.mc-slider .fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,255,255,.12); pointer-events: none; }
.mc-slider .thumb {
  position: absolute; top: -3px; bottom: -3px; width: 24px; margin-left: -12px;
  border: 6px solid transparent; border-image: url("/img/btn.svg") 2 fill / 6px stretch;
  pointer-events: none;
}
.mc-slider:hover .thumb, .mc-slider:focus-within .thumb { border-image-source: url("/img/btn-hover.svg"); }
.mc-slider:hover .label, .mc-slider:focus-within .label { color: var(--yellow); }
.mc-slider .label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; color: #fff; text-shadow: 2px 2px 0 var(--shadow); font-size: .95rem; padding: 0 8px; text-align: center; }
.mc-slider input { position: absolute; inset: -6px 0; width: 100%; height: calc(100% + 12px); margin: 0; opacity: 0; cursor: pointer; }

/* ---------- mic meter: the experience bar ---------- */
.xp { position: relative; padding-top: 6px; }
.meter {
  position: relative; height: 18px; background: #000; border: 3px solid #000;
  box-shadow: inset 0 0 0 3px #2b2b2b; overflow: hidden;
}
.meter .bar {
  position: absolute; inset: 3px auto 3px 3px; width: 0%;
  background: linear-gradient(#a8ff5a 0 33%, #6fd52a 33% 66%, #3e9612 66%);
  transition: width .06s linear;
}
.meter .bar.hot { background: linear-gradient(#ffff8a 0 33%, #f5e43a 33% 66%, #b3a000 66%); }
.meter::after { /* segment notches */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(5.555% - 3px), #000 calc(5.555% - 3px) 5.555%);
}
.meter .mark { position: absolute; top: -3px; bottom: -3px; width: 3px; background: #fff; box-shadow: 0 0 0 1px #000; z-index: 1; }
.meter.active { box-shadow: inset 0 0 0 3px #3e9612, 0 0 12px rgba(128,255,32,.55); }
.xp .lvl {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  font-weight: 500; font-size: 1.15rem; color: #80ff20; pointer-events: none;
  text-shadow: 2px 0 #000, -2px 0 #000, 0 2px #000, 0 -2px #000;
}

/* ---------- login ---------- */
.login { width: 100%; max-width: 480px; }
.spinner { display: inline-grid; grid-template-columns: repeat(3, 8px); gap: 3px; vertical-align: middle; margin-right: 12px; }
.spinner i { width: 8px; height: 8px; background: #5a5a5a; opacity: .2; animation: blink 1.2s infinite; }
.spinner i:nth-child(2) { animation-delay: .1s } .spinner i:nth-child(3) { animation-delay: .2s }
.spinner i:nth-child(4) { animation-delay: .7s } .spinner i:nth-child(5) { animation-delay: .6s } .spinner i:nth-child(6) { animation-delay: .5s }
.spinner i:nth-child(7) { animation-delay: .8s } .spinner i:nth-child(8) { animation-delay: .9s } .spinner i:nth-child(9) { animation-delay: 1s }
@keyframes blink { 0%, 100% { opacity: .2 } 25% { opacity: 1 } }
.status-line { text-align: center; min-height: 28px; display: flex; align-items: center; justify-content: center; }
.waiting { padding: 10px 0 14px; }
.footer { margin-top: 20px; font-size: .78rem; color: #e8e8e8; text-align: center; max-width: 520px; text-shadow: 2px 2px 0 rgba(0,0,0,.6); opacity: .85; }
.login .help {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 10px;
  border: 3px solid transparent; border-image: url("/img/slot.svg") 1 fill / 3px stretch;
  color: #fff; text-shadow: 2px 2px 0 var(--shadow); font-size: .85rem; line-height: 1.35;
}
.login .help svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--yellow); }
.link-btn { background: none; border: 0; color: var(--aqua); cursor: pointer; padding: 4px; text-shadow: none; text-decoration: underline; }

/* ---------- hub ---------- */
.hub { width: 100%; max-width: 1080px; margin: 0 auto; justify-content: flex-start; align-items: stretch; }
.hub-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px;
  animation: panel-in .4s var(--ease) backwards;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { width: 40px; height: 40px; flex: none; filter: drop-shadow(3px 3px 0 rgba(0,0,0,.4)); }
.brand h1 { margin: 0; font-weight: 400; font-size: clamp(1.1rem, 4vw, 1.6rem); letter-spacing: .08em; line-height: 1; white-space: nowrap; }
.brand h1 span { color: var(--gold); }
.brand .srv { font-size: .8rem; color: #ddd; letter-spacing: .1em; text-transform: uppercase; margin-top: 3px; }
.pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px; font-size: .9rem; white-space: nowrap;
  background: rgba(0,0,0,.55); border: 3px solid #000; box-shadow: inset 0 0 0 2px rgba(255,255,255,.12);
}
/* the server-list ping bars */
.ping { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.ping i { width: 3px; background: #2e2e2e; box-shadow: 1px 1px 0 #000; }
.ping i:nth-child(1) { height: 4px } .ping i:nth-child(2) { height: 7px } .ping i:nth-child(3) { height: 10px } .ping i:nth-child(4) { height: 13px } .ping i:nth-child(5) { height: 16px }
.ping.on i { background: #22ee22; }
.ping.wait i { animation: ping 1.2s steps(1) infinite; }
.ping.wait i:nth-child(2) { animation-delay: .15s } .ping.wait i:nth-child(3) { animation-delay: .3s } .ping.wait i:nth-child(4) { animation-delay: .45s } .ping.wait i:nth-child(5) { animation-delay: .6s }
@keyframes ping { 0%, 50% { background: #22ee22; } 51%, 100% { background: #2e2e2e; } }
.ping.off i { background: #2e2e2e; } .ping.off i:nth-child(1) { background: #ee2222; }

.cols { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }

.me { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.head-wrap { position: relative; flex: none; }
.avatar {
  display: block; width: 60px; height: 60px; image-rendering: pixelated;
  border: 3px solid transparent; border-image: url("/img/slot.svg") 1 fill / 3px stretch; padding: 3px;
  transition: transform .15s var(--bounce);
}
.avatar.speaking { transform: scale(1.06); }
.avatar.speaking + .ring { opacity: 1; }
.ring { position: absolute; inset: -4px; border: 3px solid var(--green); box-shadow: 0 0 12px var(--green); opacity: 0; transition: opacity .1s; pointer-events: none; }
.me .name { font-size: 1.25rem; font-weight: 500; word-break: break-all; color: var(--label); }
.me .sub { color: #6b6b6b; font-size: .85rem; display: flex; align-items: center; gap: 6px; }
.me .sub::before { content: ""; width: 8px; height: 8px; background: var(--dark-green); box-shadow: 1px 1px 0 #000; }

.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toggle-btn { flex-direction: column; min-height: 84px; gap: 4px; }
.toggle-btn svg { width: 28px; height: 28px; }
.toggle-btn .t { font-size: .95rem; }
.toggle-btn .s { font-size: .8rem; letter-spacing: .1em; color: var(--green); }
.toggle-btn.state-off .s { color: #ffd0d0; }
.talk-hint { text-align: center; color: #5a5a5a; font-size: .85rem; padding: 2px 4px; }
.ptt-btn { min-height: 72px; font-size: 1.1rem; touch-action: none; -webkit-touch-callout: none; }
.ptt-btn .hint { color: #ddd; text-shadow: 2px 2px 0 var(--shadow); margin-top: 2px; }
.ptt-btn.held { color: var(--green); }
kbd { display: inline-block; background: #2b2b2b; border: 2px solid #000; box-shadow: inset 0 -3px 0 #0e0e0e, inset 0 2px 0 #4a4a4a; padding: 0 6px; color: #fff; text-shadow: 2px 2px 0 #000; font-family: inherit; font-size: .85em; }
.shortcuts { display: flex; justify-content: center; gap: 14px; font-size: .78rem; color: #5a5a5a; margin-top: 10px; flex-wrap: wrap; }
@media (hover: none) { .shortcuts { display: none; } }

/* ---------- groups (server-list style inside a dark well) ---------- */
.groups-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.groups-head h2 { margin: 0; }
.well {
  border: 3px solid transparent; border-image: url("/img/well.svg") 1 fill / 3px stretch;
  background: none; padding: 6px;
}
.group-list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: min(58vh, 520px); min-height: 180px; overflow-y: auto; overscroll-behavior: contain;
  color: #fff; text-shadow: 2px 2px 0 var(--shadow);
}
.empty { color: #9a9a9a; text-align: center; padding: 34px 12px; text-shadow: 2px 2px 0 #000; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty svg { width: 40px; height: 40px; color: #5a5a5a; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.group {
  border: 3px solid transparent;
  transition: background .12s, border-color .12s;
  animation: pop .3s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 40ms);
}
@keyframes pop { from { opacity: 0; transform: translateX(-10px); } }
.group:hover { background: rgba(255,255,255,.08); }
.group.mine { border-color: #808080; background: rgba(0,0,0,.35); box-shadow: inset 0 0 0 2px #000; }
.group-head { display: flex; align-items: center; gap: 10px; padding: 6px 8px; cursor: pointer; width: 100%; background: none; border: 0; text-align: left; text-shadow: inherit; }
.group-head:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }
.gicon {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  background: #555; box-shadow: inset 3px 3px 0 rgba(255,255,255,.25), inset -3px -3px 0 rgba(0,0,0,.35), 0 0 0 2px #000;
  font-weight: 500; font-size: 1.2rem;
}
.gicon.normal { background: #5d6f8a; } .gicon.open { background: #3d8f5a; } .gicon.isolated { background: #7a4a9a; }
.ginfo { flex: 1; min-width: 0; }
.group-name { display: flex; align-items: center; gap: 6px; font-weight: 500; word-break: break-word; }
.group-name svg.lock { width: 14px; height: 14px; color: var(--yellow); flex: none; }
.gmeta { display: flex; gap: 10px; align-items: center; font-size: .8rem; color: #a8a8a8; margin-top: 2px; }
.tag { color: var(--gray); }
.tag.open { color: #7fe39a; } .tag.isolated { color: #d79cff; } .tag.normal { color: #9cc0ff; }
.faces { display: flex; flex: none; }
.faces img { width: 22px; height: 22px; box-shadow: 0 0 0 2px #000; margin-left: -4px; background: #000; }
.faces img:first-child { margin-left: 0; }
.faces .more { font-size: .75rem; color: #ccc; margin-left: 6px; align-self: center; }
.chev { width: 12px; height: 12px; flex: none; color: #8a8a8a; transition: transform .2s var(--ease); }
.group.open .chev { transform: rotate(90deg); }
.members { display: none; padding: 2px 8px 8px 58px; }
.group.open .members { display: block; animation: fold .22s var(--ease); }
@keyframes fold { from { opacity: 0; transform: translateY(-6px); } }
.member { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: .95rem; }
.member img { width: 20px; height: 20px; box-shadow: 0 0 0 2px #000; transition: box-shadow .1s, transform .1s; }
.member.speaking img { box-shadow: 0 0 0 2px var(--green), 0 0 8px var(--green); transform: scale(1.1); }
.member svg { width: 14px; height: 14px; flex: none; color: #8a8a8a; transition: color .08s, transform .08s; }
.member.speaking svg.voice { color: var(--green); transform: scale(1.25); }
.member.speaking .mname { color: var(--green); }
.member .badge { color: #8a8a8a; font-size: .75rem; }
.members .hint { color: #8a8a8a; text-shadow: none; }
.group-actions { display: flex; gap: 8px; padding: 0 8px 8px 58px; }

/* ---------- MC tooltip ---------- */
.tip {
  position: fixed; z-index: 90; pointer-events: none; max-width: 260px;
  border: 6px solid transparent; border-image: url("/img/tip.svg") 2 fill / 6px stretch;
  padding: 2px 4px; font-size: .85rem; color: #fff; text-shadow: 2px 2px 0 #3f3f3f;
  opacity: 0; transition: opacity .12s;
}
.tip.in { opacity: 1; }
.tip b { color: var(--yellow); display: block; }

/* ---------- note particles while speaking ---------- */
.note {
  position: absolute; left: 50%; top: 0; width: 14px; height: 14px; pointer-events: none; z-index: 2;
  animation: note 1.1s var(--ease) forwards;
}
.note svg { width: 100%; height: 100%; filter: drop-shadow(1px 1px 0 rgba(0,0,0,.5)); }
@keyframes note { from { transform: translate(-50%, 10px) scale(.6); opacity: 0; } 20% { opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), -46px) scale(1); opacity: 0; } }

/* ---------- modal ---------- */
#modal-root { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
.modal-back {
  position: absolute; inset: 0; background: linear-gradient(rgba(16,16,16,.75), rgba(16,16,16,.85));
  display: flex; align-items: center; justify-content: center; padding: calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b));
  pointer-events: auto; opacity: 0; transition: opacity .18s; overflow-y: auto;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.modal-back.in { opacity: 1; }
.modal { max-width: 460px; max-height: 100%; overflow-y: auto; transform: translateY(16px) scale(.96); transition: transform .25s var(--bounce); animation: none; filter: none; margin: auto; }
.modal-back.in .modal { transform: none; }
.modal.wide { max-width: 600px; }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.set-grid > .full { grid-column: 1 / -1; }
.section { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: #6b6b6b; margin: 4px 0 8px; display: flex; align-items: center; gap: 8px; }
.section::after { content: ""; flex: 1; height: 3px; background: #a0a0a0; box-shadow: 0 3px 0 #fff; }

/* ---------- toasts (advancement style) ---------- */
#toasts {
  position: fixed; top: calc(12px + var(--safe-t)); right: 12px; z-index: 60;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; max-width: calc(100vw - 24px);
}
.toast {
  display: flex; align-items: center; gap: 12px; width: 340px; max-width: 100%; padding: 6px 10px 6px 6px;
  border: 6px solid transparent; border-image: url("/img/toast.svg") 2 fill / 6px stretch;
  transform: translateX(calc(100% + 24px)); transition: transform .45s var(--ease);
}
.toast.in { transform: none; }
.toast .ico {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center;
  border: 3px solid transparent; border-image: url("/img/slot.svg") 1 fill / 3px stretch;
}
.toast .ico svg { width: 18px; height: 18px; }
.toast.good .ico svg { color: var(--green); } .toast.bad .ico svg { color: var(--red); }
.toast b { display: block; color: var(--yellow); font-size: .95rem; font-weight: 500; }
.toast.bad b { color: #ff7a7a; }
.toast span { font-size: .85rem; color: #fff; }

/* ---------- video overlay ---------- */
#video-root { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.video-stage { position: absolute; inset: 0; background: #000; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .5s; pointer-events: auto; }
.video-stage.in { opacity: 1; }
.video-stage video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.video-stage.clean { transition: opacity .12s; }
.video-stage.clean video { object-fit: cover; }
.video-title { position: absolute; left: 20px; bottom: calc(24px + var(--safe-b)); right: 160px; font-size: 1.1rem; opacity: 0; transition: opacity .6s; }
.video-stage.titled .video-title { opacity: .9; }
.video-skip { position: absolute; right: 16px; bottom: calc(20px + var(--safe-b)); width: auto; opacity: 0; pointer-events: none; transition: opacity .3s; }
.video-skip.show { opacity: 1; pointer-events: auto; }
.video-sound-hint {
  position: absolute; left: 50%; bottom: calc(28px + var(--safe-b)); transform: translateX(-50%);
  padding: 4px 10px; border: 6px solid transparent; border-image: url("/img/toast.svg") 2 fill / 6px stretch;
  font-size: 1rem; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .3s;
  animation: bob 1.6s ease-in-out infinite;
}
.video-stage.needs-sound .video-sound-hint { opacity: 1; }
.video-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: #000; }
.video-progress i { display: block; height: 100%; width: 0; background: linear-gradient(#a8ff5a 0 50%, #3e9612 50%); }

/* ---------- misc ---------- */
.banner {
  border: 6px solid transparent; border-image: url("/img/btn-red.svg") 2 fill / 6px stretch;
  padding: 6px 8px; margin-bottom: 12px; color: #fff; text-shadow: 2px 2px 0 #3d0c0c; font-size: .9rem;
}
.banner.info { border-image-source: url("/img/btn-green.svg"); text-shadow: 2px 2px 0 #1d3d0c; }
.banner .row-gap { margin-top: 8px; }
.banner .mc-btn { width: 100%; }
.reconnect { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 70; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .cols { grid-template-columns: 1fr; }
  .group-list { max-height: none; min-height: 140px; }
  .hub { max-width: 560px; }
  .splash { --sx: 0%; right: 0; bottom: auto; top: -18px; }
}
@media (max-width: 520px) {
  body { font-size: 17px; }
  .screen { padding-left: 10px; padding-right: 10px; }
  .panel { padding: 6px 6px 8px; }
  .splash { --sx: 0%; right: 0; bottom: auto; top: -18px; }
  .code-slots { gap: 6px; }
  .code-slots i { height: 58px; font-size: 1.7rem; }
  .set-grid { grid-template-columns: 1fr; }
  .brand img { width: 32px; height: 32px; }
  .pill .lbl { display: none; }
  .members, .group-actions { padding-left: 8px; }
  .toast { width: 100%; }
}
@media (max-height: 560px) and (min-width: 700px) {
  .logo { margin-bottom: 14px; }
  .logo h1 { font-size: 3rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-delay: 0s !important; transition-duration: .001s !important; }
}
