/* RKAID · är·ˈkād · the cloud website. The same system as the host's app (web/static/style.css):
   Night / Cabinet / Chalk / Paper / Brass; Archivo 900 headings, Inter UI, Instrument Serif
   italic asides, Press Start 2P for arcade cues only; radii 8 / 12 / 16 / 22 / pill;
   plain button = the one primary, .ghost secondary, .link quiet. */
:root {
  --night: #0F1115; --cabinet: #171A21; --raise: #1F232C; --chalk: #ECEAE4; --paper: #F4F1EA;
  --brass: #F5B841; --old-brass: #8A5A00; --ok: #5FD38D; --bad: #FF7A70; --muted: #A6A59F;
  --line: rgba(236, 234, 228, .09); --line-2: rgba(236, 234, 228, .16);
  --fill: rgba(236, 234, 228, .06); --fill-2: rgba(236, 234, 228, .11);
  --f-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --f-display: "Archivo", "Arial Black", "Helvetica Neue", "Inter", system-ui, sans-serif;
  --f-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --f-arcade: "Press Start 2P", ui-monospace, "SF Mono", Menlo, monospace;
  --f-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --r-m: 12px; --r-l: 16px; --r-xl: 22px;
  --e1: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 8px 24px rgba(0, 0, 0, .32);
  --e3: 0 1px 0 rgba(255, 255, 255, .07) inset, 0 32px 90px rgba(0, 0, 0, .65);
  --ease: cubic-bezier(.2, .8, .2, 1); --t1: .16s; --t2: .22s;
  --gutter: 32px;
  /* older names */
  --bg: var(--night); --panel: var(--cabinet); --text: var(--chalk); --accent: var(--brass); --warn: var(--brass); --radius: var(--r-l);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--night); color: var(--chalk);
  font: 15px/1.5 var(--f-ui); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
.screen { min-height: 100vh; min-height: 100dvh; }
.center { display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden;
  background: radial-gradient(900px 520px at 50% -10%, rgba(245, 184, 65, .13), transparent 62%),
    radial-gradient(700px 500px at 85% 110%, rgba(157, 184, 232, .07), transparent 60%), var(--night); }
.muted { color: var(--muted); }
.small { font-size: 13px; line-height: 1.45; }
.error { color: var(--bad); min-height: 1.3em; margin: 0; font-size: 14px; }
.error:empty { min-height: 0; }
::selection { background: rgba(245, 184, 65, .35); }

/* controls */
input, select { background: rgba(0, 0, 0, .28); color: var(--chalk); border: 1px solid var(--line-2); border-radius: var(--r-m);
  padding: 11px 14px; font: inherit; width: 100%; transition: border-color var(--t1), box-shadow var(--t1); }
input::placeholder { color: #8F8E89; }
input:hover, select:hover { border-color: rgba(236, 234, 228, .28); }
input:focus, select:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px rgba(245, 184, 65, .22); }
select { width: auto; padding: 9px 12px; border-radius: 10px; }
button, a.button { background: var(--brass); color: var(--night); border: 1px solid transparent; border-radius: var(--r-m); padding: 10px 16px;
  font: 600 14px/1.3 var(--f-ui); cursor: pointer; text-decoration: none; display: inline-block; text-align: center;
  transition: background var(--t1), color var(--t1), border-color var(--t1), transform var(--t1), box-shadow var(--t1); }
button:hover, a.button:hover { background: #FFC95C; }
button:active, a.button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
button.ghost, a.button.secondary { background: var(--fill); color: var(--chalk); border-color: var(--line-2); }
button.ghost:hover, a.button.secondary:hover { background: var(--fill-2); border-color: rgba(236, 234, 228, .26); }
button.link { background: none; border-color: transparent; color: var(--muted); padding: 8px 10px; font-weight: 500; }
button.link:hover { color: var(--bad); background: rgba(255, 122, 112, .1); }
button.danger { background: var(--bad); color: var(--night); }
button.danger:hover { background: #FF948B; }
button.switch { justify-self: center; color: var(--brass); }
button.switch:hover { color: #FFC95C; background: none; text-decoration: underline; text-underline-offset: 3px; }
.row { display: flex; gap: 10px; justify-content: flex-end; }
.card .row > * { flex: 1; min-height: 44px; font-size: 15px; }

/* cards: sign-in, questions, dialogs */
.card { position: relative; width: min(400px, 100%); background: linear-gradient(180deg, rgba(31, 35, 44, .96), rgba(23, 26, 33, .96));
  border: 1px solid var(--line-2); border-radius: var(--r-xl); padding: 32px; display: grid; gap: 12px; box-shadow: var(--e3);
  animation: rise var(--t2) var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.signin-brand { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.wordmark { font: 900 22px/1 var(--f-display); letter-spacing: -.02em; color: var(--chalk); }
.say { font: italic 17px/1 var(--f-serif); color: var(--brass); }
.card .wordmark { font-size: 30px; }
.card .say { font-size: 20px; }
.coin { font: 9px/1 var(--f-arcade); letter-spacing: .08em; color: var(--brass); margin: 0 0 8px; animation: blink 1.4s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.card h1 { margin: 0; font: 900 26px/1.12 var(--f-display); letter-spacing: -.02em; text-wrap: balance; overflow-wrap: anywhere; }
.card h3 { margin: 0; font: 900 22px/1.15 var(--f-display); letter-spacing: -.02em; }
.card h4 { margin: 16px 0 0; font: 700 12px/1.2 var(--f-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.card p { margin: 0; text-wrap: pretty; }
.card #signin-sub, .card #ask-body { color: var(--muted); margin-bottom: 8px; }
.card #ask-body { color: #D6D4CE; }
.card button[type=submit], .card #f-go { margin-top: 4px; padding: 12px 16px; font-size: 15px; }
#f-note:empty, #ask-note:empty { display: none; }
.card.wide { width: min(560px, 100%); }
/* the cloud's own message pages (Cabinet offline, not yours) */
.message h1 { font-size: 30px; }
.message p { color: #D6D4CE; }
.message a { color: var(--brass); text-underline-offset: 3px; }

/* home */
.topbar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--gutter) 18px; background: linear-gradient(var(--night) 62%, rgba(15, 17, 21, 0)); }
.brand { display: flex; align-items: baseline; gap: 8px; }
.controls { display: flex; align-items: center; gap: 12px; }
.status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(95, 211, 141, .16); flex: none; }
.status.offline .dot { background: var(--bad); box-shadow: none; }
.status.reconnecting .dot { background: var(--brass); box-shadow: none; animation: blink 1.2s ease-in-out infinite; }
#me { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; font-weight: 600; }
#me::before { content: attr(data-initial); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--paper); color: var(--night); font: 800 13px/1 var(--f-ui); }
#me:disabled { opacity: .7; }
.menu { position: absolute; right: var(--gutter); top: 60px; z-index: 3; background: rgba(27, 30, 38, .98); border: 1px solid var(--line-2);
  border-radius: var(--r-l); padding: 6px; display: grid; min-width: 220px; box-shadow: var(--e3); animation: rise var(--t1) var(--ease) both; }
.menu button { text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 10px; font-weight: 500; }
.menu button:hover { background: var(--fill-2); }

.page { max-width: 920px; margin: 0 auto; padding: 24px var(--gutter) 72px; display: grid; gap: 56px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.section-head h2 { margin: 0; font: 900 clamp(28px, 4vw, 40px)/1.05 var(--f-display); letter-spacing: -.03em; }
.section-head .aside { display: block; margin-top: 6px; font: italic 19px/1.2 var(--f-serif); color: var(--muted); letter-spacing: 0; }
#people .section-head h2 { font-size: 24px; }
.section-note { margin: 8px 0 0; }
.empty { margin-top: 20px; border: 1px dashed var(--line-2); background: var(--fill); border-radius: var(--r-xl); padding: 48px 24px; text-align: center;
  display: grid; gap: 8px; justify-items: center; }
.empty p { margin: 0; max-width: 46ch; }
.empty strong { font: 900 22px/1.15 var(--f-display); letter-spacing: -.02em; }
.notice { margin: 20px 0 0; padding: 14px 16px; border: 1px solid rgba(245, 184, 65, .35); background: rgba(245, 184, 65, .08); border-radius: var(--r-m); font-size: 14px; }

/* a Cabinet */
.servers { display: grid; gap: 12px; margin-top: 20px; }
.server { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; overflow: hidden;
  background: linear-gradient(180deg, var(--raise), var(--cabinet)); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 20px 20px 20px 24px;
  box-shadow: var(--e1); transition: border-color var(--t2), box-shadow var(--t2), transform var(--t2) var(--ease); }
.server.online { border-color: rgba(245, 184, 65, .32); }
.server.online::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brass); box-shadow: 0 0 24px rgba(245, 184, 65, .7); }
.server.online:hover { border-color: rgba(245, 184, 65, .6); box-shadow: var(--e1), 0 0 40px rgba(245, 184, 65, .12); transform: translateY(-1px); }
.server.offline { background: var(--cabinet); box-shadow: none; }
.server-main { display: grid; gap: 4px; flex: 1; min-width: 0; }
.server-main strong { font: 900 22px/1.15 var(--f-display); letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server.offline .server-main strong { color: #C9C7C1; }
.server-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; }
.server.online .server-status { color: #D6D4CE; }
.server.offline .dot { background: #6B6D75; box-shadow: none; }
.server-sub { color: var(--muted); font: italic 17px/1.2 var(--f-serif); }
.server-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.server-actions a.button { padding: 11px 26px; font-size: 15px; font-weight: 700; margin-left: 6px; }
.server-actions a.button:not(.secondary) { box-shadow: 0 8px 24px rgba(245, 184, 65, .25); }

/* lists: people, invites */
.list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 4px; }
.list:empty { display: none; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px;
  background: var(--fill); border-radius: var(--r-m); padding: 8px 8px 8px 14px; font-size: 14.5px; }
.list li .who { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; flex-wrap: wrap; }
#invites-list li, #sinvites-list li { background: none; border: 1px dashed var(--line-2); color: var(--muted); }
#invites-list li .who, #sinvites-list li .who { font-weight: 400; font-size: 13.5px; }
.list li .acts { display: flex; align-items: center; gap: 4px; flex: none; }
.list li select { padding: 6px 8px; font-size: 13px; }
.badge { font: 600 11px/1 var(--f-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--brass); border: 1px solid rgba(245, 184, 65, .4);
  border-radius: 999px; padding: 4px 8px; }
.invite, .invite-make { display: flex; gap: 8px; margin-top: 12px; }
.invite { padding: 12px; border-radius: var(--r-m); background: rgba(245, 184, 65, .08); border: 1px solid rgba(245, 184, 65, .3); animation: rise var(--t2) var(--ease) both; }
.invite input { font: 13px var(--f-mono); min-width: 0; }
.invite-make select { flex: 1; min-width: 0; }
#people-error:empty { display: none; }

/* dialogs */
dialog { background: transparent; border: 0; padding: 12px; color: inherit; max-width: 100vw; max-height: 100vh; max-height: 100dvh; overflow: auto; }
dialog::backdrop { background: rgba(8, 9, 12, .66); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
dialog .card { gap: 12px; }
dialog .section-head { align-items: center; }
#claim-code { font: 600 22px var(--f-mono); letter-spacing: .14em; text-align: center; text-transform: uppercase; padding: 14px; }
#claim-code::placeholder { letter-spacing: .14em; }
#confirm-body { color: #D6D4CE; }

/* toast: a slip of Paper */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 10; max-width: min(520px, calc(100vw - 32px));
  background: var(--paper); color: var(--night); border-radius: 14px; padding: 11px 18px; font-size: 14px; font-weight: 600; text-align: center;
  box-shadow: 0 16px 44px rgba(0, 0, 0, .55), 0 0 0 1px rgba(138, 90, 0, .25); animation: toast-in var(--t2) var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  input, select { font-size: 16px; }
  .brand .say { display: none; }
  .card { padding: 24px; border-radius: 20px; }
  .page { gap: 40px; padding-top: 12px; }
  .section-head .aside { font-size: 17px; }
  .server { flex-direction: column; align-items: stretch; padding: 18px 16px 16px 20px; gap: 14px; }
  .server-actions { justify-content: flex-end; flex-wrap: wrap; }
  .server-actions a.button { flex: 1; }
  .list li { flex-wrap: wrap; }
  .invite-make { flex-wrap: wrap; }
  .invite-make > * { flex: 1 1 100%; }
  .status #status-text { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .coin { animation: none !important; }
}

.server-actions:empty { display: none; }
