/* The party join page. Same tokens as the launcher and the website; dark, like the brand.
   A game's own phone screen (frame.html) styles itself. */
:root {
  --ground: #0d0f14;
  --surface: #161a22;
  --raised: #1f2430;
  --line: #2a3040;
  --line-strong: #3a4152;
  --text: #eef0f5;
  --text-2: #c9cfdb;
  --muted: #9aa3b5;
  --accent: #ffb547;
  --on-accent: #1a1206;
  --bad: #ff7a7a;
  --display: 'Chakra Petch', system-ui, sans-serif;
  --body: 'IBM Plex Sans', system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  background: var(--ground);
  color: var(--text);
  font: 400 17px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }

.card {
  width: min(420px, 100% - 32px);
  display: grid;
  gap: 20px;
  margin: 24px 0;
  padding: 26px 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; font: 700 20px/1 var(--display); letter-spacing: 0.01em; }
.mark { width: 32px; height: 32px; flex: none; }
h1 { margin: 0; font: 700 32px/1.1 var(--display); }
.lede { margin: 6px 0 0; color: var(--muted); }
label, legend { display: grid; gap: 6px; color: var(--text-2); font-size: 15px; font-weight: 600; }
input {
  font: 600 22px var(--body);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--ground);
  color: var(--text);
  width: 100%;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
input::placeholder { color: var(--line-strong); }
#code { font: 700 34px var(--display); text-transform: uppercase; letter-spacing: 0.35em; text-align: center; padding: 10px 14px; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
legend { margin-bottom: 8px; }
fieldset button { width: 40px; height: 40px; border-radius: 50%; border: 0; padding: 0; outline: 3px solid transparent; outline-offset: 2px; }
fieldset button[aria-pressed='true'] { outline-color: var(--text); }
button { font: inherit; border: 0; cursor: pointer; }
#go, #notice-button {
  padding: 15px;
  border-radius: 12px;
  font: 700 20px var(--display);
  letter-spacing: 0.02em;
  background: var(--accent);
  color: var(--on-accent);
}
#go:disabled { opacity: 0.5; }
#go:active, #notice-button:active { transform: translateY(1px); }
.error { color: var(--bad); margin: 0; min-height: 1.5em; font-size: 15px; }

main { position: fixed; inset: 0; display: flex; flex-direction: column; }
header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 12px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
header .mark { width: 26px; height: 26px; }
#me { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; font-weight: 600; }
#who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#swatch { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); flex: none; }
#room { font: 700 15px var(--display); color: var(--muted); letter-spacing: 0.18em; padding: 3px 8px; border: 1px solid var(--line); border-radius: 8px; }
#leave { width: 36px; height: 36px; border-radius: 10px; background: transparent; color: var(--muted); font-size: 18px; }
#leave:active { background: var(--raised); }
#stage { flex: 1; position: relative; }
#stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--ground); }
#notice {
  position: absolute;
  inset: 0;
  top: 53px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 24px;
  text-align: center;
  background: var(--ground);
  font: 600 20px/1.35 var(--display);
}
#notice p { margin: 0; max-width: 320px; }
#notice-button { min-width: 200px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
#notice:has(#notice-button:not([hidden])) .spinner { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
