@font-face {
  font-family: "Saira Condensed";
  src: url("assets/SairaCondensed-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Saira Condensed";
  src: url("assets/SairaCondensed-Medium.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
/* group + lock only, baked from assets/ui/fonts (opsz 20, wght 400, fill 0, like the loader) */
@font-face {
  font-family: "Material Symbols Outlined";
  src: url("assets/material-symbols.ttf") format("truetype");
  font-display: block;
}

/* osmosis dark style + ember coral accent (DESIGN.md) */
:root {
  --bg: #0c0d10;
  --panel: #121317;
  --panel-low: #0d0e11;
  --field: #0e0e11;
  --button: #18191e;
  --button-hover: #202228;
  --text: #e5e7eb;
  --muted: #7c8089;
  --border: #24262c;
  --border-hover: #3a3d45;
  --accent: #f08769;
  --poor: #f5848a;
  --accent-line: color-mix(in srgb, var(--accent) 60%, transparent);
  --radius-control: 3px;
  --radius-window: 12px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.4 "Segoe UI", "Saira Condensed", system-ui, sans-serif;
  text-transform: lowercase;
  -webkit-font-smoothing: antialiased;
}

::selection { background: color-mix(in srgb, var(--accent) 32%, transparent); color: var(--text); }

.card {
  width: 100%;
  max-width: 340px;
  padding: 36px 28px 20px;
  background: linear-gradient(var(--panel), var(--panel-low));
  border: 1px solid var(--border);
  border-radius: var(--radius-window);
}

/* brand */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

/* the menu hue-shifts the cyan ribbon to the accent */
.logo {
  width: 56px;
  height: 56px;
  filter: hue-rotate(172deg) saturate(1.15);
}

.wordmark {
  margin: 0;
  font-family: "Segoe UI Semibold", "Segoe UI", "Saira Condensed", sans-serif;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
}

/* form */
.form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field {
  position: relative;
  display: flex;
  align-items: center;
  height: 40px;
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  cursor: text;
  transition: border-color 160ms var(--ease);
}
.field:hover { border-color: var(--border-hover); }
.field:focus-within { border-color: var(--accent-line); }

.icon {
  position: absolute;
  left: 11px;
  font-family: "Material Symbols Outlined";
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
  pointer-events: none;
  user-select: none;
  transition: color 160ms var(--ease);
}
.field:focus-within .icon { color: var(--text); }

.form[hidden] { display: none; }

.field input {
  width: 100%;
  height: 100%;
  padding: 0 12px 0 38px;
  background: transparent;
  border: 0;
  border-radius: inherit;
  outline: none;
  color: var(--text);
  caret-color: var(--accent);
  font: inherit;
  text-transform: none;
}
.field input::placeholder { color: var(--muted); opacity: 1; }

/* keep browser autofill on the field color */
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  box-shadow: inset 0 0 0 40px var(--field);
  caret-color: var(--accent);
}

.status {
  min-height: 16px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}
/* same poor-status red the loader uses for errors */
.status.error { color: var(--poor); }

/* account */
.account {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.account[hidden] { display: none; }

.account-name {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.2;
  text-transform: none;
}

.games {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.game {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  padding: 14px;
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.game-name { font-size: 15px; }
.game-state, .game-access { justify-self: end; text-align: right; }
.game-state, .game-meta { color: var(--muted); font-size: 12px; }

a.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
a.btn[hidden] { display: none; }

/* tonal accent action */
.btn {
  height: 40px;
  padding: 0 12px;
  background: var(--button);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  font: inherit;
  cursor: pointer;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), opacity 160ms var(--ease);
}

.btn-primary {
  background: color-mix(in srgb, var(--accent) 18%, var(--panel));
  border-color: var(--accent-line);
}
.btn-primary:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 24%, var(--panel));
  border-color: var(--accent);
}
.btn-primary:active:not(:disabled) { background: color-mix(in srgb, var(--accent) 30%, var(--panel)); }
.btn:disabled { opacity: .45; cursor: default; }
.btn[aria-busy="true"] { opacity: .7; }

/* small action: no fill, muted until hover */
.btn-text {
  align-self: center;
  margin-top: 6px;
  padding: 6px 10px;
  background: none;
  border: 0;
  border-radius: var(--radius-control);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: color 160ms var(--ease);
}
.btn-text:hover { color: var(--text); }

.btn:focus-visible,
.btn-text:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }

/* one entrance, like the loader's startup: emblem settles, then the form */
@media (prefers-reduced-motion: no-preference) {
  .brand { animation: settle 520ms var(--ease) both; }
  .form { animation: settle 520ms 80ms var(--ease) both; }
}
@keyframes settle {
  from { opacity: 0; transform: translateY(8px); }
}
