/* Styles shared by the main page and the room page. */

:root {
  color-scheme: dark;
  --ink: #E8E4D8;
  --muted: #A9A597;
  --paper: #1F222B;
  --ground: #14161C;
  --line: #3D414E;
  --gold: #C9A24A;
  --problem: #E58A7B;
}

* { box-sizing: border-box; }

/* Without this, a rule like display: flex would make hidden elements visible. */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  padding: 24px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0D0F15;
  color: var(--ink);
  font-family: 'Barlow', 'Segoe UI', sans-serif;
}

.card {
  width: 100%;
  max-width: 460px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: linear-gradient(#2A2E39, #1E212A);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 #FFFFFF14, 0 12px 28px #00000080;
}

.brand { margin: 0; text-align: center; }
.brand small {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .3em;
  text-transform: uppercase;
}
.brand span {
  font-family: 'Alfa Slab One', Georgia, serif;
  font-size: clamp(38px, 11vw, 52px);
  font-weight: 400;
  line-height: 1.1;
}

h2 { margin: 0; font-size: 18px; }
p { margin: 0; line-height: 1.4; }
.muted { color: var(--muted); }
.centered { text-align: center; }
.problem { color: var(--problem); font-weight: 600; }

/* A floating message that stays visible on every screen. */
.toast {
  position: fixed;
  z-index: 10;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 460px;
  margin: 0 auto;
  padding: 12px 16px;
  text-align: center;
  background: #2A1B1B;
  border: 1px solid var(--problem);
  border-radius: 6px;
  box-shadow: 0 8px 18px #00000080;
}

label { display: block; margin-bottom: 6px; font-weight: 600; }

input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  background: var(--ground);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: 500 16px 'Barlow', 'Segoe UI', sans-serif;
}

button {
  min-height: 44px;
  padding: 0 18px;
  background: linear-gradient(#343945, #252831);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: inset 0 1px 0 #FFFFFF1F, 0 3px 0 #00000099;
  font: 700 15px 'Barlow', 'Segoe UI', sans-serif;
  cursor: pointer;
}
button:disabled { opacity: .5; cursor: not-allowed; }
button.main {
  background: linear-gradient(#D6B15C, #B48E3C);
  border-color: #B48E3C;
  color: var(--ground);
}

.row { display: flex; gap: 8px; }
.row input { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }

.player-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.player {
  min-height: 52px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.player-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.player-note { display: block; font-size: 13px; font-weight: 500; color: var(--muted); }
.player.offline .face { opacity: .4; }
.face { display: block; flex: none; }

/* The plane on the main menu and the loading screen. */
.flight-scene { width: 100%; max-width: 360px; margin: 0 auto; }
.flight-scene svg { display: block; width: 100%; height: auto; overflow: visible; }
.flight-ground { stroke: #3D414E; stroke-width: 1.5; stroke-linecap: round; }
.flight-tower { fill: none; stroke: #3D414E; stroke-width: 1.5; stroke-linejoin: round; }
.flight-trail { fill: none; stroke: #C9A24A; stroke-width: 1; stroke-dasharray: 1; stroke-dashoffset: 1; }
.flight-plane { fill: #C9A24A; }

/* Joining with a room code. */
.or-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.code-input { text-transform: uppercase; letter-spacing: .25em; font-weight: 700; }
.code-input::placeholder { color: #6E6B62; font-weight: 500; }
.room-code-box { padding: 12px 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; background: var(--ground); border: 1px solid var(--gold); border-radius: 8px; }
.room-code-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.room-code { font-family: 'Alfa Slab One', Georgia, serif; font-size: 36px; line-height: 1.1; letter-spacing: .08em; }
.game-room-code { margin-top: 2px; color: var(--muted); font-size: 15px; font-weight: 700; letter-spacing: .08em; }
