/* =============================================================================
   site.css — Chrome Naga Global Styles
   =============================================================================
   ORGANIZATION:
     1.  Font Definitions
     2.  CSS Variables          (design tokens — colors, sizes, fonts)
     3.  Reset & Base           (body, html, box model)
     4.  Shell — Sidebar        (#sidebar and its children)
     5.  Shell — Content Area   (#content-area)
     6.  Component — Banner     (.banner and modifiers)
     7.  Component — Card       (.card)
     8.  Component — DataTable  (.datatable)
     9.  Component — Form       (.form-field, inputs, buttons)
     10. Component — Checkbox   (.checkbox-group)
     11. Scrollbar
     12. Per-Page Overrides     (one subsection per page)

   CONVENTIONS:
     - All visual styling lives here. No <style> blocks in HTML fragments.
     - Inline styles are not used. IDs and classes only.
     - Page fragments use shared component classes (e.g. .banner, .datatable).
     - Per-page overrides are scoped with a page class on the fragment's root div.
       e.g. <div class="page carwars"> in the fragment,
            then .carwars .banner { } here to override the banner for that page.
   ============================================================================= */


/* =============================================================================
   1. FONT DEFINITIONS
   Add new fonts here
   Paths are relative to site.css.
   ============================================================================= */

/* JetBrains Mono font import */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

@font-face {
    font-family: 'Immortal';
    src: url(htmlFonts/immortal/IMMORTAL.ttf);
    font-style: normal;
    font-weight: 100;
}

@font-face {
    font-family: 'Paintedlady';
    src: url(htmlFonts/painted-lady/Painted\ Lady.otf);
    font-style: normal;
    font-weight: bold;
}

@font-face {
    font-family: 'Darkwaters';
    src: url(htmlFonts/dark-waters/DarkWaters-Regular.ttf);
    font-style: normal;
    font-weight: 100;
}

@font-face {
    font-family: 'Boogaloo';
    src: url(htmlFonts/boogaloo/Boogaloo-Regular.ttf);
    font-style: normal;
    font-weight: 100;
}

@font-face {
    font-family: 'Pirata';
    src: url(htmlFonts/pirata-one/PirataOne-Regular.ttf);
    font-style: normal;
    font-weight: 100;
}

@font-face {
    font-family: 'StopD';
    src: url(htmlFonts/stopd/Stopn.ttf);
    font-style: normal;
    font-weight: 100;
}


/* =============================================================================
   2. CSS VARIABLES
   Design tokens. Change a value here and it updates everywhere.
   ============================================================================= */

:root {
    /* --- Sizing --- */
    --sidebar-width:      270px;
    --sidebar-collapsed:  48px;
    --content-max-width:  900px;
    --banner-height:      220px;

    /* --- Colors --- */
    --color-bg:           rgba(79, 103, 74, 0.7);   /* stone wall tint */
    --color-panel:        rgba(60, 60, 60, 0.90);   /* center content panel */
    --color-accent:       #cc2200;
    --color-accent-hover: #ff3300;
    --color-text:         #e8e8e8;
    --color-text-muted:   #aaaaaa;
    --color-border:       #444444;
    --color-row-alt:      rgba(0, 0, 0, 0.15);      /* alternating table rows */

    /* --- Sidebar — Chrome Naga metallic theme --- */
    /* Keep these separate so the sidebar always looks the same regardless of page */
    --sidebar-bg-top:        #0d1117;               /* near-black with cool blue tint */
    --sidebar-bg-bottom:     #161c24;               /* slightly lighter steel at bottom */
    --sidebar-border:        #1e3a4a;               /* dark cyan-tinted border */
    --sidebar-chrome-line:   #2a9fd6;               /* bright cyan accent edge */
    --sidebar-text:          #b8c8d4;               /* cool silver-gray text */
    --sidebar-text-muted:    #5a7a8a;               /* dim steel for inactive items */
    --sidebar-hover-bg:      rgba(42, 159, 214, 0.08);
    --sidebar-active-bg:     rgba(42, 159, 214, 0.14);
    --sidebar-active-border: #2a9fd6;               /* neon cyan active indicator */
    --sidebar-title-color:   #c8dde8;               /* light silver for site name */
    --sidebar-title-glow:    #27a1f1;
    --sidebar-select-bg:     rgba(13, 17, 23, 0.8);
    --sidebar-toggle-border: #1e3a4a;

    /* --- Fonts --- */
    --font-display:       'Garamond', serif;
    --font-body:          'Garamond', Georgia, serif;

    /* --- Banner defaults (overridden per page) --- */
    --banner-bg:          #111111;
    --banner-overlay:     rgba(82, 82, 82, 0.3);
    --banner-title-color: #ffffff;
    --banner-glow:        rgba(0, 0, 0, 0.5);
    --banner-accent-line: #cc2200;
    --banner-font:        'Immortal', 'Times New Roman', serif;

    /* --- Transitions --- */
    --transition:         0.3s ease;
}


/* =============================================================================
   3. RESET & BASE
   ============================================================================= */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    min-height: 100%;
    margin: 0;
    background-color: #0e1520;
    background-image:
        linear-gradient(rgba(16, 138, 194, 0.4), rgba(65, 180, 233, 0.2)),
        url("htmlImages/grunge-wall-texture.jpg");
    background-size: cover;
    background-attachment: fixed;
    font-family: var(--font-body);
    color: var(--color-text);
    overflow-x: hidden;
}

code {
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--color-border);
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 0.9em;
    color: var(--color-accent-hover);
}


/* =============================================================================
   4. SHELL — SIDEBAR
   Fixed overlay on the left. Floats over the stone background.
   Collapses to --sidebar-collapsed wide when toggled.

   THEME: Chrome Naga metallic — dark cool steel with cyan/blue accents.
   This section intentionally uses --sidebar-* variables exclusively so the
   sidebar always looks the same regardless of which page is loaded.
   ============================================================================= */

#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);

    /* Brushed metal gradient — dark top to slightly lighter steel at bottom */
    background: linear-gradient(
        180deg,
        var(--sidebar-bg-top)    0%,
        var(--sidebar-bg-bottom) 100%
    );

    /* Thin cyan edge on the right — the chrome trim */
    border-right: 1px solid var(--sidebar-border);
    box-shadow:
        inset -1px 0 0 var(--sidebar-chrome-line),  /* inner cyan edge glow */
        4px 0 16px rgba(0, 0, 0, 0.6);              /* shadow onto content */

    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
    transition: width var(--transition);
}

#sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

/* Site name — silver with subtle cyan glow */
#sidebar-title {
    padding: 20px 16px 16px;
    font-family: var(--font-display);
    font-size: 1.3em;
    color: var(--sidebar-title-color);
    white-space: nowrap;
    letter-spacing: 0.08em;
    text-shadow:
        0 0 20px  var(--sidebar-title-glow),
        0 0 30px  var(--sidebar-title-glow),
        0 1px 2px rgba(0, 0, 0, 0.8);
    
    /* Bottom border with a subtle cyan shimmer */
    border-bottom: 1px solid var(--sidebar-border);
    box-shadow: 0 1px 0 rgba(42, 159, 214, 0.15);

    transition: opacity var(--transition);
}

#sidebar-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--sidebar-border);
    margin-top: auto;       /* pushes footer to the bottom */
    flex-shrink: 0;
    box-shadow: 0 -1px 0 rgba(42, 159, 214, 0.1);
}

#sidebar-footer-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

#sidebar.collapsed #sidebar-footer {
    justify-content: center;
    padding: 0.75em 0;
    gap: 0;
}

#sidebar-email {
    color: var(--sidebar-text-muted);
    font-size: 1em;
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--transition);
}

#sidebar-email:hover {
    color: var(--sidebar-chrome-line);
}

#sidebar.collapsed #sidebar-title {
    opacity: 0;
    pointer-events: none;
}

#sidebar-footer-icon.collapsed {
    display: block;
    margin: 0 auto;
}

/* Hide email text when collapsed — icon stays visible */
#sidebar.collapsed #sidebar-email {
    display: none;
}

/* Collapse / expand toggle button — chrome styled */
/* Button used to collapse or expand the sidebar */
#sidebar-toggle {
    position: absolute;
    top: 16px;
    right: 12px;
    background: linear-gradient(135deg, #1a2530, #0d1117);
    border: 1px solid var(--sidebar-toggle-border);
    color: var(--sidebar-text-muted);
    width: 28px;
    height: 28px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
    transition: color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

#sidebar-toggle:hover {
    color: var(--sidebar-chrome-line);
    border-color: var(--sidebar-chrome-line);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.05),
        0 0 6px rgba(42, 159, 214, 0.3);
}

#sidebar.collapsed #sidebar-toggle {
    right: 50%;
    transform: translateX(50%);
}

/* Section dropdown */
/* Dropdown to choose a section in the sidebar */
#section-select {
    margin: 16px 12px 8px;
    padding: 8px 10px;
    background-color: var(--sidebar-select-bg);
    border: 1px solid var(--sidebar-border);
    color: var(--sidebar-text);
    font-family: var(--font-body);
    font-size: 0.9em;
    border-radius: 3px;
    cursor: pointer;
    width: calc(100% - 24px);
    transition: opacity var(--transition), border-color var(--transition), box-shadow var(--transition);
}

#section-select:hover,
#section-select:focus {
    border-color: var(--sidebar-chrome-line);
    box-shadow: 0 0 6px rgba(42, 159, 214, 0.2);
    outline: none;
}

#sidebar.collapsed #section-select {
    opacity: 0;
    pointer-events: none;
}

/* Sub-page list */
/* Container for the sub-page navigation buttons */
#sub-nav {
    flex: 1;
    padding: 8px 0;
    transition: opacity var(--transition);
    overflow: hidden;   /* Hides the horizontal scrollbar when transition from open/close */
}

#sidebar.collapsed #sub-nav {
    opacity: 0;
    pointer-events: none;
}

/* Individual sub-page nav buttons */
/* Each page button inside the sidebar sub-navigation */
.sub-nav-item {
    display: block;
    width: 100%;
    padding: 10px 20px;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    color: var(--sidebar-text-muted);
    font-family: var(--font-body);
    font-size: 0.95em;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    transition:
        color var(--transition),
        border-color var(--transition),
        background-color var(--transition),
        text-shadow var(--transition);
}

.sub-nav-item:hover {
    color: var(--sidebar-text);
    background-color: var(--sidebar-hover-bg);
    text-shadow: 0 0 8px rgba(42, 159, 214, 0.2);
}

/* Active tab — cyan left edge + subtle glow */
.sub-nav-item.active {
    color: var(--sidebar-chrome-line);
    border-left-color: var(--sidebar-active-border);
    background-color: var(--sidebar-active-bg);
    text-shadow:
        0 0 8px  rgba(42, 159, 214, 0.5),
        0 0 16px rgba(42, 159, 214, 0.2);
}


/* =============================================================================
   5. SHELL — CONTENT AREA
   The mount point where page fragments are injected.
   Provides no visual styling — each page fragment handles its own layout.
   ============================================================================= */

/* Main content area where pages are loaded */
#content-area {
    min-height: 100vh;
    /* remove display:flex and align-items — was causing the squish */
}

/* Outer content panel that wraps each page fragment */
.content-panel {
    width: 60%;
    margin: 0 auto;
    min-height: 100%;
    background-color: rgba(10, 16, 26, 0.85);
    padding-bottom: 3em;
    position: relative;   /* ← add this */
}

.content-body {
    padding: 32px;
}

/* =============================================================================
   6. COMPONENT — BANNER
   Standard page banner: background image, dark overlay, title, accent line.
   Used by adding <div class="banner"> to a page fragment.
   Per-page overrides in section 12 change colors, images, and fonts.
   ============================================================================= */

/* Page banner with background and title overlay */
.banner {
    width: 100%;
    height: var(--banner-height);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 40px;
    overflow: hidden;
    flex-shrink: 0;
    background-color: var(--banner-bg);
    background-size: cover;
    background-position: center;
}

/* Dark overlay so text is always readable over any image */
.banner::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: var(--banner-overlay);
    z-index: 0;
}

/* Thin accent line at the bottom */
.banner::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--banner-accent-line);
    z-index: 1;
}

/* Banner title text */
.banner h1 {
    position: relative;
    z-index: 1;
    font-family: var(--banner-font);
    font-size: 4.0em;
    color: var(--banner-title-color);
    letter-spacing: 0.04em;
    text-shadow:
        0 0 4px #000,
        0 0 12px var(--banner-glow),
        0 0 24px var(--banner-glow);
    white-space: nowrap;
}


/* =============================================================================
   7. COMPONENT — CARD
   Generic content card. Reusable across all pages.
   Override colors/borders in per-page section 12.
   ============================================================================= */

/* Standard reusable content card style */
.card {
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 1em 1.2em;
    margin-bottom: 1em;
}

/* Small muted section label at the top of a card */
.card-label {
    font-size: 0.78em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 0.6em;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.4em;
}

/* Search row — label + input side by side */
.card-search-row {
    display: flex;
    align-items: center;
    gap: 1em;
    flex-wrap: wrap;
}

.card-search-row label {
    font-size: 0.9em;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.card-search-input {
    flex: 1;
    min-width: 160px;
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1em;
    padding: 6px 10px;
    transition: border-color var(--transition);
}

.card-search-input:focus {
    border-color: var(--color-accent);
    outline: none;
}

/* Filters row — two or more groups side by side */
.card-filters-row {
    display: flex;
    gap: 0;
    flex-wrap: wrap;
}

.card-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.35em;
    flex: 1;
    min-width: 160px;
    padding: 0 1.2em;
}

.card-filter-group:first-child {
    padding-left: 0;
}

.card-filter-group-title {
    font-size: 0.8em;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 0.3em;
}

.card-filter-group label {
    display: flex;
    align-items: center;
    gap: 0.5em;
    font-size: 0.9em;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color var(--transition);
}

.card-filter-group label:hover {
    color: var(--color-text);
}

.card-filter-group input[type="checkbox"] {
    accent-color: var(--color-accent);
    width: 13px;
    height: 13px;
    cursor: pointer;
}

/* Vertical divider between filter groups */
.card-filter-divider {
    width: 1px;
    background-color: var(--color-border);
    align-self: stretch;
    flex-shrink: 0;
}

/* Table card — zero padding so the table bleeds to the edges cleanly */
.card-table {
    padding: 0;
    overflow: hidden;
}

.card-table .datatable-wrapper {
    margin: 0;
}

/* Card heading — for title-style cards (e.g. home page cards) */
.card h2 {
    font-family: var(--font-display);
    color: var(--color-text);
    font-size: 1.4em;
    margin-bottom: 10px;
    letter-spacing: 0.03em;
}

.card p + p {
    margin-top: 8px;
}


/* Help button and panel wrapper in the top-right corner */
#help-container {
    position: fixed;
    top: 1em;
    right: 1em;
    z-index: 50;
}

#help-container.hidden { display: none; }

.help-btn {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #2a9fd6;
    background: rgba(10, 16, 26, 0.85);
    color: #2a9fd6;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 6px 8px;
    overflow: hidden;
    text-align: left;
    transition: width 0.35s ease, height 0.35s ease, border-radius 0.35s ease,
                background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.35s ease;
}

#help-container:hover .help-btn {
    width: 280px;
    min-height: 120px;
    height: auto;
    border-radius: 8px;
    background-color: rgba(10, 16, 26, 0.97);
    border-color: #2a9fd6;
    box-shadow: 0 0 0 1px rgba(42, 159, 214, 0.3), 4px 4px 16px rgba(0, 0, 0, 0.6);
    cursor: default;
}

.help-btn-icon {
    position: absolute;
    top: 6px;
    right: 8px;
    font-weight: bold;
    color: #2a9fd6;
    line-height: 1;
    transition: color var(--transition);
}

#help-container:hover .help-btn-icon { color: #ffffff; }

.help-panel {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    width: 100%;
    font-size: 0.88em;
    color: var(--color-text-muted);
    line-height: 1.7;
    transition: opacity 0.2s ease 0.15s, max-height 0.3s ease 0.1s, padding 0.2s ease 0.1s;
}

#help-container:hover .help-panel {
    opacity: 1;
    max-height: 400px;
    padding: 28px 12px 12px;
}

.help-panel h3 {
    position: absolute;
    top: 7px;
    left: 12px;
    font-family: var(--font-display);
    color: var(--color-text);
    font-size: 0.95em;
    opacity: 0;
    white-space: nowrap;
    overflow: hidden;
    max-width: 0;
    transition: opacity 0.2s ease 0.2s, max-width 0.3s ease 0.15s;
}

#help-container:hover .help-panel h3 { opacity: 1; max-width: 200px; }


/* =============================================================================
   8. COMPONENT — DATATABLE
   Base styles shared by both themes.
   Apply .datatable-dark or .datatable-light alongside .datatable.
   ============================================================================= */

/* Table wrapper and reset styles for data tables */
.datatable {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    margin: 0;
}

.datatable thead td,
.datatable thead th {
    padding: 12px 16px;
    border-bottom: 2px solid var(--color-border);
    border-right: 1px solid rgba(255,255,255,0.15);
    font-weight: bold;
    font-size: 1.05em;
    letter-spacing: 0.06em;
    font-family: var(--font-display);
    text-align: left;
}

.datatable thead td:last-child,
.datatable thead th:last-child {
    border-right: none;
}

.datatable tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: background-color var(--transition);
}

.datatable tbody td {
    padding: 10px 16px;
    border-right: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
}

.datatable tbody td:last-child {
    border-right: none;
}

.datatable tbody tr:first-child td {
    padding-top: 14px;
}

/* Dark table theme used by Smash Up and other dark pages */
/* --- Dark theme (default — used by Smash Up etc.) --- */
.datatable-dark {
    color: var(--color-text);
}

.datatable-dark thead tr {
    background-color: var(--color-accent);
    color: #ffffff;
}

.datatable-dark tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.15);
}

.datatable-dark tbody tr:hover {
    background-color: rgba(204, 34, 0, 0.08);
}

/* --- Light theme (used by Frosthaven etc.) --- */
.datatable-light {
    color: #1a2a3a;
}

.datatable-light thead tr {
    background-color: #1a5a96;
    color: #ffffff;
}

.datatable-light thead td,
.datatable-light thead th {
    border-right-color: rgba(255, 255, 255, 0.2);
}

.datatable-light tbody tr {
    background-color: rgba(220, 235, 248, 0.50);
    border-bottom-color: rgba(100, 150, 200, 0.3);
}

.datatable-light tbody tr:nth-child(even) {
    background-color: rgba(198, 220, 241, 0.65);
}

.datatable-light tbody tr:hover {
    background-color: rgba(150, 200, 240, 0.55);
}

.datatable-light tbody td {
    border-right-color: rgba(100, 150, 200, 0.15);
}

/* =============================================================================
   9. COMPONENT — FORM FIELDS
   Inputs, labels, and buttons used across generator pages.
   ============================================================================= */

/* Layout for form fields in rows */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 20px;
}

/* Individual form field container and spacing */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field label {
    font-size: 0.82em;
    color: var(--color-text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Text and number input styling for form controls */
.form-field input[type="text"],
.form-field input[type="number"] {
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1em;
    padding: 6px 10px;
    width: 120px;
    transition: border-color var(--transition);
}

.form-field input:focus {
    border-color: var(--color-accent);
    outline: none;
}

.form-derived {
    font-size: 0.9em;
    color: var(--color-text-muted);
    padding-bottom: 6px;
}

.form-derived span {
    color: var(--color-accent-hover);
    font-weight: bold;
}

/* Primary action button used for save, generate, or submit actions */
/* Primary action button */
.btn-primary {
    background-color: var(--color-accent);
    border: none;
    border-radius: 4px;
    color: #ffffff;
    font-family: var(--font-display);
    font-size: 1em;
    letter-spacing: 0.05em;
    padding: 10px 28px;
    cursor: pointer;
    transition: background-color var(--transition), transform 0.1s;
}

.btn-primary:hover  { background-color: var(--color-accent-hover); }
.btn-primary:active { transform: scale(0.97); }


/* =============================================================================
   10. COMPONENT — CHECKBOX GROUP
   Used for filter panels and house rule toggles.
   ============================================================================= */

/* Container for grouped checkbox filters */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    color: var(--color-text-muted);
    cursor: pointer;
}

.checkbox-group label:hover {
    color: var(--color-text);
}

.checkbox-group input[type="checkbox"],
.checkbox-group input[type="radio"] {
    accent-color: var(--color-accent);
    width: 14px;
    height: 14px;
    cursor: pointer;
}


/* =============================================================================
   11. SCROLLBAR
   ============================================================================= */

/* ::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-accent); } */


/* =============================================================================
   11.5. RESPONSIVE — MOBILE
   ============================================================================= */

@media (max-width: 768px) {

    /* Hide sidebar completely on mobile — just show the toggle button */
    #sidebar {
        width: var(--sidebar-collapsed);
    }

    #sidebar-title,
    #section-select,
    #sub-nav {
        opacity: 0;
        pointer-events: none;
    }

    /* Content area takes full width on mobile */
    #content-area {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }
    /* Center panel takes more width on mobile */
    .content-panel {
        width: 95%;
    }

    /* Smaller banner title so it fits */
    .banner h1 {
        font-size: 1.6em;
        white-space: normal;    /* allow wrapping on mobile */
    }

    /* Stack form fields vertically on mobile */
    .form-row {
        flex-direction: column;
    }

    .form-field input[type="text"],
    .form-field input[type="number"] {
        width: 100%;
    }

}


/* =============================================================================
   12. PER-PAGE OVERRIDES
   =============================================================================
   Each page gets its own subsection here.
   Scope overrides with the page's root class: .page-carwars .banner { }
   The page fragment's root div should have class="page-<id>" so these apply.

   STRUCTURE PER PAGE:
     a) Banner overrides  (background image, title color, glow, accent line)
     b) Layout overrides  (panel width, background, padding)
     c) Component tweaks  (datatable column widths, card colors, etc.)
   ============================================================================= */


/* ---------------------------------------------------------------------------
   HOME
   --------------------------------------------------------------------------- */

.page-home .banner {
    --banner-height:      300px;
    --banner-title-color: #e8e8e8;
    --banner-glow:        rgba(150, 100, 50, 0.4);
    --banner-accent-line: #cc2200;
    --banner-font:        'Immortal', 'Times New Roman', serif;
    background-image:     url("htmlImages/banners/home-banner.png");
    background-color: #1a1008;
}

.page-home .banner h1 {
    font-size: 5em;
    letter-spacing: 0.08em;
}

/* Intro card — slightly warmer and more prominent than a standard card */
.page-home .card {
    border-color: #555544;
    background-color: rgba(30, 25, 15, 0.6);
}

.page-home .card p {
    color: #ccccbb;
    font-size: 1.05em;
    line-height: 1.8;
}

.page-home .card p + p {
    margin-top: 0.6em;
    color: #888877;
    font-size: 0.95em;
    font-style: italic;
}

.page-home .card-label {
    color: #cc6633;
    border-bottom-color: #555544;
}


/* ---------------------------------------------------------------------------
   TEST (fetch + script loading test page)
   --------------------------------------------------------------------------- */

.page-test .banner {
    --banner-title-color: #44ff88;
    --banner-glow:        rgba(68, 255, 136, 0.4);
    --banner-accent-line: #44ff88;
}


/* ---------------------------------------------------------------------------
   CAR WARS GENERATOR
   --------------------------------------------------------------------------- */

.page-carwars .banner {
    background-image:     url("htmlImages/banners/carwars-banner.png");
    --banner-title-color: #f5a623;
    --banner-accent-line: #f5a623;
    --banner-font:        'StopD', 'Garamond', serif;
}

.page-carwars .card {
    border-color: #3a3020;
    background-color: rgba(20, 16, 8, 0.5);
}

.page-carwars .card-label {
    color: #f5a623;
    border-bottom-color: #3a3020;
}

/* Budget inputs */
.page-carwars .cw-budget-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5em;
    align-items: flex-end;
    margin-bottom: 0.8em;
}

.page-carwars .cw-budget-field {
    display: flex;
    flex-direction: column;
    gap: 0.4em;
}

.page-carwars .cw-budget-field label,
.page-carwars .cw-options-row label {
    font-size: 0.8em;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #aaaaaa;
    cursor: pointer;
    transition: color 0.3s ease;
}
.page-carwars .cw-budget-field label:hover { 
    color: #e8e8e8; 
}

.page-carwars .cw-budget-input {
    width: 80px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid #3a3020;
    border-radius: 4px;
    color: #e8e8e8;
    font-family: var(--font-body);
    font-size: 1em;
    padding: 6px 10px;
    transition: border-color 0.3s ease;
}
.page-carwars .cw-budget-input:focus { 
    border-color: #f5a623; 
    outline: none; 
}

/* Derived stats */
.page-carwars .cw-derived-stats {
    display: flex;
    gap: 2em;
    padding-top: 0.6em;
    margin-top: 0.6em;
    border-top: 1px solid #3a3020;
}
.page-carwars .cw-derived-stat { font-size: 0.9em; color: #aaaaaa; }
.page-carwars .cw-derived-stat span { color: #f5a623; font-weight: bold; }

/* Options */
.page-carwars .cw-options-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2em;
    align-items: center;
}

.page-carwars .cw-options-row label {
    display: flex;
    align-items: center;
    gap: 0.5em;
    font-size: 0.9em;
}

.page-carwars .card-filter-group input[type="checkbox"] {
    accent-color: #f5a623;
    width: 14px;
    height: 14px;
    cursor: pointer;
}

/* Generate button */
.page-carwars .cw-generate-btn {
    background-color: #f5a623;
    border: none;
    border-radius: 4px;
    color: #111111;
    font-family: var(--banner-font);
    font-size: 1.1em;
    letter-spacing: 0.08em;
    padding: 10px 32px;
    cursor: pointer;
    margin-top: 0.5em;
    transition: background-color 0.3s ease, transform 0.1s;
}
.page-carwars .cw-generate-btn:hover { background-color: #ffc147; }
.page-carwars .cw-generate-btn:active { transform: scale(0.97); }

/* Car layout grid */
.page-carwars .cw-car-layout {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: auto auto auto;
    gap: 0.8em;
    align-items: start;
    justify-items: stretch;
    margin-top: 0.5em;
}

.page-carwars .cw-car-front   { grid-column: 2; grid-row: 1; }
.page-carwars .cw-car-image   { grid-column: 2; grid-row: 2; display: flex; justify-content: center; }
.page-carwars .cw-car-back    { grid-column: 2; grid-row: 3; }
.page-carwars .cw-car-left    { grid-column: 1; grid-row: 2; }
.page-carwars .cw-car-right   { grid-column: 3; grid-row: 2; }

.page-carwars .cw-car-image img {
    width: 220px;
    opacity: 0.9;
    filter: invert(1) sepia(1) saturate(2) brightness(0.85);
}

/* Side panels */
.page-carwars .cw-side-panel {
    background-color: rgba(20, 16, 8, 0.4);
    border: 1px solid #3a3020;
    border-radius: 6px;
    padding: 0.6em 0.8em;
    min-height: 80px; min-width: 140px;
}

.page-carwars .cw-side-panel-title {
    font-size: 0.75em;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #f5a623;
    border-bottom: 1px solid #3a3020;
    padding-bottom: 0.3em;
    margin-bottom: 0.5em;
}

.page-carwars .cw-crew-panel { margin-top: 0.8em; }

/* Card entries */
.page-carwars .cw-card-entry {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5em;
    font-size: 0.82em;
    color: #cccccc;
    padding: 0.25em 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.page-carwars .cw-card-entry:last-child { border-bottom: none; }
.page-carwars .cw-card-name             { flex: 1; }
.page-carwars .cw-card-cost             { font-size: 0.85em; color: #f5a623; white-space: nowrap; }
.page-carwars .cw-card-type             { font-size: 0.78em; color: #777766; white-space: nowrap; }

/* Checkerboard accent strip */
.page-carwars .cw-checkerboard-strip {
    height: 8px;
    border-radius: 4px 4px 0 0;
    background-color: #f5a623;
}


/* ---------------------------------------------------------------------------
   GLOOMHAVEN COMPONENT LIST
   --------------------------------------------------------------------------- */

.page-gloomhaven .banner {
    background-image:     url("htmlImages/banners/gloomhaven-banner.png");
    --banner-title-color: #e8c96a;
    --banner-accent-line: #c8961e;
    --banner-font:        'Pirata', 'Garamond', serif;
}

/* Warm amber card borders to match the dungeon gold theme */
.page-gloomhaven .card {
    border-color: #3a2e10;
    background-color: rgba(18, 14, 5, 0.55);
}

.page-gloomhaven .card-label {
    color: #c8961e;
    border-bottom-color: #3a2e10;
}

/* Checkbox accents and filter labels */
.page-gloomhaven .card-filter-group input[type="checkbox"] {
    accent-color: #c8961e;
}

.page-gloomhaven .card-filter-group label:hover {
    color: #e8c96a;
}

.page-gloomhaven .card-filter-divider {
    background-color: #3a2e10;
}

/* Table header — deep dungeon gold */
.page-gloomhaven .datatable thead tr {
    background-color: #7a5a10;
}

.page-gloomhaven .datatable tbody tr:hover {
    background-color: rgba(200, 150, 30, 0.08);
}


/* ---------------------------------------------------------------------------
   FROSTHAVEN ITEM LIST
   --------------------------------------------------------------------------- */

.page-frosthaven .banner {
    background-image:     url("htmlImages/banners/frosthaven-banner.png");
    --banner-title-color: #cceeff;
    --banner-accent-line: #30a4fc;
    --banner-font:        'Pirata', 'Garamond', serif;
}

/* Card border tinted icy blue instead of default gray */
.page-frosthaven .card {
    border-color: #1e3a5a;
}

/* Card label and filter group titles — icy blue accent */
.page-frosthaven .card-label,
.page-frosthaven .card-filter-group-title {
    color: #5a9fc8;
    border-bottom-color: #1e3a5a;
}

/* Divider tinted to match */
.page-frosthaven .card-filter-divider {
    background-color: #1e3a5a;
}

/* Search input border tinted icy blue */
.page-frosthaven .card-search-input {
    border-color: #1e3a5a;
}

.page-frosthaven .card-search-input:focus {
    border-color: #2a9fd6;
}

/* Checkbox accent color — royal blue */
.page-frosthaven .card-filter-group input[type="checkbox"] {
    accent-color: #2a7fc1;
}

/* Label hover — light icy blue */
.page-frosthaven .card-filter-group label:hover {
    color: #cceeff;
}

/* Item icons */
.page-frosthaven .fhItemIcon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}


/* Separated checkbox — visually detached from the group above it */
.page-frosthaven .card-filter-group .card-filter-item-separated {
    margin-top: 0.6em;
}

/* Two-column grid for resource checkboxes */
.page-frosthaven .card-filter-resource-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35em 0.5em;
    margin-top: 0.2em;
}


/* ---------------------------------------------------------------------------
   WISHLIST
   --------------------------------------------------------------------------- */

.page-wishlist .banner {
    --banner-title-color: #dddddd;
    --banner-glow:        rgba(200, 200, 200, 0.3);
    --banner-accent-line: #888888;
}


/* ---------------------------------------------------------------------------
   ADD NEW PAGES BELOW THIS LINE
   Copy the block above and replace "pagename" with page's id.

   .page-pagename .banner { }
   .page-pagename .content-panel { }
   .page-pagename .datatable { }
   --------------------------------------------------------------------------- */


/* ---------------------------------------------------------------------------
   SMASH UP Randomizer
   --------------------------------------------------------------------------- */

.page-smashup .banner {
    background-image:     url("htmlImages/banners/smashup-banner.png");
    --banner-title-color: #df2424;
    --banner-accent-line: #df2424;
    --banner-font:        'Boogaloo', cursive;
}

/* Card style shared by all three control sections */
.page-smashup #smashPlayerCollection,
.page-smashup #smashCheckCollection,
.page-smashup .smashup-table-card {
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 1em 1.2em;
    margin-bottom: 1em;
}

/* Vertical divider between faction count and player names */
.page-smashup .form-divider {
    width: 1px;
    background-color: var(--color-border);
    align-self: stretch;
    margin: 0 0.5em;
}

/* Top row: All Factions on left, sort pills on right */
.page-smashup .smashup-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75em;
    margin-bottom: 0.75em;
    border-bottom: 1px solid var(--color-border);
}

/* All Factions toggle */
.page-smashup .smashup-all-factions {
    display: flex;
    align-items: center;
    gap: 0.5em;
    color: var(--color-text);
    cursor: pointer;
    font-size: 1em;
}

.page-smashup .smashup-all-factions input[type="checkbox"] {
    accent-color: #e02222;
}

/* Sort options — horizontal pill row */
.page-smashup .smashup-sort {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em;
}

.page-smashup .smashup-sort label {
    display: flex;
    align-items: center;
    gap: 0.3em;
    padding: 0.25em 0.75em;
    border: 1px solid var(--color-border);
    border-radius: 2em;
    font-size: 0.82em;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color var(--transition),
                border-color var(--transition),
                background-color var(--transition);
}

.page-smashup .smashup-sort label:hover {
    color: var(--color-text);
    border-color: #e02222;
}

/* Hide the actual radio button — the pill label is the visual */
.page-smashup .smashup-sort input[type="radio"] {
    display: none;
}

/* Checked state — highlight the pill */
.page-smashup .smashup-sort input[type="radio"]:checked + * ,
.page-smashup .smashup-sort label:has(input:checked) {
    color: #ffffff;
    background-color: #e02222;
    border-color: #e02222;
}

/* Expansion checkboxes — 3 columns */
.page-smashup .smashup-expansions {
    display: block;
    column-count: 3;
    column-gap: 1.5em;
    margin-bottom: 0;
}

.page-smashup .smashup-expansions label {
    break-inside: avoid;
    display: block;
    margin-bottom: 0.3em;
}

.page-smashup .checkbox-group input[type="checkbox"],
.page-smashup .checkbox-group input[type="radio"] {
    accent-color: #e02222;
}

/* Table card */
.page-smashup .smashup-table-card { padding: 0; overflow: hidden; }
.page-smashup .datatable-wrapper   { margin: 0; }
.page-smashup .datatable thead tr  { background-color: #e02222; }



/* ---------------------------------------------------------------------------
   CODING — PROJECTS
   --------------------------------------------------------------------------- */

.page-projects .banner {
    background-image:     url("htmlImages/banners/projects-banner.png");
    background-color:     #0a0612;
    --banner-title-color: #e8f4fb;
    --banner-accent-line: #5ab4e0;
    --banner-font:        'Garamond', 'Times New Roman', serif;
}

.page-projects .content-panel {
    background-color: #f5f0eb;
}

.page-projects .card {
    background-color: #ffffff;
    border-color: rgba(0, 0, 0, 0.07);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}


/* ── CARD LAYOUT ── */

.page-projects .proj-card {
    display: flex;
    flex-direction: row;
    gap: 2em;
    align-items: center;
}
.page-projects .proj-card.proj-flip { flex-direction: row-reverse; }

.page-projects .proj-image-wrap { flex: 0 0 320px; max-width: 320px; }


/* ── IMAGE PLACEHOLDER ── */

.page-projects .proj-image-placeholder {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #eef2f6;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.page-projects .proj-image-placeholder::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg,  transparent, transparent 24px, rgba(90,180,224,0.06) 24px, rgba(90,180,224,0.06) 25px),
        repeating-linear-gradient(90deg, transparent, transparent 24px, rgba(90,180,224,0.06) 24px, rgba(90,180,224,0.06) 25px);
}

.page-projects .proj-image-placeholder:hover {
    border-color: rgba(90, 180, 224, 0.5);
    box-shadow: 0 0 16px rgba(90, 180, 224, 0.12);
}

.page-projects .proj-image-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 7px;
    position: relative;
    z-index: 1;
}

.page-projects .proj-image-icon {
    font-size: 2em;
    opacity: 0.2;
    position: relative;
    z-index: 1;
}


/* ── ACTIVE DOT ── */

.page-projects .proj-active-dot      { position: absolute; top: 8px; right: 8px; width: 10px; height: 10px; border-radius: 50%; z-index: 2; }
.page-projects .proj-active-dot--on  { background-color: #17f70b; box-shadow: 0 0 8px rgba(5, 141, 11, 0.8); animation: proj-pulse 2.5s ease-in-out infinite; }
.page-projects .proj-active-dot--off { background-color: #d0d8e0; }

@keyframes proj-pulse {
    0%, 100% { opacity: 1;   transform: scale(1);   }
    50%       { opacity: 0.4; transform: scale(0.8); }
}


/* ── CONTENT ── */

.page-projects .proj-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}


/* ── TECH PILLS ── */

.page-projects .proj-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em;
    margin-bottom: 0.75em;
}

.page-projects .proj-pill {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.7em;
    padding: 0.25em 0.7em;
    border-radius: 999px;
    background: rgba(90, 180, 224, 0.1);
    border: 1px solid rgba(90, 180, 224, 0.3);
    color: #2a8ab8;
    white-space: nowrap;
}


/* ── TITLE ── */

.page-projects .proj-title {
    font-family: var(--font-display);
    font-size: 1.55em;
    color: #1a2a3a;
    letter-spacing: 0.03em;
    margin-bottom: 0.5em;
    line-height: 1.2;
}


/* ── WIP BADGE ── */

.page-projects .proj-wip-badge {
    display: inline-block;
    font-size: 0.38em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background-color: rgba(90, 180, 224, 0.1);
    border: 1px solid rgba(90, 180, 224, 0.35);
    color: #2a8ab8;
    border-radius: 999px;
    padding: 3px 10px;
    vertical-align: middle;
    position: relative;
    top: -4px;
}


/* ── DESCRIPTION ── */

.page-projects .proj-description {
    font-size: 0.92em;
    color: #4a5a6a;
    line-height: 1.85;
    margin-bottom: 1.2em;
}


/* ── LINKS ── */

.page-projects .proj-links {
    display: flex;
    gap: 0.6em;
    flex-wrap: wrap;
    margin-bottom: 1em;
}

.page-projects .proj-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    font-size: 0.78em;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 5px 16px;
    border-radius: 999px;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.page-projects .proj-link-github {
    background-color: #5ab4e0;
    border: 1px solid #5ab4e0;
    color: #ffffff;
}
.page-projects .proj-link-github:hover {
    background-color: #3a9acb;
    border-color: #3a9acb;
    box-shadow: 0 2px 10px rgba(90, 180, 224, 0.35);
    color: #ffffff;
}

.page-projects .proj-link-live {
    background-color: transparent;
    border: 1px solid #5ab4e0;
    color: #2a8ab8;
}
.page-projects .proj-link-live:hover {
    background-color: rgba(90, 180, 224, 0.1);
    color: #1a6a98;
}

.page-projects .proj-link-demo {
    background-color: transparent;
    border: 1px solid #5ab4e0;
    color: #2a8ab8;
}
.page-projects .proj-link-demo:hover {
    background-color: rgba(90, 180, 224, 0.1);
    color: #1a6a98;
}

.page-projects .proj-link-request {
    background: none;
    border: none;
    color: #8a9aaa;
    cursor: default;
    font-style: italic;
    letter-spacing: 0.03em;
    padding-left: 2px;
}

.page-projects .proj-link-soon {
    background: none;
    border: none;
    color: #aab8c4;
    cursor: default;
    padding-left: 2px;
}


/* ── START DATE ── */

.page-projects .proj-start-date {
    font-size: 0.78em;
    color: #8a9aaa;
    letter-spacing: 0.04em;
    margin-top: 0.4em;
    font-style: italic;
}


/* ── RESPONSIVE ── */

@media (max-width: 768px) {
    .page-projects .proj-card,
    .page-projects .proj-card.proj-flip { flex-direction: column; }
    .page-projects .proj-image-wrap     { flex: none; max-width: 100%; width: 100%; }
}