/* Cool Apps — play pages of the browser games. Loaded before the game's own stylesheet: the base the games expect,
   the age question and the loading states. Everything of the age question is under .age-gate, with its own colour
   tokens (the site's palette, light and dark), so the game's rules never reach it. */

html, body { margin: 0; }
body { font: 14px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; }
[hidden] { display: none !important; }

/* The game's markup stays invisible (but laid out, so the game can measure it) until its scripts have run. */
html:not(.game-on) #stage { visibility: hidden; }

/* ------------------------------------------------------------------------------------------------ age question */

.age-gate {
  --ag-bg: #ffffff;
  --ag-surface: #f5f7fb;
  --ag-text: #0f1729;
  --ag-muted: #4a5568;
  --ag-border: #dde3ec;
  --ag-border-strong: #c3ccda;
  --ag-accent: #0b5cad;
  --ag-accent-hover: #094c8f;
  --ag-on-accent: #ffffff;
  --ag-error: #b42318;
  --ag-shadow: 0 1px 2px rgba(15, 23, 41, 0.06), 0 4px 16px rgba(15, 23, 41, 0.06);
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  overflow-y: auto;
  box-sizing: border-box;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: var(--ag-bg);
  color: var(--ag-text);
  color-scheme: light;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}
@media (prefers-color-scheme: dark) {
  .age-gate:not([data-theme="light"]) {
    --ag-bg: #0b1220;
    --ag-surface: #111b2d;
    --ag-text: #e6ecf5;
    --ag-muted: #9fb0c8;
    --ag-border: #233149;
    --ag-border-strong: #31415e;
    --ag-accent: #5cc8ff;
    --ag-accent-hover: #8ed9ff;
    --ag-on-accent: #04111f;
    --ag-error: #ff8a7a;
    --ag-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}
.age-gate[data-theme="dark"] {
  --ag-bg: #0b1220;
  --ag-surface: #111b2d;
  --ag-text: #e6ecf5;
  --ag-muted: #9fb0c8;
  --ag-border: #233149;
  --ag-border-strong: #31415e;
  --ag-accent: #5cc8ff;
  --ag-accent-hover: #8ed9ff;
  --ag-on-accent: #04111f;
  --ag-error: #ff8a7a;
  --ag-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

.age-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 26rem;
  margin: auto;
  padding: 24px;
  background: var(--ag-surface);
  border: 1px solid var(--ag-border);
  border-radius: 12px;
  box-shadow: var(--ag-shadow);
}
.age-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  font-weight: 700;
  font-size: 1.0625rem;
}
.age-brand img { width: 40px; height: 40px; flex: none; border-radius: 10px; }
.age-title {
  margin: 0 0 16px;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.age-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 10px;
}
@media (max-width: 359px) {
  .age-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .age-field-month { grid-column: 1 / -1; }
}
.age-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.age-field select {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  padding: 10px 8px 10px 12px;
  border: 1px solid var(--ag-border-strong);
  border-radius: 8px;
  background: var(--ag-bg);
  color: var(--ag-text);
  font: inherit;
  cursor: pointer;
}
.age-field select[aria-invalid="true"] { border-color: var(--ag-error); box-shadow: 0 0 0 1px var(--ag-error); }
.age-field select:focus-visible, .age-continue:focus-visible {
  outline: 3px solid var(--ag-accent);
  outline-offset: 2px;
}
.age-error { margin: 12px 0 0; color: var(--ag-error); font-size: 0.9375rem; }
.age-continue {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  margin-top: 20px;
  padding: 10px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--ag-accent);
  color: var(--ag-on-accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.age-continue:hover { background: var(--ag-accent-hover); }
.age-note { margin: 12px 0 0; color: var(--ag-muted); font-size: 0.875rem; text-align: center; }

/* ------------------------------------------------------------------------------------------------ messages */

.play-error, .play-noscript {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 1001;
  box-sizing: border-box;
  max-width: 26rem;
  margin: 0 auto;
  padding: 12px 16px;
  border-radius: 12px;
  background: #0f1729;
  color: #ffffff;
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  text-align: center;
}
