:root {
  color-scheme: dark;
  --navy-950: #071725;
  --navy-900: #132d46;
  --navy-800: #1d3c59;
  --maize: #d2ad52;
  --maize-pale: #eee2bd;
  --paper: #f3f0e8;
  --ink: #17283a;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/*
 * Optional host-theme contract. These fallbacks preserve the native standalone
 * presentation; a host may define the theme variables before or after this file.
 */
:root[data-mithrandir-theme="active"] {
  --navy-950: var(--theme-navy-950, #071725);
  --navy-900: var(--theme-navy-900, #132d46);
  --navy-800: var(--theme-navy-800, #1d3c59);
  --maize: var(--theme-maize, #d2ad52);
  --maize-pale: var(--theme-maize-pale, #eee2bd);
  --paper: var(--theme-text, #f3f0e8);
  --ink: var(--theme-text, #17283a);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  background: var(--navy-950);
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  color: var(--paper);
  font-family: var(--sans);
}

button,
select,
input {
  font: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  transform: translateY(-180%);
  background: var(--maize);
  color: var(--navy-950);
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.game-shell {
  min-height: 100vh;
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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


/* Complete native defaults; host values are consumed only while host-owned. */
:root {
  --euchre-page: #071d1c;
  --euchre-surface: #102d35;
  --euchre-raised: #173b3b;
  --euchre-text: #f3f0e8;
  --euchre-muted: #bacbc8;
  --euchre-border: #647f80;
  --euchre-accent: #d2ad52;
  --euchre-accent-contrast: #071725;
  --euchre-focus: #ffdc78;
  --euchre-danger: #ffb4ac;
}
:root[data-euchre-color-scheme="light"] {
  color-scheme: light;
  --euchre-page: #f3f0e8;
  --euchre-surface: #ffffff;
  --euchre-raised: #e6ece8;
  --euchre-text: #17283a;
  --euchre-muted: #465c59;
  --euchre-border: #718580;
  --euchre-accent: #685014;
  --euchre-accent-contrast: #ffffff;
  --euchre-focus: #735200;
  --euchre-danger: #a51624;
}
:root[data-euchre-color-scheme="dark"] { color-scheme: dark; }
:root[data-euchre-theme-source="host"],
:root[data-mithrandir-theme="active"] {
  --euchre-page: var(--theme-page, #071d1c);
  --euchre-surface: var(--theme-surface, #102d35);
  --euchre-raised: var(--theme-control, #173b3b);
  --euchre-text: var(--theme-text, #f3f0e8);
  --euchre-muted: var(--theme-text-muted, #bacbc8);
  --euchre-border: var(--theme-border-strong, #647f80);
  --euchre-accent: var(--theme-accent, #d2ad52);
  --euchre-accent-contrast: var(--theme-accent-contrast, #071725);
  --euchre-focus: var(--theme-focus, #ffdc78);
  --euchre-danger: var(--theme-danger, #ffb4ac);
}
:root[data-euchre-theme-source="host"][data-euchre-color-scheme="light"],
:root[data-mithrandir-theme="active"][data-euchre-color-scheme="light"] {
  --euchre-page: var(--theme-page, #f3f0e8);
  --euchre-surface: var(--theme-surface, #ffffff);
  --euchre-raised: var(--theme-control, #e6ece8);
  --euchre-text: var(--theme-text, #17283a);
  --euchre-muted: var(--theme-text-muted, #465c59);
  --euchre-border: var(--theme-border-strong, #718580);
  --euchre-accent: var(--theme-accent, #685014);
  --euchre-accent-contrast: var(--theme-accent-contrast, #ffffff);
  --euchre-focus: var(--theme-focus, #735200);
  --euchre-danger: var(--theme-danger, #a51624);
}
html { background: var(--euchre-page); }
body { color: var(--euchre-text); }
.skip-link { background: var(--euchre-accent); color: var(--euchre-accent-contrast); }
:root[data-euchre-theme-source="host"] .appearance-control,
:root[data-mithrandir-theme="active"] .appearance-control { display: none !important; }
