@font-face {
  font-family: "Ironfront Stencil";
  src: url("./assets/fonts/BlackOpsOne-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --accent: #e0a83a;
  --accent-2: #c8801e;
  --accent-green: #4fd67a;
  --accent-green-dim: #2f8a4f;
  --panel: #12161c;
  --panel-2: #1a2029;
  --line: #2b333d;
  --line-2: #394452;
  --text: #eef2f6;
  --text-dim: #9aa7b4;
  --danger: #e2604f;
}

* { box-sizing: border-box; }

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

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #0a0c0f;
  color: var(--text);
  min-height: 100vh;
  padding: 3rem 1rem 4rem;
}

/* Faint static scanlines + edge vignette - lighter than the game client's
   overlay (no flicker animation) so form inputs stay crisp and clickable. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.35) 0px,
      rgba(0, 0, 0, 0.35) 1px,
      rgba(0, 0, 0, 0) 2px,
      rgba(0, 0, 0, 0) 4px
    ),
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.5) 100%);
}

main {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
}

.eyebrow {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent-green);
  margin: 0 0 0.5rem;
}

h1 {
  font-family: "Ironfront Stencil", system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: 0.02em;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  margin: 0 0 1.75rem;
  color: var(--text);
}

#whoami {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

#whoami img.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
}

#whoami strong { color: var(--text); font-weight: 600; }

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: var(--panel-2);
  color: var(--text);
  padding: 0.55rem 1rem;
  transition: border-color 0.15s, color 0.15s;
}
button:hover { border-color: var(--accent); color: var(--accent); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1305;
  font-weight: 600;
}
button.primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #1a1305; }

input {
  font: inherit;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 3px;
  color: var(--text);
  padding: 0.5rem 0.65rem;
}
input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input::placeholder { color: var(--text-dim); }

form#create {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2rem;
  padding: 1.1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
}
form#create input#roomName { flex: 1 1 12rem; }
form#create input#roomPassword { flex: 0 1 10rem; }
form#create .field-hint {
  flex-basis: 100%;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: -0.2rem 0 0;
}

#rooms {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

#rooms li {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.85rem 1rem;
  background: var(--panel);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

#rooms li.room-empty {
  color: var(--text-dim);
  justify-content: center;
  border-style: dashed;
}

.room-info { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.room-name { display: flex; align-items: center; gap: 0.4rem; font-weight: 600; color: var(--text); }
.room-name .lock-icon { color: var(--accent); font-size: 0.85em; }
.room-meta { font-size: 0.82rem; color: var(--text-dim); }

.room-join-area { display: flex; align-items: center; gap: 0.5rem; flex: 0 0 auto; }

.password-prompt {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.password-prompt input {
  width: 9rem;
}
.password-error {
  color: var(--danger);
  font-size: 0.78rem;
  flex-basis: 100%;
  margin: 0.3rem 0 0;
}

[hidden] { display: none !important; }
