/* BoundBlox, licensed by Project O1. Flat: greyish black, greys and white,
   Arial like Roblox's own UI, and a slow oil-paint background (oil.js) behind
   everything outside the game. */

:root {
  --bg: #111113;
  --bg-2: rgba(22, 22, 24, 0.94);
  --surface: rgba(30, 30, 33, 0.92);
  --surface-2: #2a2a2e;
  --surface-3: #3a3a3f;
  --line: #2c2c30;
  --text: #ffffff;
  --muted: #b9b9be;
  --faint: #8a8a90;
  --blue: #ffffff;          /* the accent: white (kept under its old name) */
  --blue-hover: #e4e4e7;
  --on-accent: #111113;
  --link: #ffffff;
  --green: #ffffff;
  --green-hover: #e4e4e7;
  --danger: #ff8a8a;
  --good: #63d69b;
  --radius: 8px;
  --top: 56px;
  --side: 220px;
  --font: "Builder Sans", Arial, Helvetica, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.i { display: inline-flex; }
.icon { width: 22px; height: 22px; flex: none; }
.icon-sm { width: 18px; height: 18px; flex: none; }
.icon-xs { width: 14px; height: 14px; flex: none; }
.icon-lg { width: 28px; height: 28px; flex: none; }

/* ---- Boot (before the app script runs) ---------------------------------------------- */
#boot { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
#boot.boot-failed { align-content: center; gap: 12px; padding: 16px; text-align: center; color: var(--text); }
#boot.boot-failed h1 { font-size: 20px; }
#boot.boot-failed p { color: var(--muted); max-width: 46ch; }
#boot.boot-failed button { justify-self: center; padding: 9px 18px; border: 0; border-radius: var(--radius); background: var(--blue); color: var(--on-accent); font-weight: 600; }

/* ---- Buttons ----------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 16px; border: 0; border-radius: var(--radius);
  font-weight: 600; white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--blue); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--blue-hover); }
.btn-secondary { background: var(--surface-2); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-3); }
.btn-sm { min-height: 32px; padding: 0 14px; font-size: 14px; }
.btn-wide { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: var(--radius);
  background: transparent; color: var(--text);
}
.icon-btn:hover { background: var(--surface-2); }
.round {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--text);
}
.round:hover { background: var(--surface-3); }
.round .icon { width: 18px; height: 18px; }
.link-btn { border: 0; background: none; color: var(--link); font-weight: 600; padding: 4px 0; justify-self: start; }
.link-btn:hover { text-decoration: underline; }

/* ---- Shell layout ---------------------------------------------------------------- */
#app { min-height: 100vh; }
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 30; height: var(--top);
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: var(--bg-2); border-bottom: 1px solid var(--line);
}

.tabs { display: flex; gap: 2px; flex: none; }
.tabs a { padding: 7px 12px; border-radius: var(--radius); color: var(--muted); font-weight: 600; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current] { color: var(--text); background: var(--surface-2); }
.search { position: relative; flex: 1; max-width: 520px; margin: 0 auto; }
.search input {
  width: 100%; height: 36px; padding: 0 12px 0 38px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); outline: none;
}
.search input::placeholder { color: var(--faint); }
.search input:focus { border-color: var(--muted); }
.search-icon { position: absolute; left: 10px; top: 7px; color: var(--faint); pointer-events: none; }
.account { flex: none; display: flex; justify-content: flex-end; min-width: 80px; }

.chip-wrap { position: relative; }
.chip { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 4px; border: 0; border-radius: var(--radius); background: none; font-weight: 600; }
.chip:hover { background: var(--surface-2); }
.chip-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); object-fit: cover; flex: none; }
.avatar.big { width: 72px; height: 72px; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); width: 230px; padding: 6px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.menu-head { display: flex; gap: 10px; align-items: center; padding: 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-head div { display: grid; min-width: 0; }
.menu-head span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 8px; border: 0; border-radius: 6px; background: none; text-align: left; }
.menu-item:hover { background: var(--surface-2); }

.content { padding: calc(var(--top) + 24px) 28px 40px; max-width: 1480px; margin: 0 auto; min-width: 0; outline: none; overflow-x: clip; }
.content h1 { font-size: 26px; font-weight: 700; line-height: 1.2; margin-bottom: 16px; }
.foot { max-width: 1480px; margin: 0 auto; padding: 0 28px 28px; color: var(--faint); font-size: 12px; }
.foot a { color: var(--link); }

/* ---- Home ----------------------------------------------------------------------------- */
.content h1.hello { font-size: 22px; margin-bottom: 20px; }
.signin-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--muted);
}

.rows { display: grid; gap: 28px; }
.rows > *, .row, .game > *, .side > * { min-width: 0; }
.row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.row-head h2 { font-size: 19px; font-weight: 700; }
.row-head h2 a { display: inline-flex; align-items: center; gap: 2px; }
.row-head h2 a:hover { text-decoration: underline; }
.row-nav { display: flex; gap: 6px; }
.scroller {
  display: grid; grid-auto-flow: column; grid-auto-columns: 158px; gap: 14px;
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
}
.scroller::-webkit-scrollbar { display: none; }
.scroller > * { scroll-snap-align: start; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px 14px; }

/* ---- Game tile ------------------------------------------------------------------------ */
.card { display: grid; gap: 5px; min-width: 0; }
.thumb { aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.2s; }
.thumb img.in { opacity: 1; }
.card:hover .thumb { transition: transform 0.12s ease; }
.card:active .thumb { transform: scale(0.97); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 140ms; }
.card-title { text-decoration: underline; }
.card-title { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; gap: 12px; color: var(--muted); font-size: 13px; }
.card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.skeleton .thumb, .skeleton .card-title, .skeleton .card-meta { background: var(--surface); border-radius: 6px; color: transparent; }
.skeleton .card-title { width: 85%; }
.skeleton .card-meta { width: 50%; }

/* ---- Game page ------------------------------------------------------------------------- */
.game { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
.media { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media-prev, .media-next { position: absolute; top: 50%; translate: 0 -50%; background: rgba(0, 0, 0, 0.6); }
.media-prev { left: 10px; }
.media-next { right: 10px; }
.dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 6px; }
.dots button { width: 8px; height: 8px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.45); }
.dots button[aria-current="true"] { background: #fff; }
.side { display: grid; gap: 12px; }
.game-title { font-size: 26px !important; margin: 0 !important; }
.by { color: var(--muted); display: flex; align-items: center; gap: 4px; }
.by strong { color: var(--text); font-weight: 600; }
.verified { color: var(--link); display: inline-flex; }
.play-row { display: flex; gap: 8px; margin-top: 4px; }
.btn-play { flex: 1; min-height: 54px; border-radius: var(--radius); background: var(--green); color: var(--on-accent); font-size: 18px; }
.pill {
  justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
  border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--muted); font-size: 13px; font-weight: 600;
}
.pill:hover { color: var(--text); border-color: var(--surface-3); }
.btn-play:hover { background: var(--green-hover); }
.fav { width: 54px; height: 54px; background: var(--surface-2); }
.fav[aria-pressed="true"] { color: #ff6b85; }
.fav[aria-pressed="true"] svg { fill: currentColor; }
.votes { display: flex; gap: 18px; color: var(--muted); }
.votes span { display: inline-flex; align-items: center; gap: 6px; }
.fine { color: var(--faint); font-size: 13px; }
.about { margin-top: 28px; display: grid; gap: 10px; max-width: 1100px; }
.about h2 { font-size: 19px; font-weight: 700; }
.desc { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); max-height: 7.3em; overflow: hidden; }
.desc.open { max-height: none; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 16px; margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.stat dt { color: var(--faint); font-size: 13px; }
.stat dd { font-weight: 600; margin-top: 2px; }
.skeleton-game .media, .skeleton-game .line, .play-skel { background: var(--surface); }
.line { height: 22px; border-radius: 6px; }
.w60 { width: 60%; height: 30px; }
.w40 { width: 40%; }
.play-skel { height: 54px; border-radius: var(--radius); }

.notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--muted); margin-bottom: 16px; }
.notice.bad { border-color: #5a2c31; background: #2a1d1f; color: #ffc9c9; }

/* ---- Responsive -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .game { grid-template-columns: 1fr; }
  .content { padding-left: 20px; padding-right: 20px; }
  .foot { padding: 0 20px 24px; }
}
/* Phones and narrow windows: search gets its own row under the bar, and the
   tabs move to a thumb-reachable bottom bar. */
@media (max-width: 760px) {
  :root { --top: 100px; }
  .topbar { flex-wrap: wrap; align-content: center; row-gap: 6px; height: var(--top); padding: 6px 12px; gap: 8px; }
  .search { order: 3; flex: 1 1 100%; max-width: none; margin: 0; }
  .topbar { justify-content: flex-end; }
  .chip-name { display: none; }
  .account { min-width: 0; }
  .tabs {
    display: flex; position: fixed; inset: auto 0 0 0; z-index: 30; justify-content: space-around; overflow: visible;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--bg-2); border-top: 1px solid var(--line);
  }
  .tabs a { flex: 1; text-align: center; }
  .content { padding: calc(var(--top) + 16px) 16px 24px; }
  .foot { padding: 0 16px 80px; }
  .scroller { grid-auto-columns: 128px; gap: 12px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 18px 12px; }
  .row-nav { display: none; }
}
body.playing .tabs { display: none; }

/* ---- Settings dialog --------------------------------------------------------------- */
.settings h1 { font-size: 22px; font-weight: 700; padding-right: 32px; }
.set-group { display: grid; gap: 8px; }
.set-group h2 { font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.seg-btn { flex: 1 1 auto; min-height: 34px; padding: 0 12px; border: 0; border-radius: 7px; background: none; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.seg-btn:hover { color: var(--text); }
.seg-btn[aria-checked="true"] { background: var(--blue); color: var(--on-accent); }
.set-toggle { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.set-toggle input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--blue); flex: none; }
.set-toggle > span { display: grid; gap: 2px; }

/* ---- Sign-in page (#/signin) ------------------------------------------------------- */
.signin-wrap { display: grid; justify-items: center; padding: 12px 0 24px; }
.signin-wrap .notice { width: min(100%, 460px); }
.modal.signin-page { box-shadow: none; }

/* ---- Embedded player Play screen (/blox/embed) --------------------------------------- */
.embed { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; overflow: hidden; background: var(--bg); }
.embed-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; filter: blur(18px) brightness(0.38); transform: scale(1.08); transition: opacity 0.3s; }
.embed-art.in { opacity: 1; }
.embed-card { position: relative; display: grid; gap: 14px; width: min(100%, 380px); padding: 18px; border-radius: 14px; background: rgba(24, 25, 27, 0.82); border: 1px solid var(--line); }
.embed-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.embed-head > div { min-width: 0; }
.embed-icon { width: 56px; height: 56px; border-radius: 12px; background: var(--surface-2); object-fit: cover; flex: none; }
.embed-icon:not([src]) { visibility: hidden; }
.embed-title { font-size: 19px; font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.embed-by { color: var(--muted); font-size: 13px; }
.embed-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.embed-credit { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; color: var(--faint); font-size: 11px; opacity: .7; pointer-events: none; }

/* ---- Slow join hint (host.js watchJoin) -------------------------------------------- */
.loading-hint { display: grid; gap: 10px; margin-top: 8px; padding: 12px; border-radius: var(--radius); background: rgba(0, 0, 0, 0.45); color: var(--muted); font-size: 14px; }
.loading-hint-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---- Sign-in dialog (signin.js) ---------------------------------------------------- */
.modal-shade { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, 0.65); overflow-y: auto; }
.modal {
  position: relative; width: min(100%, 460px); padding: 24px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: grid; gap: 14px;
}
.modal-close { position: absolute; right: 10px; top: 10px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); display: grid; place-items: center; }
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.signin h1 { font-size: 22px; font-weight: 700; padding-right: 32px; }
.signin-lead { color: var(--muted); }
.signin-form { display: grid; gap: 10px; }
.signin-form textarea {
  width: 100%; min-height: 84px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: var(--text); outline: none; resize: vertical;
  font: 12.5px/1.4 ui-monospace, Consolas, "Cascadia Mono", monospace; word-break: break-all;
}
.signin-form textarea:focus { border-color: var(--muted); }
.signin-form textarea::placeholder { color: var(--faint); }
.signin-form .btn { min-height: 42px; }
.signin-status { min-height: 1.4em; font-size: 14px; color: var(--muted); }
.signin-status.bad { color: var(--danger); }
.signin-status.good { color: var(--good); }
.how { display: grid; border-top: 1px solid var(--line); }
.how details { border-bottom: 1px solid var(--line); padding: 10px 0; font-size: 14px; }
.how summary { cursor: pointer; font-weight: 600; }
.how p, .how-steps { margin-top: 8px; color: var(--muted); }
.how-steps { padding-left: 20px; display: grid; gap: 6px; }
kbd, .how code { padding: 1px 5px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); font: 12px ui-monospace, Consolas, monospace; color: var(--text); }
.signin-warn { color: var(--faint); font-size: 13px; }
.signin-body, .qs, .cookie { display: grid; gap: 14px; }
.signin-status { display: flex; align-items: center; gap: 8px; }
.signin-status:empty { display: none; }
.signin-status.linked { color: #cdd8ff; }
.signin-switch { justify-self: center; font-size: 14px; }
.qs-main { display: flex; align-items: center; justify-content: center; gap: 20px; flex-wrap: wrap; padding: 6px 0; }
.relay-row {
  display: flex; align-items: flex-start; gap: 8px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: var(--muted); font-size: 13px; line-height: 1.4;
}
.relay-text { flex: 1; min-width: 0; }
.relay-text code {
  padding: 1px 5px; border-radius: 4px; background: var(--surface-2);
  border: 1px solid var(--line); font: 12px ui-monospace, Consolas, monospace;
  color: var(--text); white-space: nowrap;
}
.relay-dot { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: var(--faint); flex: none; }
.relay-dot.wait { background: var(--link); animation: pulse 1.1s ease-in-out infinite; }
.relay-dot.ok { background: var(--good); }
.relay-dot.off { background: #e2a33c; }
.relay-retry { justify-self: start; font-size: 13px; padding: 0; }
.qr-box { width: 156px; height: 156px; padding: 8px; border-radius: var(--radius); background: #fff; flex: none; }
.qr { width: 100%; height: 100%; image-rendering: pixelated; }
.qr:not([src]) { visibility: hidden; }
.qs-code { display: grid; justify-items: center; gap: 8px; }
.code-label { color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.code { display: flex; gap: 5px; }
.code span { display: grid; place-items: center; width: 32px; height: 42px; border-radius: 6px; background: var(--surface-2); font: 700 22px/1 ui-monospace, Consolas, monospace; }
.code span.blank { background: var(--surface-2); }
.expiry { color: var(--faint); font-size: 12px; min-height: 1em; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--link); flex: none; animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
@media (max-width: 480px) { .modal { padding: 20px 16px; } }

/* ---- Engine (the game itself) ------------------------------------------------------- */
#input-container { position: absolute; top: 0; left: -1000px; z-index: -1; }
#input-input, #input-textarea { display: none; border: 0; outline: 0; background: transparent; resize: none; }
#canvas { display: none; width: 100vw; height: 100vh; background: #000; outline: none; touch-action: none; }
body.playing { overflow: hidden; }
body.playing #app { display: none; }
body.playing #canvas { display: block; }
#canvas.tab-lock-contended { filter: blur(4px); }

#loading-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--bg); transition: opacity 0.5s ease; }
#loading-overlay.loading-exiting { opacity: 0; pointer-events: none; }
#loading-background-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; filter: blur(24px) brightness(0.35); transform: scale(1.1); }
#loading-background-image[src] { opacity: 1; }
.loading-card { position: relative; display: grid; justify-items: center; gap: 12px; max-width: min(90vw, 420px); padding: 0 16px; text-align: center; }
#loading-icon-shell { width: 128px; height: 128px; border-radius: 18px; overflow: hidden; background: var(--surface-2); }
#loading-experience-icon { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.3s; }
#loading-icon-shell.loading-image-ready #loading-experience-icon { opacity: 1; }
#loading-experience-title { font-size: 22px; font-weight: 700; }
.loading-creator { color: var(--muted); }
.loading-bar { width: 180px; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.loading-bar span { display: block; width: 40%; height: 100%; border-radius: 2px; background: var(--blue); animation: slide 1.3s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
#status { min-height: 1.3em; color: var(--muted); white-space: pre-line; }
#loading-overlay.loading-failed .loading-card { display: none; }
.loading-error-panel { position: relative; display: grid; gap: 12px; width: min(90vw, 400px); padding: 20px; border-radius: 12px; background: var(--surface); text-align: center; }
#loading-error-title { font-size: 19px; }
#loading-error-code { color: var(--faint); font-size: 13px; }
#loading-error-leave { padding: 9px 16px; border: 0; border-radius: var(--radius); background: var(--blue); color: var(--on-accent); font-weight: 600; }
#loading-cancel { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 22px; line-height: 1; }
#loading-overlay.loading-failed #loading-cancel { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Password sign-in */
.signin-tabs { margin-top: 2px; }
.signin-tabs .seg-btn[aria-selected="true"] { background: var(--blue); color: var(--on-accent); }
.signin-form input {
  width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: var(--text); font: inherit; outline: none;
}
.signin-form input:focus { border-color: var(--muted); }
.signin-form input::placeholder { color: var(--faint); }
.signin-form input:disabled { opacity: .6; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 64px; }
.pw-show { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 13px; }
.code-input { font: 600 20px/1 ui-monospace, Consolas, monospace !important; letter-spacing: .3em; text-align: center; }
.pw-methods { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; }
.pw-links { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.pw { display: grid; gap: 12px; }

/* Join errors that will be retried on another server stay invisible: the
   loading card keeps showing until a server works or the tries run out
   (host.js adds .join-error-shown then). */
body:not(.join-error-shown) #loading-overlay.loading-failed .loading-card { display: grid; }
body:not(.join-error-shown) #loading-overlay.loading-failed .loading-error-panel { display: none; }
body:not(.join-error-shown) #loading-overlay.loading-failed #loading-cancel { display: block; }

/* ---- Project O1 ------------------------------------------------------------------- */
.brand { flex: none; display: inline-flex; align-items: center; margin-right: 4px; }
.brand img { height: 34px; width: auto; }
.topbar { background: var(--bg-2); }
.tabs a[aria-current] { color: var(--on-accent); background: var(--blue); }
.link-btn, .foot a, .verified { text-decoration: underline; text-underline-offset: 2px; }
.card-title { text-decoration: none; }
.card:hover .card-title { text-decoration: underline; }

/* Credits */
.foot { display: grid; gap: 14px; padding-top: 28px; border-top: 1px solid var(--line); margin-top: 12px; }
.foot-brand { display: flex; align-items: center; gap: 14px; }
.foot-brand img { width: 72px; height: auto; }
.foot-brand p { color: var(--muted); font-size: 13px; }
.foot-title { color: var(--text) !important; font-weight: 700; font-size: 15px !important; }
.foot-fine { color: var(--faint); }
.loading-credit { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; color: var(--faint); font-size: 12px; pointer-events: none; }

/* Oil-paint background (oil.js): fixed behind the page, off while playing. */
/* Blurred and a little oversized (so the blur has no soft edges), dimmed: far away, not in your face. */
#oil { position: fixed; inset: -40px; z-index: -1; width: calc(100vw + 80px); height: calc(100vh + 80px); pointer-events: none; opacity: 0; filter: blur(14px); transition: opacity 1.2s ease; }
#oil.on { opacity: 0.8; }
body.playing #oil { display: none; }
html, body { background: var(--bg); }
body:has(#oil.on) { background: transparent; }
@media (max-width: 760px) {
  .brand { margin-right: auto; }
  .brand img { height: 30px; }
  .foot-brand img { width: 56px; }
}

/* Early-beta notice (Home) */
.beta-notice {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 14px 16px; margin-bottom: 16px; border: 1px solid var(--surface-3); border-left: 3px solid var(--text);
  border-radius: var(--radius); background: var(--surface);
}
.beta-notice p { color: var(--muted); font-size: 14px; }
.beta-notice p + p { margin-top: 4px; }
.beta-title { color: var(--text) !important; font-weight: 700; font-size: 15px !important; margin-bottom: 2px; }
@media (max-width: 760px) { .beta-notice { flex-direction: column; } }
