:root {
  --bg: #0d1712;
  --bg2: #13221a;
  --card: #172a20;
  --line: #24402f;
  --felt: #1c5a3a;
  --text: #f4efe3;
  --muted: #9db3a5;
  --gold: #f2c14e;
  --gold-dark: #b98a1c;
  --red: #ef5350;
  --blue: #5aa9e6;
  --gold-text: var(--gold);
  --on-accent: #f4efe3;
  --bg-glow: #17301f;
  --warn-bg: #4a3410;
  --err-bg: #4a1616;
  --err-text: #ffd1d1;
  --err-line: #7a2a2a;
  --flash: #5a1d1d;
  --dot-off: #555;
  --seg-on-line: #2f7a52;
  color-scheme: dark;
  --radius: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

:root[data-theme="light"] {
  --bg: #f3efe4;
  --bg2: #e7e0cd;
  --card: #fffcf4;
  --line: #d8cfb8;
  --text: #1f2a23;
  --muted: #5e6f63;
  --gold: #e0a82e;
  --gold-dark: #b07d12;
  --gold-text: #8a5f00;
  --red: #c62828;
  --blue: #1f6fb2;
  --bg-glow: #fbf8f0;
  --warn-bg: #f6e3b4;
  --err-bg: #fde2e0;
  --err-text: #8e1b1b;
  --err-line: #f0b4ae;
  --flash: #f7c9c4;
  --dot-off: #b9b3a3;
  --seg-on-line: #164a30;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg) radial-gradient(120% 80% at 50% 0%, var(--bg-glow) 0%, var(--bg) 60%);
  color: var(--text);
  font: 15px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-weight: 400; }

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100%;
  padding: calc(8px + var(--safe-top)) 12px calc(12px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
}

/* ---------- шапка ---------- */
.topbar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.brand { font-weight: 800; font-size: 20px; letter-spacing: .5px; display: flex; align-items: center; gap: 6px; }
.logo { color: var(--gold-text); font-size: 24px; }
.mode { flex: 1; font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card);
  display: grid; place-items: center; font-size: 15px; font-weight: 700;
}
.conn {
  background: var(--warn-bg); color: var(--gold-text); text-align: center;
  border-radius: 10px; padding: 6px; font-size: 13px; margin-bottom: 8px;
}

/* ---------- общие ---------- */
.screen { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.card h2 { margin: 0 0 8px; font-size: 16px; }
.btn {
  border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 700; font-size: 16px;
  background: var(--card); border: 1px solid var(--line);
  transition: transform .08s ease, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .35; pointer-events: none; }
.btn.primary { background: linear-gradient(180deg, #3fa66b, #2a7d4e); border-color: #4fbf7e; color: var(--on-accent); }
.btn.gold { background: linear-gradient(180deg, var(--gold), var(--gold-dark)); color: #2a1d00; border-color: #ffd877; }
.btn.ghost { background: transparent; }
.btn.big { padding: 15px 10px; font-size: 17px; }
.btn.tiny { padding: 6px 10px; font-size: 12px; font-weight: 600; border-radius: 9px; }

/* ---------- сообщение ---------- */
.msg-screen { justify-content: center; align-items: center; }
.msg-card { text-align: center; padding: 30px 16px; }
.msg-card h2 { margin: 8px 0; }
.msg-card p { color: var(--muted); max-width: 320px; margin: 0 auto; }
.big-die { font-size: 64px; color: var(--gold); animation: wobble 1.6s ease-in-out infinite; }
@keyframes wobble { 0%,100% { transform: rotate(-12deg); } 50% { transform: rotate(12deg) translateY(-6px); } }

/* ---------- лобби ---------- */
.lobby-players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lobby-players li { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.lobby-players .name { flex: 1; font-weight: 600; }
.lobby-players .tag { font-size: 11px; color: var(--gold-text); border: 1px solid var(--gold-dark); padding: 1px 6px; border-radius: 6px; }
.kick { background: none; border: 0; color: var(--red); font-size: 13px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #10170f;
}
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot-off); flex: none; }
.online-dot.on { background: #4fd17f; box-shadow: 0 0 6px #4fd17f; }
.field-label { font-size: 12px; color: var(--muted); margin: 10px 0 6px; text-transform: uppercase; letter-spacing: .6px; }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--bg2); border-radius: 11px; padding: 3px; gap: 3px; }
.segmented button { border: 0; background: transparent; padding: 9px 4px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); }
.segmented button.on { background: var(--felt); color: var(--on-accent); box-shadow: inset 0 0 0 1px var(--seg-on-line); }
.segmented.locked button { pointer-events: none; }
.setting-desc { font-size: 13px; margin: 8px 0 0; color: var(--muted); }
.lobby-actions { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }

/* ---------- игроки ---------- */
.players { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.players.solo { grid-template-columns: 1fr; }
.pchip {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 7px 9px 6px; display: flex; flex-direction: column; gap: 2px;
  transition: border-color .3s, box-shadow .3s, transform .3s;
}
.pchip.current { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 16px rgba(242,193,78,.25); }
.pchip.me .pname::after { content: " (ты)"; color: var(--muted); font-weight: 400; }
.pchip.flash { animation: flash .9s ease; }
@keyframes flash { 0% { background: var(--flash); } 100% { background: var(--card); } }
.prow { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pname { flex: 1; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pscore { font-weight: 800; font-size: 19px; font-variant-numeric: tabular-nums; }
.pscore.bump { animation: bump .6s ease; }
@keyframes bump { 40% { transform: scale(1.3); color: var(--gold-text); } }
.badges { display: flex; flex-wrap: wrap; gap: 4px; font-size: 11px; color: var(--muted); min-height: 15px; }
.badge { background: var(--bg2); border-radius: 6px; padding: 0 5px; white-space: nowrap; }
.badge.warn { color: var(--gold-text); }
.badge.bad { color: var(--red); }
.pip-dots { letter-spacing: 1px; }
.pchip .timer-mini { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--gold); }

/* ---------- стол ---------- */
.table-wrap {
  position: relative; flex: 1; min-height: 230px;
  border-radius: 18px; overflow: hidden;
  box-shadow: inset 0 0 0 6px #3b2614, inset 0 0 0 8px #24170c, 0 8px 24px rgba(0,0,0,.4);
  background: var(--felt);
}
#table3d { position: absolute; inset: 0; }
#table3d canvas { display: block; width: 100% !important; height: 100% !important; }
.roll-badge {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  background: rgba(10, 20, 14, .78); border: 1px solid rgba(255,255,255,.12);
  padding: 5px 14px; border-radius: 20px; font-weight: 800; font-size: 16px; color: #f4efe3;
  backdrop-filter: blur(4px); animation: pop .35s ease; white-space: nowrap;
}
.roll-badge.zero { color: var(--red); }
.roll-badge.good { color: #f2c14e; }
@keyframes pop { from { transform: translateX(-50%) scale(.6); opacity: 0; } }
.reactions-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.reaction {
  position: absolute; bottom: 8px; font-size: 34px; text-align: center;
  animation: floatUp 2.4s ease-out forwards;
}
.reaction small { display: block; font-size: 11px; color: #fff; text-shadow: 0 1px 2px #000; }
@keyframes floatUp {
  0% { transform: translateY(0) scale(.5); opacity: 0; }
  15% { transform: translateY(-20px) scale(1.1); opacity: 1; }
  100% { transform: translateY(-190px) scale(1); opacity: 0; }
}

/* ---------- панель хода ---------- */
.turn-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.turn-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.turn-who { font-weight: 700; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.turn-points { display: flex; align-items: baseline; gap: 6px; }
.turn-points .label { font-size: 12px; color: var(--muted); }
#turnPoints { font-size: 26px; font-weight: 900; color: var(--gold-text); font-variant-numeric: tabular-nums; }
.kept-row { display: flex; gap: 5px; align-items: center; min-height: 26px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.mini-die {
  width: 24px; height: 24px; border-radius: 6px; background: #f6f1e4;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  padding: 3px; box-shadow: inset 0 -2px 0 #cfc6ad;
}
.mini-die i { width: 4px; height: 4px; border-radius: 50%; background: #1b1b1b; place-self: center; visibility: hidden; }
.mini-die i.on { visibility: visible; }
.mini-die.one i.on { background: #c62828; width: 6px; height: 6px; }
.hint { font-size: 13px; color: var(--gold-text); min-height: 0; }
.hint:empty { display: none; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions.single { grid-template-columns: 1fr; }
.timer-bar { height: 4px; background: var(--bg2); border-radius: 2px; overflow: hidden; }
#timerFill { height: 100%; background: var(--gold); width: 100%; transition: width .25s linear; }
#timerFill.low { background: var(--red); }

/* ---------- реакции ---------- */
.react-bar { display: flex; justify-content: space-between; gap: 4px; }
.react-bar button { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 0; font-size: 20px; }
.react-bar button:active { transform: scale(.9); }

/* ---------- журнал ---------- */
.log { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; font-size: 13px; }
.log summary { cursor: pointer; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log ul { list-style: none; margin: 8px 0 0; padding: 0; max-height: 220px; overflow-y: auto; display: flex; flex-direction: column-reverse; gap: 3px; }
.log li { color: var(--muted); }
.log li.notable { color: var(--text); }
.owner-tools { display: flex; justify-content: center; gap: 8px; }

/* ---------- объявления ---------- */
.toast {
  position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%);
  z-index: 50; text-align: center; pointer-events: none;
  animation: toastIn .45s cubic-bezier(.2, 1.6, .4, 1);
  width: min(90vw, 420px);
}
.toast-emoji { font-size: 72px; filter: drop-shadow(0 6px 12px rgba(0,0,0,.6)); }
.toast-text {
  margin-top: 4px; font-size: 22px; font-weight: 900; text-transform: uppercase; color: #fff8ea;
  text-shadow: 0 2px 0 #000, 0 0 18px rgba(0,0,0,.8);
}
.toast.out { animation: toastOut .35s ease forwards; }
@keyframes toastIn { from { transform: translate(-50%, -50%) scale(.3); opacity: 0; } }
@keyframes toastOut { to { transform: translate(-50%, -50%) scale(1.3); opacity: 0; } }
.shake { animation: shake .5s; }
@keyframes shake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }

.error-toast {
  position: fixed; left: 50%; bottom: calc(18px + var(--safe-bottom)); transform: translateX(-50%);
  background: var(--err-bg); color: var(--err-text); border: 1px solid var(--err-line);
  padding: 8px 14px; border-radius: 10px; z-index: 60; font-size: 14px; max-width: 90vw;
}

/* ---------- модалки ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 52; display: grid; place-items: center; padding: 16px; backdrop-filter: blur(3px); }
.modal-card {
  width: min(100%, 440px); max-height: 88vh; overflow-y: auto;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 18px; padding: 18px;
  display: flex; flex-direction: column; gap: 10px; animation: toastIn .35s ease;
  user-select: text; -webkit-user-select: text;
}
.modal-card h2 { margin: 0; text-align: center; }
.trophy { font-size: 64px; text-align: center; }
.ranking { margin: 0; padding: 0 0 0 22px; display: flex; flex-direction: column; gap: 4px; font-size: 16px; }
.ranking li span { float: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.rules { font-size: 14px; }
.rules h3 { font-size: 14px; margin: 10px 0 4px; color: var(--gold-text); }
.rules p, .rules ul { margin: 0 0 4px; }
.rules ul { padding-left: 18px; }
.rules .active-mode { color: var(--gold-text); }

@media (max-height: 640px) {
  .table-wrap { min-height: 190px; }
  .btn.big { padding: 12px 8px; }
  .log { display: none; }
}

/* ================= v2: правила, пресеты, админка, эффекты ================= */
.center { text-align: center; }
.btn.small { padding: 9px 10px; font-size: 14px; flex: 1; }
.btn.danger { color: var(--red); border-color: var(--err-line); }
.row-btns { display: flex; gap: 8px; margin-top: 8px; }
.input {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font: inherit;
}

/* пресеты и сводка правил */
.preset-name { color: var(--gold-text); font-weight: 700; font-size: 14px; margin-left: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: var(--bg2); color: var(--text);
  border-radius: 16px; padding: 5px 11px; font-size: 13px; font-weight: 600;
}
.chip.on { background: var(--felt); color: var(--on-accent); border-color: var(--seg-on-line); }
.chip.static { cursor: default; }
.chip:disabled { opacity: 1; }
.rules-summary { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.rules-summary b { color: var(--text); font-weight: 600; }
.segmented button { white-space: normal; line-height: 1.15; padding-left: 2px; padding-right: 2px; }

/* редактор правил */
.modal-card.editor { width: min(100%, 480px); }
.editor fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 10px; padding: 8px 12px 10px; display: flex; flex-direction: column; gap: 8px; }
.editor legend { font-weight: 800; padding: 0 6px; color: var(--gold-text); }
.ff-label { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.ff-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.ff-num { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ff-num .ff-label { margin: 0; flex: 1; min-width: 140px; }
.ff-num .ff-hint { flex-basis: 100%; margin-top: 0; }
.num-row { display: flex; align-items: center; gap: 4px; }
.num-row button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); font-weight: 800; }
.num-row input, .pit-row input, .adm-player input {
  width: 64px; padding: 6px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font: inherit; text-align: center;
}
.pit-row { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.pit-row button { margin-left: auto; background: none; border: 0; color: var(--red); font-size: 16px; }
.toggle { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--felt); }
.editor-actions { position: sticky; bottom: -18px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: var(--bg2); padding: 8px 0 0; }

/* поделиться */
.share-result { display: flex; flex-direction: column; gap: 8px; }
.share-code { text-align: center; font-size: 18px; }
.share-code b { color: var(--gold-text); letter-spacing: 2px; }
.share-link { font-size: 12px; color: var(--muted); word-break: break-all; text-align: center; }

/* ачивки */
.ach-grid { display: flex; flex-direction: column; gap: 6px; }
.ach { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); opacity: .55; }
.ach.got { opacity: 1; border-color: var(--gold-dark); }
.ach-emoji { font-size: 26px; width: 34px; text-align: center; }
.ach b { display: block; font-size: 14px; }
.ach small { color: var(--muted); font-size: 12px; }
.finish-ach { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--gold-text); text-align: center; }
.toast.toast-ach .toast-text { color: #ffe08a; font-size: 19px; }

/* зритель, пауза, риск, объявление */
.spec-banner { text-align: center; font-size: 13px; color: var(--gold-text); background: var(--warn-bg); border-radius: 10px; padding: 5px; }
.pause-overlay {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
  background: rgba(5, 15, 10, .62); color: #fff; font-size: 22px; font-weight: 900; letter-spacing: 2px;
  backdrop-filter: blur(2px); z-index: 3;
}
.pause-overlay div { font-size: 54px; }
.risk { font-size: 12px; text-align: center; border-radius: 8px; padding: 4px; background: var(--bg2); }
.risk.low { color: #3fa66b; }
.risk.mid { color: var(--gold-text); }
.risk.high { color: var(--red); }
.announce {
  position: fixed; left: 50%; top: calc(10px + var(--safe-top)); transform: translate(-50%, -140%);
  z-index: 70; max-width: min(92vw, 480px); padding: 10px 16px; border-radius: 14px;
  background: linear-gradient(180deg, var(--gold), var(--gold-dark)); color: #2a1d00;
  font-weight: 800; box-shadow: 0 8px 24px rgba(0,0,0,.4); transition: transform .4s cubic-bezier(.2,1.4,.4,1);
}
.announce.show { transform: translate(-50%, 0); }
.error-toast.info { background: var(--card); color: var(--text); border-color: var(--line); }

/* стикеры */
.react-bar .sticker-btn { flex: 1.2; }
.sticker-tray { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.sticker-tray button { background: var(--bg2); border: 0; border-radius: 10px; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sticker-tray span { font-size: 22px; }
.sticker-tray small { font-size: 9px; font-weight: 800; line-height: 1.1; text-align: center; }
.sticker-pop {
  position: absolute; z-index: 4; pointer-events: none; text-align: center;
  background: #fffaf0; color: #1d140a; border: 3px solid #1d140a; border-radius: 18px;
  padding: 6px 12px 4px; box-shadow: 4px 5px 0 rgba(0,0,0,.35);
  animation: stickerIn 2.6s cubic-bezier(.2,1.5,.4,1) forwards;
}
.st-emoji { font-size: 40px; line-height: 1; }
.st-text { font-weight: 900; font-size: 15px; letter-spacing: .5px; }
.sticker-pop small { font-size: 10px; color: #6b5a44; }
@keyframes stickerIn {
  0% { transform: scale(.2) rotate(-25deg); opacity: 0; }
  12% { transform: scale(1.15) rotate(6deg); opacity: 1; }
  20%, 30% { transform: scale(1) rotate(-4deg); }
  25% { transform: scale(1) rotate(4deg); }
  85% { transform: scale(1) rotate(-2deg); opacity: 1; }
  100% { transform: scale(.8) translateY(-30px); opacity: 0; }
}

/* анимации событий на столе */
.fx-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.fx { position: absolute; inset: 0; }
.fx-truck .truck { position: absolute; bottom: 18%; font-size: 72px; animation: truckDrive 2.6s ease-in-out forwards; transform: scaleX(-1); }
.fx-truck .dust { position: absolute; bottom: 16%; font-size: 36px; animation: truckDust 2.6s ease-in-out forwards; }
@keyframes truckDrive {
  0% { left: 105%; }
  35%, 55% { left: 38%; transform: scaleX(-1) rotate(-14deg); }
  45% { transform: scaleX(-1) rotate(-22deg); }
  100% { left: -40%; transform: scaleX(-1) rotate(0); }
}
@keyframes truckDust { 0% { left: 125%; opacity: 0; } 35%, 55% { left: 62%; opacity: 1; } 100% { left: -10%; opacity: 0; } }
.fx-pit .hole { position: absolute; left: 50%; top: 58%; font-size: 64px; transform: translate(-50%, -50%) scale(0); animation: holeOpen 1.9s ease forwards; }
.fx-pit .shovel { position: absolute; left: 56%; top: 30%; font-size: 52px; transform-origin: 20% 90%; animation: dig 1.9s ease forwards; }
.fx-pit.small .hole { font-size: 44px; }
.fx-pit.small .shovel { font-size: 36px; }
@keyframes holeOpen { 30% { transform: translate(-50%, -50%) scale(1.2); } 45%, 80% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1); opacity: 0; } }
@keyframes dig {
  0% { opacity: 0; transform: rotate(-40deg); }
  15% { opacity: 1; transform: rotate(20deg) translateY(10px); }
  30% { transform: rotate(-30deg); }
  45% { transform: rotate(20deg) translateY(10px); }
  60% { transform: rotate(-30deg); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: rotate(-10deg) translateY(-20px); }
}
.fx-barrel .barrel { position: absolute; left: 50%; top: 45%; font-size: 76px; transform-origin: 50% 100%; animation: barrelSwing 1.8s ease forwards; }
.fx-barrel.small .barrel { font-size: 46px; }
@keyframes barrelSwing {
  0% { transform: translate(-50%, -50%) scale(.2); opacity: 0; }
  15% { transform: translate(-50%, -50%) scale(1.1) rotate(0); opacity: 1; }
  30% { transform: translate(-50%, -50%) rotate(-16deg); }
  45% { transform: translate(-50%, -50%) rotate(14deg); }
  60% { transform: translate(-50%, -50%) rotate(-9deg); }
  75% { transform: translate(-50%, -50%) rotate(5deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(0) scale(.9); opacity: 0; }
}
.badge.swing { display: inline-block; animation: badgeSwing 2.4s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes badgeSwing { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.fly-layer { position: fixed; inset: 0; pointer-events: none; z-index: 55; }
.fly {
  position: fixed; font-size: 28px; font-weight: 900; color: var(--red);
  text-shadow: 0 2px 0 #000, 0 0 12px rgba(0,0,0,.6); white-space: nowrap;
}
.pchip.hit { animation: hit .5s ease; }
@keyframes hit { 30% { transform: scale(.94) rotate(-2deg); } 60% { transform: scale(1.03) rotate(1deg); } }

/* админ-панель */
.modal-card.admin { width: min(100%, 480px); }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: var(--card); border-radius: 10px; padding: 3px; }
.tabs button { border: 0; background: transparent; padding: 7px 2px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.tabs button.on { background: var(--felt); color: var(--on-accent); }
.tab { display: flex; flex-direction: column; gap: 8px; }
.force-row { display: flex; gap: 6px; }
.force-row .btn { flex: none; }
.adm-player { display: flex; align-items: center; gap: 4px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.adm-player b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.adm-player button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); }
.adm-room { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.adm-room > div { flex: 1; min-width: 0; }
.adm-room.current b { color: var(--gold-text); }
.adm-room .small { font-size: 12px; color: var(--muted); }
.audit { list-style: none; margin: 0; padding: 0; font-size: 12px; max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; color: var(--muted); font-family: ui-monospace, monospace; }
