/* Shared by the solver (index.html) and the daily game (daily/index.html). */

:root {
  --bg: #f6f5f1;
  --card: #ffffff;
  --text: #1c1c1e;
  --muted: #6e6e73;
  --accent: #1f6feb;
  --ok: #1a7f37;
  --fail: #b42318;
  --line: #d8d8dc;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111113;
    --card: #1c1c1f;
    --text: #f2f2f4;
    --muted: #9a9aa0;
    --accent: #4c8dff;
    --ok: #4ac26b;
    --fail: #ff7b72;
    --line: #3a3a3e;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding: calc(env(safe-area-inset-top) + 32px) 20px calc(env(safe-area-inset-bottom) + 32px);
}
main { max-width: 440px; margin: 0 auto; }
h1 { font-size: 28px; margin: 0; }
form { display: flex; flex-direction: column; gap: 12px; }

button {
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  padding: 16px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
button:active { opacity: 0.8; }
/* Outlined button for secondary actions. */
button.secondary {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--line);
  font-size: 16px;
}

/* Small link at the top to the other page (SCHILDLI or the solver). */
.switch { display: flex; justify-content: flex-end; margin: -16px 0 16px; }
.switch a {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 6px 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
}
.switch a:active { opacity: 0.7; }

/* Swiss rear plate: shield, canton code, dot, number, canton arms. */
.plate {
  align-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border: 3px solid #111;
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3.5px #111;
  font: 700 38px/1 "DIN Alternate", "DIN Condensed", Bahnschrift, "Arial Narrow", sans-serif;
  color: #111;
}
.plate .shield { flex: none; width: 28px; height: 34px; object-fit: contain; }
/* Fixed width (fits the widest code, NW) so the plate never changes size. */
.plate .code { flex: none; width: 1.6em; text-align: right; letter-spacing: 0.02em; }
.plate .dot { flex: none; margin: 0 -2px; }
/* Exactly six digits wide, so the coat of arms sits right after them. */
.plate .number { flex: none; width: calc(6ch + 0.3em); text-align: center; letter-spacing: 0.04em; }

/* Where the player types their own solution. */
#guess {
  width: 100%;
  font: 500 20px/1.3 ui-monospace, "SF Mono", Menlo, monospace;
  padding: 14px 12px;
  color: var(--text);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 12px;
  outline: none;
}
#guess:focus { border-color: var(--accent); }
