:root {
  --bg0: #080b1a;
  --card: rgba(21, 27, 62, 0.82);
  --card2: #1c2352;
  --raise: rgba(255, 255, 255, 0.055);
  --line: rgba(135, 155, 255, 0.17);
  --text: #eef1ff;
  --muted: #9aa5d6;
  --accent: #6d7cff;
  --accent2: #38bdf8;
  --grad: linear-gradient(135deg, #6d7cff 0%, #38bdf8 100%);
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --gold: #fbbf24;
  --shadow: 0 12px 32px rgba(3, 6, 28, 0.5);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg0);
  color: var(--text);
  font-family: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

/* soft drifting colour glow behind everything */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: linear-gradient(160deg, #0b1030 0%, #080b1a 60%); }
.bg::before, .bg::after { content: ""; position: absolute; width: 90vmax; height: 90vmax; border-radius: 50%; will-change: transform; }
.bg::before { left: -35vmax; top: -45vmax; background: radial-gradient(circle, rgba(109, 124, 255, 0.34), transparent 62%); animation: drift1 24s ease-in-out infinite alternate; }
.bg::after { right: -40vmax; bottom: -50vmax; background: radial-gradient(circle, rgba(56, 189, 248, 0.24), transparent 62%); animation: drift2 28s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(14vmax, 10vmax) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-12vmax, -9vmax) scale(1.1); } }

#app {
  position: relative; z-index: 1;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

[hidden] { display: none !important; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; gap: 12px; padding: 8px 14px; flex: none; }
.brand { display: flex; align-items: center; gap: 9px; }
.logo { width: 30px; height: 30px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 4px 14px rgba(109, 124, 255, 0.45); }
.logo svg { width: 20px; height: 9px; overflow: visible; }
.logo path, .lobby-logo path { fill: none; stroke: #fff; stroke-width: 12; stroke-linecap: round; stroke-linejoin: round; }
.top h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: 0.01em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--raise); border: 1px solid var(--line); padding: 3px 10px 3px 8px; border-radius: 999px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status.ok { color: #a7f3d0; } .status.ok::before { background: var(--good); box-shadow: 0 0 8px var(--good); }
.status.warn { color: #fde68a; } .status.warn::before { background: var(--warn); animation: blink 1s infinite; }
.status.bad { color: #fecdd3; } .status.bad::before { background: var(--bad); }
.ver { margin-left: auto; font-size: 11px; color: #56608f; }
.boot { margin: 20px 16px; color: var(--muted); }
.boot.bad { color: var(--bad); }
@keyframes blink { 50% { opacity: 0.3; } }

/* ---------- layout ---------- */
.room {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 12px;
  padding: 0 12px 12px;
  animation: fadeUp 0.5s ease both;
}
.stage { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
.side { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 12px; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.panel h2 {
  margin: 0 0 10px; font-size: 12px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.09em; font-weight: 800;
}
.count { color: var(--accent2); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }

/* ---------- players ---------- */
.plist { flex: none; max-height: 38%; overflow-y: auto; }
.players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.player { display: flex; align-items: center; gap: 8px; padding: 6px 9px; background: var(--raise); border: 1px solid transparent; border-radius: 12px; min-width: 0; }
.player.offline { opacity: 0.5; }
.player.drawing { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(109, 124, 255, 0.22); }
/* someone who has guessed the word: the whole name plate turns green */
.player.guessed { background: linear-gradient(90deg, #047857, #059669); border-color: #34d399; box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35); }
.player.guessed .name, .player.guessed .pts { color: #fff; }
.player.just { animation: pop 0.45s ease both; }
.player .name { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player .pts { font-size: 13px; color: var(--accent2); font-weight: 800; font-variant-numeric: tabular-nums; }
.tag { font-size: 10px; padding: 2px 8px; border-radius: 999px; background: var(--grad); color: #fff; font-weight: 800; letter-spacing: 0.03em; }
.tag.muted { background: var(--line); color: var(--muted); }
.mkhost { flex: none; border: 1px solid var(--line); background: rgba(8, 11, 26, 0.5); border-radius: 9px; padding: 2px 6px; font-size: 13px; line-height: 1.4; transition: transform 0.15s, border-color 0.15s; }
.mkhost:hover { border-color: var(--accent2); transform: scale(1.12); }
.avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--line); flex: none; }
.avatar.sm { width: 22px; height: 22px; }
.avatar.fallback { display: grid; place-items: center; font-weight: 800; color: var(--text); background: #38457f; font-size: 13px; }

/* ---------- lobby ---------- */
.lobby { animation: fadeUp 0.55s 0.05s ease both; }
.lobby-head { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.lobby-logo { width: 54px; height: 54px; border-radius: 18px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 8px 22px rgba(109, 124, 255, 0.5); animation: floaty 3.4s ease-in-out infinite; }
.lobby-logo svg { width: 36px; height: 16px; overflow: visible; }
@keyframes floaty { 50% { transform: translateY(-4px) rotate(-3deg); } }
.panel .lobby-title { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: 0; text-transform: none; color: var(--text); }
.lobby-sub { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.lobby.readonly .rounds, .lobby.readonly .chips, .lobby.readonly .custom { opacity: 0.7; }
.setting { margin-top: 14px; padding: 14px; background: var(--raise); border: 1px solid var(--line); border-radius: 16px; }
.setting-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.setting-top label { font-weight: 800; font-size: 15px; }
.setting-hint { color: var(--muted); font-size: 12px; }
.rounds { display: flex; align-items: center; gap: 10px; }
.rounds input[type=range] { flex: 1; min-width: 0; accent-color: var(--accent); height: 28px; }
.step { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card2); font-size: 20px; line-height: 1; transition: transform 0.12s, background 0.15s, border-color 0.15s; }
.step:hover:not(:disabled) { border-color: var(--accent2); background: #263070; }
.step:active:not(:disabled) { transform: scale(0.88); }
.num { width: 74px; padding: 9px; border-radius: 12px; border: 1px solid var(--line); background: rgba(8, 11, 26, 0.55); text-align: center; font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card2); font-size: 14px; font-weight: 700; transition: transform 0.12s, background 0.15s, border-color 0.15s; }
.chip:hover:not(:disabled) { border-color: var(--accent2); transform: translateY(-1px); }
.chip:active:not(:disabled) { transform: scale(0.94); }
.chip.on { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(109, 124, 255, 0.45); }
.custom { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 14px; }
.note { color: var(--muted); font-size: 13px; margin: 12px 0 0; text-align: center; }

.primary { position: relative; overflow: hidden; background: var(--grad); color: #fff; border: 0; border-radius: 14px; padding: 12px 18px; font-weight: 800; font-size: 16px; box-shadow: 0 6px 18px rgba(80, 110, 255, 0.45); transition: transform 0.12s, box-shadow 0.15s, filter 0.15s; }
.primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(80, 110, 255, 0.55); filter: brightness(1.06); }
.primary:active:not(:disabled) { transform: scale(0.97); }
.primary.small { padding: 9px 16px; font-size: 14px; border-radius: 12px; }
.primary.big { width: 100%; margin-top: 18px; padding: 15px 18px; font-size: 18px; letter-spacing: 0.02em; }
.primary.big:not(:disabled)::after { content: ""; position: absolute; top: 0; bottom: 0; width: 45%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent); animation: shine 3.2s ease-in-out infinite; }
@keyframes shine { 0% { left: -60%; } 55%, 100% { left: 130%; } }
.ghost { background: var(--raise); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-weight: 700; transition: transform 0.12s, border-color 0.15s; }
.ghost:hover { border-color: var(--accent2); }
.ghost:active { transform: scale(0.96); }
.ghost.small { padding: 7px 13px; font-size: 13px; color: var(--muted); }

/* ---------- game ---------- */
.game { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 8px; min-height: 0; animation: fadeUp 0.4s ease both; }
.gamebar { flex: 0 0 100%; display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.pill { font-size: 12px; font-weight: 800; background: rgba(109, 124, 255, 0.2); border: 1px solid rgba(109, 124, 255, 0.45); color: #c7d0ff; padding: 5px 11px; border-radius: 999px; white-space: nowrap; }
.hint { flex: 1; text-align: center; font-weight: 800; letter-spacing: 0.2em; font-size: 20px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hint small { font-size: 11px; letter-spacing: 0; color: var(--muted); font-weight: 700; margin-left: 6px; }
.hint.you { color: var(--accent2); }
.timer { min-width: 56px; text-align: right; font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; }
.timer.urgent { color: var(--bad); animation: pulse 0.8s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.14); } }

/* blue time bar: empties from the left, the avatars below show who guessed at that moment */
.timebar { flex: 0 0 100%; padding: 0 14px; }
.bar { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.09); overflow: hidden; }
.barfill { height: 100%; width: 100%; border-radius: 999px; transform-origin: right center; background: linear-gradient(90deg, #2563eb, #60a5fa); box-shadow: 0 0 12px rgba(96, 165, 250, 0.7); will-change: transform; }
.barfill.settle { transition: transform 0.5s ease; }
.guesstrack { position: relative; height: 34px; }
.gb { position: absolute; width: 26px; height: 26px; margin-left: -13px; border-radius: 50%; padding: 2px; background: #38bdf8; box-shadow: 0 2px 8px rgba(3, 6, 28, 0.6); transition: left 0.3s ease, top 0.3s ease; animation: gbIn 0.45s cubic-bezier(.2, 1.4, .4, 1) both; z-index: 1; }
.gb::before { content: ""; position: absolute; left: 50%; bottom: 100%; width: 2px; height: var(--stem, 6px); margin-left: -1px; background: rgba(125, 211, 252, 0.7); z-index: -1; }
.gb .avatar { width: 22px; height: 22px; display: block; }
.gb.first { background: var(--gold); box-shadow: 0 0 10px rgba(251, 191, 36, 0.7); }
.gb.first::before { background: rgba(251, 191, 36, 0.75); }
@keyframes gbIn { from { transform: translateY(-8px) scale(0); opacity: 0; } to { transform: none; opacity: 1; } }

.board {
  position: relative;
  flex: 1 1 320px;
  min-width: 0;
  max-width: calc((100dvh - 225px) * 4 / 3);
  aspect-ratio: 4 / 3;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  border: 3px solid rgba(135, 155, 255, 0.28);
  box-shadow: var(--shadow);
  user-select: none; -webkit-user-select: none;
}
#canvas { width: 100%; height: 100%; display: block; background: #fff; touch-action: none; }
#canvas.can-draw { cursor: crosshair; }

.overlay {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 12px;
  background: radial-gradient(circle at 50% 40%, rgba(25, 32, 80, 0.9), rgba(8, 11, 26, 0.94));
  animation: fadeIn 0.3s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.obox { width: 100%; max-width: 440px; max-height: 100%; overflow-y: auto; text-align: center; animation: pop 0.45s ease both; }
.obox h3 { margin: 0 0 8px; font-size: 22px; font-weight: 800; }
.obox .big { font-size: 34px; font-weight: 800; margin: 6px 0 10px; word-break: break-word; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; animation: pop 0.6s 0.15s ease both; }
.obox .sub { color: var(--muted); font-size: 14px; margin: 4px 0 10px; }
.wordbtns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 12px 0; }
.wordbtn { padding: 13px 22px; font-size: 19px; font-weight: 800; border-radius: 14px; border: 2px solid rgba(109, 124, 255, 0.7); background: var(--card2); animation: pop 0.45s ease both; transition: transform 0.15s, background 0.15s, box-shadow 0.15s; }
.wordbtn:hover:not(:disabled) { transform: translateY(-4px); background: #28307a; box-shadow: 0 8px 20px rgba(80, 110, 255, 0.45); }
.wordbtn:active:not(:disabled) { background: var(--grad); }
.gainlist, .rank { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; text-align: left; }
.gainlist li, .rank li { display: flex; gap: 8px; align-items: center; background: var(--raise); border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; font-size: 14px; animation: slideIn 0.4s ease both; }
.gainlist .n, .rank .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.gainlist .v, .rank .v { color: var(--accent2); font-weight: 800; }
.rank .m { width: 26px; text-align: center; }
.obtns { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }

.tools { flex: 0 0 176px; display: flex; flex-direction: column; gap: 9px; padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; animation: slideIn 0.35s ease both; }
.toolgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.toolrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tool { padding: 8px 6px; border-radius: 11px; border: 1px solid var(--line); background: var(--card2); font-size: 13px; font-weight: 700; white-space: nowrap; transition: transform 0.12s, border-color 0.15s, background 0.15s; }
.tool:hover { border-color: var(--accent2); }
.tool:active { transform: scale(0.94); }
.tool.on { border-color: var(--accent); background: rgba(109, 124, 255, 0.3); box-shadow: 0 0 0 2px rgba(109, 124, 255, 0.25); }
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(26px, 1fr)); gap: 5px; justify-items: center; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.18); padding: 0; transition: transform 0.12s; }
.swatch:hover { transform: scale(1.15); }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); transform: scale(1.1); }
.colorpick { width: 34px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: none; }
.sizes { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.sizebtn { width: 30px; height: 30px; border-radius: 10px; border: 1px solid var(--line); background: var(--card2); display: grid; place-items: center; padding: 0; transition: transform 0.12s; }
.sizebtn:active { transform: scale(0.92); }
.sizebtn i { display: block; border-radius: 50%; background: var(--text); }
.sizebtn.on { border-color: var(--accent); background: rgba(109, 124, 255, 0.3); }
.gamefoot { flex: 0 0 100%; display: flex; gap: 8px; justify-content: center; }

/* ---------- chat ---------- */
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chatlog { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding-right: 2px; }
.msg { display: flex; gap: 7px; align-items: flex-start; font-size: 14px; word-break: break-word; padding: 4px 8px; border-radius: 10px; animation: slideIn 0.25s ease both; }
.msg .body { min-width: 0; }
.msg .who { font-weight: 800; margin-right: 6px; }
.msg.mine { background: rgba(109, 124, 255, 0.13); }
.msg.sys { color: var(--muted); font-size: 13px; font-style: italic; padding: 2px 8px; }
.msg.priv { background: rgba(52, 211, 153, 0.1); }
.msg.priv .body { color: #86efac; }
.msg.priv .who::after { content: " (guessed chat)"; font-weight: 600; font-size: 11px; color: #4ade80; }
.msg.sys.priv { color: #86efac; }
/* private Neko messages: only the person they are for can see these */
.msg.sys.tone-good { color: #bbf7d0; font-style: normal; font-weight: 800; background: rgba(52, 211, 153, 0.2); border: 1px solid rgba(52, 211, 153, 0.5); animation: pop 0.45s ease both; }
.msg.sys.tone-close { color: #fde68a; font-style: normal; font-weight: 800; background: rgba(251, 191, 36, 0.16); border: 1px solid rgba(251, 191, 36, 0.45); animation: pop 0.45s ease both; }
.chatform { display: flex; gap: 6px; margin-top: 10px; }
.chatform input { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(8, 11, 26, 0.55); font-size: 16px; transition: border-color 0.15s, box-shadow 0.15s; }
.chatform input:focus { outline: none; border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2); }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: rgba(28, 35, 82, 0.95); border: 1px solid var(--line); padding: 10px 18px; border-radius: 14px; z-index: 50; max-width: 90vw; font-size: 14px; font-weight: 700; box-shadow: var(--shadow);
  animation: toastIn 0.3s ease both;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(135, 155, 255, 0.3) transparent; }

/* ---------- phones / narrow ---------- */
@media (max-width: 819px) {
  .top { padding: 6px 12px; }
  .top h1 { font-size: 18px; }
  .room { display: flex; flex-direction: column; overflow-y: auto; padding: 0 8px 10px; gap: 10px; }
  .stage { flex: none; overflow: visible; }
  .side { flex: 1 0 auto; min-height: 300px; }
  .plist { max-height: none; flex: none; }
  .plist h2 { display: none; }
  .players { flex-direction: row; overflow-x: auto; padding-bottom: 2px; }
  .player { flex: none; max-width: 190px; }
  .chat { min-height: 200px; }
  /* portrait phone: the board uses the full width of the screen */
  .board { flex: 0 0 100%; max-width: 100%; }
  .tools { flex: 0 0 100%; }
  .toolgrid { grid-template-columns: repeat(5, 1fr); }
  .hint { font-size: 17px; letter-spacing: 0.12em; }
  .swatch { width: 28px; height: 28px; }
}

/* phone held sideways: board and tools side by side so the board still fits the screen height */
@media (max-width: 819px) and (orientation: landscape) {
  .board { flex: 1 1 300px; max-width: calc((100dvh - 175px) * 4 / 3); }
  .tools { flex: 0 0 150px; }
  .toolgrid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- word picking: timer on top, compact so it never needs scrolling ---------- */
.obox .sub.pick { font-weight: 800; color: #c7d0ff; font-size: clamp(13px, 2.4dvh, 15px); margin: 0 0 6px; }
.pickbar { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; margin: 0 auto clamp(8px, 2.4dvh, 18px); max-width: 280px; }
.pickfill { height: 100%; width: 100%; border-radius: 999px; transform-origin: right center; background: linear-gradient(90deg, #60a5fa, #a78bfa); transition: transform 0.25s linear; }
.obox.picking h3 { font-size: clamp(17px, 3.2dvh, 22px); margin-bottom: 4px; }
.obox.picking .wordbtns { gap: clamp(6px, 1.4dvh, 10px); margin: clamp(6px, 1.6dvh, 12px) 0 0; }
.obox.picking .wordbtn { padding: clamp(8px, 1.8dvh, 13px) clamp(12px, 2.6dvh, 22px); font-size: clamp(15px, 2.8dvh, 19px); }
.overlay { overflow-y: auto; }
@media (max-width: 819px) { .obox.picking .avatar { width: 36px !important; height: 36px !important; margin-bottom: 4px !important; } }

/* ---------- music button ---------- */
.ver { margin-left: 0; }
.musicbtn { margin-left: auto; position: relative; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--raise); color: var(--accent2); display: grid; place-items: center; padding: 0; transition: transform 0.15s, background 0.15s, border-color 0.15s, color 0.15s; }
.musicbtn:hover { border-color: var(--accent2); transform: scale(1.08); }
.musicbtn:active { transform: scale(0.92); }
.musicbtn .x { display: none; }
.musicbtn.muted { color: var(--muted); }
.musicbtn.muted .x { display: block; stroke: var(--bad); }
.musicbtn.muted .w1, .musicbtn.muted .w2 { display: none; }
.musicbtn.on .w1 { animation: wave 1.8s ease-in-out infinite; }
.musicbtn.on .w2 { animation: wave 1.8s 0.3s ease-in-out infinite; }
@keyframes wave { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
/* music is on but waiting for the first tap: gentle pulse ring */
.musicbtn.waiting::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--accent2); animation: ring 1.6s ease-out infinite; }
@keyframes ring { from { transform: scale(0.85); opacity: 0.9; } to { transform: scale(1.35); opacity: 0; } }