:root {
  --bg: #0b1320;
  --panel: #152036;
  --panel-2: #1c2a46;
  --line: #2a3b5f;
  --text: #eef2fb;
  --muted: #93a3c4;
  --accent: #ffd23f;
  --accent-ink: #231a00;
  --red: #ef3e4a;
  --green: #3ddc97;
  --blue: #4cc9f0;
  --radius: 14px;
  --font-display: 'Comfortaa', system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; }
.hidden { display: none !important; }

.screen { position: fixed; inset: 0; }

/* ---------- buttons ---------- */
.btn {
  border: 2px solid var(--line);
  background: var(--panel-2);
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 700;
  transition: transform .08s, background .15s, opacity .15s;
}
.btn:hover:not(:disabled) { background: #253659; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: #e6b800; }
.btn.primary:hover:not(:disabled) { background: #ffdc66; }
.btn.big { padding: 14px 22px; font-size: 17px; width: 100%; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.ghost { background: transparent; }

.lang {
  position: fixed; top: max(10px, env(safe-area-inset-top)); right: 10px; z-index: 60;
  background: var(--panel); color: var(--text); border: 2px solid var(--line);
  border-radius: 10px; padding: 6px 8px; font-size: 13px;
}

/* ---------- intro (credits slide) ---------- */
.intro {
  position: fixed; inset: 0; z-index: 50; overflow: auto;
  display: grid; place-items: center;
  padding: max(56px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at 50% 35%, #12203a 0%, var(--bg) 55%, #060a12 100%);
  transition: opacity .4s ease;
}
.intro.out { opacity: 0; pointer-events: none; }
.intro-card { width: min(560px, 100%); text-align: center; animation: introIn .8s ease both; }
@keyframes introIn { from { opacity: 0; transform: translateY(10px); } }
.intro-ycycle { display: block; width: 100%; max-width: 520px; height: auto; margin: 0 auto; }
.intro-text { margin: 4px auto 22px; max-width: 32em; font-size: 17px; line-height: 1.55; font-weight: 600; }
.intro-logos {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  width: fit-content; max-width: 100%; margin: 0 auto 24px; padding: 12px 18px;
  background: #fff; border-radius: 16px;
}
.intro-logos img { display: block; height: 56px; width: auto; min-width: 0; }
.intro .btn.big { width: auto; min-width: 220px; }
@media (max-width: 440px) {
  .intro-text { font-size: 15px; }
  .intro-logos { gap: 12px; padding: 10px 12px; }
  .intro-logos img { height: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  .intro, .intro-card { transition: none; animation: none; }
}

/* ---------- home ---------- */
#home { display: grid; place-items: center; padding: 16px; overflow: auto; }
.home-bg {
  position: absolute; inset: -20px;
  background: url('assets/map.jpg') center / cover no-repeat;
  filter: blur(6px) brightness(.35) saturate(1.2);
}
.home-card {
  position: relative; width: min(420px, 100%);
  background: rgba(21, 32, 54, .92); border: 2px solid var(--line);
  border-radius: 22px; padding: 22px 22px 18px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
#logoCanvas { width: 100%; max-width: 320px; height: auto; }
h1 {
  font-family: var(--font-display); font-weight: 700; letter-spacing: .12em;
  font-size: 40px; margin: 4px 0 0; color: var(--red);
  text-shadow: 0 3px 0 #7a0f17;
}
.sub { margin: 4px 0 0; font-weight: 600; }
.edition { margin: 2px 0 18px; color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: .06em; }
.join-row { display: flex; gap: 8px; margin-top: 12px; }
.join-row input {
  flex: 1; min-width: 0; background: var(--bg); border: 2px solid var(--line); color: var(--text);
  border-radius: 12px; padding: 10px 12px; font-size: 18px; letter-spacing: .3em; text-transform: uppercase; text-align: center;
}
.error { color: var(--red); min-height: 1.4em; margin: 10px 0 0; font-weight: 600; }

/* ---------- lobby ---------- */
#lobby { display: flex; flex-direction: column; }
.lobby-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 150px 10px 12px;
  border-bottom: 2px solid var(--line); background: var(--panel);
}
.room-code { flex: 1; text-align: center; font-weight: 600; color: var(--muted); }
.room-code b { color: var(--accent); font-size: 24px; letter-spacing: .25em; font-family: var(--font-display); }
.lobby-main { flex: 1; display: grid; grid-template-columns: 1fr 340px; min-height: 0; }
.picker-wrap { overflow: auto; padding: 14px 16px 30px; }
.picker-wrap h2 { font-family: var(--font-display); margin: 0 0 10px; font-size: 20px; }
.country { margin-bottom: 18px; }
.country h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 15px; }
.country h4 img { width: 26px; height: 17px; border-radius: 2px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.pcard {
  position: relative; background: var(--panel); border: 2px solid var(--line); border-radius: 12px;
  padding: 6px 4px 8px; text-align: center; display: flex; flex-direction: column; align-items: center;
}
.pcard img { width: 64px; height: 64px; }
.pcard .nm { font-size: 12px; font-weight: 600; line-height: 1.2; min-height: 2.4em; }
.pcard .tag { position: absolute; top: 4px; right: 4px; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 6px; background: var(--line); }
.pcard.mine { border-color: var(--accent); background: #2a2a1a; }
.pcard.mine .tag { background: var(--accent); color: var(--accent-ink); }
.pcard.taken { opacity: .45; cursor: not-allowed; }
.pcard:not(.taken):hover { border-color: #4a6aa5; }

.lobby-side { border-left: 2px solid var(--line); padding: 14px; overflow: auto; display: flex; flex-direction: column; gap: 12px; background: #0e1829; }
.panel { background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius); padding: 12px; }
.panel h3 { margin: 0 0 8px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.pill { background: var(--line); border-radius: 20px; padding: 0 8px; font-size: 12px; }
.player-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow: auto; }
.player-list li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.player-list img { width: 30px; height: 30px; }
.player-list .q { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--line); font-weight: 800; }
.player-list .badge { font-size: 10px; background: var(--accent); color: var(--accent-ink); border-radius: 6px; padding: 1px 6px; font-weight: 800; }
.player-list .off { opacity: .45; }
.settings { display: grid; gap: 8px; }
.settings label { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.settings select { background: var(--bg); color: var(--text); border: 2px solid var(--line); border-radius: 8px; padding: 4px 6px; }
.settings select:disabled { opacity: 1; border-color: transparent; appearance: none; -webkit-appearance: none; text-align: right; }
.hint { color: var(--muted); font-size: 13px; text-align: center; margin: 0; }

/* ---------- game HUD ---------- */
#game { touch-action: none; user-select: none; -webkit-user-select: none; }
#canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hud-top { position: absolute; top: max(8px, env(safe-area-inset-top)); left: 8px; display: flex; flex-direction: column; gap: 6px; max-width: min(340px, calc(100vw - 150px)); pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.taskbar { background: rgba(11, 19, 32, .8); border: 2px solid var(--line); border-radius: 10px; padding: 4px 8px 6px; }
.taskbar-label { font-size: 11px; font-weight: 700; color: var(--muted); }
.taskbar-track { height: 10px; background: #0a2a1a; border-radius: 6px; overflow: hidden; margin-top: 3px; }
#taskbarFill { height: 100%; width: 0; background: var(--green); transition: width .4s; }
.task-panel { background: rgba(11, 19, 32, .8); border: 2px solid var(--line); border-radius: 10px; padding: 6px 8px; }
.task-toggle { background: none; border: 0; padding: 0; font-weight: 800; font-size: 13px; }
.task-toggle::after { content: ' ▾'; color: var(--muted); }
.task-panel.collapsed #taskList, .task-panel.collapsed .task-note { display: none; }
.task-panel.collapsed .task-toggle::after { content: ' ▸'; }
.task-note { margin: 2px 0; font-size: 11px; color: var(--red); font-weight: 700; }
.task-note.ghost { color: var(--blue); }
#taskList { list-style: none; margin: 4px 0 0; padding: 0; font-size: 12px; display: grid; gap: 2px; }
#taskList li.done { color: var(--green); text-decoration: line-through; opacity: .8; }
#taskList li.near { color: var(--accent); font-weight: 700; }

.banner {
  position: absolute; top: max(8px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  background: var(--red); color: #fff; font-weight: 800; padding: 8px 14px; border-radius: 10px;
  animation: pulse 1s infinite alternate; text-align: center; max-width: 60vw; font-size: 13px; z-index: 5;
}
@keyframes pulse { from { opacity: 1; } to { opacity: .65; } }

.hud-actions {
  position: absolute; right: max(10px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom));
  display: grid; grid-template-columns: repeat(3, auto); gap: 10px; justify-items: end; align-items: end;
}
.act {
  position: relative; width: 84px; height: 84px; border-radius: 20px; border: 3px solid rgba(255,255,255,.25);
  background: rgba(21, 32, 54, .85); display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; gap: 2px;
  transition: transform .08s, opacity .15s;
}
.act i { font-style: normal; font-size: 30px; line-height: 1; }
.act:active:not(:disabled) { transform: scale(.94); }
.act:disabled { opacity: .35; }
.act.act-small { width: 64px; height: 64px; font-size: 10px; }
.act.act-small i { font-size: 22px; }
.act.imp { border-color: rgba(239, 62, 74, .6); }
.act.ready { border-color: var(--accent); box-shadow: 0 0 18px rgba(255, 210, 63, .45); }
.act.imp.ready { border-color: var(--red); box-shadow: 0 0 18px rgba(239, 62, 74, .6); }
.act .cd { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 30px; background: rgba(0,0,0,.55); border-radius: 17px; }
.act .cd:empty { display: none; }
.controls-hint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); color: rgba(255,255,255,.55); font-size: 12px; pointer-events: none; white-space: nowrap; }
@media (pointer: coarse) { .controls-hint { display: none; } }

.ghost-chat-btn { align-self: flex-start; }
.ghost-chat-panel { position: fixed; left: 8px; bottom: 8px; width: min(340px, calc(100vw - 16px)); height: 260px; z-index: 20; }
.ghost-chat-panel .chat { height: 100%; background: rgba(11, 19, 32, .92); }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 30; background: rgba(5, 8, 15, .7); display: grid; place-items: center; padding: 12px; }
.overlay.solid { background: #05080f; z-index: 40; }

.map-wrap { position: relative; max-width: 100%; max-height: 100%; }
#miniMap { display: block; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); border-radius: 12px; border: 3px solid var(--line); background: #fff; }
.map-wrap .btn { position: absolute; top: 8px; left: 8px; }

.task-modal { width: min(460px, 100%); background: var(--panel); border: 3px solid var(--line); border-radius: 18px; overflow: hidden; }
.task-modal header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--panel-2); }
.task-modal h3 { margin: 0; font-size: 15px; }
.x { background: none; border: 0; font-size: 20px; padding: 4px 8px; }
.task-body { padding: 12px 14px 18px; position: relative; }
.task-body.tg-complete::after {
  content: '✔'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 90px; color: var(--green);
  background: rgba(21, 32, 54, .85); animation: pop .4s;
}
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- mini-games ---------- */
.tg-hint { margin: 0 0 10px; color: var(--muted); font-size: 13px; text-align: center; }
.tg-body { display: flex; flex-direction: column; align-items: center; gap: 10px; position: relative; touch-action: none; }
.tg-grid { display: grid; gap: 8px; width: 100%; }
.tg-grid-4 { grid-template-columns: repeat(4, 1fr); }
.tg-tile { aspect-ratio: 1; border-radius: 12px; border: 2px solid var(--line); background: var(--panel-2); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; }
.tg-tile small { font-size: 14px; }
.tg-tile.tg-emoji { font-size: 30px; }
.tg-tile.ok { background: #1c4a36; border-color: var(--green); }
.bad { animation: shake .3s; border-color: var(--red) !important; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.tg-list { font-size: 26px; display: flex; gap: 8px; align-items: center; }
.tg-list span { font-size: 13px; color: var(--muted); font-weight: 700; }
.tg-list i { font-style: normal; transition: opacity .2s; }
.tg-list i.ok { opacity: .25; }
.tg-hold { display: flex; align-items: center; gap: 26px; }
.tg-gauge { position: relative; width: 56px; height: 200px; border: 3px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--bg); }
.tg-gauge-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; }
.tg-gauge-zone { position: absolute; left: 0; right: 0; background: rgba(61, 220, 151, .35); border-top: 2px dashed var(--green); border-bottom: 2px dashed var(--green); z-index: 1; }
.tg-big { width: 120px; height: 120px; border-radius: 50%; border: 4px solid var(--line); background: var(--panel-2); font-size: 52px; touch-action: none; user-select: none; -webkit-user-select: none; }
.tg-big.pressed { transform: scale(.93); border-color: var(--accent); }
.bump { animation: bump .15s; }
@keyframes bump { 50% { transform: scale(.9); } }
.tg-track { width: 100%; height: 76px; border-radius: 14px; background: var(--bg); border: 3px solid var(--line); position: relative; padding: 4px; }
.tg-track::after { content: '→ → →'; position: absolute; inset: 0; display: grid; place-items: center; color: var(--line); font-weight: 800; letter-spacing: .3em; pointer-events: none; }
.tg-card { width: 96px; height: 62px; border-radius: 10px; background: linear-gradient(135deg, #ffd23f, #f08c00); display: grid; place-items: center; font-size: 34px; touch-action: none; cursor: grab; position: relative; z-index: 1; }
.tg-wires { position: relative; display: flex; justify-content: space-between; width: 100%; max-width: 320px; height: 240px; }
.tg-wires svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tg-wcol { display: flex; flex-direction: column; justify-content: space-around; }
.tg-wire { width: 46px; height: 34px; border-radius: 8px; border: 3px solid #0006; }
.tg-wire.sel { outline: 3px solid #fff; }
.tg-wire:disabled { opacity: .6; }
.tg-count { font-weight: 800; font-size: 18px; }
.tg-bar { width: 100%; height: 12px; background: var(--bg); border-radius: 8px; overflow: hidden; }
.tg-bar div { height: 100%; width: 0; background: var(--green); transition: width .1s; }
.tg-area { position: relative; width: 100%; height: 240px; background: #1f6f3a; border: 3px solid var(--line); border-radius: 14px; overflow: hidden; touch-action: none; }
.tg-ball { position: absolute; left: 0; top: 0; width: 56px; height: 56px; display: grid; place-items: center; font-size: 44px; cursor: pointer; }
.tg-scrub { background: #d9e6ef; }
.tg-bg { position: absolute; inset: 0; display: grid; place-items: center; font-size: 150px; opacity: .9; pointer-events: none; }
.tg-dirt { position: absolute; border-radius: 50%; background: radial-gradient(circle at 40% 40%, #7a5a3a, #4e3522 70%, transparent 72%); pointer-events: none; }
.tg-grill { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; padding: 12px; border-radius: 14px; background: repeating-linear-gradient(90deg, #333 0 6px, #1a1a1a 6px 18px); }
.tg-skewer { height: 70px; font-size: 44px; border-radius: 12px; border: 2px solid transparent; background: rgba(255,255,255,.05); transition: filter .3s; }
.tg-skewer.raw { filter: saturate(.5) brightness(1.35) hue-rotate(-15deg); }
.tg-skewer.cooked { filter: none; border-color: var(--accent); box-shadow: 0 0 16px rgba(255, 170, 0, .7); }
.tg-skewer.burnt { filter: brightness(.2); }
.tg-skewer.gone { visibility: hidden; }
.tg-plate { font-size: 26px; min-height: 36px; }
.tg-msg { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); background: var(--red); padding: 6px 12px; border-radius: 10px; font-weight: 800; opacity: 0; pointer-events: none; white-space: nowrap; z-index: 3; }
.tg-msg.show { animation: msg 1.4s; }
@keyframes msg { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- role reveal / kill / over ---------- */
.reveal { text-align: center; animation: fadein .6s; }
.reveal h2 { font-family: var(--font-display); font-size: clamp(38px, 10vw, 76px); margin: 0; letter-spacing: .06em; }
.reveal h2.crew { color: var(--blue); }
.reveal h2.imp { color: var(--red); }
.reveal p { color: var(--muted); max-width: 440px; margin: 10px auto; }
.reveal .avatars { display: flex; justify-content: center; gap: 10px; margin: 18px 0 8px; flex-wrap: wrap; }
.reveal .avatars figure { margin: 0; display: flex; flex-direction: column; align-items: center; font-weight: 700; font-size: 13px; }
.reveal .avatars img { width: 110px; height: 110px; }
.reveal .avatars.small img { width: 72px; height: 72px; }
.reveal .red { color: var(--red); }
@keyframes fadein { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
.overlay.kill { background: radial-gradient(circle, #6d0d14, #1a0306); z-index: 45; }

/* ---------- meeting ---------- */
.meeting { width: min(980px, 100%); max-height: 100%; display: flex; flex-direction: column; background: #d8e2ee; color: #14213d; border-radius: 20px; border: 4px solid #8aa0bd; overflow: hidden; }
.meeting-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: #b9c8db; gap: 10px; }
.meeting-head h2 { margin: 0; font-family: var(--font-display); font-size: 22px; }
.meeting-head p { margin: 2px 0 0; font-size: 13px; }
.timer { font-weight: 800; font-size: 14px; background: #14213d; color: #fff; border-radius: 10px; padding: 6px 10px; white-space: nowrap; }
.meeting-main { display: grid; grid-template-columns: 1fr 300px; gap: 12px; padding: 12px; min-height: 0; overflow: auto; }
.vote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.vcard { position: relative; display: flex; align-items: center; gap: 8px; background: #fff; border: 3px solid #9fb3cc; border-radius: 12px; padding: 5px 8px; min-height: 58px; text-align: left; color: inherit; }
.vcard img.av { width: 46px; height: 46px; flex: none; }
.vcard .nm { font-weight: 800; font-size: 14px; line-height: 1.15; }
.vcard .ct { display: flex; align-items: center; gap: 4px; font-size: 11px; color: #4a5a78; }
.vcard .ct img { width: 16px; height: 11px; }
.vcard.dead { opacity: .5; background: #e7c9c9; }
.vcard.dead::after { content: '✖'; position: absolute; left: 14px; top: 4px; font-size: 36px; color: #c62828; }
.vcard.me { border-color: #14213d; }
.vcard.canvote:hover { border-color: #1e6fd9; }
.vcard.selected { border-color: #1e6fd9; background: #e3efff; }
.vcard .badge { position: absolute; top: -8px; right: 6px; background: #14213d; color: #fff; font-size: 10px; font-weight: 800; border-radius: 6px; padding: 1px 6px; }
.vcard .confirm { margin-left: auto; display: flex; gap: 4px; }
.vcard .confirm button { width: 34px; height: 34px; border-radius: 50%; border: 0; font-size: 16px; font-weight: 800; }
.vcard .confirm .yes { background: var(--green); }
.vcard .confirm .no { background: #f28b8b; }
.vcard .voters, .voters { display: flex; flex-wrap: wrap; gap: 2px; margin-left: auto; }
.voters img { width: 24px; height: 24px; }
.vcard.ejected { border-color: var(--red); }
.skip-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.skip-row .btn { background: #fff; border-color: #9fb3cc; color: #14213d; }
.chat { display: flex; flex-direction: column; background: #0e1829; color: var(--text); border-radius: 12px; min-height: 240px; max-height: 60vh; overflow: hidden; border: 2px solid var(--line); }
.chat-log { flex: 1; overflow: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.msg { display: flex; gap: 6px; align-items: flex-start; }
.msg img { width: 26px; height: 26px; flex: none; }
.msg b { display: block; font-size: 11px; color: var(--accent); }
.msg.ghost { opacity: .7; font-style: italic; }
.msg span { word-break: break-word; }
.chat-form { display: flex; gap: 6px; padding: 6px; border-top: 2px solid var(--line); }
.chat-form input { flex: 1; min-width: 0; background: var(--bg); color: var(--text); border: 2px solid var(--line); border-radius: 8px; padding: 6px 8px; }

/* ---------- eject ---------- */
.overlay.sea { background: linear-gradient(#5fb8c9, #1f6f86 60%, #0d3b4f); z-index: 42; overflow: hidden; }
.waves { position: absolute; inset: 0; background: repeating-radial-gradient(ellipse at 50% 120%, transparent 0 28px, rgba(255,255,255,.08) 28px 32px); animation: drift 6s linear infinite; }
@keyframes drift { to { background-position: 200px 0; } }
#ejectImg { position: absolute; top: 34%; left: 0; width: 120px; height: 120px; animation: fly 4.5s linear forwards; }
@keyframes fly { from { transform: translateX(-140px) rotate(0); } to { transform: translateX(110vw) rotate(900deg); } }
.eject-text { position: absolute; left: 0; right: 0; top: 58%; text-align: center; padding: 0 16px; }
#ejectText { font-family: var(--font-display); font-size: clamp(20px, 5vw, 34px); font-weight: 700; margin: 0; text-shadow: 0 2px 6px rgba(0,0,0,.4); }
#ejectSub { color: #e6f6ff; margin: 8px 0 0; }

/* ---------- misc ---------- */
.toast { position: fixed; left: 50%; top: 70px; transform: translateX(-50%) translateY(-20px); background: var(--green); color: #032314; font-weight: 800; padding: 8px 16px; border-radius: 12px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 70; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.err { background: var(--red); color: #fff; }
.conn { position: fixed; bottom: 0; left: 0; right: 0; background: var(--red); color: #fff; text-align: center; font-weight: 700; padding: 6px; z-index: 80; }
.no-server { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; background: var(--bg); text-align: center; font-weight: 600; line-height: 1.6; }

@media (max-width: 760px) {
  .lobby-head { padding-right: 130px; flex-wrap: wrap; }
  .lobby-head #btnCopy { order: 3; width: 100%; }
  .room-code { text-align: left; }
  .lobby-main { display: flex; flex-direction: column; overflow: auto; }
  .picker-wrap { overflow: visible; }
  .lobby-side { border-left: 0; border-top: 2px solid var(--line); }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .meeting-main { grid-template-columns: 1fr; }
  .vote-grid { grid-template-columns: 1fr 1fr; }
  .vcard { padding: 4px 6px; gap: 4px; }
  .vcard img.av { width: 36px; height: 36px; }
  .vcard .nm { font-size: 12px; }
  .chat { min-height: 180px; max-height: 240px; }
  .act { width: 70px; height: 70px; font-size: 10px; }
  .act i { font-size: 26px; }
  .act.act-small { width: 56px; height: 56px; }
  .hud-top { max-width: calc(100vw - 16px); }
  .hud-top .taskbar, .hud-top .task-panel { max-width: 62vw; }
  .banner { top: auto; bottom: 180px; max-width: 90vw; }
}

.timer:empty { display: none; }
.act span { display: block; width: 100%; padding: 0 2px; text-align: center; line-height: 1.05; overflow: hidden; }
@media (max-width: 760px) {
  .meeting-head { flex-wrap: wrap; }
  .meeting-head h2 { font-size: 18px; }
  .timer { font-size: 12px; }
  .act { font-size: 9px; letter-spacing: 0; }
}

/* fishing (Stardew style) */
.tg-fish { display: flex; align-items: center; gap: 18px; }
.tg-fish-track { position: relative; width: 58px; height: 236px; border-radius: 10px; border: 3px solid #8a5d33; background: linear-gradient(#5ec6d6, #1f6f96); overflow: hidden; touch-action: none; }
.tg-fish-bar { position: absolute; left: 3px; right: 3px; height: 62px; bottom: 0; border-radius: 6px; background: rgba(120, 220, 120, .45); border: 2px solid #6fdc6f; }
.tg-fish-bar.on { background: rgba(120, 240, 120, .7); }
.tg-fish-fish { position: absolute; left: 50%; transform: translateX(-50%); font-size: 24px; line-height: 26px; bottom: 90px; pointer-events: none; }
.tg-fish-meter { position: relative; width: 14px; height: 236px; border-radius: 7px; background: var(--bg); border: 2px solid var(--line); overflow: hidden; }
.tg-fish-meter div { position: absolute; left: 0; right: 0; bottom: 0; height: 25%; }

/* clock (Stardew style) + mute */
.hud-right { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 42px); right: 10px; display: flex; gap: 6px; align-items: center; }
.clock {
  background: #f3dea4; color: #4a2f16; border: 3px solid #8a5d33; border-radius: 10px; padding: 3px 10px;
  font-weight: 800; font-size: 14px; box-shadow: inset 0 -3px 0 #d9b870; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.mute { padding: 4px 8px; font-size: 15px; }
.emote-bar, .sab-menu {
  position: absolute; right: 10px; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 250px);
  display: flex; flex-wrap: wrap; gap: 6px; max-width: 260px; justify-content: flex-end;
  background: rgba(11, 19, 32, .9); border: 2px solid var(--line); border-radius: 14px; padding: 8px; z-index: 6;
}
.emote-bar button { font-size: 26px; width: 48px; height: 48px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel-2); }
.emote-bar button:active { transform: scale(.9); }
.sab-menu { flex-direction: column; }
.sab-menu .btn { text-align: left; }
/* wildfire */
.banner.fire { background: linear-gradient(90deg, #d62828, #f77f00); }
.fire-vignette { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 120px 30px rgba(255, 60, 20, .55); animation: pulse .6s infinite alternate; }
/* confetti */
.confetti { position: fixed; top: -12px; width: 8px; height: 12px; z-index: 41; animation: fall linear forwards; pointer-events: none; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
.act.holding { border-color: var(--blue); box-shadow: 0 0 18px rgba(76, 201, 240, .75); }
