@media (min-width: 992px) {
    .mobile-menu-overlay-full,
    .mobile-menu-panel {
        display: none !important;
    }
}
/**
 * AnagramSolver.io - Main Stylesheet
 * Version: 2.0
 * Theme: Playful, Scrabble-inspired
 * Bootstrap 5.3.3 Compatible
 * 
 * Table of Contents:
 * 0. Font Face Declarations
 * 1. CSS Variables & Theme
 * 2. Base & Typography
 * 3. Header & Navigation
 * 4. Hero Section
 * 5. Search Components
 * 6. Tool Pages
 * 7. Word Results
 * 8. Features & Cards
 * 9. Content Sections
 * 10. Footer
 * 11. Utilities
 * 12. Animations
 * 13. Responsive
 */

/* ============================================
   0. FONT DECLARATIONS
   ============================================ */
/* System Font Stack - Maximum Performance
   No custom fonts = zero font download overhead
   Native fonts render instantly with no layout shift */

/* ============================================
   1. CSS VARIABLES & THEME
   ============================================ */
:root {
    /* Primary Colors - Scrabble Tile Inspired */
    --primary: #E4A853;
    --primary-dark: #C8922E;
    --primary-light: #F5D69A;
    --primary-rgb: 228, 168, 83;
    
    /* Secondary Colors - Green Accent */
    /* Changed from #538d4e to #3d6b39 for WCAG AA contrast (4.5:1+) with white text */
    --secondary: #3d6b39;
    --secondary-dark: #2d5029;
    --secondary-light: #538d4e;
    --secondary-rgb: 61, 107, 57;
    
    /* Accent Colors */
    --accent: #C24B3B;
    --accent-light: #E67065;
    --success: #4CAF50;
    --warning: #FF9800;
    --danger: #F44336;
    --info: #2196F3;
    
    /* Background Colors */
    --bg-warm: #FDF8F0;
    --bg-cream: #FFF9F0;
    --bg-light: #FFFEFB;
    --bg-white: #FFFFFF;
    --bg-dark: #1A1A1A;
    
    /* Text Colors */
    --text-dark: #2B2B2B;
    --text-muted: #5A5A5A;
    --text-light: #666666;  /* Improved contrast - 5.74:1 ratio for WCAG AA */
    --text-white: #FFFFFF;
    
    /* Tile Colors */
    --tile-bg: #F7E6C4;
    --tile-border: #D4B896;
    --tile-shadow: #C8922E;
    --tile-result: #A8E6CF;
    --tile-result-border: #6ABF9D;
    
    /* Game Colors */
    --scrabble-us: #E4A853;
    --scrabble-uk: #6B8E23;
    --wwf: #4169E1;
    --wordle: #6AAA64;
    --quordle: #FFB347;
    --octordle: #9B59B6;
    
    /* Shadows */
    --shadow-xs: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.15);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.2);
    --shadow-tile: 0 3px 0 var(--tile-shadow), 0 5px 10px rgba(0,0,0,0.2);
    
    /* Typography - Modern System Font Stack (2026 Optimized) */
    --font-display: system-ui, "Segoe UI Variable", "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif;
    --font-body: system-ui, "Segoe UI Variable", "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    
    /* Override Bootstrap's font variable for consistency */
    --bs-body-font-family: system-ui, "Segoe UI Variable", "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
    
    /* Spacing */
    --section-padding: 80px 0;
    --section-padding-sm: 60px 0;
    --section-padding-xs: 40px 0;
    
    /* Border Radius */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 30px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-tooltip: 1080;
}

/* Dark Mode Variables (for future use) */
[data-theme="dark"] {
    --bg-warm: #1A1A1A;
    --bg-cream: #222222;
    --bg-light: #2B2B2B;
    --text-dark: #F5F5F5;
    --text-muted: #AAAAAA;
}

/* ============================================
   2. BASE & TYPOGRAPHY
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--bs-body-font-family);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-warm);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Headings */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-dark);
    margin-top: 0;
    margin-bottom: 0.5em;
}

h1, .h1 { font-size: calc(1.375rem + 1.5vw); }
h2, .h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3, .h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4, .h4 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h5, .h5 { font-size: 1.125rem; }
h6, .h6 { font-size: 1rem; }

/* Paragraphs */
p {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.lead {
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.7;
}

/* Links */
a {
    color: var(--secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* Lists */
ul, ol {
    margin-top: 0;
    margin-bottom: 1rem;
    padding-left: 2rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Selection */
::selection {
    background: var(--primary);
    color: var(--text-dark);
}

/* ============================================
   3. HEADER & NAVIGATION
   ============================================ */
.site-header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: var(--z-sticky);
    transition: box-shadow var(--transition-base);
}

.site-header.scrolled {
    box-shadow: var(--shadow-md);
}

.navbar {
    padding: 0.75rem 0;
}

/* Brand */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    text-decoration: none;
}

.navbar-brand:hover {
    color: var(--text-dark);
}

.brand-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: linear-gradient(145deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--text-dark);
    font-weight: 700;
    font-size: 1.25rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-tile);
}

.brand-text {
    color: var(--text-dark);
}

.brand-text span {
    color: var(--secondary);
}

/* Navigation Links */
.navbar-nav {
    gap: 0.25rem;
}

.navbar-nav > li {
    margin-bottom: 0;
}

.dropdown-menu > li {
    margin-bottom: 0;
}

.nav-link {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-dark);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

@media (min-width: 992px) {
    .navbar {
        padding: 0.45rem 0;
    }
    .navbar .container {
        align-items: center;
    }
    .navbar-collapse {
        justify-content: flex-end;
    }
    .navbar-nav {
        align-items: center;
        gap: 0.35rem;
    }
    .nav-link {
        padding: 0.45rem 0.9rem;
        font-size: 1rem;
    }
    .navbar-brand {
        gap: 0.4rem;
    }
    .brand-tile {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-dark);
    background: rgba(var(--primary-rgb), 0.1);
}

/* Mega Menu Dropdown (desktop) */
.dropdown-mega {
    position: relative;
}

.dropdown-mega .dropdown-menu {
    position: absolute;
    left: 0;
    top: 100%;
    min-width: 260px;
    padding: 0.5rem 0.25rem;
    padding-top: 0.9rem;
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    margin-top: 0;
    z-index: var(--z-dropdown);
    background: #ffffff;
    display: none;
}

/* Invisible bridge to prevent dropdown closing when cursor moves through gap */
.dropdown-mega .dropdown-menu::before {
    content: '';
    position: absolute;
    top: -0.5rem;
    left: 0;
    right: 0;
    height: 0.5rem;
    background: transparent;
}

/* Hide default Bootstrap caret (we use inline chevron icons) */
.dropdown-toggle::after {
    display: none !important;
    content: none !important;
}

@media (min-width: 992px) {
    .dropdown-mega:hover > .dropdown-menu {
        display: block;
    }
}

.navbar-nav .dropdown-mega:nth-of-type(1) .dropdown-menu {
    left: 0;
    right: auto;
}

.navbar-nav .dropdown-mega:nth-of-type(2) .dropdown-menu {
    left: 0;
    right: auto;
}

.dropdown-mega .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.98rem;
    transition: none;
}

.dropdown-mega .dropdown-item:hover {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary-dark);
}

/* Dropdown Menu Icons */
.menu-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Icon Color Classes */
.icon-primary { color: #E4A853; }
.icon-success { color: #22c55e; }
.icon-danger { color: #ef4444; }
.icon-info { color: #06b6d4; }
.icon-warning { color: #f97316; }
.icon-purple { color: #8b5cf6; }
.icon-blue { color: #3b82f6; }
.icon-pink { color: #ec4899; }
.icon-teal { color: #14b8a6; }
.icon-indigo { color: #6366f1; }
.icon-orange { color: #f97316; }

.nav-arrow-icon {
    margin-left: 6px;
    transition: none;
}

@media (min-width: 992px) {
    .dropdown-mega:hover .nav-arrow-icon {
        transform: rotate(180deg);
    }
}

.nav-cta {
    font-weight: 700;
    color: var(--primary);
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    transition: color 0.2s ease;
}

.nav-cta:hover,
.nav-cta:focus {
    color: var(--primary-dark);
}

/* Mobile Navigation */
.navbar-toggler {
    border: none;
    padding: 0.5rem;
    font-size: 1.5rem;
    color: var(--text-dark);
    background: transparent;
}

.navbar-toggler:focus {
    box-shadow: none;
    outline: none;
}

/* Mobile Off-Canvas Menu (slides from right) */
/* Mobile Menu Overlay */
.mobile-menu-overlay-full,
.mobile-menu-panel {
    display: none;
}

.mobile-menu-overlay {
    display: none;
}

@media (max-width: 991.98px) {
    /* Fullscreen mobile menu */
    .mobile-menu-overlay-full {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
        z-index: 1200;
    }
    
    .mobile-menu-overlay-full.open {
        opacity: 1;
        visibility: visible;
    }
    
    .mobile-menu-panel {
        display: block;
        position: fixed;
        inset: 0;
        background: #ffffff;
        z-index: 1210;
        transform: translateY(2%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s ease;
        overflow: hidden;
    }
    
    .mobile-menu-panel.open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .mobile-menu-panel-inner {
        display: flex;
        flex-direction: column;
        height: 100%;
    }
    
    .mobile-menu-header-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1.25rem 1.75rem;
        border-bottom: 1px solid #eee;
        flex-shrink: 0;
        background: #fff;
    }
    
    .mobile-menu-header-row.subpanel {
        justify-content: space-between;
    }
    
    .menu-title {
        font-family: var(--font-display);
        font-size: 1.2rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        margin: 0;
        color: var(--text-dark);
    }
    
    .mobile-menu-close {
        background: none;
        border: none;
        font-size: 1.6rem;
        color: var(--text-dark);
        cursor: pointer;
        padding: 0.25rem;
        line-height: 1;
        opacity: 0.8;
        transition: opacity 0.2s ease, color 0.2s ease;
    }
    
    .mobile-menu-close:hover,
    .mobile-menu-close:focus {
        opacity: 1;
        color: var(--primary-dark);
    }
    
    .mobile-menu-body {
        display: none;
        flex: 1;
        overflow-y: auto;
        padding: 0.5rem 1.75rem 1.75rem;
    }
    
    .mobile-menu-body.active {
        display: block;
    }
    
    .mobile-menu-item {
        width: 100%;
        text-align: left;
        padding: 1.15rem 0;
        border-bottom: 1px solid #f0f0f0;
        background: none;
        border: none;
        color: var(--text-dark);
        font-family: var(--font-display);
        font-size: 1.05rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        cursor: pointer;
        transition: color 0.2s ease, padding-left 0.2s ease, background-color 0.2s ease;
    }
    
    .mobile-menu-item.link {
        text-decoration: none;
        justify-content: flex-start;
    }
    
    .mobile-menu-item:hover,
    .mobile-menu-item:focus {
        color: var(--primary-dark);
        padding-left: 0.25rem;
        background: #f8f9fa;
    }
    
    .mobile-subpanel {
        display: none;
        flex-direction: column;
        height: 100%;
    }
    
    .mobile-subpanel.active {
        display: flex;
    }
    
    .mobile-menu-back {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        background: none;
        border: none;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--text-dark);
        cursor: pointer;
        padding: 0.35rem 0;
    }
    
    .mobile-menu-back:hover,
    .mobile-menu-back:focus {
        color: var(--primary-dark);
    }
    
    .mobile-menu-footer-panel {
        padding: 1.25rem 1.75rem;
        text-align: center;
        color: #767676;  /* Improved contrast - 4.54:1 ratio */
        font-size: 0.9rem;
        border-top: 1px solid #eee;
        flex-shrink: 0;
    }
    
    /* Dark overlay behind menu - covers left side */
    .mobile-menu-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: calc(100% - min(85vw, 400px));
        height: 100%;
        background: rgba(50, 50, 50, 0.6);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 1055;
    }
    
    .mobile-menu-overlay.show {
        opacity: 1;
        visibility: visible;
    }
    
    /* Hamburger toggle - larger icon */
    .navbar-toggler {
        padding: 0.5rem;
        font-size: 1.75rem;
    }
    
    .navbar-toggler svg {
        width: 32px;
        height: 32px;
    }
    
    /* Slide-in panel */
    .navbar-collapse {
        position: fixed;
        top: 0;
        right: calc(-1 * min(85vw, 400px));
        width: min(85vw, 400px);
        height: 100vh;
        background: #FFFFFF;
        padding: 0;
        box-shadow: -4px 0 20px rgba(0,0,0,0.15);
        transition: right 0.3s ease;
        z-index: 1060;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }
    
    /* Ensure all menu content is above overlay */
    .navbar-collapse * {
        position: relative;
        z-index: 1;
    }
    
    .navbar-collapse.show {
        right: 0;
    }
    
    .navbar-collapse.collapsing {
        right: calc(-1 * min(85vw, 400px));
        transition: right 0.3s ease;
        height: 100vh !important;
        display: flex;
    }
    
    /* Mobile menu header with close button */
    .mobile-menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1.25rem 1.75rem;
        border-bottom: 1px solid #e5e5e5;
        flex-shrink: 0;
        background: #fff;
    }
    
    .mobile-menu-header .brand-text {
        font-family: var(--font-display);
        font-size: 1.15rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-dark);
    }
    
    .mobile-menu-close {
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--text-dark);
        cursor: pointer;
        padding: 0.25rem;
        line-height: 1;
        opacity: 0.7;
        transition: opacity 0.2s ease;
    }
    
    .mobile-menu-close:hover {
        opacity: 1;
        color: var(--primary-dark);
    }
    
    /* Mobile nav items - main menu */
    .mobile-menu-content {
        flex: 1;
        overflow-y: auto;
        padding-bottom: 100px;
    }
    
    .navbar-nav {
        flex-direction: column;
        gap: 0;
        padding: 0;
    }
    
    .navbar-nav .nav-item {
        border-bottom: 1px solid #f0f0f0;
    }
    
    .navbar-nav .nav-item:last-child {
        border-bottom: none;
    }
    
    .navbar-nav .nav-link {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1.35rem 1.75rem;
        font-size: 1rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-dark);
        background: transparent;
        border-radius: 0;
        transition: background-color 0.2s ease, color 0.2s ease;
    }
    
    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link:focus {
        background: #f8f9fa;
        color: var(--primary-dark);
    }
    
    .navbar-nav .nav-link.active {
        color: var(--primary);
        background: rgba(var(--primary-rgb), 0.05);
    }
    
    /* Hide Bootstrap dropdown caret */
    .navbar-nav .dropdown-toggle::after {
        content: none;
        display: none;
    }
    
    /* Arrow icon for dropdown toggles */
    .navbar-nav .nav-arrow {
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.25s ease;
        color: #666;
        margin-left: auto;
        flex-shrink: 0;
    }
    
    .navbar-nav .nav-arrow svg {
        width: 20px;
        height: 20px;
    }
    
    .navbar-nav .dropdown-toggle.active .nav-arrow {
        transform: rotate(180deg);
        color: var(--primary);
    }
    
    /* Hide desktop dropdown menu on mobile */
    .dropdown-mega .dropdown-menu {
        display: none !important;
    }
    
    /* Mobile Accordion Submenu */
    .mobile-submenu {
        display: none;
        background: #f8f9fa;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .mobile-submenu.show {
        display: block;
        max-height: 500px;
    }
    
    .mobile-submenu .dropdown-item {
        display: block;
        padding: 1.1rem 1.75rem 1.1rem 2.75rem;
        font-size: 0.95rem;
        font-weight: 500;
        color: var(--text-dark);
        text-transform: none;
        letter-spacing: normal;
        border-bottom: 1px solid #eee;
        text-decoration: none;
        transition: background-color 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
    }
    
    .mobile-submenu .dropdown-item:last-child {
        border-bottom: none;
    }
    
    .mobile-submenu .dropdown-item:hover,
    .mobile-submenu .dropdown-item:focus {
        background: #f0f0f0;
        color: var(--primary-dark);
        padding-left: 3rem;
    }
    
    /* Copyright footer */
    .mobile-menu-footer {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 1.5rem 1.75rem;
        text-align: center;
        color: #767676;  /* Improved contrast - 4.54:1 ratio */
        font-size: 0.85rem;
        background: #fff;
        border-top: 1px solid #e5e5e5;
        flex-shrink: 0;
    }
    
    /* Mobile Filter Optimizations */
    .quick-filter-letters .quick-filter-btn {
        min-width: 32px;
        min-height: 32px;
        font-size: 0.8rem;
        touch-action: manipulation;
    }
    
    .quick-filter-buttons .quick-filter-btn {
        min-width: 36px;
        min-height: 36px;
        touch-action: manipulation;
    }
    
    .radio-option,
    .checkbox-option {
        min-height: 44px;
        padding: 0.75rem 0.5rem;
    }
    
    .filter-input {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .filter-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .filter-help-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .dict-badge {
        padding: 0.2rem 0.4rem;
    }
}

/* ============================================
   3.5 BREADCRUMB STYLES
   ============================================ */
.styled-breadcrumb {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(228, 168, 83, 0.12) 0%, rgba(228, 168, 83, 0.06) 100%);
    border: 1px solid rgba(228, 168, 83, 0.2);
    border-radius: var(--radius-md);
}

.styled-breadcrumb .breadcrumb {
    margin-bottom: 0;
    background: transparent;
    padding: 0;
    display: flex;
    align-items: center;
}

.styled-breadcrumb .breadcrumb-item {
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    display: flex;
    align-items: center;
}

.styled-breadcrumb .breadcrumb-item a {
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.styled-breadcrumb .breadcrumb-item a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.styled-breadcrumb .breadcrumb-item.active {
    color: var(--text-dark);
    font-weight: 600;
}

.styled-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
}

/* ============================================
   4. HERO SECTION
   ============================================ */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #F5C97A 30%, #FFDC9A 60%, var(--primary) 100%);
    min-height: 70vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 60px 0;
}

.hero-compact {
    min-height: auto;
    padding: 40px 0;
}

.hero-title {
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(255,255,255,0.3);
}

.hero-title .highlight {
    color: var(--secondary);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-dark);
    opacity: 0.85;
    margin-bottom: 2rem;
}

/* Floating Tiles Animation */
.floating-tiles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.float-tile {
    position: absolute;
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.3);
    backdrop-filter: blur(2px);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-dark);
    opacity: 0.6;
    left: var(--x);
    top: var(--y);
    animation: floatTile 6s ease-in-out infinite;
    animation-delay: var(--delay);
}

/* ============================================
   5. SEARCH COMPONENTS
   ============================================ */
.search-box {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    max-width: 550px;
    margin: 0 auto;
}

.search-box-wide {
    max-width: 700px;
}

.tile-input {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    text-align: center;
    width: 100%;
    padding: 1rem 1.5rem;
    border: 3px solid var(--text-dark);
    border-radius: var(--radius-md);
    background: var(--tile-bg);
    color: var(--text-dark);
    transition: all var(--transition-fast);
}

.tile-input::placeholder {
    color: #767676;  /* Improved contrast - 4.54:1 ratio */
    font-size: 1.25rem;
    letter-spacing: 0.1em;
}

.tile-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.3);
    background: #FFFEF5;
}

/* Filter Inputs */
.filter-input {
    border: 2px solid #E0E0E0;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    font-size: 16px; /* 16px prevents iOS Safari auto-zoom on focus */
    transition: border-color var(--transition-fast);
}

.filter-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
    outline: none;
}

/* Filter Field Labels */
.filter-field-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
    padding-left: 0.75rem;
}

/* Filter Count Badge */
.filter-count-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: #fff;
    background: var(--secondary);
    border-radius: 50px;
    margin-left: 0.5rem;
    vertical-align: middle;
    animation: badgePulse 0.3s ease-out;
}

@keyframes badgePulse {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* Loading Spinner Animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin {
    animation: spin 0.8s linear infinite;
}

.btn-loading {
    align-items: center;
}

/* Smaller Apply Filters button for sidebar */
#apply-filters-btn,
#mobile-apply-filters-btn {
    font-size: 1rem;
    padding: 0.75rem 1rem;
    min-height: 44px;
}

/* Apply Filters button loading state - spin the icon */
.is-loading .apply-btn-icon {
    animation: spin 1s linear infinite;
}

/* Filter Input with Help Button */
.filter-input-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
}

/* Locked prefix styling for base filters */
.filter-input-wrapper.has-locked-prefix {
    background: #fff;
    border: 2px solid #E0E0E0;
    border-radius: 50px;
    overflow: visible;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.filter-input-wrapper.has-locked-prefix:focus-within {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(231, 153, 44, 0.15);
}

.filter-locked-prefix {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.6rem 0.5rem 0.85rem;
    background: linear-gradient(135deg, #f5f5f5 0%, #ebebeb 100%);
    color: #555;
    font-weight: 700;
    font-size: 0.9rem;
    border-right: 2px solid #E0E0E0;
    min-width: 30px;
    text-transform: lowercase;
    user-select: none;
    font-family: var(--font-heading);
    border-radius: 48px 0 0 48px;
}

.filter-input-with-prefix {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding-left: 0.5rem;
    padding-right: 2.5rem;
    flex: 1;
    min-width: 0;
    border-radius: 0 48px 48px 0 !important;
}

.filter-input-with-prefix:focus {
    outline: none;
    box-shadow: none !important;
}

.filter-input-with-prefix::placeholder {
    color: #767676;  /* Improved contrast - 4.54:1 ratio */
    font-size: 0.85rem;
}

.filter-input-with-help {
    padding-right: 3rem;
    border-radius: 50px;
}

.filter-help-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: color var(--transition-fast);
}

.filter-help-btn:hover {
    color: var(--text-dark);
}

.filter-help-btn svg {
    width: 20px;
    height: 20px;
}

/* Filter Tooltip */
.filter-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 0.875rem 1.25rem;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.6;
    width: 220px;
    max-width: 240px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
    text-align: center;
    /* font-family: var(--font-body); */
    font-family: var(--bs-body-font-family);
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    pointer-events: none;
}

.filter-tooltip-wide {
    width: 260px;
    max-width: 280px;
}

/* Tooltip Arrow */
.filter-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 10px solid transparent;
    border-top-color: #333;
}

/* Tooltip Highlighted Text */
.filter-tooltip em {
    color: #E4A853;
    font-style: normal;
    font-weight: 700;
}

/* Show tooltip ONLY on click (active state) */
.filter-help-btn.active .filter-tooltip {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Tooltip on right side for Ends and Length fields */
.col-6:nth-child(2) .filter-tooltip,
.col-6:nth-child(4) .filter-tooltip {
    left: auto;
    right: 0;
    transform: translateX(0);
}

.col-6:nth-child(2) .filter-tooltip::after,
.col-6:nth-child(4) .filter-tooltip::after {
    left: auto;
    right: 20px;
    transform: none;
}

/* Tooltip on left side for Starts and Contains fields */
.col-6:nth-child(1) .filter-tooltip,
.col-6:nth-child(3) .filter-tooltip {
    left: 0;
    right: auto;
    transform: translateX(0);
}

.col-6:nth-child(1) .filter-tooltip::after,
.col-6:nth-child(3) .filter-tooltip::after {
    left: 20px;
    right: auto;
    transform: none;
}

/* Search Button */
.btn-search {
    background: var(--secondary);
    color: var(--text-white);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all var(--transition-base);
    cursor: pointer;
}

.btn-search:hover {
    background: var(--secondary-dark);
    color: var(--text-white);
    box-shadow: 0 4px 12px rgba(var(--secondary-rgb), 0.3);
}

/* Button SVG Icons - Bolder/Larger */
.btn-search svg {
    width: 20px;
    height: 20px;
    stroke-width: 0.5px;
    stroke: currentColor;
}

/* Tool-Specific Button Colors */
.hero-unscrambler .btn-search {
    background: #b8860b;
}
.hero-unscrambler .btn-search:hover {
    background: #8b6914;
    box-shadow: 0 6px 20px rgba(184, 134, 11, 0.4);
}

.hero-scrambler .btn-search {
    background: #16a34a;
}
.hero-scrambler .btn-search:hover {
    background: #15803d;
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.4);
}

.hero-scrabble .btn-search {
    background: #0891b2;
}
.hero-scrabble .btn-search:hover {
    background: #0e7490;
    box-shadow: 0 6px 20px rgba(8, 145, 178, 0.4);
}

.hero-wordle .btn-search {
    background: #ea580c;
}
.hero-wordle .btn-search:hover {
    background: #c2410c;
    box-shadow: 0 6px 20px rgba(234, 88, 12, 0.4);
}

/* Anagram Solver Homepage - Golden Button */

.hero-home {
    min-height: auto;
    padding: 30px 0 30px;
}


.hero-home .btn-search {
    background: #C8922E;
}
.hero-home .btn-search:hover {
    background: #a67a24;
    box-shadow: 0 6px 20px rgba(200, 146, 46, 0.4);
}

/* Tool-Specific Input Focus Colors */
.hero-unscrambler .tile-input:focus,
.hero-unscrambler .filter-input:focus {
    border-color: #b8860b;
    box-shadow: 0 0 0 4px rgba(184, 134, 11, 0.25);
}

.hero-scrambler .tile-input:focus,
.hero-scrambler .filter-input:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.25);
}

.hero-scrabble .tile-input:focus,
.hero-scrabble .filter-input:focus {
    border-color: #0891b2;
    box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.25);
}

.hero-wordle .tile-input:focus,
.hero-wordle .filter-input:focus {
    border-color: #ea580c;
    box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.25);
}

/* Tool-Specific Input Backgrounds */
.hero-unscrambler .tile-input {
    background: #fffbf0;
}
.hero-unscrambler .tile-input:focus {
    background: #fff8e6;
}

.hero-scrambler .tile-input {
    background: #f0fff4;
}
.hero-scrambler .tile-input:focus {
    background: #e6ffed;
}

.hero-scrabble .tile-input {
    background: #f0fdff;
}
.hero-scrabble .tile-input:focus {
    background: #e0faff;
}

.hero-wordle .tile-input {
    background: #fff7f0;
}
.hero-wordle .tile-input:focus {
    background: #ffefe0;
}

/* Trust Badges */
.trust-badges {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.badge-item {
    background: rgba(255,255,255,0.85);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-full);
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge-item i {
    color: var(--secondary);
    font-size: 1.1rem;
}

/* ============================================
   6. TOOL PAGES
   ============================================ */
.tool-page {
    padding: var(--section-padding);
}

.tool-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tool-header h1 {
    margin-bottom: 0.5rem;
}

.tool-header .lead {
    max-width: 600px;
    margin: 0 auto;
}

.tool-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    align-items: start;
}

.tool-sidebar {
    position: static;
}

/* ============================================
   7. WORD RESULTS
   ============================================ */
.results-container {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    /* box-shadow: var(--shadow-sm); */
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bg-cream);
}

.results-count {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--secondary);
}

.word-group {
    margin-bottom: 2rem;
}

.word-group-header {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-dark);
    padding: 0.75rem 1rem;
    background: var(--bg-cream);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.word-group-header span {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.9rem;
}

.word-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.word-tile {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: var(--tile-bg);
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-dark);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
}

.word-tile:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.word-tile .points {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Smart Threshold - Hidden Words */
.word-tile.word-tile-hidden {
    display: none !important;
}

.result-card.expanded .word-tile.word-tile-hidden {
    display: inline-flex !important;
}

/* Show All Button */
.show-all-container {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.btn-show-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem 1.5rem;
    background: transparent;
    border: 2px solid var(--secondary);
    border-radius: var(--radius-md);
    color: var(--secondary);
    font-family: var(--font-display);
    font-weight: 500;
    cursor: pointer;
}

.btn-show-all:hover {
    background: var(--secondary);
    border-color: var(--secondary);
    color: #fff;
}

.btn-show-all svg {
    transition: none;
}

.btn-show-all:hover svg {
    transform: none;
}

/* Hide button when expanded */
.result-card.expanded .btn-show-all {
    display: none;
}

/* Load More Button */
.load-more-container {
    margin-top: 1rem;
}

.btn-load-more {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem 1.5rem;
    background: transparent;
    border: 2px solid var(--secondary);
    border-radius: var(--radius-md);
    color: var(--secondary);
    font-family: var(--font-display);
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

.btn-load-more:hover {
    background: var(--secondary);
    border-color: var(--secondary);
    color: #fff;
}

.btn-load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-load-more .remaining-count {
    font-weight: 400;
    opacity: 0.8;
    font-size: 0.85em;
}

.btn-load-more svg {
    width: 16px;
    height: 16px;
}

/* Word Count Summary */
.word-count-summary {
    background: linear-gradient(135deg, var(--bg-warm) 0%, var(--bg-cream) 100%);
    border: 1px solid var(--tile-border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.word-count-summary strong {
    font-weight: 600;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--text-dark);
}


/* Result card count styling */
.result-card-count .count-displayed,
.result-card-count .count-total {
    font-weight: 600;
}

/* ============================================
   8. FEATURES & CARDS
   ============================================ */
.section {
    /* padding: var(--section-padding); */
    padding: 2rem 0 4rem;
}

.section-light {
    background: var(--bg-light);
}

.section-dark {
    background: var(--secondary);
    color: var(--text-white);
}

.section-dark h2,
.section-dark h3,
.section-dark p {
    color: var(--text-white);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    margin-bottom: 0.75rem;
}

.section-header p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Feature Cards */
.feature-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    height: 100%;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    border: 2px solid transparent;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.feature-icon i {
    font-size: 1.75rem;
    color: var(--text-dark);
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.feature-card p {
    font-size: 0.95rem;
    margin: 0;
}

/* Step Cards */
.step-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    text-align: center;
    height: 100%;
    position: relative;
    box-shadow: var(--shadow-md);
}

.step-number {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 45px;
    height: 45px;
    background: var(--secondary);
    color: var(--text-white);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(var(--secondary-rgb), 0.3);
}

.step-icon {
    width: 80px;
    height: 80px;
    background: var(--tile-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem auto 1.5rem;
}

.step-icon i {
    font-size: 2rem;
    color: var(--primary-dark);
}

/* Game Cards */
.game-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1rem;
    text-align: center;
    transition: all var(--transition-base);
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.game-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    box-shadow: 0 3px 0 rgba(0,0,0,0.2);
}

.game-icon.scrabble-us { background: linear-gradient(145deg, var(--scrabble-us), #C8922E); color: var(--text-dark); }
.game-icon.scrabble-uk { background: linear-gradient(145deg, var(--scrabble-uk), #556B2F); color: var(--text-white); }
.game-icon.wwf { background: linear-gradient(145deg, var(--wwf), #2B4BA0); color: var(--text-white); }
.game-icon.wordle { background: linear-gradient(145deg, var(--wordle), #538D4E); color: var(--text-white); }
.game-icon.quordle { background: linear-gradient(145deg, var(--quordle), #E59400); color: var(--text-dark); }
.game-icon.octordle { background: linear-gradient(145deg, var(--octordle), #7D3C98); color: var(--text-white); }

/* Example Cards */
.example-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.example-tiles {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.example-tiles .tile {
    width: 36px;
    height: 40px;
    background: linear-gradient(145deg, var(--tile-bg) 0%, #E8D5B0 100%);
    border: 2px solid var(--tile-border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-dark);
    box-shadow: 0 2px 0 var(--tile-border);
}

.example-tiles.result .tile {
    background: linear-gradient(145deg, var(--tile-result) 0%, #88D8B0 100%);
    border-color: var(--tile-result-border);
    box-shadow: 0 2px 0 var(--tile-result-border);
}

.example-arrow {
    padding: 1rem 0;
    color: var(--primary);
    font-size: 1.5rem;
}

.example-label {
    margin-top: 1rem;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--secondary);
}

/* Testimonial Cards */
.testimonial-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    height: 100%;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary);
}

.testimonial-card .stars {
    color: var(--primary);
    margin-bottom: 1rem;
}

.testimonial-card .quote {
    font-style: italic;
    color: var(--text-dark);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.testimonial-card .author strong {
    display: block;
    font-family: var(--font-display);
}

.testimonial-card .author span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Tip Cards */
.tip-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    height: 100%;
    box-shadow: var(--shadow-sm);
    border-top: 4px solid var(--secondary);
}

.tip-card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tip-card h3 i {
    color: var(--primary);
}

/* ============================================
   9. CONTENT SECTIONS
   ============================================ */
/* FAQ Accordion */
.faq-accordion .accordion-item {
    background: var(--bg-white);
    border: none;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.faq-accordion .accordion-button {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-dark);
    background: var(--bg-white);
    padding: 1.25rem 1.5rem;
}

.faq-accordion .accordion-button:not(.collapsed) {
    background: var(--tile-bg);
    color: var(--text-dark);
    box-shadow: none;
}

.faq-accordion .accordion-button:focus {
    box-shadow: none;
}

.faq-accordion .accordion-button::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%232D5A4B'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
}

.faq-accordion .accordion-body {
    padding: 0 1.5rem 1.5rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* CTA Section */
.cta-section {
    padding: var(--section-padding-sm);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    text-align: center;
}

.cta-section h2 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.cta-section p {
    color: var(--text-dark);
    opacity: 0.85;
    margin-bottom: 1.5rem;
}

.btn-cta {
    background: var(--secondary);
    color: var(--text-white);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.9rem 2rem;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn-cta:hover {
    background: var(--secondary-dark);
    color: var(--text-white);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--secondary-rgb), 0.4);
}

/* ============================================
   10. FOOTER
   ============================================ */
.site-footer {
    background: var(--bg-dark);
    color: var(--text-white);
    padding: 4rem 0 2rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-brand .brand-tile {
    width: 35px;
    height: 35px;
    font-size: 1.2rem;
}

.footer-brand .brand-text {
    color: var(--text-white);
}

.footer-brand .brand-text span {
    color: var(--primary);
}

.site-footer p {
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
}

.footer-heading {
    color: var(--text-white);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.6rem;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary);
    padding-left: 5px;
}

.game-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.game-badge {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.85);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-bottom p {
    margin: 0;
    font-size: 0.9rem;
}

/* ============================================
   11. UTILITIES
   ============================================ */

/* ----------------------------------------
   Accessibility - Skip Link
   ---------------------------------------- */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: var(--text-dark);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    z-index: 9999;
    text-decoration: none;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 10px;
    outline: 3px solid var(--primary-dark);
    outline-offset: 2px;
}

/* ----------------------------------------
   Accessibility - Touch Targets (WCAG 2.5.5)
   Minimum 44x44px for all interactive elements
   ---------------------------------------- */
.btn,
.nav-link,
.dropdown-item,
.mobile-menu-item,
.mobile-menu-back,
.mobile-menu-close,
.quick-filter-btn,
.filter-help-btn,
.navbar-toggler {
    min-height: 44px;
    min-width: 44px;
}

/* Ensure inline buttons maintain adequate touch targets */
.filter-help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Text Colors */
.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--secondary) !important; }
.text-muted { color: var(--text-muted) !important; }

/* Background Colors */
.bg-primary { background-color: var(--primary) !important; }
.bg-secondary { background-color: var(--secondary) !important; }
.bg-warm { background-color: var(--bg-warm) !important; }
.bg-cream { background-color: var(--bg-cream) !important; }

/* Spacing */
.section-spacing { padding: var(--section-padding); }
.section-spacing-sm { padding: var(--section-padding-sm); }

/* Container */
.container-narrow {
    max-width: 800px;
    margin: 0 auto;
}

/* ============================================
   12. ANIMATIONS
   ============================================ */
@keyframes floatTile {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }

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

/* ============================================
   13. RESPONSIVE
   ============================================ */
@media (max-width: 1199.98px) {
    .tool-content {
        grid-template-columns: 1fr 300px;
    }
}

@media (max-width: 991.98px) {
    :root {
        --section-padding: 60px 0;
    }
    
    .hero {
        min-height: auto;
        padding: 50px 0;
    }
    
    .tool-content {
        grid-template-columns: 1fr;
    }
    
    .tool-sidebar {
        position: static;
        order: -1;
    }
    
    .dropdown-mega .dropdown-menu {
        max-width: 100%;
    }
    
    .float-tile {
        display: none;
    }
}

@media (max-width: 767.98px) {
    :root {
        --section-padding: 50px 0;
        --section-padding-sm: 40px 0;
    }
    
    /* hero-title uses default h1 clamp() sizing */
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .search-box {
        padding: 1.5rem;
    }
    
    .tile-input {
        font-size: 1.25rem;
        letter-spacing: 0.1em;
    }
    
    .btn-search {
        font-size: 1rem;
        padding: 0.85rem 1.5rem;
    }
    
    .feature-card,
    .step-card,
    .testimonial-card,
    .tip-card {
        padding: 1.5rem;
    }
    
    .dropdown-menu-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .trust-badges {
        flex-direction: column;
        align-items: center;
    }
    
    .example-tiles .tile {
        width: 30px;
        height: 34px;
        font-size: 0.95rem;
    }
    
    .game-card {
        padding: 1rem 0.75rem;
    }
    
    .game-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
}

/* ============================================
   14. SIDEBAR STYLES
   ============================================ */
.sidebar {
    position: static;
}

.sidebar-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0,0,0,0.08);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.sidebar-card-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e5e5;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Sidebar Icon Styling */
.sidebar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: currentColor;
    flex-shrink: 0;
}

.sidebar-icon svg {
    color: white !important;
}

.sidebar-icon.icon-primary { background: #E4A853; }
.sidebar-icon.icon-success { background: #22c55e; }
.sidebar-icon.icon-danger { background: #ef4444; }
.sidebar-icon.icon-info { background: #06b6d4; }
.sidebar-icon.icon-warning { background: #f97316; }
.sidebar-icon.icon-purple { background: #8b5cf6; }
.sidebar-icon.icon-blue { background: #3b82f6; }
.sidebar-icon.icon-pink { background: #ec4899; }
.sidebar-icon.icon-teal { background: #14b8a6; }
.sidebar-icon.icon-indigo { background: #6366f1; }
.sidebar-icon.icon-orange { background: #f97316; }

/* Sidebar Input Wrapper */
.search-input-wrapper {
    position: relative;
}

.tile-input-sidebar {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
    width: 100%;
    padding: 0.9rem 2.5rem 0.9rem 1rem;
    border: 2px solid var(--text-dark);
    border-radius: var(--radius-md);
    background: #FFFFFF;
    color: var(--text-dark);
    transition: all var(--transition-fast);
}

.tile-input-sidebar::placeholder {
    color: #767676;  /* Improved contrast - 4.54:1 ratio */
    font-size: 1rem;
    letter-spacing: 0.1em;
}

.tile-input-sidebar:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.3);
    background: #FFFEF5;
}

.clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--text-dark);
    color: var(--text-white);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.clear-btn:hover {
    background: var(--secondary);
}

/* Filter Input Group */
.filter-input-group {
    position: relative;
}

.filter-input-group .help-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 0.85rem;
    cursor: help;
}

/* Custom Radio & Checkbox */
.radio-option,
.checkbox-option {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.5rem;
    margin: 0 -0.5rem;
    cursor: pointer;
    user-select: none;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
}

.radio-option:hover,
.checkbox-option:hover {
    background-color: rgba(231, 153, 44, 0.08);
}

.radio-option:has(input:checked),
.checkbox-option:has(input:checked) {
    background-color: rgba(231, 153, 44, 0.12);
}

.radio-option input[type="radio"],
.checkbox-option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #CCC;
    margin-right: 0.75rem;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

/* Improved focus states for accessibility */
.radio-option input[type="radio"]:focus-visible,
.checkbox-option input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

.filter-input:focus-visible {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(231, 153, 44, 0.2);
    outline: none;
}

.quick-filter-btn:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

.radio-option input[type="radio"] {
    border-radius: 50%;
}

.checkbox-option input[type="checkbox"] {
    border-radius: 4px;
}

.radio-option input[type="radio"]:checked,
.checkbox-option input[type="checkbox"]:checked {
    border-color: var(--secondary);
    background: var(--secondary);
}

.radio-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--text-white);
    border-radius: 50%;
}

.checkbox-option input[type="checkbox"]:checked::after {
    content: '\2713';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-white);
    font-size: 12px;
    font-weight: bold;
}

.radio-option label,
.checkbox-option label {
    margin: 0;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-dark);
}

/* Quick Length Filter Buttons */
.quick-length-filters {
    margin-bottom: 1rem;
}

.quick-filter-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.quick-filter-hint {
    font-size: 0.7rem;
    color: var(--text-light);
    font-style: italic;
}

.quick-filter-buttons {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.quick-filter-btn {
    width: 36px;
    height: 36px;
    border: 2px solid #e0e0e0;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-filter-btn:hover {
    border-color: var(--secondary);
    background: rgba(61, 107, 57, 0.1);
}

.quick-filter-btn.active {
    background: var(--secondary);
    border-color: var(--secondary);
    color: var(--text-white);
}

/* A-Z Letter Quick Filters (smaller for 26 items) */
.quick-filter-letters .quick-filter-btn {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
    text-decoration: none;
}

.quick-nav-filters {
    margin-bottom: 0.5rem;
}

/* Mobile: Make A-Z buttons horizontally scrollable */
@media (max-width: 991.98px) {
    .quick-filter-letters {
        display: flex;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: var(--secondary) transparent;
        gap: 0.35rem;
        padding: 0.5rem 0;
        margin: 0 -0.25rem;
    }
    
    .quick-filter-letters::-webkit-scrollbar {
        height: 4px;
    }
    
    .quick-filter-letters::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .quick-filter-letters::-webkit-scrollbar-thumb {
        background: var(--secondary);
        border-radius: 4px;
    }
    
    .quick-filter-letters .quick-filter-btn {
        flex-shrink: 0;
        width: 34px;
        height: 34px;
    }
}

.quick-nav-filters .quick-filter-label {
    font-size: 0.75rem;
    margin-bottom: 0.4rem;
}

/* Clear All Filters Button */
.btn-clear-filters {
    background: transparent;
    border: 2px solid #d3d6da;
    color: #5f6368;  /* Improved contrast - 5.96:1 ratio */
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.btn-clear-filters:hover {
    border-color: #787c7e;
    color: #3a3a3c;
    background: #f5f5f5;
}

/* Option Group Label */
.option-group-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Option Divider */
.option-divider {
    border: 0;
    border-top: 1px solid #e5e5e5;
    margin: 0.75rem 0;
}

/* Dictionary Badges */
.dict-badge {
    display: inline-block;
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    background: #e5e5e5;
    color: #666;
    font-weight: 600;
    margin-left: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.dict-badge-recommended {
    background: var(--secondary);
    color: white;
}

/* Sidebar Tip Card */
.sidebar-card-tip {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fcd34d;
}

.tip-content {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #92400e;
}

.tip-icon {
    flex-shrink: 0;
    color: #f59e0b;
}

/* Radio/Checkbox with icons */
.radio-option label svg,
.checkbox-option label svg {
    opacity: 0.6;
}

.radio-option input:checked + label svg,
.checkbox-option input:checked + label svg {
    opacity: 1;
}

/* ============================================
   15. RESULTS PAGE STYLES
   ============================================ */
.results-section {
    padding: 2rem 0 4rem;
    min-height: 60vh;
}

.results-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--bg-cream);
}

.results-title {
    font-size: 1.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.results-title .bi-check-circle-fill {
    font-size: 1.5rem;
}

.results-count {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.results-count strong {
    color: var(--secondary);
}

/* Result Cards */
.result-card {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.result-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.1), 0 2px 6px rgba(0,0,0,0.06);
}

.result-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--secondary);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
}

.result-card-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: #FFFFFF;
    margin: 0;
}

.result-card-count {
    font-size: 0.9rem;
    /* Changed to dark text on light bg for better contrast */
    color: var(--secondary);
    background: rgba(255,255,255,0.95);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.result-card-body {
    padding: 1.25rem 1.5rem;
}

/* Word Tiles */
.word-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.word-tile {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    background: var(--tile-bg);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.word-tile:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.word-text {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.word-points {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-white);
    background: var(--secondary);
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-full);
    min-width: 22px;
    text-align: center;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.no-results i {
    margin-bottom: 1rem;
}

.no-results h3 {
    margin-bottom: 0.5rem;
}

.no-results p {
    margin: 0;
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.welcome-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.welcome-icon i {
    font-size: 2rem;
    color: var(--text-dark);
}

.welcome-message h1 {
    margin-bottom: 0.75rem;
}

.welcome-message .lead {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.how-to-use {
    text-align: left;
    background: var(--bg-cream);
    border-radius: var(--radius-md);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
}

.how-to-use h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.how-to-use ul {
    margin: 0;
    padding-left: 1.25rem;
}

.how-to-use li {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.example-searches {
    margin-top: 1.5rem;
}

.example-searches h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.example-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.example-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--tile-bg);
    border: 2px solid var(--tile-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--text-dark);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.example-link:hover {
    background: var(--primary);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
}

/* ============================================
   16. WORD MODAL STYLES
   ============================================ */
.word-modal-content {
    border: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.word-modal-header {
    background: var(--secondary);
    color: #ffffff !important;
    padding: 1.25rem 1.5rem;
    border: none;
}

.word-modal-header .modal-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: #ffffff !important;
}

.word-modal-header .modal-title i,
.word-modal-header .modal-title .bi,
.word-modal-header .modal-title i.bi,
.word-modal-header .modal-title i.bi-book,
.word-modal-header i,
.word-modal-header .bi,
.word-modal-header i::before,
.word-modal-header .bi::before {
    color: #ffffff !important;
    fill: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    filter: brightness(0) invert(1);
}

.word-modal-header #wordModalWord {
    text-transform: uppercase;
    font-weight: 700;
    color: #ffffff !important;
}

.word-modal-body {
    padding: 1.5rem;
}

.word-modal-footer {
    background: var(--bg-cream);
    border: none;
    padding: 1rem 1.5rem;
}

/* Modal Content Styling (for AJAX loaded content) */
.word-modal-body h6.h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
}

.word-modal-body .bg-white {
    background: var(--bg-white) !important;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
    margin: 0 !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.word-modal-body .bg-white:last-of-type {
    border-bottom: none;
}

/* Definition Cards in Modal */
.word-modal-body .card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    background: var(--bg-white);
    margin-bottom: 1rem;
}

.word-modal-body .card-header {
    background: var(--secondary);
    color: var(--text-white);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.75rem 1rem;
    border: none;
}

/* Modal Section Title (replaces h6 for SEO) */
.modal-section-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid #e5e5e5;
}

/* Word Header Points Badges */
.word-header-section h4 {
    font-family: var(--font-display);
}

.points-badges {
    display: flex;
    gap: 0.5rem;
}

.badge-points {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    min-width: 75px;
}

.badge-points .badge-pts {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
}

.badge-points .badge-label {
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-scrabble {
    background: linear-gradient(135deg, #c9a227 0%, #d4af37 50%, #e6c55a 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(201, 162, 39, 0.3);
}

.badge-wwf {
    background: linear-gradient(135deg, #2e7d32 0%, #388e3c 50%, #43a047 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(46, 125, 50, 0.3);
}

.badge-wordle-nyt {
    background: var(--secondary); /* Wordle green - updated for contrast */
    color: #fff;
    box-shadow: 0 2px 4px rgba(61, 107, 57, 0.3);
}

.badge-wordle-valid {
    background: #6c757d; /* Gray for regular Wordle */
    color: #fff;
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.3);
}

.badge-wordle-invalid {
    background: #dc3545; /* Red for invalid */
    color: #fff;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.badge-invalid {
    background: linear-gradient(135deg, #6b7280 0%, #9ca3af 50%, #6b7280 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(107, 114, 128, 0.3);
}

/* Word Info Card */
.word-info-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
}

.word-info-card .card-body {
    padding: 1.25rem;
}

.word-info-card h4 {
    font-family: var(--font-display);
    color: var(--text-dark);
}

/* Word Games Grid */
.word-games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.word-game-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: #fff;
    border-radius: 6px;
    font-size: 0.875rem;
    border: 1px solid #e9ecef;
}

.word-game-item span {
    color: var(--text-dark);
    font-weight: 500;
}

@media (max-width: 480px) {
    .word-games-grid {
        grid-template-columns: 1fr;
    }
}

/* Letter Tiles */
.letter-breakdown-section {
    padding: 1rem 0;
}

.letter-tiles-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
}

.letter-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 62px;
    background: linear-gradient(145deg, #faf8f0, #e8dcc8);
    border: 1px solid #d4c8a8;
    border-radius: 6px;
    box-shadow: 
        2px 3px 5px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
}

.letter-tile::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, transparent 100%);
    border-radius: 4px 4px 0 0;
    pointer-events: none;
}

.tile-letter {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    color: #3d2c1e;
    line-height: 1;
}

.tile-points {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 600;
    /* Changed from #8b7355 to #6d5942 for WCAG AA contrast (5.5:1) */
    color: #6d5942;
    margin-top: 2px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .letter-tile {
        width: 42px;
        height: 52px;
    }
    
    .tile-letter {
        font-size: 1.25rem;
    }
    
    .badge-points {
        padding: 0.4rem 0.65rem;
        font-size: 0.8rem;
    }
}

.word-modal-body .card-body {
    padding: 1.25rem;
    background: var(--bg-white);
}

/* Badge Styling in Modal */
.word-modal-body .badge.text-bg-success {
    background: var(--success) !important;
    font-weight: 600;
    padding: 0.35em 0.65em;
}

.word-modal-body .badge.text-bg-danger {
    background: var(--danger) !important;
    font-weight: 600;
    padding: 0.35em 0.65em;
}

.word-modal-body .badge.text-bg-warning {
    background: var(--primary) !important;
    color: var(--text-dark) !important;
    font-weight: 600;
}

.word-modal-body .badge.text-bg-primary {
    background: var(--secondary) !important;
    font-weight: 600;
}

.word-modal-body .badge.text-bg-secondary {
    background: var(--bg-cream) !important;
    color: var(--text-dark) !important;
    font-weight: 500;
    border: 1px solid var(--border-light);
}

/* Definition Text */
.word-modal-body .fw-bold {
    color: var(--text-dark);
    line-height: 1.6;
}

/* Alert in Modal */
.word-modal-body .alert-info {
    background: var(--bg-cream);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    border-radius: var(--radius-md);
}

/* Modal Dictionary Status */
.dict-status {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bg-cream);
}

.dict-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
}

.dict-badge.valid {
    background: rgba(76, 175, 80, 0.15);
    color: #2E7D32;
}

.dict-badge.invalid {
    background: rgba(244, 67, 54, 0.1);
    color: #C62828;
}

/* Modal Definition Cards */
.def-card {
    background: var(--bg-cream);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.def-card:last-child {
    margin-bottom: 0;
}

.def-pos {
    display: inline-block;
    background: var(--secondary);
    color: var(--text-white);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.def-text {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.def-example {
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.95rem;
    padding-left: 1rem;
    border-left: 3px solid var(--primary);
}

.def-synonyms {
    margin-top: 0.75rem;
}

.def-synonyms-label {
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.def-synonym {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-dark);
    margin: 0.2rem;
}

/* Definition Not Found Section */
.definition-not-found-content {
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #f0f0f0;
}

.not-found-message {
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-radius: 8px;
    border-left: 4px solid #f97316;
}

.not-found-message p {
    color: #9a3412;
    font-size: 0.95rem;
    line-height: 1.5;
}

.not-found-message.not-found-valid {
    background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
    border-left-color: #06b6d4;
}

.not-found-message.not-found-valid p {
    color: #164e63;
}

/* Definition Example Style */
.definition-example {
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.95rem;
    padding-left: 1rem;
    border-left: 3px solid var(--primary);
    margin-top: 0.25rem;
}

/* Synonyms List */
.synonyms-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.synonym-badge {
    display: inline-block;
    padding: 0.3rem 0.65rem;
    background: var(--bg-cream);
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dark);
}

.not-found-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.not-found-actions .btn {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.not-found-actions .btn-primary {
    background: var(--secondary);
    border-color: var(--secondary);
}

.not-found-actions .btn-primary:hover {
    background: var(--secondary-dark);
    border-color: var(--secondary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(61, 107, 57, 0.3);
}

.not-found-actions .btn-outline-secondary {
    border-color: #d1d5db;
    color: var(--text-dark);
}

.not-found-actions .btn-outline-secondary:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

/* Mobile/Tablet: Full width buttons in modal */
@media (max-width: 991.98px) {
    .not-found-actions {
        flex-direction: column;
    }
    
    .not-found-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   17. RESPONSIVE - RESULTS & SIDEBAR
   ============================================ */
@media (max-width: 991.98px) {
    .sidebar {
        position: static;
    }
    
    .results-section {
        padding: 1.5rem 0 3rem;
    }
}

@media (max-width: 767.98px) {
    .results-title {
        font-size: 1.35rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .result-card-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
    }
    
    .word-tiles {
        gap: 0.5rem;
    }
    
    .word-tile {
        padding: 0.4rem 0.65rem;
    }
    
    .word-text {
        font-size: 0.95rem;
    }
    
    .sidebar-card {
        padding: 1.25rem;
    }
    
    .welcome-message {
        padding: 2rem 1.25rem;
    }
    
    .how-to-use {
        padding: 1.25rem;
    }
}

/* ============================================
   18. SKELETON LOADER
   ============================================ */

/* Skeleton Animation */
@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton-loading {
    pointer-events: none;
}

/* Skeleton Card */
.skeleton-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.skeleton-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.skeleton-title {
    height: 24px;
    width: 140px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite ease-in-out;
    border-radius: 6px;
}

.skeleton-count {
    height: 20px;
    width: 60px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite ease-in-out;
    border-radius: 10px;
}

/* Skeleton Tiles */
.skeleton-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skeleton-tile {
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite ease-in-out;
}

/* Different widths for variety */
.skeleton-tile:nth-child(5n + 1) { width: 80px; }
.skeleton-tile:nth-child(5n + 2) { width: 65px; }
.skeleton-tile:nth-child(5n + 3) { width: 95px; }
.skeleton-tile:nth-child(5n + 4) { width: 72px; }
.skeleton-tile:nth-child(5n + 5) { width: 88px; }

/* Animation delay for staggered effect */
.skeleton-tile:nth-child(2) { animation-delay: 0.1s; }
.skeleton-tile:nth-child(3) { animation-delay: 0.2s; }
.skeleton-tile:nth-child(4) { animation-delay: 0.3s; }
.skeleton-tile:nth-child(5) { animation-delay: 0.4s; }
.skeleton-tile:nth-child(6) { animation-delay: 0.5s; }
.skeleton-tile:nth-child(7) { animation-delay: 0.6s; }
.skeleton-tile:nth-child(8) { animation-delay: 0.7s; }

/* Results content fade during loading */
.results-content.loading {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Skeleton container shown while loading */
.skeleton-results {
    display: none;
}

.results-content.loading + .skeleton-results,
.skeleton-results.active {
    display: block;
}

/* ============================================
   19. TOOL PAGE CONTENT BLOCKS
   ============================================ */

/* Hero for Tool Pages */
.hero-tool {
    min-height: auto;
    padding: 30px 0 30px;
}

/* .hero-tool .hero-title uses default h1 font-size */

.hero-tool .hero-subtitle {
    font-size: 1.25rem;
    max-width: 700px;
    margin: 0 auto 2rem;
}

/* Tool-Specific Hero Gradients (matching nav icon colors) */

/* Word Unscrambler - Golden/Brown (icon-primary: #E4A853) */
.hero.hero-unscrambler {
    background: linear-gradient(135deg, #E4A853 0%, #F5D89A 30%, #FFEEC4 60%, #E4A853 100%);
}
.hero.hero-unscrambler .hero-title,
.hero.hero-unscrambler .hero-subtitle {
    color: #3d2e0a;
}

/* Jumble Solver - Green (icon-success: #22c55e) */
.hero.hero-scrambler {
    background: linear-gradient(135deg, #22c55e 0%, #86efac 30%, #bbf7d0 60%, #22c55e 100%);
}
.hero.hero-scrambler .hero-title,
.hero.hero-scrambler .hero-subtitle {
    color: #052e16;
}

/* Scrabble Word Finder - Cyan (icon-info: #06b6d4) */
.hero.hero-scrabble {
    background: linear-gradient(135deg, #06b6d4 0%, #67e8f9 30%, #a5f3fc 60%, #06b6d4 100%);
}
.hero.hero-scrabble .hero-title,
.hero.hero-scrabble .hero-subtitle {
    color: #083344;
}

/* Wordle Solver - Orange (icon-warning: #f97316) */
.hero.hero-wordle {
    background: linear-gradient(135deg, #f97316 0%, #fdba74 30%, #fed7aa 60%, #f97316 100%);
}
.hero.hero-wordle .hero-title,
.hero.hero-wordle .hero-subtitle {
    color: #431407;
}

/* Content Blocks */
.content-block {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.content-block h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--primary);
}

.content-block h3 {
    font-size: 1.15rem;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.content-block h4 {
    font-size: 1.05rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.content-block p {
    color: var(--text-muted);
    line-height: 1.7;
}

.content-block .lead {
    font-size: 1.15rem;
    color: var(--text-dark);
}

/* Styled Lists */
.styled-list {
    padding-left: 0;
    list-style: none;
    counter-reset: step-counter;
}

.styled-list > li {
    position: relative;
    padding-left: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.styled-list > li::before {
    content: counter(step-counter);
    counter-increment: step-counter;
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    background: var(--secondary);
    color: var(--text-white);
    border-radius: 50%;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Nested lists inside styled-list should use regular bullets */
.styled-list ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.styled-list ul li {
    padding-left: 0;
    margin-bottom: 0.5rem;
}

.styled-list ul li::before {
    display: none;
}

/* Benefit Cards */
.benefit-card {
    background: var(--bg-cream);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--secondary);
}

.benefit-card:last-child {
    margin-bottom: 0;
}

.benefit-card h3 {
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    border-bottom: none;
    padding-bottom: 0;
}

.benefit-card p {
    margin-bottom: 0;
}

/* Tips Grid */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.tip-item {
    background: var(--bg-cream);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    border-top: 3px solid var(--primary);
}

.tip-item h4 {
    font-size: 1rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.tip-item p {
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* Examples Table */
.examples-table {
    overflow-x: auto;
}

.examples-table table {
    width: 100%;
    border-collapse: collapse;
}

.examples-table th {
    background: var(--secondary);
    color: var(--text-white);
    font-family: var(--font-display);
    font-weight: 600;
    padding: 0.75rem 1rem;
    text-align: left;
}

.examples-table th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

.examples-table th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
    text-align: center;
}

.examples-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--bg-cream);
}

.examples-table td:last-child {
    text-align: center;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--secondary);
}

.examples-table tr:hover td {
    background: var(--bg-cream);
}

.examples-table a {
    color: var(--secondary);
    font-weight: 600;
    text-decoration: none;
}

.examples-table a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Word Length Links */
.word-length-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.length-link {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    background: var(--tile-bg);
    border: 2px solid var(--tile-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.length-link:hover {
    background: var(--primary);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Related Tools Grid */
.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.related-tool {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-cream);
    border-radius: var(--radius-md);
    color: var(--text-dark);
    font-family: var(--font-display);
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
}

.related-tool:hover {
    background: var(--tile-bg);
    border-color: var(--primary);
    color: var(--secondary);
    transform: translateY(-2px);
}

/* FAQ Items */
.faq-item {
    background: var(--bg-cream);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.faq-item:last-child {
    margin-bottom: 0;
}

.faq-item h3 {
    font-size: 1.05rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.faq-item p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* Responsive for Tool Pages */
@media (max-width: 767.98px) {
    .hero-tool {
        padding: 40px 0 50px;
    }
    
    .content-block {
        padding: 1.5rem;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
    }
    
    .related-tools-grid {
        grid-template-columns: 1fr;
    }
    
    .word-length-links {
        gap: 0.5rem;
    }
    
    .length-link {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* ============================================
   20. TOOL PAGE SIDEBAR STYLES
   ============================================ */

/* Sidebar Links List */
.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-link {
    display: block;
    padding: 0.6rem 0.85rem;
    background: var(--bg-cream);
    border-radius: var(--radius-sm);
    color: var(--text-dark);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: var(--tile-bg);
    border-left-color: var(--primary);
    color: var(--secondary);
    padding-left: 1rem;
}

/* CTA Sidebar Card */
.sidebar-card-cta {
    background: linear-gradient(135deg, var(--tile-bg) 0%, var(--primary-light) 100%);
    border: 2px solid var(--primary);
}

.sidebar-card-cta .sidebar-card-title {
    border-bottom-color: var(--primary);
}

/* Filter Results Sidebar Card */
.sidebar-card-filter {
    background: linear-gradient(135deg, #fdfaf5 0%, #faf6ef 100%);
    border: 2px solid #e8e0d5;
}

.sidebar-card-filter .sidebar-card-title {
    border-bottom-color: #e8e0d5;
}

/* Quick Search Form in Sidebar */
.quick-search-form .tile-input-sidebar {
    font-size: 1.1rem;
    padding: 0.75rem 1rem;
}

.quick-search-form .btn-search {
    font-size: 1rem;
    padding: 0.75rem 1rem;
}

/* ============================================
   21. MOBILE SIDEBAR BOTTOM SHEET
   ============================================ */

/* Floating Action Button */
.mobile-sidebar-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    background: var(--secondary);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 20px rgba(61, 107, 57, 0.4), 0 2px 8px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-sidebar-fab:hover,
.mobile-sidebar-fab:focus {
    background: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(61, 107, 57, 0.5), 0 4px 12px rgba(0,0,0,0.2);
}

.mobile-sidebar-fab svg {
    flex-shrink: 0;
}

/* FAB Badge for active filters count */
.fab-badge {
    background: var(--primary);
    color: var(--text-dark);
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.25rem;
}

/* Hide FAB when sheet is open */
.mobile-sidebar-fab.hidden {
    transform: translateY(100px);
    opacity: 0;
    pointer-events: none;
}

/* Overlay */
.mobile-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-sidebar-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Bottom Sheet */
.mobile-sidebar-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 85vh;
    background: var(--bg-warm);
    border-radius: 20px 20px 0 0;
    z-index: 1110;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
}

.mobile-sidebar-sheet.open {
    transform: translateY(0);
}

/* Sheet Header */
.mobile-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e5e5;
    background: #fff;
    border-radius: 20px 20px 0 0;
    flex-shrink: 0;
    position: relative;
}

.mobile-sidebar-header::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: #d0d0d0;
    border-radius: 4px;
}

.mobile-sidebar-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.mobile-sidebar-close {
    background: none;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.mobile-sidebar-close:hover {
    opacity: 1;
}

/* Sheet Body */
.mobile-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1rem 2rem;
    -webkit-overflow-scrolling: touch;
}

/* Adjust sidebar cards inside sheet */
.mobile-sidebar-body .sidebar-card {
    margin-bottom: 1.25rem;
}

.mobile-sidebar-body .sidebar-card:last-child {
    margin-bottom: 0;
}

/* Form spacing in mobile sidebar */
.mobile-sidebar-body form {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* Last sidebar-card inside form should also have margin for proper separation */
.mobile-sidebar-body form .sidebar-card:last-child {
    margin-bottom: 0;
}

/* Hide desktop sidebar on mobile when bottom sheet exists */
@media (max-width: 991.98px) {
    .results-section .col-lg-4 > .sidebar {
        display: none;
    }
    
    /* Ensure body doesn't scroll when sheet is open */
    body.mobile-sidebar-open {
        overflow: hidden;
    }
}

/* Hide FAB and sheet on desktop */
@media (min-width: 992px) {
    .mobile-sidebar-fab,
    .mobile-sidebar-overlay,
    .mobile-sidebar-sheet {
        display: none !important;
    }
}

/* ============================================
   22. TOAST NOTIFICATION (REUSABLE)
   ============================================ */
#toast-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
}

.validation-toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    background: #ffffff;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    min-width: 360px;
    max-width: 520px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    color: #856404;
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
    transition: opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
    overflow: hidden;
}

.validation-toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Toast Icon */
.validation-toast .toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffc107;
    margin-top: 2px;
}

.validation-toast .toast-icon svg {
    width: 20px;
    height: 20px;
}

/* Toast Content */
.validation-toast .toast-content {
    flex: 1;
    min-width: 0;
}

.validation-toast .toast-title {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #856404;
    line-height: 1.4;
}

.validation-toast .toast-message {
    margin: 0;
    font-size: 0.85rem;
    color: #856404;
    opacity: 0.85;
    line-height: 1.5;
}

/* Close Button */
.validation-toast .toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #856404;
    cursor: pointer;
    padding: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    border-radius: 4px;
    margin-top: -2px;
    margin-right: -4px;
}

.validation-toast .toast-close:hover {
    opacity: 1;
    background-color: rgba(133, 100, 4, 0.1);
}

.validation-toast .toast-close svg {
    width: 14px;
    height: 14px;
}

/* Progress Bar */
.validation-toast .toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #ffc107 0%, #ffb300 100%);
    width: 100%;
    transform-origin: left;
    transform: scaleX(0);
}

@keyframes toastProgress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Mobile adjustments */
@media (max-width: 576px) {
    #toast-container {
        top: 70px;
        left: 12px;
        right: 12px;
        transform: none;
    }
    
    .validation-toast {
        min-width: auto;
        width: 100%;
        padding: 0.875rem 1rem;
    }
    
    .validation-toast .toast-icon {
        width: 20px;
        height: 20px;
    }
    
    .validation-toast .toast-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .validation-toast .toast-title {
        font-size: 0.9rem;
    }
    
    .validation-toast .toast-message {
        font-size: 0.8rem;
    }
}

/* ============================================
   23. LETTER GRID STYLES (Words Starting/Ending/With)
   ============================================ */
.letter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.letter-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.5rem;
    background: linear-gradient(145deg, var(--tile-bg) 0%, #E8D5B0 100%);
    border: 2px solid var(--tile-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-fast);
    box-shadow: 0 3px 0 var(--tile-border);
}

.letter-grid-item:hover {
    transform: translateY(-4px);
    background: linear-gradient(145deg, var(--primary-light) 0%, var(--primary) 100%);
    border-color: var(--primary-dark);
    box-shadow: 0 6px 12px rgba(var(--primary-rgb), 0.3);
}

.letter-grid-char {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.letter-grid-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.35rem;
}

/* ============================================
   24. LENGTH GRID STYLES (Words By Length)
   ============================================ */
.length-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.length-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 0.75rem;
    background: linear-gradient(145deg, var(--tile-bg) 0%, #E8D5B0 100%);
    border: 2px solid var(--tile-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-fast);
    box-shadow: 0 3px 0 var(--tile-border);
}

.length-grid-item:hover {
    transform: translateY(-4px);
    background: linear-gradient(145deg, var(--primary-light) 0%, var(--primary) 100%);
    border-color: var(--primary-dark);
    box-shadow: 0 6px 12px rgba(var(--primary-rgb), 0.3);
}

.length-grid-item.highlight {
    background: linear-gradient(145deg, var(--secondary-light) 0%, var(--secondary) 100%);
    border-color: var(--secondary-dark);
}

.length-grid-item.highlight .length-grid-num,
.length-grid-item.highlight .length-grid-label {
    color: var(--text-white);
}

.length-grid-num {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.length-grid-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.35rem;
}

/* Responsive adjustments for grids */
@media (max-width: 575.98px) {
    .letter-grid {
        grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
        gap: 0.5rem;
    }
    
    .letter-grid-item {
        padding: 0.75rem 0.35rem;
    }
    
    .letter-grid-char {
        font-size: 1.35rem;
    }
    
    .length-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 0.5rem;
    }
    
    .length-grid-item {
        padding: 1rem 0.5rem;
    }
    
    .length-grid-num {
        font-size: 1.5rem;
    }
}

/* ============================================
   24b. VOWEL GRID STYLES (Vowel Words)
   ============================================ */
.vowel-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    margin-top: 1.5rem;
    max-width: 500px;
}

.vowel-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 0.75rem;
    background: linear-gradient(145deg, var(--tile-bg) 0%, #E8D5B0 100%);
    border: 2px solid var(--tile-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-fast);
    box-shadow: 0 3px 0 var(--tile-border);
}

.vowel-grid-item:hover {
    transform: translateY(-4px);
    background: linear-gradient(145deg, var(--primary-light) 0%, var(--primary) 100%);
    border-color: var(--primary-dark);
    box-shadow: 0 6px 12px rgba(var(--primary-rgb), 0.3);
}

.vowel-grid-item:hover .vowel-grid-char,
.vowel-grid-item:hover .vowel-grid-label {
    color: var(--text-white);
}

.vowel-grid-char {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.vowel-grid-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.35rem;
}

/* Vowel quick filter buttons in sidebar */
.quick-filter-vowels {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.quick-filter-btn-vowel {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
    font-weight: 700;
}

.quick-filter-btn-vowel.active {
    background: var(--secondary);
    border-color: var(--secondary);
    color: var(--text-white);
}

/* Responsive adjustments for vowel grid */
@media (max-width: 575.98px) {
    .vowel-grid {
        gap: 0.5rem;
        max-width: 100%;
    }
    
    .vowel-grid-item {
        padding: 1rem 0.5rem;
    }
    
    .vowel-grid-char {
        font-size: 1.5rem;
    }
    
    .vowel-grid-label {
        font-size: 0.6rem;
    }
}

/* ============================================
   25. LETTER NAVIGATION (A-Z Quick Nav)
   ============================================ */
.letter-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    justify-content: center;
    padding: 1rem;
    background: var(--bg-cream);
    border-radius: var(--radius-md);
    border: 1px solid var(--tile-border);
}

.letter-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    background: var(--tile-bg);
    border: 2px solid var(--tile-border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.letter-nav-item:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--text-dark);
    transform: translateY(-2px);
}

.letter-nav-item.active {
    background: var(--primary);
    border-color: var(--primary-dark);
    color: var(--text-white);
    box-shadow: 0 3px 0 var(--primary-dark);
}

/* ============================================
   26. FILTER FORM STYLES (Word List Pages)
   ============================================ */
.results-filters {
    background: var(--bg-cream);
    border: 1px solid var(--tile-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    /* margin-bot tom: 1.5rem; */
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
}

.filter-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 16px; /* 16px prevents iOS Safari auto-zoom on focus */
    /* font-family: var(--font-body); */
    font-family: var(--bs-body-font-family);
    color: var(--text-dark);
    background-color: var(--bg-white);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235A5A5A' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 10px;
    border: 2px solid var(--tile-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.filter-select:hover {
    border-color: var(--primary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

/* Responsive filter form */
@media (max-width: 767.98px) {
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        justify-content: space-between;
    }
    
    .filter-select {
        flex: 1;
        max-width: 200px;
    }
    
    .letter-nav-item {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
}

/* ============================================
   UNSCRAMBLE CONTENT SECTIONS
   SEO content sections below results
   ============================================ */

.unscramble-content-sections {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Content Section Base */
.content-section {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.content-section > .section-title {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--tile-bg) 100%);
    border-bottom: 1px solid var(--tile-border);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

/* Legacy section-header support */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--tile-bg) 100%);
    border-bottom: 1px solid var(--tile-border);
}

.section-icon {
    display: none;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.section-body {
    padding: 1.5rem;
}

.section-body p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

.section-body p:last-child {
    margin-bottom: 0;
}

/* Letter Spread Display */
.letter-spread {
    display: inline-flex;
    gap: 0.25rem;
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.15em;
    /* Changed from var(--primary-dark) #C8922E to #705410 for WCAG AA contrast */
    color: #705410;
}

/* Summary Section Stats */
.summary-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: var(--bg-warm);
    border-radius: var(--radius-sm);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Game-specific points columns for All Dictionaries */
.stat-item.stat-game-points {
    min-width: auto;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

/* Scrabble column - subtle cream/gold tint */
.stat-item.stat-game-points:has(.stat-pts-scrabble) {
    background: rgba(201, 169, 98, 0.15);
}

/* WWF column - subtle orange tint */
.stat-item.stat-game-points:has(.stat-pts-wwf) {
    background: rgba(255, 149, 0, 0.12);
}

.stat-value.stat-pts-scrabble {
    /* Changed from #8b6914 to #705410 for WCAG AA contrast (5.5:1) */
    color: #705410;
    font-weight: 700;
}

.stat-value.stat-pts-wwf {
    /* Changed from #d35400 to #b34700 for WCAG AA contrast (4.6:1) */
    color: #b34700;
    font-weight: 700;
}

/* Dictionary column styling for specific dictionaries */
.stat-item.stat-dict {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

/* Words With Friends - orange theme */
.stat-item.stat-dict-wwf {
    background: rgba(255, 149, 0, 0.12);
}
.stat-item.stat-dict-wwf .stat-value {
    /* Changed from #d35400 to #b34700 for WCAG AA contrast */
    color: #b34700;
    font-weight: 600;
}

/* Scrabble US (OTCWL) - cream/gold theme */
.stat-item.stat-dict-otcwl {
    background: rgba(201, 169, 98, 0.15);
}
.stat-item.stat-dict-otcwl .stat-value {
    /* Changed from #8b6914 to #705410 for WCAG AA contrast */
    color: #705410;
    font-weight: 600;
}

/* Scrabble UK (SOWPODS) - cream/gold theme */
.stat-item.stat-dict-sowpods {
    background: rgba(201, 169, 98, 0.15);
}
.stat-item.stat-dict-sowpods .stat-value {
    /* Changed from #8b6914 to #705410 for WCAG AA contrast */
    color: #705410;
    font-weight: 600;
}

.stat-highlight {
    font-size: 1.5rem;
    color: var(--secondary);
}

.best-word {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: var(--secondary);
    color: white;
    border-radius: var(--radius-xs);
    font-family: var(--font-display);
    margin-right: 0.5rem;
}

.best-points {
    font-size: 0.85rem;
    color: var(--secondary);
    font-weight: 500;
}

/* Dual points display for All Dictionaries (Best Word stat) */
.best-points-dual {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

.best-points-dual .pts-scrabble {
    /* Changed from var(--primary) for WCAG AA contrast */
    color: #705410;
}

.best-points-dual .pts-wwf {
    color: var(--secondary);
}

.best-points-dual .pts-separator {
    color: var(--text-muted);
    font-size: 0.6rem;
}

/* Mini Letter Tiles */
.letter-tiles-mini {
    display: inline-flex;
    gap: 0.25rem;
}

.mini-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #FDF8F0 0%, var(--tile-bg) 100%);
    border: 2px solid var(--tile-border);
    border-radius: 4px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-dark);
    box-shadow: 0 2px 0 var(--tile-shadow);
}

/* Length Breakdown Pills */
.length-breakdown {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.breakdown-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.breakdown-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.breakdown-pill {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    background: var(--bg-white);
    border: 2px solid var(--tile-border);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.breakdown-pill:hover {
    border-color: var(--secondary);
    transform: translateY(-1px);
}

.pill-length {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary);
    font-family: var(--font-display);
}

.pill-label {
    font-size: 0.75rem;
    color: var(--text-light);
}

.pill-count {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 0.4rem;
    background: var(--secondary);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

/* Points Section */
.points-display {
    margin: 1.5rem 0;
}

.points-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 2rem;
}

.points-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.point-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 0.5rem;
    background: linear-gradient(135deg, #FDF8F0 0%, var(--tile-bg) 100%);
    border: 2px solid var(--tile-border);
    border-radius: var(--radius-sm);
    min-width: 56px;
    box-shadow: 0 3px 0 var(--tile-shadow);
}

.tile-letter {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.tile-points {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-xs);
}

.tile-points.scrabble {
    background: var(--primary);
    color: white;
}

.tile-points.wwf {
    background: var(--wwf);
    color: white;
}

.points-totals {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.total-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
}

.total-row.scrabble {
    background: rgba(228, 168, 83, 0.15);
    border-left: 4px solid var(--primary);
}

.total-row.wwf {
    background: rgba(65, 105, 225, 0.1);
    border-left: 4px solid var(--wwf);
}

.total-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 70px;
}

.total-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    font-family: var(--font-display);
}

/* Points Tips - Legacy support */
.points-tip {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(61, 107, 57, 0.08) 0%, rgba(61, 107, 57, 0.03) 100%);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--secondary);
    margin-top: 1rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.points-tip .tip-icon {
    display: none;
}

.points-tip .tip-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Related Cards Grid */
.related-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.related-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-warm);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.related-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: var(--primary-light);
}

.related-card .card-icon {
    display: none;
}

.related-card .card-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-dark);
}

.related-card .card-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.5;
}

/* FAQ List (Non-accordion style) */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    padding: 1.25rem 1.5rem;
    background: var(--bg-warm);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--secondary);
    box-shadow: none;
}

.faq-item:first-child {
    padding-top: 1.25rem;
}

.faq-item:last-child {
    padding-bottom: 1.25rem;
}

h3.faq-question {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 0.6rem 0;
    line-height: 1.4;
}

p.faq-answer {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0;
}

/* Legacy FAQ accordion support */
.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-accordion .faq-item {
    border: 1px solid var(--tile-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    padding: 0;
    transition: box-shadow var(--transition-fast);
}

.faq-accordion .faq-item:hover {
    box-shadow: var(--shadow-sm);
}

button.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--bg-warm);
    border: none;
    cursor: pointer;
    text-align: left;
    /* font-family: var(--font-body); */
    font-family: var(--bs-body-font-family);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    transition: background var(--transition-fast);
}

button.faq-question:hover {
    background: var(--primary-light);
}

button.faq-question[aria-expanded="true"] {
    background: var(--primary-light);
}

button.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(180deg);
}

.faq-icon {
    color: var(--primary-dark);
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

/* Accordion FAQ Answer (hidden by default) */
.faq-accordion div.faq-answer {
    display: none;
    padding: 1.25rem;
    background: var(--bg-white);
}

.faq-accordion div.faq-answer p {
    margin: 0;
}

/* Content Section FAQ Answer (always visible) */
.faq-list div.faq-answer {
    padding: 0.5rem 0 0 0;
}

.faq-list div.faq-answer p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* Game Cards */
.game-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.game-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-warm);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.game-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    background: var(--primary-light);
}

.game-card .game-icon {
    display: none;
}

.game-card .game-name {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-dark);
}

.game-card .game-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.5;
}

/* Scramble Pills */
.scramble-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.scramble-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1rem;
    background: var(--bg-warm);
    border: 2px solid var(--tile-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-dark);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.scramble-pill:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-1px);
}

.scramble-note {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

/* Tips Grid */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.tip-card {
    padding: 1.25rem 1.5rem;
    background: var(--bg-warm);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--secondary);
}

.tip-card .tip-header {
    display: none;
}

.tip-card .tip-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tip-icon {
    flex-shrink: 0;
    color: var(--primary);
}

.tip-card h3.tip-title {
    margin: 0 0 0.75rem 0;
}

/* Word title in definition modal - styled as heading without semantic h element */
.word-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-dark);
}

.tip-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0;
}

/* Strategic and info tips */
.strategic-tip,
.double-letter-tip,
.bingo-tip {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(61, 107, 57, 0.08) 0%, rgba(61, 107, 57, 0.03) 100%);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--secondary);
    font-size: 0.95rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.strategic-tip .tip-icon,
.bingo-tip .tip-icon {
    flex-shrink: 0;
    margin-top: 0.15rem;
    color: var(--secondary);
    color: var(--text-muted);
    line-height: 1.7;
}

/* Responsive Content Sections */
@media (max-width: 767.98px) {
    .unscramble-content-sections {
        margin-top: 2rem;
        gap: 1.5rem;
    }
    
    .section-header {
        padding: 1rem 1.25rem;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
    
    .section-body {
        padding: 1.25rem;
    }
    
    .summary-stats {
        gap: 1rem;
    }
    
    .points-row {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .related-cards {
        grid-template-columns: 1fr;
    }
    
    .game-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Content Section Skeletons (AJAX Loading)
   ============================================ */

.unscramble-content-sections.loading {
    opacity: 0.7;
    pointer-events: none;
}

.skeleton-section {
    padding: 1.5rem;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.skeleton-section .skeleton-title {
    height: 28px;
    width: 65%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite ease-in-out;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.skeleton-section .skeleton-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.skeleton-section .skeleton-line {
    height: 16px;
    width: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite ease-in-out;
    border-radius: 4px;
}

.skeleton-section .skeleton-line.short {
    width: 75%;
}

.skeleton-section .skeleton-tiles {
    height: 52px;
    width: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite ease-in-out;
    border-radius: 8px;
}

/* ============================================
   Active Filters Display
   ============================================ */

.active-filters-display {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(228, 168, 83, 0.1) 0%, rgba(228, 168, 83, 0.05) 100%);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
}

.active-filters-display h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-tag {
    background: var(--primary);
    color: white;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

/* ============================================
   Top Words Grid
   ============================================ */

.top-words-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1.25rem;
}

@media (min-width: 576px) {
    .top-words-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.top-word-card {
    background: var(--tile-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.875rem 0.5rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 0;
    overflow: hidden;
}

.top-word-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.top-word-card .word-text {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    /* Changed to #5a4510 for 7:1+ contrast on tile-bg #F7E6C4 */
    color: #5a4510;
    margin-bottom: 0.35rem;
    letter-spacing: 0.01em;
    word-break: break-word;
    overflow-wrap: break-word;
}

@media (min-width: 576px) {
    .top-word-card .word-text {
        font-size: 1rem;
    }
}

.top-word-card .word-points {
    display: block;
    font-size: 0.95rem;
    color: var(--success);
    font-weight: 600;
    margin-bottom: 0.2rem;
}

/* Dual points display for All Dictionaries */
.top-word-card .word-points.dual-points {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
}

.top-word-card .word-points.dual-points .scrabble-pts {
    /* Changed from var(--primary) for WCAG AA contrast on tile-bg */
    color: #705410;
    font-weight: 700;
}

.top-word-card .word-points.dual-points .wwf-pts {
    /* Secondary is already dark enough */
    color: var(--secondary);
    font-weight: 700;
}

.top-word-card .word-length {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   Suggestions Box (No Results)
   ============================================ */

.suggestions-box {
    background: linear-gradient(135deg, #fff9e6 0%, #fef3cd 100%);
    border: 1px solid #f0d78c;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-top: 1.25rem;
}

.suggestions-box h4 {
    margin-bottom: 1rem;
    font-size: 1.05rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.suggestions-box h4 .tip-icon {
    color: var(--secondary);
}

.suggestions-box .suggestions-list {
    margin: 0;
    padding-left: 1.5rem;
}

.suggestions-box .suggestions-list li {
    margin-bottom: 0.65rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.suggestions-box .suggestions-list li:last-child {
    margin-bottom: 0;
}

.suggestions-box .suggestions-list li strong {
    color: var(--text-dark);
}

/* ============================================
   Related Cards Featured State
   ============================================ */

.related-card.featured {
    border: 2px solid var(--primary);
    background: linear-gradient(135deg, rgba(228, 168, 83, 0.08) 0%, rgba(228, 168, 83, 0.02) 100%);
}

.related-card.featured .card-title {
    color: var(--primary);
}

/* ============================================
   Responsive: New Components
   ============================================ */

@media (max-width: 767.98px) {
    .active-filters-display {
        padding: 0.875rem 1rem;
    }
    
    .filter-tag {
        font-size: 0.75rem;
        padding: 0.3rem 0.7rem;
    }
    
    .top-words-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .top-word-card {
        padding: 0.875rem;
    }
    
    .top-word-card .word-text {
        font-size: 1rem;
    }
    
    .suggestions-box {
        padding: 1.25rem;
    }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   Improves responsiveness on mobile devices
   ============================================ */

/* 1. Specific transitions for word tiles (replaces expensive 'all') */
.word-tile {
    transition: background-color 0.15s ease, 
                border-color 0.15s ease, 
                transform 0.15s ease !important;
}

/* 2. Specific transitions for form inputs */
.filter-input,
.filter-select,
.tile-input,
.tile-input-sidebar {
    transition: border-color 0.15s ease, 
                box-shadow 0.15s ease !important;
}

/* 3. CSS containment for layout isolation (reduces repaints) */
.word-tile {
    contain: layout style;
}

.result-card {
    contain: layout;
}

.word-tiles {
    contain: layout;
}

/* 4. GPU acceleration for animated panels */
.mobile-sidebar-sheet,
.mobile-menu-panel,
.mobile-menu-overlay-full {
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Remove will-change when not animating (saves memory) */
.mobile-sidebar-sheet:not(.open),
.mobile-menu-panel:not(.open) {
    will-change: auto;
}

/* 5. Mobile-specific performance improvements */
@media (max-width: 991.98px) {
    /* Faster transitions for interactive elements */
    .word-tile,
    .filter-input,
    .filter-select,
    .nav-link:not(.mobile-menu-link) {
        transition-duration: 0.1s !important;
    }
    
    /* Simpler shadows reduce paint complexity */
    .result-card {
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    /* Disable hover transform on touch devices */
    .word-tile:hover {
        transform: none;
    }
}

/* 6. Extended reduced motion support for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
    }
}

