/* Shared by every game. Only declarations that were byte-identical in all
   eleven files live here; anything a game does differently stays in that
   game's own <style>, which is loaded after this file and therefore wins.
   Change something here and it changes in all eleven games at once.

   Deliberately not versioned in the filename: the host serves everything with
   "max-age=0, must-revalidate" plus an ETag, so the browser checks this file on
   every load anyway. A version in the name would mean touching all eleven games
   again for every change here, which is the thing this file exists to avoid. */

:root {
  --redact: #b8382a;
  --olive: #6b7a4f;
  --mono: ui-monospace, "SFMono-Regular", "Courier New", Courier, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html[data-theme="dark"] {
  --bg: #0d0c0b;
  --on-bg-text: #f5f0e6;
  --on-bg-muted: #b8ae9a;
  --on-bg-border: #35312a;
  --surface: #171613;
  --surface-2: #201e1a;
  --surface-border: #35312a;
  --surface-input-bg: #0a0908;
  --surface-text: #f5f0e6;
  --surface-muted: #c9bfab;
  --icon-btn-bg: rgba(255,255,255,0.08);
  --icon-btn-border: rgba(255,255,255,0.2);
}

html[data-theme="light"] {
  --bg: #ede6d6;
  --on-bg-text: #1c1b19;
  --on-bg-muted: #7d7566;
  --on-bg-border: #c9bfa5;
  --surface: #faf7ef;
  --surface-2: #f1ebdd;
  --surface-border: #d8cdb2;
  --surface-input-bg: #ffffff;
  --surface-text: #1c1b19;
  --surface-muted: #6a6455;
  --icon-btn-bg: rgba(28,27,25,0.06);
  --icon-btn-border: rgba(28,27,25,0.18);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--on-bg-text);
  font-family: var(--sans);
  overscroll-behavior: none;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.topbar {
  display: flex;
  align-items: center;
  width: 100%;
  flex-shrink: 0;
}

.lang-select {
  width: 100%;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.5px;
  background: var(--surface-input-bg);
  color: var(--surface-text);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  padding: 10px 12px;
  -webkit-appearance: none;
  appearance: none;
}

.icon-group {
  display: flex;
  gap: 6px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--icon-btn-border);
  background: var(--icon-btn-bg);
  color: var(--on-bg-text);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-column {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.screen {
  display: none;
  flex-direction: column;
  width: 100%;
  margin: 0 auto;
}

.screen.active {
  display: flex;
}

.eyebrow {
  font-family: var(--mono);
  text-transform: uppercase;
  color: var(--on-bg-muted);
  text-align: center;
}

h1.stamp {
  font-family: var(--mono);
  text-align: center;
  color: var(--redact);
  border: 3px solid var(--redact);
  border-radius: 4px;
  margin: 0;
  transform: rotate(-2deg);
  text-transform: uppercase;
}

.card {
  background: var(--surface);
  color: var(--surface-text);
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  padding: 22px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  position: relative;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--surface-muted);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toggle {
  width: 52px;
  height: 30px;
  border-radius: 20px;
  background: var(--surface-border);
  position: relative;
  flex-shrink: 0;
  transition: background .2s;
}

.toggle.on {
  background: var(--olive);
}

.toggle .knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f7f3ea;
  transition: transform .2s;
}

.toggle.on .knob {
  transform: translateX(22px);
}

button.primary {
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: none;
  border-radius: 8px;
  width: 100%;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.modal-overlay.active {
  display: flex;
}

.modal-sheet {
  background: var(--surface);
  color: var(--surface-text);
  width: 100%;
  max-width: 460px;
  border-radius: 16px 16px 0 0;
  padding: 24px 20px max(24px, env(safe-area-inset-bottom));
  max-height: 86vh;
  overflow-y: auto;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.4);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: 1px;
  margin: 0;
  text-transform: uppercase;
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--surface-border);
  background: transparent;
  color: var(--surface-text);
  font-size: 16px;
}

.modal-sub {
  font-family: var(--sans);
  color: var(--surface-muted);
}

.overview-link {
  display: block;
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  letter-spacing: 1px;
  color: inherit;
  opacity: .75;
  text-decoration: underline;
  text-underline-offset: 3px;
}
