/* Midnight Field Kit: shared tokens and base reset. Screen styles live in deal.css and book.css. */

:root {
  /* Night table is the default until app.js applies the resolved theme. */
  color-scheme: dark;
  --bg: #16143A;
  --surface: #25225A;
  --ink: #FFF6E3;
  --ink-soft: #C9C3E6;

  /* Cards are the same paper in both themes. */
  --card-paper: #FFF6E3;
  --card-ink: #1F1B4D;

  /* Riso spot inks */
  --tomato: #E8452C;
  --marigold: #F5A81C;
  --mint: #3FBFA0;
  --sky: #3E9BE0;
  --plum: #8A4FA8;
  --coral: #FF7A5C;
  --leaf: #5C9E3A;
  --rose: #E85C8A;

  /* One suit per place */
  --suit-grocery: var(--tomato);
  --suit-waiting: var(--marigold);
  --suit-car: var(--sky);
  --suit-walk: var(--leaf);
  --suit-playground: var(--coral);
  --suit-backyard: var(--mint);
  --suit-indoors: var(--plum);
  --suit-winddown: var(--rose);

  /* iOS fonts only */
  --font-display: ui-rounded, "SF Pro Rounded", system-ui;
  --font-card: "American Typewriter", "Courier New", serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);

  --tap-min: 44px;
  --tap-big: 72px;
  --radius-card: 7px;
  --tabbar-h: 56px;
}

html[data-theme="night"] {
  color-scheme: dark;
  --bg: #16143A;
  --surface: #25225A;
  --ink: #FFF6E3;
  --ink-soft: #C9C3E6;
}

html[data-theme="day"] {
  color-scheme: light;
  --bg: #F0E2C2;
  --surface: #E6D5AE;
  --ink: #1F1B4D;
  --ink-soft: #55507F;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, p, ul, ol, figure {
  margin: 0;
  padding: 0;
}

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button, a, input, select, textarea, label {
  touch-action: manipulation;
}

button {
  min-height: var(--tap-min);
  min-width: var(--tap-min);
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}

svg {
  display: block;
}

#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.screen {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: var(--safe-top) var(--safe-right) 0 var(--safe-left);
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
