:root {
  --bg: #2b2118;
  --panel: #fff8e7;
  --cheese: #ffcf3f;
  --cheese-dark: #e8a317;
  --ink: #3a2c1a;
  --muted: #8a7b66;
  --mouse: #b9c4d0;
  --thief: #ffb347;
  --win: #6fcf6f;
  --lose: #ff8a6b;
  --radius: 18px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; user-select: none; -webkit-user-select: none; } /* no dbl-tap zoom on mobile */

body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background:
    radial-gradient(circle at 20% 15%, #3a2c1a 0, var(--bg) 60%);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 14px;
}

#app {
  width: 100%;
  max-width: min(460px, 96vw);
}

.app-header {
  text-align: center;
  font-size: 30px;
  font-weight: 800;
  color: var(--cheese);
  margin-bottom: 16px;
  padding: 0 78px; /* clear the fixed lang (left) + rules (right) buttons */
  text-shadow: 0 2px 0 rgba(0,0,0,.3);
}

.screen {
  position: relative;
  display: none;
  background: var(--panel);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  animation: pop .25s ease;
}
.screen.active { display: block; }

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

.phase-label {
  text-align: center;
  font-size: 15px;
  letter-spacing: 2px;
  color: var(--muted);
  margin: 0 0 12px;
}

.text-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 17px;
  border: 2px solid #eadbbd;
  border-radius: 12px;
  margin-bottom: 12px;
  outline: none;
  background: #fffdf7;
}
.text-input:focus { border-color: var(--cheese-dark); }

.btn {
  display: block;
  width: 100%;
  padding: 15px;
  font-size: 17px;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  background: #ece0c8;
  color: var(--ink);
  cursor: pointer;
  margin-top: 8px;
  transition: transform .08s, filter .15s;
}
.btn:active { transform: scale(.98); }
.btn:hover:not(:disabled) { filter: brightness(1.05); }
.btn.primary { background: var(--cheese); color: #5a3e00; }
.btn.ghost { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 2px #e0d2b6; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.divider {
  text-align: center;
  color: var(--muted);
  margin: 14px 0;
  font-size: 14px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fffdf7;
  border-radius: 10px;
  padding: 10px 14px;
  margin: 8px 0;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px #eadbbd;
}
.btn.toggle { width: auto; margin: 0; padding: 8px 22px; }

.wake-choice { margin: 6px 0 2px; }
.choice-info {
  text-align: center;
  font-size: 15px;
  line-height: 1.6;
  background: #fffdf7;
  border-radius: 12px;
  padding: 14px;
  box-shadow: inset 0 0 0 1px #eadbbd;
  margin-bottom: 10px;
}

.msg { text-align: center; color: var(--cheese-dark); min-height: 20px; margin: 10px 0 0; font-size: 14px; }
.msg:empty { min-height: 0; margin: 0; }
.hint { text-align: center; color: var(--muted); font-size: 13px; line-height: 1.5; margin: 12px 0 0; }

.code {
  text-align: center;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--cheese-dark);
  background: #fffdf7;
  border: 2px dashed var(--cheese-dark);
  border-radius: 12px;
  padding: 14px;
  user-select: all;
}

.player-list { list-style: none; padding: 0; margin: 16px 0; }
.player-list li {
  background: #fffdf7;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px #eadbbd;
}
.player-list li.dc { opacity: .55; font-style: italic; } /* dropped, holding their seat */

/* role card */
#role-card { margin: 8px 0 4px; }
.card {
  border-radius: var(--radius);
  padding: 26px 18px;
  text-align: center;
  color: #3a2c1a;
}
.card.mouse { background: linear-gradient(160deg, #dfe8f1, #b9c4d0); }
.card.thief { background: linear-gradient(160deg, #ffd98a, var(--thief)); }
.card { box-shadow: 0 6px 16px rgba(0,0,0,.18), inset 0 0 0 1px rgba(255,255,255,.45); animation: cardFlipIn .5s cubic-bezier(.2,.8,.2,1); }
@keyframes cardFlipIn { from { transform: rotateY(90deg); opacity: 0; } to { transform: rotateY(0); opacity: 1; } }
.card .big { font-size: 64px; line-height: 1; }
.card .role-name { font-size: 26px; font-weight: 800; margin-top: 8px; }
.card .die { margin-top: 14px; font-size: 18px; font-weight: 600; opacity: .85; }

/* night */
.screen.night {
  background: linear-gradient(180deg, #243152, #1a2440);
  color: #cdd8ee;
  overflow: hidden;
}
.screen.night::before { /* ambient twinkle, identical on every device */
  content: "✦ ˖ ✦ ⋆ ˖ ✦ ⋆ ✦ ˖ ⋆ ✦ ˖ ✦ ⋆";
  position: absolute; inset: 0; color: #ffffff14; font-size: 22px;
  letter-spacing: 30px; line-height: 60px; pointer-events: none;
  animation: twinkle 6s ease-in-out infinite;
}
@keyframes twinkle { 0%,100% { opacity:.35 } 50% { opacity:.7 } }

.night-counter {
  position: relative;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--cheese);
  margin-bottom: 10px;
}
.moon-pips { display: flex; justify-content: center; gap: 8px; margin-bottom: 8px; position: relative; }
.moon-pip { width: 12px; height: 12px; border-radius: 50%; background: #ffffff22; }
.moon-pip.filled { background: var(--cheese); box-shadow: 0 0 8px var(--cheese); }

.night-timer {
  position: relative;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: #ffe9a8;
  min-height: 22px;
  margin-top: 4px;
}

.night-table {
  position: relative;
  width: min(74vw, 46vh, 300px); /* scale with viewport, fit short/landscape screens */
  aspect-ratio: 1 / 1;
  margin: 18px auto;
  border-radius: 50%;
  background: radial-gradient(circle, #2f4068 0, #1c2746 70%);
  border: 3px solid #3a4a6e;
  box-shadow: inset 0 0 30px #0006;
}
/* center cheese sits under a cup; the cup lifts only when you're awake */
.cheese-spot {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 66px; height: 66px;
}
.cheese-under {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 42px;
  filter: drop-shadow(0 0 6px var(--cheese));
}
.cheese-under.empty { filter: none; }
.cheese-under.empty::before {
  content: ""; width: 34px; height: 34px;
  border: 2px dashed #ffffff33; border-radius: 50%;
}
.cheese-cup {
  position: absolute; left: 50%; bottom: -2px;
  transform: translateX(-50%);
  width: 60px; height: 64px;
  background: linear-gradient(160deg, #7a5d3a, #4a3826);
  border-radius: 30px 30px 12px 12px;
  box-shadow: 0 5px 10px #0007, inset 0 6px 10px #ffffff14;
  transition: transform .6s cubic-bezier(.2,.8,.2,1), opacity .5s ease;
}
.cheese-spot.lifted .cheese-cup { transform: translateX(-50%) translateY(-80px) scale(.9); opacity: 0; }
.seat {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 60px;
  transform: translate(-50%, -50%);
}
.seat .avatar {
  font-size: 30px;
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: #ffffff10;
}
.seat.me .avatar { box-shadow: 0 0 0 3px var(--cheese); } /* marks "you" — constant every night */
/* eyes-open: shown ONLY to fellow wakers, so co-wakers recognize each other */
.seat.awake .avatar { background: #ffcf3f33; box-shadow: 0 0 14px var(--cheese); animation: awakePulse 1.2s ease-in-out infinite; }
.seat.me.awake .avatar { box-shadow: 0 0 0 3px var(--cheese), 0 0 14px var(--cheese); }
@keyframes awakePulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
/* the thief caught taking the cheese, shown only to fellow wakers */
.seat .avatar { position: relative; }
.cheese-badge { position: absolute; bottom: -4px; right: -6px; font-size: 16px; }
.seat.cheese .avatar { box-shadow: 0 0 0 3px #ff6b6b, 0 0 16px #ff6b6b; }

/* peek: tappable heads gently bob to invite a tap */
.seat.peekable { cursor: pointer; }
.seat.peekable .avatar { box-shadow: 0 0 0 2px #ffffff66; animation: peekBob 1.1s ease-in-out infinite; }
@keyframes peekBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
/* the peeked head floats up with a magnifier + die badge */
.seat.peeked { z-index: 5; }
.seat.peeked .avatar {
  transform: translateY(-12px) scale(1.25);
  box-shadow: 0 0 0 3px var(--cheese), 0 0 18px var(--cheese);
  transition: transform .4s cubic-bezier(.2,.8,.2,1), box-shadow .4s ease;
}
.peek-badge {
  position: absolute; top: -16px; left: 50%; transform: translateX(-50%);
  white-space: nowrap; font-size: 13px; font-weight: 700; color: #fff;
  background: #000a; border: 1px solid var(--cheese); border-radius: 10px; padding: 1px 7px;
}
.seat .seat-name {
  font-size: 11px; margin-top: 4px; color: #cdd8ee;
  max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center;
}

.night-caption { position: relative; text-align: center; font-size: 15px; color: #9fb0d0; min-height: 22px; }

.night-action { position: relative; margin-top: 14px; }
.night-action:not(:empty) {
  background: #ffffff0d;
  border: 1px solid #ffffff22;
  border-radius: 14px;
  padding: 16px;
  animation: pop .25s ease;
}
.night-action .action-title { text-align: center; font-size: 16px; font-weight: 700; margin-bottom: 12px; color: #ffe9a8; }
.night-action .peek-card {
  text-align: center; font-size: 18px; font-weight: 700; color: #fff;
  background: #ffcf3f22; border: 1px solid var(--cheese); border-radius: 12px; padding: 14px;
}
.night-action .peek-hint { text-align: center; font-size: 12px; color: #9fb0d0; margin-top: 8px; }

.cheese-gone {
  text-align: center; font-size: 20px; font-weight: 800; color: var(--cheese-dark);
  background: #ffcf3f22; border: 2px solid var(--cheese); border-radius: 14px;
  padding: 14px; margin-bottom: 10px; animation: cheeseRingPop .5s ease both;
}

.night-host-status { position: relative; text-align: center; font-size: 12px; color: #7d8db0; margin-top: 12px; }

/* vote */
.vote-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.vote-opt {
  padding: 16px;
  font-size: 17px;
  font-weight: 700;
  border: 2px solid #eadbbd;
  border-radius: 12px;
  background: #fffdf7;
  cursor: pointer;
  transition: transform .08s, border-color .15s, background .15s;
}
.vote-opt:hover:not(:disabled) { border-color: var(--cheese-dark); }
.vote-opt:active:not(:disabled) { transform: scale(.99); }
.vote-opt.selected { border-color: var(--cheese-dark); background: var(--cheese); color: #5a3e00; }
.vote-opt:disabled { opacity: .5; cursor: default; }

/* result */
#result-banner { text-align: center; margin-bottom: 16px; }
.winner { font-size: 24px; font-weight: 800; padding: 14px; border-radius: 12px; animation: winnerPop .5s cubic-bezier(.2,1.4,.5,1) both; }
.winner.sleepyheads { background: #e3f7e3; color: #2f8f2f; }
.winner.thief { background: #ffe6dd; color: #c4502b; }
@keyframes winnerPop { 0% { transform: scale(.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.elim { margin-top: 10px; font-size: 15px; color: var(--muted); }

.reveal { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.reveal th, .reveal td { padding: 10px 8px; text-align: center; font-size: 15px; border-bottom: 1px solid #eadbbd; }
.reveal th { color: var(--muted); font-weight: 600; font-size: 13px; }
.reveal tr.eliminated td { background: #fff3cf; font-weight: 800; }
.reveal tr.eliminated td:first-child { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.reveal tr.eliminated td:last-child { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
/* staggered identity reveal */
.reveal tr { transform-origin: top; animation: rowFlip .35s ease backwards; }
@keyframes rowFlip { from { transform: rotateX(-90deg); opacity: 0; } to { transform: rotateX(0); opacity: 1; } }

/* host-only controls hidden for non-host players (and vice versa) */
.host-only { display: none; }
body.is-host .host-only { display: block; }
body.is-host .client-only { display: none; }

/* rules: a small always-available button + floating overlay */
.reconnect-banner {
  position: fixed; top: 10px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: none;
  background: var(--cheese-dark); color: #fff;
  padding: 7px 16px; border-radius: 16px; font-size: 13px; font-weight: 700;
  box-shadow: 0 3px 10px rgba(0,0,0,.4); animation: temptPulse 1.4s ease-in-out infinite;
}

.rules-btn {
  position: fixed; top: 12px; right: 12px; z-index: 50;
  background: var(--cheese-dark); color: #fff;
  border: none; border-radius: 20px;
  padding: 7px 13px; font-size: 13px; font-weight: 700; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.rules-btn:active { transform: scale(.96); }
.rules-btn:hover { filter: brightness(1.06); }
/* language toggle (中文/EN) mirrors the rules button on the left */
.lang-btn {
  position: fixed; top: 12px; left: 12px; z-index: 50;
  background: #0000004d; color: #fff;
  border: none; border-radius: 20px;
  padding: 7px 13px; font-size: 13px; font-weight: 700; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.lang-btn:active { transform: scale(.96); }
.lang-btn:hover { filter: brightness(1.2); }
.rules-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: #000a; display: none;
  align-items: center; justify-content: center; padding: 18px;
}
.rules-overlay.show { display: flex; }
.rules-card {
  background: var(--panel); color: var(--ink);
  border-radius: 16px; padding: 22px 20px;
  width: 100%; max-width: 420px; max-height: 82vh; overflow-y: auto;
  box-shadow: 0 14px 44px #000b; animation: pop .2s ease;
}
.rules-card h3 { margin: 0 0 6px; text-align: center; font-size: 20px; }
.rules-card .r-meta { text-align: center; color: var(--cheese-dark); font-weight: 700; margin: 0 0 14px; font-size: 14px; }
.rules-card p { font-size: 14px; line-height: 1.65; margin: 9px 0; }
.rules-card b { color: var(--cheese-dark); }
.rules-card .r-note { color: var(--muted); font-size: 12.5px; background: #fff3cf; padding: 8px 10px; border-radius: 8px; }
.rules-card .btn { margin-top: 14px; }

/* ---------- day/night transition (soft sun ↔ moon + sky fade) ---------- */
.sky {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  opacity: 0; visibility: hidden;
  transition: opacity .55s ease, visibility .55s ease; /* soft fade in/out */
}
.sky.show { opacity: 1; visibility: visible; }
.sky.to-night { background: radial-gradient(circle at 50% 42%, #2a3a63, #141d33); animation: skyDark 1.7s ease-in-out forwards; }
.sky.to-day { background: radial-gradient(circle at 50% 42%, #fff2c8, #ffd97a); animation: skyLight 1.7s ease-in-out forwards; }
@keyframes skyDark { from { filter: brightness(1.6); } to { filter: brightness(1); } }
@keyframes skyLight { from { filter: brightness(.7); } to { filter: brightness(1); } }
.sky-disc { position: relative; width: 88px; height: 88px; }
.sky-disc span {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 66px; opacity: 0;
  filter: drop-shadow(0 0 12px #ffffff55);
}
.sky.to-night .sun { animation: discOut 1.5s ease-in-out forwards; }
.sky.to-night .moon { animation: discIn 1.5s ease-in-out .25s forwards; }
.sky.to-day .moon { animation: discOut 1.5s ease-in-out forwards; }
.sky.to-day .sun { animation: discIn 1.5s ease-in-out .25s forwards; }
@keyframes discOut { from { opacity: 1; transform: rotate(0) scale(1); } to { opacity: 0; transform: rotate(95deg) scale(.6); } }
@keyframes discIn { from { opacity: 0; transform: rotate(-95deg) scale(.6); } to { opacity: 1; transform: rotate(0) scale(1); } }
.sky-label { font-size: 24px; font-weight: 800; color: #fff; text-shadow: 0 2px 10px #0009; opacity: 0; animation: skyFade 1.4s ease .3s forwards; }
@keyframes skyFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- dice roll (longer + bigger) ---------- */
.dice-rolling { display: inline-block; animation: diceShake .16s linear infinite; }
@keyframes diceShake {
  0% { transform: translateY(0) rotate(-14deg) scale(1.25); }
  50% { transform: translateY(-5px) rotate(14deg) scale(1.45); }
  100% { transform: translateY(0) rotate(-14deg) scale(1.25); }
}

/* ---------- game-feel juice ---------- */
/* thief seat ring pops when the theft is witnessed */
.seat.cheese .avatar { animation: cheeseRingPop .55s ease; }
@keyframes cheeseRingPop {
  0% { box-shadow: 0 0 0 3px #ff6b6b, 0 0 0 #ff6b6b; }
  50% { box-shadow: 0 0 0 6px #ff6b6b, 0 0 26px #ff6b6b; }
  100% { box-shadow: 0 0 0 3px #ff6b6b, 0 0 16px #ff6b6b; }
}
/* the prize draws the eye during the opening reveal */
.cheese-spot.lifted .cheese-under:not(.empty) { animation: cheeseBeacon 1.5s ease-in-out infinite; }
@keyframes cheeseBeacon {
  0%,100% { transform: scale(1); filter: drop-shadow(0 0 6px var(--cheese)); }
  50% { transform: scale(1.12); filter: drop-shadow(0 0 16px var(--cheese)); }
}
/* countdown urgency in the final seconds */
.night-timer.urgent { animation: urgentPulse 1s ease-in-out infinite; }
@keyframes urgentPulse { 0%,100% { transform: scale(1); color: #ff8a6b; } 50% { transform: scale(1.25); color: #ff5b42; } }
/* a one-shot jolt the instant YOU wake, then the steady pulse */
.seat.me.awake .avatar { animation: wakeJolt .4s ease, awakePulse 1.2s ease-in-out .4s infinite; }
@keyframes wakeJolt { 0% { transform: scale(.6); opacity: .4; } 60% { transform: scale(1.3); } 100% { transform: scale(1); } }
/* steal button gently tempts the thief's thumb */
.btn.tempt { animation: temptPulse 1.2s ease-in-out infinite; }
@keyframes temptPulse { 0%,100% { box-shadow: 0 0 0 0 #e8a31766; } 50% { box-shadow: 0 0 0 9px #e8a31700; } }

/* ---------- voice mic toggle ---------- */
.mic-btn {
  position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  width: 46px; height: 46px; border-radius: 50%; border: none;
  background: #ffffff26; color: #fff; font-size: 20px; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.4);
}
.mic-btn.on { background: var(--win); }
.mic-btn.night { background: var(--lose); } /* auto-muted during the night */
.mic-btn:active { transform: scale(.94); }

/* ---------- collapsible side log ---------- */
.log-toggle {
  position: fixed; right: 14px; bottom: calc(68px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  width: 38px; height: 38px; border-radius: 50%;
  background: #0000004d; color: #fff; border: none; font-size: 16px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.log-toggle:active { transform: scale(.94); }
/* small, non-intrusive floating popover (bottom-right, above the buttons) */
.log-panel {
  position: fixed; right: 14px; bottom: calc(112px + env(safe-area-inset-bottom, 0px)); z-index: 120;
  width: min(252px, 76vw); max-height: 48vh;
  background: var(--panel); color: var(--ink);
  border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.5);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(8px) scale(.97);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.log-panel.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.log-head { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; font-weight: 700; font-size: 14px; border-bottom: 1px solid #eadbbd; }
.log-x { background: none; border: none; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; }
.log-list { flex: 1; overflow-y: auto; padding: 12px 14px; }
.log-entry { font-size: 13px; line-height: 1.5; padding: 9px 11px; margin-bottom: 8px; background: #fffdf7; border-radius: 8px; box-shadow: inset 0 0 0 1px #eadbbd; }
.log-empty { color: var(--muted); font-size: 13px; text-align: center; margin-top: 24px; }

/* ---------- camera toggle + video tiles ---------- */
.cam-btn {
  position: fixed; right: 68px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  width: 46px; height: 46px; border-radius: 50%; border: none;
  background: #ffffff26; color: #fff; font-size: 19px; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.4);
}
.cam-btn.on { background: var(--win); }
.cam-btn.night { background: var(--lose); }
.cam-btn:active { transform: scale(.94); }

.video-wrap {
  position: fixed; left: 50%; bottom: calc(66px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  z-index: 55; display: none; flex-direction: column; align-items: center; gap: 6px;
  max-width: 94vw; pointer-events: none;
}
.vid-size-ctrl {
  display: flex; align-items: center; gap: 8px;
  background: #000000a6; border-radius: 16px; padding: 3px 8px; pointer-events: auto;
}
.vid-size-ctrl .vid-sz-label { color: #fff; font-size: 11px; }
.vid-sz-btn {
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: var(--cheese); color: #5a3e00; font-size: 16px; font-weight: 800;
  line-height: 1; cursor: pointer;
}
.vid-sz-btn:active { transform: scale(.9); }
.video-grid { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.vid-cell {
  position: relative; width: var(--vid-size, 120px); height: var(--vid-size, 120px);
  border-radius: 12px; overflow: hidden; background: #000;
  box-shadow: 0 2px 10px rgba(0,0,0,.5);
}
.vid-cell video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vid-cell .vid-name {
  position: absolute; bottom: 0; left: 0; right: 0;
  font-size: 10px; color: #fff; background: #0008; text-align: center; padding: 1px 0;
}
.vid-cell.me { outline: 2px solid var(--cheese); outline-offset: -2px; }
