/* Home page styles (tasks 010, 026, 093). Plain CSS, no framework. Military palette: olive, sand, dark
   slate; the same colours and font as the game's UiTheme (game/client/ui/ui_theme.gd). */
@font-face {
  font-family: "Barlow Condensed";
  src: url("/fonts/BarlowCondensed-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/fonts/BarlowCondensed-SemiBold.ttf") format("truetype");
  font-weight: 600 700;
  font-display: swap;
}

:root {
  --bg: #1f241d;
  --panel: rgba(36, 42, 32, 0.94);
  --panel-light: #323a2c;
  --olive: #6b7a3c;
  --olive-light: #8a9a52;
  --sand: #d8c9a3;
  --text: #ece7da;
  --muted: #a7a291;
  --line: #4a5540;
  --error: #e4a37a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 50% 35%, rgba(31, 36, 29, 0.35) 0%, rgba(31, 36, 29, 0.85) 80%),
    url("/img/menu_background.png") center / cover no-repeat fixed,
    var(--bg);
  color: var(--text);
  font-family: "Barlow Condensed", "Segoe UI", "DejaVu Sans", Arial, sans-serif;
  font-size: 1.1rem;
}

.logo { display: block; width: 5rem; height: 5rem; margin: 0 auto -0.5rem; }
.title.small + .logo, .logo.small { width: 3.5rem; height: 3.5rem; }

[hidden] { display: none !important; }

.home {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 3rem);
  padding: 2rem 1rem;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: min(30rem, 100%);
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.panel.wide { width: min(38rem, 100%); }

.title {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  color: var(--sand);
}

h2 { margin: 0; color: var(--sand); letter-spacing: 0.04em; }

.tagline, .muted { margin: 0; color: var(--muted); text-align: center; }
.tagline { font-size: 0.95rem; letter-spacing: 0.05em; }

.field { display: flex; flex-direction: column; gap: 0.35rem; color: var(--muted); font-size: 0.9rem; }

input, select {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #1a1e17;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

input:focus, select:focus { outline: 2px solid var(--olive-light); outline-offset: 0; }

.button {
  display: inline-block;
  padding: 0.75rem 1.4rem;
  border: 1px solid var(--olive-light);
  border-radius: 4px;
  background: var(--panel-light);
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button.primary { background: var(--olive); }
.button:hover, .button:focus-visible { background: var(--olive-light); outline: none; }
.button:disabled { opacity: 0.6; cursor: wait; }

.divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

.join { display: flex; gap: 0.6rem; }
.join input { flex: 1; font-size: 1.4rem; letter-spacing: 0.5em; text-align: center; }

.message { min-height: 1.2em; margin: 0; color: var(--error); text-align: center; }

fieldset {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0 0 0.8rem;
  padding: 0.8rem 1rem 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
}

legend { padding: 0 0.4rem; color: var(--sand); font-weight: 600; letter-spacing: 0.05em; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.row > span { flex: 1; }
.row select, .row input:not([type="checkbox"]) { width: 12rem; }
.row input[type="checkbox"] { width: 1.3rem; height: 1.3rem; accent-color: var(--olive-light); }

.actions { display: flex; justify-content: space-between; gap: 1rem; }

.room-code {
  margin: 0;
  color: var(--sand);
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-align: center;
}

.keys {
  margin: 0;
  padding: 0.8rem;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-align: center;
}

/* Task 027: public room list, copy link, room page. */
.home.split { flex-wrap: wrap; align-items: flex-start; gap: 1.5rem; padding-top: 5vh; }
#rooms-panel { width: min(26rem, 100%); }
#create-view:not([hidden]) ~ #rooms-panel, #created-view:not([hidden]) ~ #rooms-panel { display: none; }
.room-list { display: flex; flex-direction: column; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.room-entry {
  display: grid;
  grid-template-columns: 4.5rem 1fr 1fr 3.5rem;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #1a1e17;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.room-entry:hover:not(:disabled), .room-entry:focus-visible { border-color: var(--olive-light); outline: none; }
.room-entry:disabled { opacity: 0.55; cursor: default; }
.room-entry .code { color: var(--sand); font-weight: 700; letter-spacing: 0.1em; }
.room-entry .players { text-align: right; color: var(--muted); }
.copy-row { display: flex; gap: 0.5rem; }
.copy-row input { flex: 1; }
.message.ok { color: var(--olive-light); }
.title.small { font-size: 1.3rem; }
#room-form { display: flex; flex-direction: column; gap: 1rem; }
.room-entry span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.room-entry { grid-template-columns: 4.2rem 1.3fr 1.2fr 3.2rem; }

/* Task 093: links under the home panels, and the credits page (web/credits.html, built from ASSETS.md). */
.keys a { color: var(--sand); text-decoration: none; }
.keys a:hover, .keys a:focus-visible { text-decoration: underline; }
kbd {
  display: inline-block;
  min-width: 1.4em;
  padding: 0 0.35em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 3px;
  background: var(--panel-light);
  color: var(--sand);
  font: inherit;
  text-align: center;
}
.credits { width: min(52rem, 100%); margin: 2rem auto; }
.credits section { display: flex; flex-direction: column; gap: 0.35rem; padding-top: 0.6rem; border-top: 1px solid var(--line); }
.credits ul { margin: 0.2rem 0 0; padding-left: 1.2rem; color: var(--muted); font-size: 0.95rem; }
.credits code { color: var(--text); font-size: 0.85rem; }
.credits a { color: var(--olive-light); word-break: break-all; }
.credits .muted { text-align: left; }
.credits p { margin: 0; }
.credits .back { color: var(--sand); text-decoration: none; }
