/* Shared shell for every game on the site. Anything specific to one game
   stays in that game's own <style> block. */
:root {
  --bg: #0d1117;
  --panel: #161b22;
  --line: #2a323d;
  --text: #e6edf3;
  --dim: #8b949e;
  --accent: #01b4e4;
  --good: #3fb950;
  --bad: #f85149;
  --gold: #e8b339;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  justify-content: center;
  padding: 24px 16px 64px;
}
.wrap { width: 100%; max-width: 720px; }
h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -0.02em; }
.sub { color: var(--dim); font-size: 14px; margin: 0 0 24px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}
label { display: block; font-size: 13px; color: var(--dim); margin-bottom: 6px; }
input[type=text], input[type=password] {
  width: 100%;
  padding: 11px 13px;
  background: #0d1117;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
}
input:focus { outline: none; border-color: var(--accent); }
button {
  padding: 11px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #062028;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
button:hover:not(:disabled) { filter: brightness(1.12); }
button:disabled { opacity: 0.45; cursor: default; }
button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--dim);
  font-weight: 500;
}
button.ghost:hover:not(:disabled) { color: var(--text); border-color: var(--dim); filter: none; }
.row { display: flex; gap: 10px; align-items: center; }
.row > input, .row > .typeahead { flex: 1; }
.hidden { display: none !important; }

/* On a phone the buttons squeeze the text field down to a couple of words'
   worth of room, which is unusable for typing a film title. Give the field the
   full width and let the buttons drop to their own line. */
@media (max-width: 520px) {
  .row { flex-wrap: wrap; }
  .row > input, .row > .typeahead { flex: 1 0 100%; }
}

/* Back link to the game menu */
.back { font-size: 13px; margin: 0 0 14px; }
.back a { color: var(--dim); text-decoration: none; }
.back a:hover { color: var(--text); }

/* typeahead */
.typeahead { position: relative; }
.typeahead input { width: 100%; }
.suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  z-index: 20;
  background: #0d1117;
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 288px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.suggest div[role=option] {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 15px;
}
.suggest div.active, .suggest div[role=option]:hover { background: #1f2630; }
.suggest img, .suggest .noface {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  background: #21262d;
  flex-shrink: 0;
}
/* Film results are posters, not faces */
.suggest img.rect, .suggest .norect {
  width: 24px; height: 36px;
  border-radius: 3px;
}
.suggest .year { color: var(--dim); font-size: 13px; }

.spinner { color: var(--dim); font-size: 14px; }
.err { color: var(--bad); font-size: 14px; margin-top: 12px; }
a { color: var(--accent); }
.foot { margin-top: 24px; font-size: 12px; color: var(--dim); text-align: center; }
