/* ═══════════════════ THE ARCHIVE — core stylesheet ═══════════════════ */

/* ── Themes ─────────────────────────────────────────────────────────── */
:root, [data-theme="fern"] {
  --chrome: #040705;        /* sidebar + top bar */
  --view: #08100c;          /* page background */
  --surface: #111e17;       /* pills, dock, cards */
  --surface-2: #16271e;     /* hover */
  --border: #1a2e23;
  --text: #f0f7f3;
  --muted: #7b9687;
  --accent: #c8f7dc;        /* mint pill */
  --accent-text: #040705;
  --particle: 150, 220, 180;
  --danger: #ff8a8a;
}
[data-theme="midnight"] {
  --chrome: #05070d; --view: #0a0e18; --surface: #121a2b; --surface-2: #18233a;
  --border: #1d2a44; --text: #eef2fb; --muted: #7c8aa8; --accent: #bcd4ff;
  --accent-text: #05070d; --particle: 150, 180, 240;
}
[data-theme="cyber"] {
  --chrome: #07040c; --view: #0e0818; --surface: #1a1029; --surface-2: #231638;
  --border: #2c1b47; --text: #f6effe; --muted: #9a85b8; --accent: #e3c6ff;
  --accent-text: #07040c; --particle: 200, 150, 255;
}
[data-theme="catppuccin"] {
  --chrome: #11111b; --view: #1e1e2e; --surface: #313244; --surface-2: #3b3c52;
  --border: #45475a; --text: #cdd6f4; --muted: #a6adc8; --accent: #a6e3a1;
  --accent-text: #11111b; --particle: 203, 166, 247;
}
[data-theme="light"] {
  --chrome: #eef1ef; --view: #fafbfa; --surface: #e6ebe8; --surface-2: #dbe2de;
  --border: #d3dbd6; --text: #142019; --muted: #5d7266; --accent: #1f5c3d;
  --accent-text: #ffffff; --particle: 40, 110, 70;
}

/* ── Base ───────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: var(--chrome); color: var(--text);
  font: 14px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
::selection { background: var(--accent); color: var(--accent-text); }
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

/* ── Layout ─────────────────────────────────────────────────────────── */
.app { display: flex; height: 100vh; }
.main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ── Sidebar ────────────────────────────────────────────────────────── */
.sidebar {
  width: 220px; flex-shrink: 0; display: flex; flex-direction: column;
  padding: 10px 10px 12px; gap: 6px; background: var(--chrome);
  transition: margin-left .22s ease, opacity .2s;
}
.app.collapsed .sidebar { margin-left: -220px; opacity: 0; pointer-events: none; }
.sidebar-brand { display: flex; align-items: center; gap: 8px; padding: 4px 8px 8px; font-weight: 700; letter-spacing: .2px; }
.new-tab-btn {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px;
  color: var(--muted); border: 1px dashed var(--border); transition: .15s;
}
.new-tab-btn:hover { color: var(--text); background: var(--surface); border-style: solid; }
.new-tab-btn .plus { font-size: 18px; line-height: 1; }

.tab-list { list-style: none; margin: 4px 0 0; padding: 0; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.tab {
  display: flex; align-items: center; gap: 9px; padding: 8px 8px 8px 11px; border-radius: 999px;
  color: var(--muted); cursor: pointer; user-select: none; transition: background .12s, color .12s;
}
.tab:hover { background: var(--surface); color: var(--text); }
.tab.active { background: var(--accent); color: var(--accent-text); font-weight: 700; }
.tab .tab-ico { width: 16px; height: 16px; flex-shrink: 0; display: grid; place-items: center; font-size: 13px; border-radius: 4px; overflow: hidden; }
.tab .tab-ico img { width: 16px; height: 16px; }
.tab .tab-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab .tab-close { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; opacity: 0; font-size: 15px; }
.tab:hover .tab-close, .tab.active .tab-close { opacity: .75; }
.tab .tab-close:hover { opacity: 1; background: rgba(0,0,0,.12); }
.tab.loading .tab-ico { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.quick-nav { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--border); padding-top: 8px; }
.quick-nav button { display: flex; align-items: center; gap: 10px; padding: 7px 11px; border-radius: 10px; color: var(--muted); text-align: left; }
.quick-nav button:hover { background: var(--surface); color: var(--text); }
.quick-nav button.on { color: var(--text); background: var(--surface); }
.quick-nav .ico { width: 16px; text-align: center; }

/* ── Top bar ────────────────────────────────────────────────────────── */
.topbar { height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 10px 0 4px; position: relative; flex-shrink: 0; }
.tb-left, .tb-right { display: flex; align-items: center; gap: 2px; flex: 1; }
.tb-right { justify-content: flex-end; }
.icon-btn { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); font-size: 16px; }
.icon-btn:hover { background: var(--surface); color: var(--text); }
.icon-btn.on { color: var(--accent); }
.omnibox {
  flex: 0 1 640px; height: 32px; display: flex; align-items: center; gap: 8px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
}
.omnibox:focus-within { border-color: var(--muted); }
.omni-icon { color: var(--muted); font-size: 13px; }
.omnibox input { flex: 1; background: none; border: 0; outline: none; text-align: center; font-size: 13px; }
.omnibox input:focus { text-align: left; }
.status-pill { display: flex; align-items: center; gap: 6px; margin-left: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; color: var(--muted); white-space: nowrap; }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: #e8c46a; }
.status-pill.ok i { background: #6ee7a0; box-shadow: 0 0 8px #6ee7a0; }
.status-pill.local i { background: #8fb3ff; }
.status-pill b { font-weight: 600; }

.menu {
  position: absolute; right: 10px; top: 44px; z-index: 50; width: 260px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
}
.menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; }
.menu button:hover { background: var(--surface-2); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.menu-label { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); padding: 4px 10px; }
.bookmark-list { max-height: 220px; overflow-y: auto; }
.bookmark-list .empty { color: var(--muted); padding: 4px 10px 8px; font-size: 12px; }
.bookmark-list .bm { display: flex; align-items: center; }
.bookmark-list .bm button:first-child { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bookmark-list .bm button:last-child { width: 28px; text-align: center; color: var(--muted); }

/* ── Viewport ───────────────────────────────────────────────────────── */
.viewport {
  flex: 1; margin: 0 10px 10px 0; border-radius: 14px; overflow: hidden; position: relative;
  background: var(--view); border: 1px solid var(--border);
}
.app.collapsed .viewport { margin-left: 10px; }
.pane { position: absolute; inset: 0; display: none; }
.pane.active { display: block; }
.pane iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.pane.internal { overflow-y: auto; }
.pane.local-game iframe { background: #000; }

/* ── Generic page bits ──────────────────────────────────────────────── */
.page { max-width: 1180px; margin: 0 auto; padding: 28px 28px 60px; }
.page h1 { font-size: 28px; margin: 0; letter-spacing: -.3px; }
.page h2 { font-size: 17px; margin: 28px 0 10px; }
.pill-btn {
  padding: 8px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font-weight: 600; transition: .12s;
}
.pill-btn:hover { background: var(--surface-2); }
.pill-btn.primary, .pill-btn.on { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.field {
  width: 100%; padding: 10px 14px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border); outline: none;
}
.field:focus { border-color: var(--muted); }
.muted { color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px; }

/* ── Home ───────────────────────────────────────────────────────────── */
.home { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.home canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.home-center { position: relative; z-index: 1; width: min(92%, 680px); display: flex; flex-direction: column; align-items: center; gap: 22px; margin-top: -40px; }
.logo { display: flex; align-items: center; gap: 14px; user-select: none; }
.logo svg { width: 54px; height: 54px; filter: drop-shadow(0 6px 24px rgba(var(--particle), .25)); }
.logo .word { font-size: 44px; font-weight: 800; letter-spacing: -1.4px; line-height: 1; }
.logo .word span { color: var(--accent); }
[data-theme="light"] .logo .word span { color: var(--accent); }
.logo .tag { font-size: 12px; color: var(--muted); letter-spacing: 3px; text-transform: uppercase; margin-top: 6px; }
.hero-search {
  width: 100%; max-width: 580px; height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 6px 0 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
}
.hero-search:focus-within { border-color: var(--muted); }
.hero-search input { flex: 1; background: none; border: 0; outline: none; font-size: 15px; }
.hero-search .mag { color: var(--muted); }
.hero-search button { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-size: 18px; font-weight: 700; }
.dock {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); flex-wrap: wrap; justify-content: center;
}
.dock-item {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: var(--surface-2); font-size: 14px; font-weight: 700; transition: transform .15s;
}
.dock-item:hover { transform: translateY(-3px) scale(1.08); }
.dock-item img { width: 20px; height: 20px; border-radius: 4px; }
.dock-item .x { position: absolute; top: -5px; right: -5px; width: 16px; height: 16px; border-radius: 50%; background: var(--danger); color: #000; font-size: 11px; display: none; place-items: center; }
.dock.editing .dock-item .x { display: grid; }
.dock.editing .dock-item { animation: wiggle .35s ease-in-out infinite alternate; }
@keyframes wiggle { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
.dock-divider { width: 1px; height: 24px; background: var(--border); margin: 0 2px; }
.dock-tip { position: absolute; bottom: -26px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; opacity: 0; pointer-events: none; transition: .15s; }
.dock-item:hover .dock-tip { opacity: 1; }
.home-foot { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 12px; z-index: 1; }

/* ── Games ──────────────────────────────────────────────────────────── */
.games-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.games-head .actions { display: flex; gap: 8px; }
.search-row { display: flex; align-items: center; gap: 10px; padding: 0 8px 0 16px; height: 46px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; }
.search-row input { flex: 1; background: none; border: 0; outline: none; font-size: 14px; }
.search-row .dice { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); font-size: 18px; }
.search-row .dice:hover { background: var(--surface-2); color: var(--text); }
.banner {
  display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px 12px 16px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(var(--particle), .12), rgba(var(--particle), .03)); border: 1px solid var(--border);
}
.banner p { margin: 0; flex: 1; }
.banner button { width: 26px; height: 26px; border-radius: 50%; color: var(--muted); }
.banner button:hover { background: var(--surface-2); color: var(--text); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 14px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.seg button { padding: 8px; border-radius: 999px; color: var(--muted); font-weight: 600; }
.seg button.on { background: var(--accent); color: var(--accent-text); }
.filters { display: flex; gap: 8px; margin: 14px 0 20px; flex-wrap: wrap; }
.filters button { padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-weight: 600; font-size: 13px; }
.filters button.on { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.filters .count { opacity: .7; margin-left: 4px; }
.grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px 16px; }
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 720px)  { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 480px)  { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { cursor: pointer; min-width: 0; }
.tile .art { position: relative; aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); transition: transform .18s ease, box-shadow .18s; }
.tile:hover .art { transform: scale(1.03); box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.tile .art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .fav { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; opacity: 0; transition: .15s; backdrop-filter: blur(4px); }
.tile:hover .fav, .tile .fav.on { opacity: 1; }
.tile .fav.on { color: #ffd76a; }
.tile .badge { position: absolute; left: 8px; top: 8px; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; text-transform: uppercase; letter-spacing: .5px; }
.tile .name { margin-top: 8px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-state { grid-column: 1 / -1; padding: 50px 0; text-align: center; color: var(--muted); }

/* ── AI ─────────────────────────────────────────────────────────────── */
.ai { display: flex; flex-direction: column; height: 100%; max-width: 860px; margin: 0 auto; padding: 20px 24px; }
.ai-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-log { flex: 1; overflow-y: auto; padding: 18px 0; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 82%; padding: 11px 15px; border-radius: 16px; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-text); border-bottom-right-radius: 5px; }
.msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.msg.err { border-color: var(--danger); color: var(--danger); }
.msg code { background: rgba(0,0,0,.3); padding: 1px 5px; border-radius: 5px; font-size: 13px; }
.msg pre { background: rgba(0,0,0,.35); padding: 10px; border-radius: 10px; overflow-x: auto; white-space: pre; }
.ai-input { display: flex; gap: 8px; align-items: flex-end; }
.ai-input textarea { flex: 1; resize: none; min-height: 48px; max-height: 180px; padding: 13px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); outline: none; }
.ai-input button { height: 48px; padding: 0 20px; }
.ai-config { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.ai-config .full { grid-column: 1 / -1; }

/* ── Music ──────────────────────────────────────────────────────────── */
.music-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.music-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); text-align: left; transition: .15s; }
.music-card:hover { transform: translateY(-2px); background: var(--surface-2); }
.music-card .disc { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.drop { margin-top: 10px; padding: 26px; border: 2px dashed var(--border); border-radius: 16px; text-align: center; color: var(--muted); cursor: pointer; }
.drop.over { border-color: var(--accent); color: var(--text); }
.playlist { list-style: none; padding: 0; margin: 14px 0 0; }
.playlist li { display: flex; justify-content: space-between; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.playlist li:hover { background: var(--surface); }
.playlist li.on { background: var(--accent); color: var(--accent-text); font-weight: 700; }
audio { width: 100%; margin-top: 12px; }

/* ── Settings ───────────────────────────────────────────────────────── */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; margin-top: 20px; }
.settings-grid .card h3 { margin: 0 0 4px; font-size: 15px; }
.settings-grid .card p.desc { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; margin: 8px 0; flex-wrap: wrap; }
.row label { flex: 1; min-width: 120px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); font-size: 13px; }
.chips button.on { background: var(--accent); color: var(--accent-text); border-color: transparent; font-weight: 700; }
select.field { appearance: none; cursor: pointer; }
.switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); transition: .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(17px); background: var(--accent-text); }
.server-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.server { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); cursor: pointer; border: 1px solid transparent; font-size: 13px; }
.server.on { border-color: var(--accent); }
.server .url { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, monospace; }
.server .ms { font-weight: 700; }
.ms.good { color: #6ee7a0; } .ms.ok { color: #e8c46a; } .ms.bad { color: var(--danger); }

/* ── Leaderboards ───────────────────────────────────────────────────── */
.lb-table { width: 100%; border-collapse: collapse; }
.lb-table th, .lb-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.lb-table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.lb-table td.rank { width: 50px; font-weight: 800; color: var(--accent); }

/* ── Toast ──────────────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 10px 18px; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-weight: 600;
  transition: .25s; z-index: 100; box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Error page inside a tab ───────────────────────────────────────── */
.error-page { height: 100%; display: grid; place-items: center; text-align: center; padding: 30px; }
.error-page .card { max-width: 520px; }
.error-page h2 { margin-top: 0; }

@media (max-width: 760px) {
  .sidebar { position: fixed; z-index: 60; height: 100%; box-shadow: 10px 0 40px rgba(0,0,0,.5); }
  .viewport { margin-left: 10px; }
  .status-pill b { display: none; }
  .logo .word { font-size: 32px; }
}

/* ── Dupey AI ───────────────────────────────────────────────────────── */
.dupey-brand { display: flex; align-items: center; gap: 12px; }
.dupey-brand h1 { font-size: 22px; margin: 0 0 4px; }
.dupey-avatar {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-text); font-weight: 900; font-size: 20px;
  box-shadow: 0 6px 20px rgba(var(--particle), .25);
}
.dupey-pill { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.dupey-pill:hover { color: var(--text); }
.dupey-pill i { width: 8px; height: 8px; border-radius: 50%; background: #e8c46a; box-shadow: 0 0 8px currentColor; }
.dupey-pill.bad { border-color: var(--danger); }
.dupey-status { margin-top: 12px; }
.dupey-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.dupey-stats div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dupey-stats span { font-size: 11px; }
.dupey-stats b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
@media (max-width: 720px) { .dupey-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dupey-prov { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; font-size: 13px; border: 1px solid transparent; }
.dupey-prov.on { border-color: var(--accent); background: rgba(var(--particle), .06); }
.dupey-prov i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dupey-prov .n { flex: 1; }
.dupey-prov em { font-style: normal; font-size: 11px; color: var(--accent); margin-left: 6px; }
.dupey-prov .s { max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.dupey-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.dupey-suggest .pill-btn { font-weight: 500; font-size: 13px; padding: 7px 14px; }
.msg.typing { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

/* ── Game player ────────────────────────────────────────────────────── */
.player { position: absolute; inset: 0; display: flex; flex-direction: column; background: #000; }
.player-bar { display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 14px; background: var(--chrome); border-bottom: 1px solid var(--border); flex-shrink: 0; font-size: 13px; }
.player-bar button { padding: 5px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; font-size: 12.5px; }
.player-bar button:hover { background: var(--surface-2); }
.pl-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30%; }
.pl-fps { font-family: ui-monospace, monospace; font-size: 12px; color: var(--muted); padding: 2px 8px; border-radius: 999px; background: var(--surface); }
.pl-fps.good { color: #6ee7a0; } .pl-fps.ok { color: #e8c46a; } .pl-fps.bad { color: var(--danger); }
.pl-lag { display: inline-flex; align-items: center; gap: 6px; color: var(--danger); font-weight: 700; animation: pulse 1.2s ease-in-out infinite; }
.pl-lag button { border-color: var(--danger); color: var(--danger); }
.pl-spacer { flex: 1; }
.pl-lic { color: var(--muted); cursor: help; padding: 0 4px; }
.player-stage { position: relative; flex: 1; min-height: 0; background: #000; }
.player-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.player-stage .error-page { position: absolute; inset: 0; background: var(--view); }
.fs-bar { display: none; }
.player-stage:fullscreen .fs-bar {
  display: flex; position: absolute; z-index: 5; top: 0; left: 50%; transform: translate(-50%, -100%); gap: 8px; align-items: center;
  padding: 8px 12px; border-radius: 0 0 14px 14px; background: rgba(4, 7, 5, .88); color: #f0f7f3; transition: transform .2s;
  font-size: 13px; backdrop-filter: blur(6px);
}
.player-stage:fullscreen .fs-bar:hover, .player-stage:fullscreen .fs-bar:focus-within { transform: translate(-50%, 0); }
.player-stage:fullscreen .fs-bar::after { content: ""; position: absolute; left: -40px; right: -40px; bottom: -18px; height: 18px; }
.fs-bar button { padding: 4px 10px; border-radius: 999px; background: #111e17; border: 1px solid #1a2e23; color: #f0f7f3; font-size: 12px; }
.tile .rm { position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; opacity: 0; transition: .15s; }
.tile:hover .rm { opacity: 1; }
.add-game { margin-bottom: 16px; }

/* ── Accounts ───────────────────────────────────────────────────────── */
.small { font-size: 12px; }
.dim { opacity: .55; }
.avatar { border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--accent); color: var(--accent-text); font-weight: 800; flex-shrink: 0; }
.auth-card { max-width: 440px; margin: 30px auto; padding: 26px; }
.oauth-list { display: flex; flex-direction: column; gap: 8px; }
.oauth-btn { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-weight: 600; transition: .12s; }
.oauth-btn:hover { border-color: var(--muted); transform: translateY(-1px); }
.g { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: #0b0b0b; font-weight: 900; font-size: 13px; flex-shrink: 0; }
.or { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; color: var(--muted); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.tabs2 { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); margin-bottom: 12px; }
.tabs2 button { flex: 1; padding: 7px; border-radius: 999px; color: var(--muted); font-weight: 600; }
.tabs2 button.on { background: var(--accent); color: var(--accent-text); }
.account-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.account-grid .card h3 { margin: 0 0 6px; font-size: 15px; }
.admin-card.is-admin { border-color: var(--accent); }
.ok-line { color: #6ee7a0; font-weight: 700; margin: 4px 0 12px; }
.link-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.link-row:first-child { border-top: 0; }
.code-form { padding: 8px 0; }
.req-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.badge2 { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.badge2.pending { color: #e8c46a; } .badge2.approved { color: #6ee7a0; } .badge2.rejected { color: var(--danger); }
.pill-btn.danger { background: var(--danger); color: #1a0000; border-color: transparent; }
a.pill-btn { text-decoration: none; display: inline-block; }
.account-chip { margin-top: 4px; border-top: 1px solid var(--border); border-radius: 0 0 10px 10px !important; padding-top: 10px !important; }
.account-chip .av { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; font-size: 11px; font-weight: 800; }
.account-chip.signed .av { background: var(--accent); color: var(--accent-text); }
.account-chip .av img { width: 100%; height: 100%; object-fit: cover; }
.account-chip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .badge.feat { background: var(--accent); color: var(--accent-text); }

/* ── Announcements ──────────────────────────────────────────────────── */
.announce { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-radius: 14px; margin: 14px 0 0; border: 1px solid var(--border); background: var(--surface); border-left: 4px solid #8fb3ff; }
.announce .txt { flex: 1; min-width: 0; }
.announce.success { border-left-color: #6ee7a0; } .announce.warning { border-left-color: #e8c46a; } .announce.danger { border-left-color: var(--danger); }
.announce .go { padding: 5px 12px; }
.announce .x { width: 26px; height: 26px; border-radius: 50%; color: var(--muted); }
.announce .x:hover { background: var(--surface-2); color: var(--text); }
.home-ann { width: 100%; max-width: 580px; }
.home-ann .announce { margin: 0 0 6px; background: rgba(0,0,0,.35); backdrop-filter: blur(6px); }
.banner.warn { border-color: #e8c46a; }

/* ── Admin ──────────────────────────────────────────────────────────── */
.admin-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.admin-tabs button { padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-weight: 600; }
.admin-tabs button.on { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.stat span { color: var(--muted); font-size: 12px; } .stat b { font-size: 26px; }
.admin-form { margin-bottom: 16px; }
.admin-form h3 { margin: 0 0 4px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.form-grid label, .ai-config label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.form-grid .span2 { grid-column: span 2; }
@media (max-width: 600px) { .form-grid .span2 { grid-column: auto; } }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.admin-table th { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; }
.admin-table td .muted { word-break: break-all; }
.acts { white-space: nowrap; text-align: right; }
.acts .pill-btn { padding: 5px 11px; font-size: 12px; margin-left: 4px; }
.ann { display: flex; gap: 12px; padding: 12px 14px; margin-bottom: 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid #8fb3ff; }
.ann.success { border-left-color: #6ee7a0; } .ann.warning { border-left-color: #e8c46a; } .ann.danger { border-left-color: var(--danger); }
.req-card { margin-bottom: 10px; }
.lb-sub { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 10px 0 2px; }

/* Preview demo label (claude.ai preview only) */
.demo-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 10px 6px 0; padding: 6px 12px; border-radius: 10px; background: rgba(232, 196, 106, .12); border: 1px solid rgba(232, 196, 106, .4); color: var(--text); font-size: 12.5px; }
.demo-bar button { margin-left: auto; padding: 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; }
