/* Custom font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&display=swap');
/* Theme is a Tailwind `dark` class on <html>, defaulting to dark (see
   game.js's `isDark = savedDarkMode === null ? true : ...`) - declares
   this to the browser so features like Chrome's Force Dark don't try to
   auto-invert colors on top of the page's own theming. */
:root {
    color-scheme: dark;
}
:root:not(.dark) {
    color-scheme: light;
}
body {
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
#app-wrapper {
    flex-grow: 1;
}
/* Sidebar transition */
#sidebar {
    transition: transform 0.3s ease-in-out;
}
/* Custom focus ring for better accessibility.
   NOTE: this was originally written as `@apply focus:outline-none
   focus:ring-4 focus:ring-offset-2 focus:ring-blue-500
   dark:focus:ring-offset-black;` inside a plain <style> tag. The Tailwind
   Play CDN (cdn.tailwindcss.com) only processes @apply/theme() inside a
   <style type="text/tailwindcss"> block - a plain <style>/external
   stylesheet is left untouched by the browser, and @apply is not valid
   standalone CSS, so the rule was silently dropped and .focus-ring never
   applied anything (elements fell back to the browser's default outline).
   Rewritten below as the literal CSS Tailwind's ring utilities compile to,
   so the intended high-contrast focus ring actually renders. */
.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 6px #3b82f6;
}
html.dark .focus-ring:focus {
    box-shadow: 0 0 0 2px #000000, 0 0 0 6px #3b82f6;
}
/* High contrast focus for dropdowns */
select:focus {
    border-color: #3b82f6 !important; /* A bright blue */
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5) !important;
}
/* Lighter background for dropdown options */
html.dark nav#sidebar select option {
    background-color: #374151 !important; /* gray-700 */
    color: white;
}
html:not(.dark) nav#sidebar select option {
    background-color: #f3f4f6 !important; /* gray-100 */
    color: black;
}
/* Visually hidden class for screen reader announcements */
.sr-only-assertive {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
/* Font weight control */
html.force-normal-font,
html.force-normal-font body,
html.force-normal-font h1,
html.force-normal-font h2,
html.force-normal-font h3,
html.force-normal-font button,
html.force-normal-font a,
html.force-normal-font label,
html.force-normal-font select {
    font-weight: 400 !important; /* normal */
}
 /* Streak Animations */
@keyframes streak-fade-in {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}
.streak-animation {
    animation: streak-fade-in 0.5s ease-out forwards;
}
/* Custom high-contrast borders for header icons */
.header-icon-border {
    border: 1px solid #1a202c; /* Very dark gray for high contrast in light mode */
}
html.dark .header-icon-border {
    border: 1px solid #c7c7c7;
}
.header-icon-border:hover {
     border-width: 2px;
     border-color: #1a202c;
}
html.dark .header-icon-border:hover {
     border-width: 2px;
     border-color: #cccccc;
}

/* Custom Checkbox Styles */
.custom-checkbox-label {
    transition: background-color 0.2s, border-color 0.2s;
}
.custom-checkbox-label:hover > div {
    background-color: rgba(0,0,0,0.1);
}
html.dark .custom-checkbox-label:hover > div {
    background-color: rgba(255,255,255,0.1);
}
.custom-checkbox-label input:checked + div {
    border: 1px solid #1a202c; /* High-contrast border for light mode */
    background-color: #bee3f8; /* Darker blue for light mode selected */
}
html.dark .custom-checkbox-label input:checked + div {
    border: 1px solid #f7fafc; /* High-contrast border for dark mode */
    background-color: #2c5282; /* blue-800 */
}
/* Custom Footer Link Styles */
footer a.custom-link {
    text-decoration: underline;
}
footer a.custom-link:hover {
    text-decoration: none;
}
html:not(.dark) footer a.custom-link:hover {
    color: #011c45;
}
html.dark footer a.custom-link:hover {
    color: #bed5f7;
}

/* Back-to-info-page link added to the app header. Styled as a pill to
   match the other header controls (see .header-icon-border above) rather
   than pulling in the CoA Apps site's own .back-link styling, since this
   page is a self-contained Tailwind app like the rest of the header. */
.header-back-link {
    text-decoration: none;
}
.header-back-link:hover,
.header-back-link:focus-visible {
    text-decoration: underline;
}
