:root {
  --bg: #020a14;
  --panel: rgba(4, 18, 34, 0.82);
  --panel-solid: #061a2e;
  --line: rgba(120, 200, 255, 0.22);
  --text: #d8ecff;
  --muted: #7f9bb5;
  --accent: #ffe066;
  --accent2: #62e3ea;
  --danger: #ff7a7a;
  --ok: #5ed66f;
  --font: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

#stage { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
#tank { display: block; image-rendering: auto; }

#logo { position: fixed; top: 10px; left: 14px; color: var(--accent2); font-size: 13px; letter-spacing: 0.5px; text-shadow: 0 0 8px rgba(0, 0, 0, 0.8); pointer-events: none; }
#logo b { color: var(--text); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; backdrop-filter: blur(4px); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); }

/* leaderboard */
#board { position: fixed; top: 10px; right: 10px; width: 250px; max-height: calc(100vh - 20px); display: flex; flex-direction: column; }
#board header { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--accent); font-weight: 700; letter-spacing: 1px; }
#board.collapsed ol, #board.collapsed footer { display: none; }
#board.collapsed header { border-bottom: 0; }
#topList { list-style: none; margin: 0; padding: 4px 0; overflow-y: auto; }
#topList li { display: grid; grid-template-columns: 28px 1fr auto; gap: 6px; padding: 3px 10px; cursor: pointer; }
#topList li:hover { background: rgba(98, 227, 234, 0.08); }
#topList li .rk { color: var(--muted); }
#topList li .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#topList li .sc { color: var(--accent2); }
#topList li.me { background: rgba(255, 224, 102, 0.12); }
#topList li.me .nm { color: var(--accent); }
#topList li:nth-child(1) .rk { color: #ffd700; }
#topList li:nth-child(2) .rk { color: #d0d8e0; }
#topList li:nth-child(3) .rk { color: #e0a060; }
#board footer { padding: 6px 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.icon { background: none; border: 1px solid var(--line); border-radius: 4px; width: 24px; height: 22px; cursor: pointer; color: var(--muted); line-height: 1; }

/* HUD */
#hud { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); padding: 10px 14px; min-width: 560px; }
.hud-main { display: grid; grid-template-columns: 1fr 1fr auto; gap: 18px; align-items: center; }
.me-name { color: var(--accent); font-weight: 700; font-size: 16px; }
.me-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.score { font-size: 22px; font-weight: 700; color: var(--accent2); }
.bar { height: 6px; background: rgba(255, 255, 255, 0.08); border-radius: 3px; overflow: hidden; margin: 4px 0 2px; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent2), var(--accent)); transition: width 0.6s; }
.hud-actions { display: flex; gap: 8px; margin-top: 8px; }

.btn { background: var(--accent2); color: #022; border: 0; border-radius: 4px; padding: 8px 14px; cursor: pointer; font-weight: 700; letter-spacing: 0.5px; }
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 400; }
.btn.danger { background: var(--danger); }
.btn.feed { font-size: 18px; min-width: 130px; padding: 12px 18px; background: var(--accent); color: #2a1e00; }
.btn.feed.cooldown { background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; text-decoration: underline; margin-top: 12px; }

#joinBtn { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); }

/* modals */
.modal { position: fixed; inset: 0; background: rgba(0, 6, 14, 0.55); display: flex; align-items: center; justify-content: center; z-index: 10; }
.box { background: var(--panel-solid); border: 1px solid var(--line); border-radius: 8px; padding: 22px 26px; width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); }
.box.wide { width: min(980px, calc(100vw - 32px)); }
.box h2 { margin: 0 0 4px; color: var(--accent); font-size: 18px; }
.box h2 span { color: var(--accent2); }
.ascii-logo { color: var(--accent2); margin: 0 0 8px; font-size: 13px; line-height: 1.25; }
.box p { margin: 6px 0 14px; }
#loginForm { display: flex; gap: 8px; flex-wrap: wrap; }
input, select, textarea { background: #021120; border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--accent2); }
#nameInput { flex: 1; min-width: 200px; }
#pinInput, #newPin { width: 130px; }
.err { color: var(--danger); min-height: 1.2em; margin-top: 8px; font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; margin-top: 14px; flex-wrap: wrap; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 10px 0 12px; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; cursor: pointer; color: var(--muted); }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.card { background: #031424; border: 1px solid var(--line); border-radius: 6px; padding: 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 120px; justify-content: space-between; position: relative; }
.card:hover { border-color: rgba(98, 227, 234, 0.6); }
.card.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.card.locked { opacity: 0.5; cursor: not-allowed; }
.card canvas { max-width: 100%; height: auto !important; }
.card .lbl { font-size: 12px; color: var(--text); text-align: center; }
.card .lock { font-size: 11px; color: var(--muted); }
.card .badge { position: absolute; top: 4px; right: 6px; font-size: 11px; color: var(--accent); }
.pick-actions { margin-top: 10px; }
.growth { margin-top: 14px; }
.strip { display: flex; gap: 10px; align-items: flex-end; overflow-x: auto; padding: 6px 0; }
.strip figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.strip figcaption { font-size: 11px; color: var(--muted); }

.swatch { width: 100%; height: 70px; border-radius: 4px; }
.placed { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.chip { background: #031424; border: 1px solid var(--line); border-radius: 12px; padding: 3px 10px; font-size: 12px; display: inline-flex; gap: 6px; align-items: center; }
.chip button { background: none; border: 0; color: var(--danger); cursor: pointer; padding: 0; }
.slots { color: var(--muted); font-size: 12px; margin-bottom: 6px; }

#toasts { position: fixed; top: 46px; left: 14px; display: flex; flex-direction: column; gap: 6px; z-index: 20; pointer-events: none; }
.toast { background: var(--panel-solid); border: 1px solid var(--line); border-left: 3px solid var(--accent2); padding: 8px 12px; border-radius: 4px; max-width: 360px; animation: tin 0.25s ease-out; font-size: 13px; }
.toast.warn { border-left-color: var(--danger); }
.toast.good { border-left-color: var(--accent); }
@keyframes tin { from { transform: translateX(-12px); opacity: 0; } }

/* tools & popovers */
#tools { position: fixed; top: 30px; left: 12px; display: flex; gap: 6px; z-index: 6; }
.tool { background: rgba(4, 18, 34, 0.75); border: 1px solid var(--line); color: var(--muted); border-radius: 4px; padding: 3px 8px; cursor: pointer; font-size: 12px; }
.tool:hover { color: var(--accent2); }
.popover { position: fixed; top: 58px; left: 12px; width: 280px; padding: 12px; z-index: 7; display: flex; flex-direction: column; gap: 8px; }
.popover h3 { margin: 0; font-size: 13px; color: var(--accent); }
.popover label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.popover label.range { flex-direction: row; align-items: center; justify-content: space-between; }
.popover label.range input { width: 140px; }
.popover label.check { flex-direction: row; align-items: center; gap: 6px; color: var(--text); }
.popover select { width: 100%; }

/* event feed & youtube */
#feed { position: fixed; left: 12px; bottom: 12px; width: 340px; pointer-events: none; z-index: 4; }
#feedList { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column-reverse; gap: 3px; }
#feedList li { background: rgba(2, 10, 20, 0.7); border-left: 2px solid var(--accent2); padding: 3px 8px; font-size: 12px; border-radius: 0 3px 3px 0; transition: opacity 2s; }
#feedList li.old { opacity: 0.35; }
#ytBox { position: fixed; left: 12px; bottom: 130px; padding: 4px; z-index: 5; }

/* HUD extras */
.score-row { display: flex; align-items: baseline; gap: 8px; }
.mult { color: var(--accent); font-size: 13px; }
.pearl { color: #e8eef8; }
.stash { color: #c4f36e; margin-left: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chips .chip { font-size: 11px; padding: 1px 7px; }
#topList li .nm i { font-style: normal; margin-left: 3px; }

#tooltip { position: fixed; z-index: 30; pointer-events: none; background: rgba(2, 10, 22, 0.92); border: 1px solid var(--line); padding: 3px 8px; border-radius: 3px; font-size: 12px; max-width: 320px; }

/* shop / collection / card */
.row.spread { justify-content: space-between; margin-top: 0; }
.wallet { color: var(--accent2); font-size: 13px; }
.card.shop { justify-content: flex-start; text-align: center; gap: 6px; }
.card.shop .btn { margin-top: auto; }
.card .tier { color: var(--accent); font-size: 11px; border: 1px solid var(--line); padding: 0 4px; border-radius: 3px; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.coll-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.card.coll { min-height: 110px; border-width: 1px; }
.card.coll.unknown { opacity: 0.75; border-style: dashed; }
.card.coll .rar { font-size: 11px; }
.card-art { display: flex; justify-content: center; margin-bottom: 8px; }
.card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.card-stats div { display: flex; flex-direction: column; align-items: center; background: #031424; border-radius: 4px; padding: 6px; }
.card-stats b { color: var(--accent2); }
.card-stats span { font-size: 11px; color: var(--muted); }
#cardBody h2 { text-align: center; }

/* bottle message */
.scroll { background: #e8d9b0; color: #3a2a14; padding: 22px 30px; max-width: 460px; border-radius: 4px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); text-align: center; font-size: 15px; transform: rotate(-1deg); }
.scroll-top { color: #a08050; letter-spacing: 1px; }
.scroll p { margin: 14px 0; line-height: 1.5; }
.scroll .u-hint { color: #8a7050; }

/* unlock popup */
#unlockOverlay { position: fixed; inset: 0; z-index: 40; background: rgba(0, 4, 12, 0.72); display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; }
#unlockOverlay .rays { position: absolute; width: 160vmax; height: 160vmax; background: repeating-conic-gradient(rgba(255, 224, 102, 0.07) 0 8deg, transparent 8deg 20deg); animation: spin 18s linear infinite; }
#unlockBox { position: relative; background: var(--panel-solid); border: 2px solid var(--rar, var(--accent)); box-shadow: 0 0 40px var(--rar, var(--accent)); border-radius: 10px; padding: 24px 34px; min-width: 300px; max-width: 520px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
#unlockOverlay.pop #unlockBox { animation: popin 0.45s cubic-bezier(0.2, 1.6, 0.4, 1); }
.u-kicker { color: var(--rar, var(--accent)); text-transform: uppercase; letter-spacing: 2px; font-size: 12px; }
.u-art { min-height: 40px; display: flex; align-items: center; justify-content: center; padding: 10px 0; }
.u-title { font-size: 22px; font-weight: 700; color: var(--text); }
.u-sub { color: var(--rar, var(--accent)); }
.u-desc { color: var(--muted); font-size: 13px; max-width: 380px; }
.u-hint { color: var(--muted); font-size: 11px; margin-top: 10px; opacity: 0.7; }
#unlockConfetti span { position: absolute; top: -20px; font-size: 18px; animation: fall linear forwards; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes popin { from { transform: scale(0.4); opacity: 0; } }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); opacity: 0.2; } }

.toast.event { border-left-color: #d773ff; }

/* collapsible HUD */
#hud { transition: padding 0.2s; }
.hud-toggle { position: absolute; top: 6px; right: 6px; }
#hud.mini { min-width: 0; padding: 6px 40px 6px 12px; }
#hud.mini .hud-actions, #hud.mini .me-sub, #hud.mini #meBuffs, #hud.mini .bar, #hud.mini #meNext, #hud.mini .hud-score .small { display: none; }
#hud.mini .hud-main { grid-template-columns: auto auto auto; gap: 14px; }
#hud.mini .me-name { font-size: 14px; }
#hud.mini .score { font-size: 16px; }
#hud.mini .btn.feed { font-size: 13px; padding: 6px 12px; min-width: 86px; }

/* language list */
.lang-list { display: flex; flex-direction: column; gap: 2px; }
.lang-list button { text-align: left; background: none; border: 1px solid transparent; border-radius: 4px; padding: 5px 8px; cursor: pointer; color: var(--text); }
.lang-list button:hover { border-color: var(--line); }
.lang-list button.sel { color: var(--accent); border-color: var(--accent); }
.modal { cursor: default; }

/* journal / guide / notes */
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 6px; vertical-align: middle; box-shadow: 0 0 6px var(--accent); }
.quest { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; background: #031424; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; }
.quest.done { border-color: var(--ok); }
.quest .q-name { font-weight: 700; }
.quest .q-reward { color: var(--accent); white-space: nowrap; }
.quest .q-desc { color: var(--muted); font-size: 12px; }
.quest .bar { grid-column: 1 / -1; margin: 2px 0 0; }
.streak { background: #031424; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; }
.streak b { color: var(--accent); font-size: 16px; }
.ach { text-align: left; align-items: stretch; justify-content: flex-start; min-height: 0; }
.ach.locked { opacity: 0.55; cursor: default; }
.ach .lbl { text-align: left; font-weight: 700; }
.ach .small { font-size: 12px; color: var(--muted); }
.note-box textarea { width: 100%; min-height: 80px; resize: vertical; }
.note-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.note-list li { background: #031424; border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px; font-size: 13px; }
.note-list li span { color: var(--muted); font-size: 11px; margin-left: 6px; }
.card-title { text-align: center; color: var(--accent); margin: -2px 0 6px; }
.scroll-from { text-align: right; color: #7a5a30; font-style: italic; margin: -6px 0 8px; }
.guide { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.guide section { background: #031424; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.guide h4 { margin: 0 0 4px; color: var(--accent2); }
.guide p { margin: 0; font-size: 13px; line-height: 1.5; }
#weatherTag { position: fixed; top: 56px; left: 14px; font-size: 12px; color: var(--muted); text-shadow: 0 0 6px rgba(0, 0, 0, 0.9); pointer-events: none; }
.np { font-size: 11px; color: var(--muted); }

/* the secret Dread style */
body.dread {
  --panel: rgba(8, 4, 4, 0.88); --panel-solid: #0c0606; --line: rgba(160, 40, 40, 0.3);
  --text: #c9bfb0; --muted: #7a6a60; --accent: #c22a2a; --accent2: #9a8a78;
}
body.dread #logo { color: #8a1a1a; letter-spacing: 3px; }
body.dread .btn { background: #5a1414; color: #e8d8c8; }
body.dread .btn.feed { background: #7a1010; color: #f0e0d0; }
body.dread .btn.ghost { background: transparent; color: var(--text); }
body.dread .toast { border-left-color: #8a1a1a; }

#debugStats { position: fixed; right: 12px; bottom: 12px; font-size: 11px; color: #9f9; background: rgba(0, 0, 0, 0.6); padding: 4px 8px; border-radius: 3px; white-space: pre; z-index: 5; }

/* ---------------- v4 ---------------- */
.clickable { cursor: pointer; user-select: none; }
#board header.clickable:hover { background: rgba(255, 224, 102, 0.06); }
#board header .icon, .hud-toggle, #notesHead .icon { width: auto; padding: 0 4px; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
#hud .hud-toggle { height: 20px; }

/* feed button: ready glow, combo */
.btn.feed.ready { animation: feedpulse 2.2s ease-in-out infinite; }
@keyframes feedpulse { 0%, 100% { box-shadow: 0 0 0 rgba(255, 224, 102, 0); } 50% { box-shadow: 0 0 16px rgba(255, 224, 102, 0.55); } }
.combo { font-size: 12px; color: #ff9dd0; min-height: 0; margin-top: 2px; }
.combo:empty { display: none; }
.combo.hot { color: #ffe066; font-weight: 700; animation: blinkc 0.8s steps(2) infinite; }
@keyframes blinkc { 50% { opacity: 0.45; } }
.chip.boost { background: rgba(255, 122, 176, 0.08); }

/* journal: rewards waiting to be claimed */
.badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: var(--accent); color: #2a1e00; font-size: 11px; line-height: 18px; font-style: normal; text-align: center; }
#journalBtn { position: relative; }
.blink { animation: blinkbtn 1.2s ease-in-out infinite; }
@keyframes blinkbtn { 0%, 100% { box-shadow: 0 0 0 rgba(255, 224, 102, 0); border-color: var(--line); } 50% { box-shadow: 0 0 14px rgba(255, 224, 102, 0.6); border-color: var(--accent); color: var(--accent); } }
.tabs button.blink { color: var(--accent); }
.btn.glow { background: var(--accent); color: #2a1e00; box-shadow: 0 0 14px rgba(255, 224, 102, 0.45); }
.inbox { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.inbox-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; background: #031424; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 6px; padding: 8px 12px; animation: tin 0.3s ease-out; }
.inbox-item.k-achievement { border-left-color: #ffb347; }
.inbox-item.k-streak { border-left-color: #ff7ab0; }
.ii-icon { font-size: 20px; color: var(--accent); text-align: center; animation: wob 2s ease-in-out infinite; }
@keyframes wob { 50% { transform: scale(1.18) rotate(-8deg); } }
.ii-text { display: flex; flex-direction: column; gap: 2px; }
.ii-text span { color: var(--accent); font-size: 12px; }
.ach .bar { margin: 4px 0 0; }

/* confetti burst for claims */
.burst { position: fixed; z-index: 60; pointer-events: none; width: 0; height: 0; }
.burst span { position: absolute; left: 0; top: 0; font-size: 16px; font-weight: 700; animation: burst 1.1s cubic-bezier(0.15, 0.8, 0.3, 1) forwards; text-shadow: 0 0 6px currentColor; }
@keyframes burst { from { transform: translate(-50%, -50%) scale(0.4); opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 30px)) scale(1) rotate(200deg); opacity: 0; } }

/* card: supporters, actions */
.supporters { margin-top: 10px; background: #031424; border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; }
.supporters h4 { margin: 0 0 6px; color: #ff7ab0; font-size: 13px; }
.sup-list { list-style: none; margin: 0; padding: 0; max-height: 140px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.sup-list li { display: flex; justify-content: space-between; font-size: 13px; }
.sup-list b { color: #ff7ab0; font-weight: 400; }
.btn.ghost.danger { color: var(--danger); border-color: rgba(255, 122, 122, 0.4); background: transparent; }
#reportBody label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); margin: 8px 0; }
#reportBody textarea { width: 100%; resize: vertical; }

/* shop extras */
.luck { color: #c4f36e; }
.card.boost { border-width: 1px; }
.effects { list-style: none; padding: 0; margin: 2px 0; font-size: 11px; color: var(--text); text-align: left; align-self: stretch; }
.effects li::before { content: '+ '; color: var(--accent); }

/* display panel extras */
.popover { max-height: calc(100vh - 70px); overflow-y: auto; }
.popover h4 { margin: 6px 0 0; font-size: 12px; color: var(--accent2); border-top: 1px solid var(--line); padding-top: 8px; }
.pin-row { display: flex; gap: 6px; }
.pin-row input { width: 50%; }
.hidden-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.hidden-list li { display: flex; justify-content: space-between; align-items: center; }
.popover .row { margin-top: 2px; }

/* the Display button glitches once the secret style is available */
.tool.glitch { color: #ff4a4a; animation: glitchbtn 2.6s infinite; text-shadow: 1px 0 #00f0ff, -1px 0 #ff2bd6; }
@keyframes glitchbtn {
  0%, 86%, 100% { transform: none; filter: none; }
  87% { transform: translate(-2px, 1px) skewX(-12deg); filter: hue-rotate(90deg); }
  89% { transform: translate(2px, -1px); clip-path: inset(30% 0 20% 0); }
  91% { transform: translate(-1px, 0) skewX(8deg); clip-path: none; }
  93% { transform: translate(1px, 1px); filter: invert(1); }
  95% { transform: none; filter: none; }
}

/* bottle notes chat (left) */
#notesPanel { position: fixed; top: 84px; left: 12px; width: 300px; max-height: calc(100vh - 340px); min-height: 0; display: flex; flex-direction: column; z-index: 5; }
#notesHead { display: flex; align-items: center; gap: 6px; padding: 6px 10px; cursor: pointer; user-select: none; color: var(--accent2); font-size: 12px; letter-spacing: 1px; }
#notesHead .nh-title { flex: 1; }
#notesHead .dot { margin-left: 0; }
#notesPanel.collapsed .notes-body { display: none; }
.notes-body { display: flex; flex-direction: column; min-height: 0; border-top: 1px solid var(--line); padding: 0 8px 8px; }
.tabs.small { margin: 4px 0 6px; }
.tabs.small button { padding: 4px 8px; font-size: 12px; }
.chat { list-style: none; margin: 0; padding: 0 2px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; min-height: 60px; max-height: 38vh; }
.chat li.msg { background: #031424; border: 1px solid var(--line); border-radius: 8px 8px 8px 2px; padding: 5px 8px; font-size: 12px; }
.chat li.msg.sea { border-style: dashed; }
.chat li.msg.mine { border-radius: 8px 8px 2px 8px; border-color: rgba(255, 224, 102, 0.35); margin-left: 18px; }
.chat .from { color: var(--accent2); font-size: 11px; display: flex; justify-content: space-between; gap: 6px; }
.chat .from span { color: var(--muted); }
.chat .txt { white-space: pre-wrap; word-break: break-word; line-height: 1.4; }
.chat li.sys { color: var(--muted); font-size: 11px; text-align: center; padding: 4px; }
#notesForm { margin-top: 6px; }
#notesForm textarea { width: 100%; resize: none; font-size: 12px; }
#notesForm .row { margin-top: 4px; }

/* picture-in-picture window */
body.pip-body { overflow: hidden; display: flex; flex-direction: column; background: #021827; }
body.pip-body canvas { display: block; flex: 1; }
.pip-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; height: 54px; border-top: 1px solid var(--line); }
.pip-id b { color: var(--accent); }
.pip-id span { color: var(--accent2); }
.pip-bar .btn.feed { font-size: 15px; min-width: 110px; padding: 8px 12px; }

/* wallpaper / screensaver mode: only the tank */
body.wallpaper #logo, body.wallpaper #tools, body.wallpaper #board, body.wallpaper #feed, body.wallpaper #hud, body.wallpaper #joinBtn,
body.wallpaper #toasts, body.wallpaper #weatherTag, body.wallpaper #tooltip, body.wallpaper #notesPanel, body.wallpaper #ytBox { display: none !important; }
body.wallpaper #tank { cursor: none; }

#toasts { left: 50%; transform: translateX(-50%); align-items: center; top: 10px; }
#toasts .toast { animation: tdown 0.25s ease-out; }
@keyframes tdown { from { transform: translateY(-10px); opacity: 0; } }

/* cheers (likes) are public */
#topList li { grid-template-columns: 28px 1fr auto auto; }
#topList li .hearts { color: #ff7ab0; font-size: 12px; }
.me-hearts { color: #ff7ab0; }

/* auto-feeder line, rebirth */
.auto-line { font-size: 12px; color: #c4f36e; }
.auto-line:empty { display: none; }
.btn.rebirth { color: #d773ff; border-color: #d773ff; animation: blinkbtn 1.6s ease-in-out infinite; }
.rebirth-info { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.rebirth-info div { background: #031424; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 13px; }
.rebirth-info b { color: #d773ff; }

/* screamer */
#screamer { position: fixed; inset: 0; z-index: 100; background: #000; display: flex; align-items: center; justify-content: center; animation: scr 0.09s steps(2) infinite; }
#screamer pre { color: #ff1a1a; font-size: min(5vw, 4.2vh); line-height: 1.05; font-weight: 800; text-shadow: 0 0 20px #ff0000, 0 0 4px #fff; transform: scale(1.4); animation: scrz 1.2s ease-out forwards; }
@keyframes scr { 0% { background: #000; } 50% { background: #300; } }
@keyframes scrz { from { transform: scale(0.6) rotate(-3deg); } 20% { transform: scale(1.6) rotate(2deg); } to { transform: scale(1.9) rotate(-1deg); } }

/* ================= mobile (portrait) ================= */
#mNav, #mMore, #mRotate { display: none; }
body.mobile { --nav-h: calc(62px + env(safe-area-inset-bottom)); --top-h: calc(44px + env(safe-area-inset-top)); font-size: 15px; }
body.mobile #stage { align-items: flex-start; justify-content: flex-start; }
body.mobile #tank { touch-action: none; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
body.mobile #logo, body.mobile #tools, body.mobile #feed, body.mobile #tooltip, body.mobile #joinBtn, body.mobile #weatherTag { display: none !important; }
body.mobile #debugStats { bottom: calc(var(--nav-h) + 8px); }

/* the top bar: just the fish name and the score (+ progress in follow mode) */
body.mobile #hud { top: 0; left: 0; right: 0; bottom: auto; transform: none; min-width: 0; border-radius: 0; border: 0; border-bottom: 1px solid var(--line);
  padding: calc(6px + env(safe-area-inset-top)) 14px 6px; background: rgba(2, 12, 22, 0.72); }
body.mobile #hud .hud-toggle, body.mobile #hud .hud-actions, body.mobile #feedBtn, body.mobile #hud .me-sub, body.mobile #meMult, body.mobile #hud .hud-score .small { display: none !important; }
body.mobile .hud-main { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name score" "bar bar" "next next" "chips chips"; gap: 2px 10px; align-items: center; }
body.mobile .hud-id, body.mobile .hud-score { display: contents; }
body.mobile #meName { grid-area: name; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.mobile .score-row { grid-area: score; justify-self: end; }
body.mobile .score { font-size: 20px; }
body.mobile #hud .bar { grid-area: bar; margin: 2px 0 0; }
body.mobile #hud .hud-score .muted.small { grid-area: next; font-size: 11px; }
body.mobile #meBuffs, body.mobile #meCombo, body.mobile #meAuto { grid-column: 1 / -1; }
body.mobile.m-whole #hud .bar, body.mobile.m-whole #hud .hud-score .muted.small, body.mobile.m-whole #meBuffs, body.mobile.m-whole #meCombo, body.mobile.m-whole #meAuto { display: none !important; }

/* bottom navigation */
body.mobile #mNav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: var(--nav-h); padding: 0 6px env(safe-area-inset-bottom);
  background: rgba(2, 12, 22, 0.92); border-top: 1px solid var(--line); z-index: 8; align-items: center; justify-content: space-around; }
body.mobile #mNav.hidden { display: none; }
#mNav button { background: none; border: 0; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 58px; min-height: 48px; justify-content: center; font-size: 11px; position: relative; padding: 0; }
#mNav button i { font-style: normal; font-size: 15px; color: var(--accent2); }
#mNav button.off { opacity: 0.35; pointer-events: none; }
#mNav button.blink i { color: var(--accent); }
#mNav .badge { position: absolute; top: 2px; right: 6px; margin: 0; font-style: normal; }
#mNav .m-feed { width: 70px; height: 70px; min-width: 70px; border-radius: 50%; background: var(--accent); color: #2a1e00; margin-top: -26px; border: 3px solid #021827; box-shadow: 0 0 0 1px var(--line); }
#mNav .m-feed b { font-size: 14px; letter-spacing: 0.5px; }
#mNav .m-feed.cooldown { background: #12324a; color: var(--text); }
#mNav .m-feed.ready { animation: feedpulse 2s ease-in-out infinite; }

/* bottom sheets: the "More" grid, popovers, top list, bottle notes, every modal */
#mBackdrop { position: fixed; inset: 0; background: rgba(0, 6, 14, 0.5); z-index: 8; }
body.mobile #mMore { display: none; position: fixed; left: 0; right: 0; bottom: var(--nav-h); z-index: 9; border-radius: 16px 16px 0 0; padding: 8px 12px 14px; }
body.mobile.m-more #mMore { display: block; animation: sheetup 0.2s ease-out; }
@keyframes sheetup { from { transform: translateY(40%); opacity: 0; } }
.m-grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 10px; }
.m-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.m-grid button { background: #031424; border: 1px solid var(--line); border-radius: 10px; min-height: 64px; color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; }
.m-grid button i { font-style: normal; color: var(--accent2); }
body.mobile .popover { top: auto; left: 0; right: 0; bottom: var(--nav-h); width: auto; max-height: 72vh; border-radius: 16px 16px 0 0; z-index: 9; }
body.mobile #board { display: none; }
body.mobile.m-board #board { display: flex; position: fixed; top: auto; left: 0; right: 0; bottom: var(--nav-h); width: auto; max-height: 72vh; border-radius: 16px 16px 0 0; z-index: 9; }
body.mobile.m-board #board.collapsed ol, body.mobile.m-board #board.collapsed footer { display: block; }
body.mobile #notesPanel { display: none; }
body.mobile.m-notes #notesPanel:not(.hidden) { display: flex; top: auto; left: 0; right: 0; bottom: var(--nav-h); width: auto; max-height: 75vh; border-radius: 16px 16px 0 0; z-index: 9; }
body.mobile .modal { align-items: flex-end; }
body.mobile .modal .box { width: 100%; max-height: 88vh; border-radius: 16px 16px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
body.mobile .box.wide { width: 100%; }
body.mobile .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
body.mobile .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
body.mobile .tabs button { white-space: nowrap; padding: 10px 12px; }
body.mobile .btn { min-height: 44px; }
body.mobile #toasts { top: calc(var(--top-h) + 30px); width: calc(100% - 24px); }
body.mobile .toast { max-width: none; width: 100%; }
body.mobile #ytBox { left: auto; right: 8px; bottom: calc(var(--nav-h) + 8px); transform: scale(0.8); transform-origin: bottom right; }
body.mobile #unlockBox { max-width: calc(100vw - 32px); padding: 20px; }
body.mobile #screamer pre { font-size: 6vw; }

/* portrait only */
@media (orientation: landscape) and (max-height: 520px) {
  body.mobile #mRotate { display: flex; position: fixed; inset: 0; z-index: 200; background: #021827; color: var(--accent2); flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
}

#mNav .m-feed b { font-size: 11px; letter-spacing: 0; }

/* friends in the top list */
#topList li.friend .nm::after { content: ' <3'; color: #ff7ab0; font-size: 11px; }

/* visiting */
#visitBar { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 7; display: flex; gap: 10px; align-items: center; padding: 6px 12px; border-color: #d773ff; }
#visitBar span { color: #d773ff; font-size: 13px; }
body.mobile #visitBar { top: calc(var(--top-h) + 30px); width: calc(100% - 24px); justify-content: space-between; }

/* biome change: curtains + banner */
#biomeTrans { position: fixed; inset: 0; z-index: 45; pointer-events: none; }
#biomeTrans i { position: absolute; left: 0; right: 0; height: 0; background: #000; }
#biomeTrans .bt-top { top: 0; border-bottom: 2px solid #62e3ea; }
#biomeTrans .bt-bot { bottom: 0; border-top: 2px solid #62e3ea; }
#biomeTrans.closing i { animation: btclose 0.9s cubic-bezier(0.6, 0, 0.4, 1) forwards; }
#biomeTrans.opening i { height: 50.5%; animation: btopen 1.3s cubic-bezier(0.3, 0, 0.2, 1) 0.15s forwards; }
@keyframes btclose { from { height: 0; } to { height: 50.5%; } }
@keyframes btopen { from { height: 50.5%; } to { height: 0; border-width: 0; } }
#biomeBanner { position: fixed; top: 14%; left: 50%; transform: translate(-50%, -20px); z-index: 46; text-align: center; pointer-events: none; opacity: 0;
  background: rgba(2, 12, 22, 0.8); border: 1px solid #62e3ea; border-radius: 10px; padding: 14px 28px; box-shadow: 0 0 30px rgba(98, 227, 234, 0.35); }
#biomeBanner.show { animation: bannerIn 4.2s ease-out forwards; }
.bb-kicker { color: var(--accent2); letter-spacing: 3px; text-transform: uppercase; font-size: 12px; }
#biomeBannerName { font-size: 26px; font-weight: 800; color: var(--accent); margin: 4px 0; text-shadow: 0 0 12px rgba(255, 224, 102, 0.5); }
#biomeBannerSub { color: var(--text); font-size: 13px; }
@keyframes bannerIn { 0% { opacity: 0; transform: translate(-50%, -30px) scale(0.8); } 12% { opacity: 1; transform: translate(-50%, 0) scale(1.05); } 20% { transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -10px); } }

/* stars currency */
.star-c { color: #ffd84a; }
.lvl { color: #ffd84a; font-size: 11px; }

/* moderators' notices across the screen */
#notices { position: fixed; top: 22%; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 10px; width: min(560px, calc(100vw - 32px)); pointer-events: none; }
.notice { position: relative; pointer-events: auto; background: rgba(2, 12, 22, 0.92); border: 1px solid var(--accent2); border-radius: 10px; padding: 16px 40px 14px 20px; text-align: center;
  box-shadow: 0 0 34px rgba(98, 227, 234, 0.35); opacity: 0; transform: translateY(-16px) scale(0.96); transition: opacity 0.35s, transform 0.35s; }
.notice.show { opacity: 1; transform: none; }
.notice-text { font-size: 17px; line-height: 1.45; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.notice-from { margin-top: 8px; font-size: 12px; color: var(--accent2); letter-spacing: 1px; }
.notice-close { position: absolute; top: 6px; right: 8px; background: none; border: 0; color: var(--muted, #8aa); font-size: 18px; cursor: pointer; }
.notice-warn { border-color: #ff9f43; box-shadow: 0 0 34px rgba(255, 159, 67, 0.4); }
.notice-warn .notice-text { color: #ffd2a0; }
.notice-party { border-color: var(--accent); box-shadow: 0 0 40px rgba(255, 224, 102, 0.45); }
.notice-party .notice-text { color: var(--accent); font-weight: 700; }
.notice-spooky { border-color: #a0ff40; background: rgba(6, 10, 4, 0.94); box-shadow: 0 0 40px rgba(160, 255, 64, 0.35); }
.notice-spooky .notice-text { color: #c8ff90; text-shadow: 0 0 8px rgba(160, 255, 64, 0.6); }
body.mobile #notices { top: calc(var(--top-h) + 40px); }

/* ---- the grotto (second screen) ---- */
.edge-arrow { position: fixed; top: 50%; transform: translateY(-50%); z-index: 8; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: rgba(4, 18, 34, 0.7); border: 1px solid var(--line); color: var(--accent2); cursor: pointer; padding: 10px 6px; font: inherit; backdrop-filter: blur(4px); transition: background 0.2s, padding 0.2s; }
.edge-arrow:hover { background: rgba(98, 227, 234, 0.15); }
.edge-arrow.right { right: 0; border-right: 0; border-radius: 10px 0 0 10px; }
.edge-arrow.left { left: 0; border-left: 0; border-radius: 0 10px 10px 0; }
.edge-arrow .ea-ch { font-size: 30px; line-height: 0.8; }
.edge-arrow small { font-size: 10px; letter-spacing: 1px; writing-mode: vertical-rl; text-transform: uppercase; }
.edge-arrow b { font-size: 11px; color: #ff7ab0; }
.edge-arrow.right:hover .ea-ch { animation: nudge 0.6s ease-in-out infinite alternate; }
@keyframes nudge { to { transform: translateX(3px); } }
#grottoBack, #grottoPanel { display: none; }
body.in-grotto #grottoBack { display: flex; }
body.in-grotto #grottoPanel { display: flex; }
body.in-grotto #hud, body.in-grotto #board, body.in-grotto #weatherTag, body.in-grotto #visitBar, body.in-grotto #notesPanel, body.in-grotto #feed, body.in-grotto #collBtn, body.in-grotto #grottoBtn { display: none !important; }
#grottoPanel { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); width: min(980px, calc(100vw - 120px)); max-height: 46vh; flex-direction: column; z-index: 7; border-color: #ff7ab0; }
#grottoPanel.mini #gpBody, #grottoPanel.mini #gpFoot { display: none; }
.gp-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.gp-title { color: #ff7ab0; letter-spacing: 1px; }
.gp-bonus { color: #c4f36e; }
#gpTabs { display: flex; gap: 4px; }
#gpTabs button { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 4px; padding: 3px 10px; cursor: pointer; font: inherit; font-size: 12px; }
#gpTabs button.active { color: var(--accent); border-color: var(--accent); }
#gpBody { display: flex; gap: 10px; padding: 10px 12px; overflow-x: auto; overflow-y: hidden; align-items: stretch; min-height: 120px; }
.gp-card { flex: 0 0 auto; width: 210px; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: rgba(2, 10, 20, 0.55); cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.gp-card:hover { transform: translateY(-2px); }
.gp-card.sel { box-shadow: 0 0 0 1px var(--accent), 0 0 16px rgba(255, 224, 102, 0.25); }
.gp-card.picked { box-shadow: 0 0 0 2px #ff7ab0, 0 0 18px rgba(255, 122, 176, 0.35); }
.gp-card.flash { animation: gpflash 0.7s; }
@keyframes gpflash { 50% { background: rgba(255, 122, 176, 0.25); } }
.gp-card.decor { width: 150px; }
.gp-art { display: flex; align-items: center; justify-content: center; min-height: 44px; }
.gp-info { display: flex; flex-direction: column; gap: 4px; }
.gp-name { display: flex; align-items: center; gap: 4px; }
.gp-name .link, .gp-chip .link { margin: 0; padding: 0 2px; color: var(--accent2); }
.gp-mods { margin: 0; padding-left: 16px; font-size: 12px; color: #c4f36e; }
.gp-mut { color: #d773ff; }
.gp-btns { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; }
.gp-empty { color: var(--muted); padding: 18px; max-width: 520px; line-height: 1.5; }
.gp-foot { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.gp-own { flex: 0 0 auto; width: 220px; display: flex; flex-direction: column; gap: 4px; max-height: 100%; overflow-y: auto; font-size: 12px; }
.gp-chip { border: 1px solid var(--line); border-radius: 4px; padding: 3px 6px; }
.gp-chip.moving { border-color: var(--accent); color: var(--accent); }
#grottoHint { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 9; padding: 8px 14px; color: var(--accent); border-color: var(--accent); }
body.mobile #grottoPanel { width: calc(100vw - 16px); bottom: calc(var(--nav-h) + 6px); max-height: 48vh; }
body.mobile .gp-card { width: 180px; }
body.mobile .edge-arrow { top: auto; bottom: calc(var(--nav-h) + 52vh); padding: 8px 4px; }
body.mobile.in-grotto #mNav { display: none; }
body.mobile.in-grotto #grottoPanel { bottom: 8px; }
body.mobile #grottoBtn { bottom: calc(var(--nav-h) + 90px); }

/* ---- grotto v2: a bigger arrow that blinks when something new waits, eggs, offers, phone panel ---- */
.edge-arrow.right { padding: 16px 10px; gap: 6px; border-color: #ff7ab0; color: #ff9ac4; box-shadow: -4px 0 18px rgba(255, 122, 176, 0.25); }
.edge-arrow.right .ea-ch { font-size: 44px; }
.edge-arrow.right small { font-size: 12px; font-weight: 700; }
.edge-arrow.right b { font-size: 13px; background: #ff7ab0; color: #200814; border-radius: 9px; padding: 0 6px; min-width: 18px; text-align: center; }
.edge-arrow.right b:empty { display: none; }
.edge-arrow.right.alert { animation: grottoBlink 0.9s ease-in-out infinite; }
@keyframes grottoBlink {
  0%, 100% { background: rgba(4, 18, 34, 0.7); box-shadow: -4px 0 18px rgba(255, 122, 176, 0.25); }
  50% { background: rgba(255, 122, 176, 0.45); box-shadow: -6px 0 34px rgba(255, 122, 176, 0.9); color: #fff; }
}
.gp-card.egg { border-style: dashed; border-color: #ffe066; }
.gp-egg-time { color: #ffe066; font-size: 13px; }
.gp-egg-bar { height: 5px; background: rgba(255, 255, 255, 0.08); border-radius: 3px; overflow: hidden; }
.gp-egg-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ff7ab0, #ffe066); }
.gp-busy { color: #ffe066; }
.gp-offer-btn { background: #ff7ab0; animation: grottoBlink 0.9s ease-in-out infinite; }
.offer-box { text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; border-color: #ff7ab0; }
.offer-kicker { color: #ff7ab0; letter-spacing: 2px; text-transform: uppercase; font-size: 12px; }
.offer-art { min-height: 70px; display: flex; align-items: center; justify-content: center; }
.offer-name { font-size: 22px; font-weight: 800; color: var(--accent); }
.offer-box .gp-mods { text-align: left; }
.offer-full { color: #ffb347; font-size: 13px; }
.offer-list { width: 100%; display: flex; flex-direction: column; gap: 4px; max-height: 34vh; overflow-y: auto; text-align: left; }
.offer-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; font-size: 13px; }
.offer-btns { justify-content: center; gap: 10px; }
#grottoPanel { transition: max-height 0.25s; }
#grottoPanel.mini .gp-head { border-bottom: 0; }
body.mobile #grottoPanel.mini .gp-head { cursor: pointer; }
body.mobile #grottoPanel.mini .gp-bonus { display: none; }
body.mobile #grottoPanel:not(.mini) { max-height: 74vh; }
body.mobile #grottoPanel:not(.mini) #gpBody { flex-wrap: wrap; overflow-y: auto; overflow-x: hidden; max-height: calc(74vh - 110px); }
body.mobile #grottoPanel:not(.mini) .gp-card { width: calc(50% - 5px); }
body.mobile .edge-arrow.right { padding: 12px 8px; }
body.mobile .edge-arrow.right .ea-ch { font-size: 34px; }
body.mobile #offerModal .box { padding: 16px; }
.edge-arrow.right { min-width: 58px; padding: 18px 12px; }
.edge-arrow.right .ea-ch { font-size: 52px; line-height: 0.7; }
body.mobile .edge-arrow.right { min-width: 48px; }

/* technical works */
#maintenance { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(1, 8, 16, 0.78); backdrop-filter: blur(5px); }
#maintenance .mt-box { max-width: min(640px, 100%); max-height: 100%; overflow-y: auto; text-align: center; background: var(--panel-solid); border: 1px solid var(--accent2);
  border-radius: 12px; padding: 22px 26px; box-shadow: 0 0 50px rgba(98, 227, 234, 0.25); }
#mtArt { color: var(--accent2); font-size: clamp(9px, 2.4vw, 14px); line-height: 1.25; text-align: left; display: inline-block; margin: 0 0 12px; text-shadow: 0 0 8px rgba(98, 227, 234, 0.4); }
#mtTitle { margin: 0 0 8px; color: var(--accent); font-size: 24px; }
#mtText { white-space: pre-wrap; line-height: 1.5; margin: 0 0 10px; }
#mtUntil { color: #c4f36e; font-weight: 700; }
.mt-foot { margin-top: 12px; color: var(--muted); font-size: 12px; }
#maintenance.mt-warn .mt-box { border-color: #ff9f43; box-shadow: 0 0 50px rgba(255, 159, 67, 0.3); }
#maintenance.mt-warn #mtArt { color: #ffb347; }
#maintenance.mt-party .mt-box { border-color: var(--accent); }
#maintenance.mt-party #mtArt { color: var(--accent); }
#maintenance.mt-spooky .mt-box { border-color: #a0ff40; background: #050a04; }
#maintenance.mt-spooky #mtArt, #maintenance.mt-spooky #mtTitle { color: #a0ff40; text-shadow: 0 0 10px rgba(160, 255, 64, 0.6); }

/* ---- bottle chat: half-transparent, the line to write lights up under the mouse ---- */
#notesPanel.chat-panel { background: rgba(2, 12, 24, 0.32); border-color: rgba(98, 227, 234, 0.12); box-shadow: none; backdrop-filter: blur(2px); transition: background 0.2s; }
#notesPanel.chat-panel:hover { background: rgba(2, 12, 24, 0.5); }
#notesPanel.chat-panel .notes-body { border-top-color: rgba(98, 227, 234, 0.1); }
#notesPanel .chat .msg { background: rgba(0, 0, 0, 0.18); }
#notesPanel .chat .gift, .coll-notes .gift { color: var(--accent); font-size: 11px; margin-top: 2px; }
#notesPanel .chat .opened, .coll-notes .opened { color: var(--muted); font-size: 11px; font-style: italic; margin-top: 2px; }
#notesPanel .chat li.cmd { font-family: inherit; white-space: pre-wrap; text-align: left; color: #c4f36e; background: rgba(196, 243, 110, 0.06); border-radius: 4px; padding: 3px 6px; }
#notesPanel .chat li.cmd.err { color: #ff9f9f; background: rgba(255, 107, 107, 0.08); }
#notesPanel .chat li.cmd.mine-cmd { color: var(--accent2); background: none; text-align: right; }
.chat-input { display: flex; gap: 4px; align-items: flex-end; border: 1px solid rgba(98, 227, 234, 0.15); border-radius: 6px; padding: 3px; background: rgba(0, 0, 0, 0.15); transition: background 0.2s, border-color 0.2s, box-shadow 0.2s; }
.chat-input:hover, .chat-input:focus-within { background: rgba(4, 22, 40, 0.85); border-color: var(--accent2); box-shadow: 0 0 12px rgba(98, 227, 234, 0.2); }
.chat-input textarea { flex: 1; background: transparent; border: 0; resize: none; font-size: 12px; min-height: 22px; max-height: 90px; color: var(--text); outline: none; }
.chat-input .icon { background: none; border: 0; cursor: pointer; font-size: 14px; padding: 2px 4px; opacity: 0.7; }
.chat-input .icon:hover { opacity: 1; }
.chat-gift { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; padding: 6px; border: 1px dashed rgba(255, 224, 102, 0.4); border-radius: 6px; font-size: 12px; background: rgba(0, 0, 0, 0.3); }
.chat-gift input.num { width: 70px; }
.chat-gift select, .chat-gift input { font-size: 12px; }
#notesForm .row { margin-top: 2px; }
/* moving panels by their header */
.drag-handle { cursor: grab; }
.dragging { opacity: 0.85; transition: none !important; }
.dragging .drag-handle { cursor: grabbing; }
body.mobile .drag-handle { cursor: default; }
/* collection: notes */
.coll-notes { max-height: 60vh; overflow-y: auto; }
#collectionTabs { margin-bottom: 6px; }
.scroll-extra { margin-top: 8px; color: var(--accent); font-size: 13px; }
/* evolution numbers, companions from events */
.evo-stats li { font-size: 11px; }
.card.event-comp { border-style: dashed; }

/* the legend hunt: the room's shared health bar */
#huntBar { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 8; width: min(420px, calc(100vw - 24px)); padding: 8px 12px; border-color: #ff6060; box-shadow: 0 0 26px rgba(255, 96, 96, 0.35); text-align: center; }
#huntBar .hb-head { display: flex; justify-content: space-between; color: #ff8080; letter-spacing: 2px; font-size: 13px; }
#huntBar .hb-bar { position: relative; box-sizing: border-box; height: 18px; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.5); border: 1px solid #ff6060; border-radius: 4px; margin: 5px 0; overflow: hidden; }
#huntBar .hb-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #ff3030, #ffb347); transition: width 0.25s; }
#huntBar .hb-bar span { position: relative; z-index: 1; font-size: 11px; line-height: 1; color: #fff; text-shadow: 0 0 3px #000, 0 0 2px #000; }
#huntTop { color: var(--accent); min-height: 1em; }
body.mobile #huntBar { top: calc(var(--top-h) + 30px); }
body.in-grotto #huntBar { display: none !important; }
/* the legend's blessing button */
.btn.bless { background: linear-gradient(90deg, #ffd84a, #ffb347); color: #2a1a00; animation: grottoBlink 1.6s ease-in-out infinite; }
.btn.bless:disabled { animation: none; opacity: 0.6; }
/* bottle stories */
.scroll-chain { list-style: none; margin: 8px 0 0; padding: 0; text-align: left; }
.scroll-chain li { padding: 2px 0; border-top: 1px dashed rgba(0, 0, 0, 0.15); }
.scroll-chain-form { margin-top: 10px; }
.scroll-chain-form .row { gap: 6px; }
.scroll-chain-form input { flex: 1; }
.chain-line { font-size: 12px; padding-left: 8px; border-left: 2px solid rgba(98, 227, 234, 0.4); margin-top: 2px; }
#notesList li.can-chain { cursor: pointer; }
#notesList li.can-chain:hover { background: rgba(98, 227, 234, 0.08); }

/* bottle votes, anonymous toggle */
.scroll-vote { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; }
.scroll-vote .vote-btn { background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 18px; padding: 3px 12px; font-size: 16px; cursor: pointer; opacity: 0.7; transition: transform 0.15s, opacity 0.15s; }
.scroll-vote .vote-btn:hover { opacity: 1; transform: scale(1.1); }
.scroll-vote .vote-btn.on { opacity: 1; border-color: #ffd36a; background: rgba(255, 211, 106, 0.25); }
#notesAnonBtn { opacity: 0.45; }
#notesAnonBtn.on { opacity: 1; filter: drop-shadow(0 0 4px #c9a0ff); }
.chat li.can-open, #collectionNotes li.can-open { cursor: pointer; }

/* bottle chat: tabs, options under the input */
.chat-tabs { display: flex; gap: 4px; margin: 6px 0 4px; }
.chat-tabs button { flex: 1; background: rgba(0, 0, 0, 0.2); border: 1px solid rgba(98, 227, 234, 0.15); border-radius: 5px; color: var(--muted); font: inherit; font-size: 11px; padding: 3px 6px; cursor: pointer; }
.chat-tabs button.active { color: var(--accent2); border-color: var(--accent2); background: rgba(98, 227, 234, 0.1); }
.chat-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; font-size: 11px; color: var(--muted); }
.chat-opts label.check { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap; }
.chat-opts label.check input { margin: 0; }
.chat-opts #ngSign { flex: 1; min-width: 90px; font-size: 11px; padding: 2px 6px; background: rgba(0, 0, 0, 0.2); border: 1px solid rgba(98, 227, 234, 0.15); border-radius: 4px; color: var(--text); }
.card-likes { color: #ffd36a; margin-top: 2px; }
.chat .from { flex-wrap: wrap; }
/* the input stays one line while empty: the hint is cut with "..." instead of a scrollbar */
#notesInput { overflow-y: hidden; }
#notesInput::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* online / offline */
.net-badge { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 30; padding: 3px 10px; border-radius: 12px; font-size: 11px; letter-spacing: 0.5px; background: rgba(0, 0, 0, 0.55); color: #8fe3a0; border: 1px solid rgba(143, 227, 160, 0.4); pointer-events: auto; cursor: default; white-space: nowrap; }
.net-badge.off { color: #ffb4a0; border-color: rgba(255, 120, 90, 0.6); background: rgba(40, 6, 0, 0.75); cursor: pointer; animation: netPulse 2.4s ease-in-out infinite; }
@keyframes netPulse { 50% { box-shadow: 0 0 12px rgba(255, 120, 90, 0.45); } }
.net-banner { position: fixed; top: 34px; left: 50%; transform: translateX(-50%); z-index: 30; width: min(560px, calc(100vw - 24px)); display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; background: rgba(30, 8, 2, 0.92); border: 1px solid rgba(255, 120, 90, 0.6); color: #ffd9cf; font-size: 12px; line-height: 1.4; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5); }
.net-banner .nb-text { flex: 1; }
.net-banner .nb-close { background: none; border: 0; color: inherit; font-size: 16px; cursor: pointer; }
.offline-login { margin-top: 10px; padding: 8px; border: 1px dashed rgba(255, 120, 90, 0.5); border-radius: 6px; display: flex; flex-direction: column; gap: 6px; }
body.wallpaper .net-badge, body.wallpaper .net-banner { display: none !important; }
body.mobile .net-badge { top: calc(var(--top-h, 44px) + 6px); }
body.mobile .net-banner { top: calc(var(--top-h, 44px) + 32px); }
.net-banner { width: auto; max-width: min(560px, calc(100vw - 24px)); align-items: center; padding: 6px 10px; }

/* progressive unlocks */
.locked-feature { display: none !important; }
.spotlight { position: relative; z-index: 40 !important; animation: spotPulse 1.1s ease-in-out infinite; outline: 2px solid #62e3ea; outline-offset: 3px; border-radius: 8px; }
@keyframes spotPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(98, 227, 234, 0.75); } 50% { box-shadow: 0 0 0 10px rgba(98, 227, 234, 0); } }

/* encyclopedia of the ocean */
.codex-box { max-width: 860px; }
.cx-progress { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.cx-progress .bar { flex: 1; height: 10px; background: rgba(0, 0, 0, 0.4); border-radius: 5px; overflow: hidden; }
.cx-progress .bar i { display: block; height: 100%; background: linear-gradient(90deg, #62e3ea, #c4f36e); transition: width 0.4s; }
.cx-pct { font-weight: bold; color: #c4f36e; min-width: 42px; text-align: right; }
.cx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; max-height: 58vh; overflow: auto; margin-top: 8px; }
.cx-card { background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); border-radius: 6px; padding: 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 86px; justify-content: center; }
.cx-card canvas { max-width: 100%; image-rendering: pixelated; }
.cx-card.unseen { opacity: 0.45; border-style: dashed; }
.cx-icon { font-size: 26px; color: var(--accent2); font-weight: bold; }
.cx-name { font-size: 11px; text-align: center; }
/* invite and support */
.invite-box, .support-box { max-width: 460px; }
.iv-link { gap: 6px; flex-wrap: wrap; }
.iv-link input { flex: 1; min-width: 180px; font-size: 12px; }
.sp-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sp-links a { text-decoration: none; }

/* phone: pointers to bottles / events out of view */
#mPointers { position: fixed; inset: 0; pointer-events: none; z-index: 7; }
body:not(.mobile) #mPointers, body.in-grotto #mPointers { display: none; }
.m-pin { position: fixed; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%; pointer-events: auto; border: 2px solid #ffd36a; background: rgba(10, 30, 50, 0.85); color: #ffe9a0; font-size: 20px; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 14px rgba(255, 211, 106, 0.5); animation: pinPulse 1.4s ease-in-out infinite; padding: 0; }
.m-pin b { font-weight: bold; line-height: 1; }
.m-pin i { position: absolute; inset: -9px; pointer-events: none; }
.m-pin i::after { content: ''; position: absolute; right: -2px; top: 50%; margin-top: -6px; border: 6px solid transparent; border-left: 9px solid #ffd36a; }
.m-pin.pin-event { border-color: #62e3ea; color: #62e3ea; box-shadow: 0 0 14px rgba(98, 227, 234, 0.5); }
.m-pin.pin-event i::after { border-left-color: #62e3ea; }
.m-pin.pin-osya { border-color: #8fd0ff; animation: none; opacity: 0.85; }
.m-pin.pin-osya i::after { border-left-color: #8fd0ff; }
@keyframes pinPulse { 50% { transform: translate(-50%, -50%) scale(1.12); } }
/* pointers: ASCII icons in the game's font instead of emoji */
.m-pin { width: auto; min-width: 44px; height: 32px; border-radius: 16px; padding: 0 8px; font-family: "JetBrains Mono", monospace; font-size: 15px; letter-spacing: -0.5px; }
.m-pin b { font-weight: bold; white-space: nowrap; }
.m-pin s { text-decoration: none; }
.m-pin i { inset: -8px -10px; }
.pa-glass { color: #5ed66f; } .pa-cork { color: #b07a45; }
.pa-ev { color: #62e3ea; }
.pa-osya { color: #62e3ea; } .pa-eye { color: #ffffff; }

/* v11: collection sets and the season pass */
.coll-sets { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.set-row { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: rgba(0, 0, 0, 0.2); }
.set-row.done { border-color: #ffd84a; background: rgba(255, 216, 74, 0.08); }
.set-head { display: flex; justify-content: space-between; color: var(--accent2); }
.set-items .got { color: #c4f36e; } .set-items .miss { color: var(--muted); }
.pass-title { margin: 4px 0; color: #62e3ea; }
.pass-top .bar { height: 8px; background: rgba(0, 0, 0, 0.4); border-radius: 4px; overflow: hidden; margin: 4px 0 8px; }
.pass-top .bar i { display: block; height: 100%; background: linear-gradient(90deg, #62e3ea, #ffd84a); }
.pass-list { display: flex; flex-direction: column; gap: 4px; max-height: 52vh; overflow: auto; }
.pass-step { display: grid; grid-template-columns: 32px 1fr auto auto; gap: 8px; align-items: center; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line); opacity: 0.6; }
.pass-step.open { opacity: 1; border-color: #ffd84a; }
.pass-step.claimed { opacity: 0.8; border-color: rgba(196, 243, 110, 0.5); }
.pass-step.big .ps-r { color: #ffd84a; font-weight: bold; }
.ps-n { font-weight: bold; color: var(--accent2); text-align: center; }

/* v12: the festival bar and postcards */
#festBar { position: fixed; top: 6px; left: 50%; transform: translateX(-50%); z-index: 9; width: min(420px, calc(100vw - 300px)); min-width: 220px; height: 20px; border-radius: 10px; overflow: hidden; background: rgba(4, 16, 28, 0.8); border: 1px solid rgba(255, 216, 74, 0.5); cursor: pointer; font-size: 11px; }
#festBar .fb-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, rgba(255, 112, 160, 0.55), rgba(255, 216, 74, 0.6)); transition: width 0.6s; }
#festBar .fb-text { position: relative; display: block; text-align: center; line-height: 18px; color: #fff; text-shadow: 0 0 3px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; }
#festBar.done { border-color: #c4f36e; }
body.mobile #festBar { top: calc(var(--top-h, 44px) + 4px); width: calc(100vw - 24px); min-width: 0; }
body.in-grotto #festBar, body.wallpaper #festBar { display: none; }
.postcard-btn { margin-top: 6px; }

/* the invite window: one line per term */
.iv-text .iv-line { display: block; margin-bottom: 6px; }
