/*
  Base styles. Uses logical properties (margin-inline-start, padding-inline, etc.)
  instead of left/right, so layouts mirror automatically when dir="rtl".
*/

/* Self-hosted Hebrew web font with nikud support (static/fonts/README.md).
   It covers Hebrew characters only; Latin text uses the system font. */
@font-face {
  font-family: "Noto Sans Hebrew";
  src: url("../fonts/NotoSansHebrew-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}

:root {
  --font-body: "Noto Sans Hebrew", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --color-text: #1f2937;
  --color-muted: #6b7280;
  --color-bg: #fffdf7;
  --color-primary: #1d4ed8;
  --color-border: #e5e7eb;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

/* Nikud sits above and below letters; give Hebrew content a little more room. */
.content:lang(he), .content[dir="rtl"], [dir="auto"].content { line-height: 1.9; }

a { color: var(--color-primary); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.75rem;
  padding-inline: 1.5rem;
  border-block-end: 1px solid var(--color-border);
}
.site-header__brand { font-weight: 700; text-decoration: none; }
.site-header__nav { display: flex; align-items: center; gap: 1rem; }
.site-header__user { color: var(--color-muted); }

.site-main { max-width: 48rem; margin-inline: auto; padding: 2rem 1.5rem; }

.inline-form { display: inline; margin: 0; }
.link-button {
  background: none; border: 0; padding: 0; font: inherit;
  color: var(--color-primary); text-decoration: underline; cursor: pointer;
}
.button {
  display: inline-block; padding: 0.6rem 1.1rem; border-radius: var(--radius);
  background: var(--color-primary); color: #fff; text-decoration: none;
}

.messages { list-style: none; padding: 0; margin: 1rem 1.5rem; }
.message { padding: 0.6rem 1rem; border-radius: var(--radius); background: #eef2ff; }
.message--error { background: #fef2f2; }

/* Forms rendered by allauth */
form p { margin-block: 0 1rem; }
input[type="email"], input[type="password"], input[type="text"] {
  width: 100%; padding: 0.5rem; border: 1px solid var(--color-border); border-radius: var(--radius);
  font: inherit;
}
.errorlist { color: #b91c1c; padding-inline-start: 1rem; }

/* Builder room list */
.new-room { margin-block: 1rem 2rem; }
.new-room label { display: block; font-weight: 600; margin-block-end: 0.25rem; }
.new-room__row { display: flex; gap: 0.5rem; }
.new-room__row input { flex: 1; }
.hint { color: var(--color-muted); font-size: 0.9rem; margin-block: 0.25rem; }
.room-table { width: 100%; border-collapse: collapse; }
.room-table th, .room-table td {
  text-align: start; padding: 0.5rem; border-block-end: 1px solid var(--color-border);
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.builder-fallback { max-width: 40rem; margin: 4rem auto; padding: 0 1.5rem; }

/* Player pages (My rooms) */
.play-section { margin-block-end: 2.5rem; }
.game-list { list-style: none; padding: 0; display: grid; gap: 0.75rem; }
.game-list li { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.room-cards { list-style: none; padding: 0; display: grid; gap: 1rem; }
.room-card { border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1rem 1.25rem; background: #fff; }
.room-card h3 { margin-block: 0 0.5rem; }
.start-form { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.start-form select { padding: 0.45rem; border: 1px solid var(--color-border); border-radius: var(--radius); font: inherit; }
button.button { border: 0; font: inherit; cursor: pointer; }
