/**
 * Kveez V2 - Global Site Stylesheet
 * High-performance, lightweight design system with Dark & Warm Light themes
 */

/* -------------------------------------------------------------
   Typography: Self-Hosted Inter (Variable Font)
   ------------------------------------------------------------- */
/* latin-ext */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* -------------------------------------------------------------
   Design Tokens & CSS Custom Properties
   ------------------------------------------------------------- */
:root,
:root[data-theme="dark"] {
    /* Surfaces */
    --bg-dark: #0f1115;
    --bg-card: #171a21;
    --bg-card-hover: #1e222c;
    --bg-input: #12141a;

    /* Borders */
    --border-color: #272c38;
    --border-focus: #3bb166;

    /* Typography */
    --text-main: #f3f4f6;
    --text-muted: #9ca3af; /* 9ca3af 7c828c  */
    --text-dim: #6b7280;

    /* Brand & Accents */
    --primary: #3bb166;
    --primary-hover: #45ca75;
    --primary-light: rgba(59, 177, 102, 0.14);
    --accent: #00d492;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    /* Shadows */
    --shadow-header: 0 2px 14px rgba(0, 0, 0, 0.4);
    --shadow-dropdown: 0 16px 36px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--border-color);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.35);

    /* Theme Switch Slider */
    --slider-track: #12141a;
    --slider-border: #272c38;
    --slider-thumb: #3bb166;
}

:root[data-theme="light"] {
    /* Surfaces */
    --bg-dark: #faf9f6;
    --bg-card: #ffffff;
    --bg-card-hover: #f3f0e8;
    --bg-input: #ffffff;

    /* Borders */
    --border-color: #e6e3da;
    --border-focus: #15803d;

    /* Typography */
    --text-main: #1f2937;
    --text-muted: #606673; /* 6b7280 606673 */
    --text-dim: #8c929d; /* 9ca3af 8c929d */

    /* Brand & Accents */
    --primary: #15803d;
    --primary-hover: #16a34a;
    --primary-light: rgba(21, 128, 61, 0.12);
    --accent: #15803d;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #2563eb;

    /* Shadows */
    --shadow-header: 0 2px 14px rgba(0, 0, 0, 0.05);
    --shadow-dropdown: 0 16px 36px rgba(0, 0, 0, 0.1), 0 0 0 1px var(--border-color);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

    /* Theme Switch Slider */
    --slider-track: #e9e6dd;
    --slider-border: #dcd8ce;
    --slider-thumb: #15803d;
}

:root {
    /* Typography Font Stack */
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: all 0.15s ease;
    --transition-base: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);

    /* Backwards compatibility aliases for header tokens */
    --hdr-bg: var(--bg-card);
    --hdr-bg-elevated: var(--bg-card);
    --hdr-bg-hover: var(--bg-card-hover);
    --hdr-border: var(--border-color);
    --hdr-border-focus: var(--border-focus);
    --hdr-text: var(--text-main);
    --hdr-text-muted: var(--text-muted);
    --hdr-text-dim: var(--text-dim);
    --hdr-primary: var(--primary);
    --hdr-primary-hover: var(--primary-hover);
    --hdr-primary-light: var(--primary-light);
    --hdr-accent: var(--accent);
    --hdr-shadow-header: var(--shadow-header);
    --hdr-shadow-dropdown: var(--shadow-dropdown);
    --hdr-slider-track: var(--slider-track);
    --hdr-slider-border: var(--slider-border);
    --hdr-slider-thumb: var(--slider-thumb);
    --hdr-radius-sm: var(--radius-sm);
    --hdr-radius-md: var(--radius-md);
    --hdr-radius-lg: var(--radius-lg);
    --hdr-radius-full: var(--radius-full);
    --hdr-transition: var(--transition-base);
}

/* -------------------------------------------------------------
   Base Reset & Global Styles
   ------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    min-height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
}

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

/* -------------------------------------------------------------
   Layout Containers
   ------------------------------------------------------------- */
.container,
.site-container {
    width: 100%;
    max-width: 740px;
    margin: 0 auto;
    padding: 0 10px;
    box-sizing: border-box;
}

.v8row {
    width: 100%;
    max-width: 740px;
    margin: 0 auto;
    padding: 0 10px;
    box-sizing: border-box;
}

.v8full {
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* -------------------------------------------------------------
   Header Layout
   ------------------------------------------------------------- */
.site-header {
    width: 100%;
    position: relative;
    z-index: 100;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

/* Mobile top bar for sub-branding */
.header-top-bar {
    display: none;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 6px 16px;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
}

.header-main {
    width: 100%;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 740px;
    margin: 0 auto;
    padding: 8px 10px;
    min-height: 56px;
    box-sizing: border-box;
}

/* -------------------------------------------------------------
   Brand Section (Logo & Tagline)
   ------------------------------------------------------------- */
.header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-brand a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.header-logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
    border: none;
    display: block;
    transition: var(--transition-base);
}

.header-logo-img:hover {
    transform: scale(1.05);
}

.header-brand-desktop {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo-sign {
    height: 16px;
    width: auto;
    object-fit: contain;
    border: none;
    display: block;
}

.header-logo-sign:hover {
    opacity: 1;
}

.header-tagline {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    background: var(--primary-light);
    border: 1px solid var(--primary-light);
    padding: 3px 12px 1px 10px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.header-tagline::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
}

/* -------------------------------------------------------------
   Actions Cluster (User Profile, Theme Switch, Menu)
   ------------------------------------------------------------- */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

/* Icon Buttons (User & Hamburger) */
.header-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    outline: none;
    transition: var(--transition-base);
    box-sizing: border-box;
}

.header-action-btn:hover,
.header-action-btn.open {
    background: var(--bg-card-hover);
    border-color: var(--border-focus);
    color: var(--text-main);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.header-action-btn svg {
    stroke: currentColor;
    width: 20px;
    height: 20px;
    display: block;
    transition: stroke 0.15s ease;
}

/* Sign-in Button */
.header-signin-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main) !important;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    cursor: pointer;
    box-sizing: border-box;
    transition: var(--transition-base);
}

.header-signin-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-focus);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.header-signin-img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    border: none;
}

/* -------------------------------------------------------------
   Pill-Shaped Theme Switch Slider
   ------------------------------------------------------------- */
.theme-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 52px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--slider-track);
    border: 1px solid var(--slider-border);
    cursor: pointer;
    padding: 2px;
    box-sizing: border-box;
    outline: none;
    transition: var(--transition-base);
}

.theme-switch:hover {
    border-color: var(--border-focus);
}

.theme-switch-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-card);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    transform: translateX(0);
    transition: var(--transition-base);
    color: var(--text-main);
}

.theme-switch-thumb svg {
    width: 15px;
    height: 15px;
    stroke: var(--primary-hover);
    display: block;
}

/* Toggle state: Light mode shifts right */
:root[data-theme="light"] .theme-switch-thumb {
    transform: translateX(24px);
    background: #ffffff;
    color: #f59e0b;
}

/* Icon visibility inside thumb */
.theme-switch-thumb .icon-moon {
    display: block;
}

.theme-switch-thumb .icon-sun {
    display: none;
}

:root[data-theme="light"] .theme-switch-thumb .icon-moon {
    display: none;
}

:root[data-theme="light"] .theme-switch-thumb .icon-sun {
    display: block;
}

/* -------------------------------------------------------------
   Animated Hamburger Icon
   ------------------------------------------------------------- */
.hamburger-icon {
    position: relative;
    width: 18px;
    height: 14px;
}

.hamburger-line {
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: var(--transition-base);
}

.hamburger-line-1 { top: 0; }
.hamburger-line-2 { top: 6px; }
.hamburger-line-3 { bottom: 0; }

.header-action-btn.open .hamburger-line-1 {
    top: 6px;
    transform: rotate(45deg);
    background: var(--accent);
}

.header-action-btn.open .hamburger-line-2 {
    opacity: 0;
    transform: translateX(4px);
}

.header-action-btn.open .hamburger-line-3 {
    top: 6px;
    bottom: auto;
    transform: rotate(-45deg);
    background: var(--accent);
}

/* -------------------------------------------------------------
   Dropdown Navigation Panels
   ------------------------------------------------------------- */
.dropdown-wrapper {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 1100;
    min-width: 270px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-dropdown);
    padding: 8px;
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    pointer-events: none;
    transition: var(--transition-base);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-sizing: border-box;
}

.dropdown-menu.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.dropdown-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition-base);
    box-sizing: border-box;
    border: 1px solid transparent;
}

.dropdown-link:hover {
    background: var(--bg-card-hover);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.05);
    transform: translateX(3px);
    text-decoration: none;
}

.dropdown-link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    flex-shrink: 0;
}

.dropdown-link-icon svg {
    display: block;
    width: 16px;
    height: 16px;
}

.dropdown-link-text {
    color: var(--text-main);
    font-weight: 500;
    transition: color 0.15s ease;
}

.dropdown-link:hover .dropdown-link-text {
    color: var(--primary-hover);
}

/* -------------------------------------------------------------
   Notification Notice Banner
   ------------------------------------------------------------- */
.notice-bar,
.header-notice-bar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 16px;
    color: var(--text-main);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
}

.notice-bar a,
.header-notice-bar a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
    transition: color 0.15s ease;
}

.notice-bar a:hover,
.header-notice-bar a:hover {
    color: var(--primary-hover);
}

.notice-bar svg,
.header-notice-bar svg {
    vertical-align: middle;
}

/* -------------------------------------------------------------
   Page Hero (Title & Subtitle)
   ------------------------------------------------------------- */
.page-hero {
    /*padding: 32px 10px 16px;*/
    padding: 20px 10px;
    text-align: center;
}

.page-title {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.25;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-muted);
    width: 100%;
    margin: 0 auto;
}

/* -------------------------------------------------------------
   Brain Games Winning Streak Widget
   ------------------------------------------------------------- */
.brain-streak-widget {
    max-width: 440px;
    margin: 0 auto 24px auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    /*padding: 16px 20px;*/
    padding: 14px 14px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.brain-streak-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.brain-streak-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}

.brain-streak-help-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
}

.brain-streak-help-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.brain-streak-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.brain-streak-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.brain-streak-flame {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 2px 8px rgba(239, 68, 68, 0.35));
}

.brain-streak-count {
    font-size: 38px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    letter-spacing: -0.03em;
    min-width: 60px;
    text-align: left;
}

.brain-streak-calendar {
    display: grid;
    grid-template-columns: repeat(7, auto);
    justify-content: center;
    gap: 20px;
    justify-items: center;
    margin-bottom: 12px;
}

.brain-streak-day-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 100%;
}

.brain-streak-day-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.brain-streak-day-col.is-today .brain-streak-day-label {
    color: var(--primary);
    font-weight: 700;
}

.brain-streak-box,
.brain-streak-pause-box {
    width: 25px;
    height: 25px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.streak-box-empty {
    background: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--text-dim);
}

.streak-box-win {
    background: var(--primary);
    border: 1.5px solid var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(59, 177, 102, 0.3);
}

.streak-box-pause {
    background: var(--info);
    border: 1.5px solid var(--info);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.streak-box-fail {
    background: var(--danger);
    border: 1.5px solid var(--danger);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.brain-streak-pauses {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
}

.brain-streak-pauses-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-right: 2px;
}

.brain-streak-guest-notice {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    text-align: center;
    color: var(--text-muted);
    line-height: 1.4;
}

.brain-streak-login-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.brain-streak-login-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

@media (max-width: 480px) {
    .brain-streak-widget {
        padding: 14px 14px;
        margin-bottom: 18px;
    }

    .brain-streak-box,
    .brain-streak-pause-box {
        width: 22px;
        height: 22px;
        font-size: 11px;
        border-radius: 4px;
    }

    .brain-streak-calendar {
        gap: 16px;
    }

    .brain-streak-count {
        font-size: 32px;
    }

    .brain-streak-flame {
        width: 28px;
        height: 28px;
    }
}

/* -------------------------------------------------------------
   Button Primitives
   ------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    transition: var(--transition-base);
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.btn-secondary {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-focus);
    color: var(--text-main);
    transform: translateY(-1px);
    text-decoration: none;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

/* Icon Button */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    outline: none;
    transition: var(--transition-base);
    box-sizing: border-box;
}

.btn-icon:hover,
.btn-icon.open {
    background: var(--bg-card-hover);
    border-color: var(--border-focus);
    color: var(--text-main);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-icon svg {
    stroke: currentColor;
    width: 20px;
    height: 20px;
    display: block;
    transition: stroke 0.15s ease;
}

/* -------------------------------------------------------------
   Badges & Status Pills
   ------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-full);
    letter-spacing: 0.4px;
    white-space: nowrap;
    text-transform: uppercase;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary-light);
}

.badge-muted {
    background: var(--bg-card-hover);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

/* -------------------------------------------------------------
   Cards & Surfaces
   ------------------------------------------------------------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-sizing: border-box;
    transition: var(--transition-base);
}

.card:hover {
    border-color: var(--border-focus);
}

/* -------------------------------------------------------------
   All Apps Directory Navigation (views/menuAllApps.php)
   ------------------------------------------------------------- */
.apps-nav {
    margin: 32px auto 20px;
}

.apps-nav-list,
.apps-subnav,
.apps-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.apps-nav-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Top-level category bars */
.apps-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    transition: var(--transition-base);
}

.apps-nav-header:hover {
    border-color: var(--border-focus);
    background: var(--bg-card-hover);
}

.apps-nav-header a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    width: 100%;
}

.apps-nav-header a:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

/* Nested sub-categories list */
.apps-subnav {
    margin-top: 6px;
    padding-left: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Sub-category clickable bar */
.apps-subcat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: var(--transition-base);
}

.apps-subcat-header:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-focus);
}

.apps-subcat-header.active {
    color: var(--primary);
    border-color: var(--border-focus);
}

.apps-subcat-chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
    stroke: currentColor;
    flex-shrink: 0;
}

.apps-subcat-header.active .apps-subcat-chevron {
    transform: rotate(180deg);
}

/* Collapsible list of games */
.apps-list {
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0 6px 14px;
}

.apps-list.show {
    display: flex;
}

/* Game flex item */
.apps-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 38px;
    padding: 2px 12px;
    border-bottom: 1px solid var(--border-color);
}

.apps-item:hover {
    background: var(--bg-card-hover);
}

.apps-item-link {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    flex: 1;
}

.apps-item:hover .apps-item-link {
    color: var(--text-main);
    text-decoration: none;
}

/* -------------------------------------------------------------
   Game Rules & Knowledge Section
   ------------------------------------------------------------- */
.rules-section {
    padding: 20px 10px 20px;
    margin-top: 10px;
}

.rules-block {
    width: 100%;
    text-align: left;
}

.rules-lang-offer {
    display: inline-flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    transition: var(--transition-base);
}

.rules-lang-offer:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.rules-lang-link {
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.rules-lang-link:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

.rules-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 16px 0;
    letter-spacing: -0.01em;
    line-height: 1.35;
}

.rules-subtitle {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0 0 16px 0;
}

.rules-title + .rules-subtitle {
    margin-top: -8px;
}

.rules-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rules-line {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-muted);
}

/* -------------------------------------------------------------
   Letter Game Tiles (.rule-tile & legacy .v8lettbox compatibility)
   ------------------------------------------------------------- */
.rule-tile,
.v8lettbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 18px;
    color: #ffffff;
    margin: 0 8px 4px 0;
    user-select: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.boxsz1 { width: 40px; height: 40px; font-size: 20px; line-height: normal; }
.boxsz2 { width: 34px; height: 34px; font-size: 16px; line-height: normal; }
.boxsz3 { width: 28px; height: 28px; font-size: 14px; line-height: normal; }

/* Scheme A: Standard */
.rule-tile-correct,
.v8bggre2 {
    background-color: #2e7d32;
    color: #ffffff;
}

.rule-tile-present,
.v8bgred {
    background-color: #d32f2f;
    color: #ffffff;
}

.rule-tile-absent,
.v8bgbla4 {
    background-color: #424242;
    color: #ffffff;
}

/* Scheme B: High-contrast / Colorblind */
.rule-tile-correct-alt,
.v8bggre3 {
    background-color: #4a7be0;
    color: #ffffff;
}

.rule-tile-present-alt,
.v8bgred2 {
    background-color: #e65100;
    color: #ffffff;
}

.rule-tile-absent-alt,
.v8bggry9 {
    background-color: #c2185b;
    color: #ffffff;
}

/* -------------------------------------------------------------
   User Statistics Section
   ------------------------------------------------------------- */
.stats-section {
    padding: 20px 10px 20px;
    margin-top: 20px;
}

.stats-header {
    text-align: center;
    width: 100%;
    margin: 0 auto 28px;
}

.stats-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}

.stats-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

.stats-notice-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 20px;
}

.stats-notice-wrapper .stats-notice {
    margin-top: 0;
}

.stats-notice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 6px 14px;
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.25);
    border-radius: var(--radius-full);
    color: #facc15;
    font-size: 13px;
    font-weight: 500;
}

.stats-notice a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.stats-notice a:hover {
    color: var(--primary-hover);
}

/* 2-Column Responsive Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    margin: 0 auto;
    align-items: stretch;
}

.stats-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-card);
    min-width: 0;
    overflow: hidden;
}

.stats-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* -------------------------------------------------------------
   Slick Bar Chart
   ------------------------------------------------------------- */
.stats-chart {
    display: flex;
    flex-direction: column;
    height: 240px;
    width: 100%;
    min-width: 0;
}

.stats-chart-bars {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(14, minmax(0, 1fr));
    gap: 3px;
    align-items: end;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    min-width: 0;
}

/* Subtle background guide lines */
.stats-chart-bars::before {
    content: "";
    position: absolute;
    inset: 0 0 8px 0;
    background: repeating-linear-gradient(
        to top,
        transparent 0,
        transparent calc(25% - 1px),
        var(--border-color) calc(25% - 1px),
        var(--border-color) 25%
    );
    opacity: 0.35;
    pointer-events: none;
}

.stats-chart-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    position: relative;
    cursor: pointer;
    min-width: 0;
}

.stats-bar-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    position: relative;
    min-width: 0;
}

.stats-bar-value {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
    white-space: nowrap;
    opacity: 0.85;
    transition: var(--transition-fast);
}

.stats-chart-col:hover .stats-bar-value {
    opacity: 1;
    transform: translateY(-2px);
    color: var(--primary);
}

.stats-bar {
    width: 100%;
    max-width: 18px;
    height: var(--bar-h, 0%);
    min-height: 4px;
    background: linear-gradient(180deg, var(--primary) 0%, #059669 100%);
    border-radius: 4px 4px 2px 2px;
    transition: height 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.15s ease, filter 0.15s ease;
    animation: bar-rise 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes bar-rise {
    from {
        height: 0%;
        opacity: 0.3;
    }
}

.stats-bar-zero {
    background: var(--border-color);
    opacity: 0.5;
    min-height: 3px;
    border-radius: 2px;
}

.stats-bar.stats-bar-fail {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%) !important;
}

.stats-chart-col:hover .stats-bar:not(.stats-bar-zero):not(.stats-bar-fail) {
    filter: brightness(1.15);
    box-shadow: 0 0 10px rgba(0, 212, 146, 0.4);
}

.stats-chart-col:hover .stats-bar.stats-bar-fail {
    filter: brightness(1.15);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.stats-chart-axis {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

/* -------------------------------------------------------------
   Stats History Table
   ------------------------------------------------------------- */
.stats-table-wrapper {
    height: 240px;
    overflow-y: auto;
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
    width: 100%;
}

.stats-table-wrapper::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.stats-table-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.stats-table-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.stats-table thead th {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 7px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    z-index: 2;
    white-space: nowrap;
}

.stats-table thead th:last-child {
    text-align: right;
}

.stats-table tbody tr {
    transition: background 0.15s ease;
}

.stats-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.stats-table tbody td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    white-space: nowrap;
}

.stats-table-date {
    color: var(--text-muted);
}

.stats-table-score {
    text-align: right;
    font-weight: 600;
    color: var(--text-main);
}

#community14DaysTable .stats-table-score {
    text-align: left;
}

/* -------------------------------------------------------------
   Daily Game Statistics Section
   ------------------------------------------------------------- */
.stats-metrics-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
    margin-bottom: 20px;
}

.stats-metric-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    box-shadow: var(--shadow-card);
    transition: var(--transition-fast);
}

.stats-metric-box:hover {
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.stats-metric-val {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.1;
    min-height: 29px;
    letter-spacing: -0.02em;
}

.stats-metric-lbl {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* 2x2 KPI Grid inside Left Card */
.stats-kpi-grid-2x2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 10px;
    height: 100%;
}

.stats-row-full {
    width: 100%;
    margin-top: 16px;
}

/* 30-Day Vertical Bar Chart */
.stats-chart-bars-30 {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(30, minmax(0, 1fr));
    gap: 3px;
    align-items: end;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    min-width: 0;
}

.stats-chart-bars-30::before {
    content: "";
    position: absolute;
    inset: 0 0 8px 0;
    background: repeating-linear-gradient(
        to top,
        transparent 0,
        transparent calc(25% - 1px),
        var(--border-color) calc(25% - 1px),
        var(--border-color) 25%
    );
    opacity: 0.35;
    pointer-events: none;
}

/* Guess Distribution Histogram */
.stats-dist-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    padding: 4px 0;
}

.stats-dist-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.stats-dist-label {
    width: 18px;
    text-align: right;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.stats-dist-track {
    flex: 1;
    height: 22px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    position: relative;
}

.stats-dist-bar-ghost {
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.12));
    border-radius: 4px;
    width: var(--bar-pct, 15%);
    transition: width 0.4s ease;
}

.stats-dist-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #059669 100%);
    border-radius: 4px;
    width: var(--bar-pct, 0%);
    transition: width 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

.stats-dist-bar-fill.stats-dist-bar-fail {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.stats-dist-bar-zero {
    height: 100%;
    width: 0% !important;
    background: transparent !important;
    padding: 0 !important;
}

.stats-dist-row.is-zero .stats-dist-bar-fill,
.stats-dist-row.is-zero .stats-dist-bar-ghost {
    background: transparent !important;
    width: 0% !important;
    padding: 0 !important;
}

.stats-dist-val {
    position: absolute;
    right: 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-main);
}

/* 30-Day Activity Strip */
.stats-calendar-strip {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    gap: 6px;
    padding: 8px 0;
}

.stats-cal-cell {
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--text-muted);
    transition: var(--transition-fast);
    position: relative;
    cursor: default;
}

.stats-cal-cell.is-win {
    background: rgba(0, 212, 146, 0.25);
    border-color: rgba(0, 212, 146, 0.5);
    color: #00d492;
    font-weight: 700;
}

.stats-cal-cell.is-fail {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
    font-weight: 700;
}

.stats-cal-cell.is-empty {
    opacity: 0.45;
}

/* Card 4A: Donut Win Rate Chart */
.stats-pie-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 220px;
    padding: 10px 0;
}

.stats-pie-chart {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: conic-gradient(var(--primary) var(--pie-pct, 0%), var(--border-color) 0);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.4s ease;
}

.stats-pie-inner {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25);
}

.stats-pie-val {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.stats-community-split {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 16px;
    align-items: center;
}

.stats-big-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 212, 146, 0.08);
    border: 1px solid rgba(0, 212, 146, 0.2);
    border-radius: var(--radius-md);
    text-align: center;
}

.stats-badge-num {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
}

.stats-badge-sub {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 4px;
}

.stats-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

.stats-pill-easy {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.stats-pill-medium {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.stats-pill-hard {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* 14-Day Chart Difficulty Tints */
.stats-bar-high { background: linear-gradient(180deg, #10b981 0%, #059669 100%) !important; }
.stats-bar-mid  { background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%) !important; }
.stats-bar-low  { background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%) !important; }

/* 14-Day Table Score Tints */
.stats-score-high { color: #10b981 !important; font-weight: 700; }
.stats-score-mid  { color: #f59e0b !important; font-weight: 700; }
.stats-score-low  { color: #ef4444 !important; font-weight: 700; }

.stats-ghost-text {
    display: inline-block;
    height: 14px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    color: transparent !important;
}

.stats-pill-percentile {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    background: rgba(0, 212, 146, 0.15);
    color: #00d492;
    border: 1px solid rgba(0, 212, 146, 0.3);
}

.stats-pill-percentile.stats-pill-high {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

.stats-pill-percentile.stats-pill-mid {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.3);
}

.stats-pill-percentile.stats-pill-low {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.stats-pill-percentile.stats-pill-zero {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Section Grouping */
.stats-section-group {
    margin-top: 20px;
    padding-top: 20px;
}

.stats-group-header {
    margin-bottom: 16px;
}

.stats-group-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 4px 0;
    letter-spacing: -0.01em;
}

.stats-group-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

/* Guest Overlay on Locked Sections */
.stats-overlay-container {
    position: relative;
    border-radius: var(--radius-lg);
    width: 100%;
    overflow: hidden;
}

.stats-overlay-blurred {
    filter: blur(2.5px);
    opacity: 0.55;
    pointer-events: none;
    user-select: none;
}

.stats-overlay-card {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(3px);
    z-index: 10;
    padding: 24px;
    text-align: center;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.stats-overlay-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.stats-overlay-text {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 340px;
    margin-bottom: 16px;
    line-height: 1.45;
}

.stats-overlay-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-fast);
}

.stats-overlay-btn:hover {
    background: var(--primary-hover);
    color: #fff;
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .stats-metrics-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .stats-community-split {
        grid-template-columns: 1fr;
    }
    .stats-calendar-strip {
        grid-template-columns: repeat(10, 1fr);
    }
}

/* -------------------------------------------------------------
   Reviews & Ratings Section
   ------------------------------------------------------------- */
.reviews-section {
    padding: 20px 10px 20px;
    margin-top: 20px;
}

.reviews-block {
    width: 100%;
}

.reviews-header {
    text-align: center;
    margin-bottom: 24px;
}

.reviews-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}

.reviews-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

/* Rating Summary Header */
.reviews-summary {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding: 8px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-card);
}

.reviews-summary-score {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.reviews-summary-stars {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #f59e0b;
}

.reviews-summary-stars svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    stroke: currentColor;
}

.reviews-summary-count {
    font-size: 13px;
    color: var(--text-muted);
    border-left: 1px solid var(--border-color);
    padding-left: 12px;
}

/* Review Submission Card */
.reviews-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-card);
}

.reviews-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.reviews-rating-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.reviews-rating-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.reviews-star-picker {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.reviews-star-btn {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--border-color);
    transition: color 0.15s ease, transform 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.reviews-star-btn svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
    stroke: currentColor;
    stroke-width: 1;
}

.reviews-star-btn:hover {
    transform: scale(1.15);
}

.reviews-star-btn.active,
.reviews-star-btn.hover {
    color: #f59e0b;
}

.reviews-textarea {
    width: 100%;
    min-height: 110px;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    transition: var(--transition-base);
    box-sizing: border-box;
}

.reviews-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.reviews-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.reviews-msg {
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition-base);
}

.reviews-msg.success {
    color: var(--primary);
}

.reviews-msg.error {
    color: var(--danger);
}

/* Guest Sign-in Prompt Card */
.reviews-guest-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 28px;
}

.reviews-guest-text {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

/* Reviews List */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.review-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: var(--shadow-card);
    transition: var(--transition-base);
}

.review-card:hover {
    border-color: var(--border-focus);
}

.review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 12px;
}

.review-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.review-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.review-author-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.review-date {
    font-size: 12px;
    color: var(--text-muted);
}

.review-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: #f59e0b;
}

.review-stars svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    stroke: currentColor;
}

.review-body {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
    word-break: break-word;
}

.review-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 14px;
}

.review-hidden {
    display: none;
}

.reviews-more-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

/* -------------------------------------------------------------
   Site Footer
   ------------------------------------------------------------- */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 24px 0;
    margin-top: 48px;
    width: 100%;
}

.site-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    width: 100%;
    max-width: 740px;
    margin: 0 auto;
    padding: 0 10px;
    box-sizing: border-box;
}

.site-footer-copy {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.site-footer-links {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.site-footer-link {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-fast);
    font-weight: 500;
}

.site-footer-link:hover {
    color: var(--primary);
    text-decoration: none;
}

/* -------------------------------------------------------------
   Support & Share Section
   ------------------------------------------------------------- */
.share-section {
    padding: 20px 10px 20px;
    margin-top: 10px;
}

.share-card {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
}

.share-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 12px;
    letter-spacing: -0.01em;
}

.share-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0 0 20px;
}

.share-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 4px 6px 4px 14px;
    transition: var(--transition-base);
}

.share-input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.share-url-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-main);
    min-width: 0;
}

.share-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    transition: var(--transition-base);
}

.share-copy-btn.copied {
    background: #059669;
    border-color: #059669;
    color: #ffffff;
}

.share-copy-btn svg {
    width: 14px;
    height: 14px;
}

/* -------------------------------------------------------------
   AdSense
   ------------------------------------------------------------- */
.alc {
    text-align: center;
}

.adsncful {
    display: block !important;
    width: 100% !important;
    min-width: 250px;
}

#adpnful, #adpnful2 { 
    width: 100%;
    min-height: 280px; 
    margin: 30px auto;
    text-align: center;
    background-color: var(--bg-card);
}

#v7_adp_250 {
    display: block;
    margin: 30px auto;
    background-color: var(--bg-dark);
    width: 300px;
    height: 250px;
}

/* -------------------------------------------------------------
   Game / App Container & Header
   ------------------------------------------------------------- */
.app-section {
    width: 100%;
    margin-top: 14px;
}

.app-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    /*box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);*/
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    /*padding: 18px 24px;*/
    padding: 12px 22px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.app-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.app-date-badge {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    letter-spacing: 0.01em;
}

/* -------------------------------------------------------------
   App Toast & Loading Overlays
   ------------------------------------------------------------- */
.app-toast {
    visibility: hidden;
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    padding: 10px 22px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-toast.show {
    visibility: visible;
    animation: appToastIn 0.3s ease-out;
}

.app-loader-toast {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1100;
    padding: 16px 32px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
    color: var(--text-main);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}

@keyframes appToastIn {
    from {
        opacity: 0;
        transform: translate(-50%, -10px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* -------------------------------------------------------------
   Result Modal Dialog
   ------------------------------------------------------------- */
.app-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.app-modal-overlay.show,
.app-modal-overlay.open {
    display: flex;
}

.app-modal-card {
    width: 100%;
    max-width: 380px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    animation: appModalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes appModalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.app-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background-color: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
}

.app-modal-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.app-modal-icon svg {
    width: 22px;
    height: 22px;
}

.app-modal-icon .icon-win,
.app-modal-icon .icon-lose {
    display: none;
}

.app-modal-overlay[data-state="win"] .app-modal-icon .icon-win,
.app-modal-overlay:not([data-state="lose"]) .app-modal-icon .icon-win {
    display: inline-flex;
}

.app-modal-overlay[data-state="lose"] .app-modal-icon .icon-lose {
    display: inline-flex;
}

.app-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.app-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.app-modal-close:hover {
    color: var(--text-main);
    background-color: var(--bg-card-hover);
}

.app-modal-close svg {
    width: 18px;
    height: 18px;
}

.app-modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: center;
}

.app-modal-answer {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    padding: 10px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.app-modal-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 16px;
    gap: 2px;
}

.app-modal-btn-sub {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.app-modal-btn-main {
    font-size: 15px;
    font-weight: 700;
}

.app-modal-share {
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-modal-share-text {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

.app-modal-share-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.app-modal-share-link {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: var(--text-dim);
    text-align: left;
    padding-left: 6px;
    user-select: all;
}

.app-modal-copy-badge {
    display: inline-block;
    min-height: 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
}

/* -------------------------------------------------------------
   Game / App Footer & Post-Game Results
   ------------------------------------------------------------- */
.clsno {
    display: none !important;
}

.app-footer {
    padding: 12px;
    background-color: var(--bg-card);
    /*border-top: 1px solid var(--border-color);*/
    text-align: center;
}

.app-play-again-panel {
    display: none;
    justify-content: center;
    align-items: center;
    padding-bottom: 16px;
}

.app-play-again-panel.show {
    display: flex;
}

.app-play-again-btn {
    min-width: 140px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
}

.app-report-wrapper {
    padding-top: 8px;
    text-align: center;
}

.app-report {
    display: inline-block;
    max-width: 100%;
    overflow-x: auto;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    color: var(--text-muted);
    text-align: center;
}

.app-report:empty {
    display: none;
}

.app-result-panel {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    /*border-top: 1px solid var(--border-color);*/
}

.app-result-panel.show {
    display: flex;
}

.app-result-title {
    font-size: 15px;
    /*font-weight: 700;*/
    padding-left: 16px;
    color: var(--text-muted);
    line-height: 1;
}

.app-result-content {
    width: 100%;
    padding: 24px;
    background-color: var(--bg-dark);
    border: 3px dashed var(--border-focus);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    text-align: left;
    word-break: break-word;
    /*box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);*/
    white-space: pre-line;
}

.app-result-content b,
.app-result-content strong {
    color: var(--text-main);
    font-weight: 700;
}

.app-result-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-result-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 16px;
    gap: 6px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
}

.app-result-badge {
    display: inline-block;
    min-height: 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

/* Desktop: 12px box margins + 12px app-footer padding = 24px gap to the card edge */
@media (min-width: 641px) {
    .app-result-content {
        width: calc(100% - 24px);
        margin-left: 12px;
        margin-right: 12px;
    }
}

/* -------------------------------------------------------------
   Responsive Breakpoints
   ------------------------------------------------------------- */
@media (max-width: 768px) {
    .header-brand-desktop {
        display: none;
    }

    .header-top-bar {
        display: flex;
    }

    .header-inner {
        padding: 6px 10px;
    }

    .dropdown-menu {
        min-width: 250px;
        right: -6px;
    }

    .page-hero {
        padding: 24px 10px 10px;
    }

    .apps-subnav {
        padding-left: 6px;
    }

    .apps-list {
        padding-left: 8px;
    }

    .rules-title {
        font-size: 18px;
    }

    .rules-subtitle {
        font-size: 13px;
    }

    .rules-line {
        font-size: 14px;
    }

    .reviews-card {
        padding: 16px;
    }

    .share-card {
        padding: 16px;
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stats-chart-bars {
        gap: 4px;
    }

    .stats-chart-bars-30 {
        gap: 1px;
    }

    .stats-bar-value {
        font-size: 9px;
    }

    .reviews-guest-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
    }

    .reviews-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .reviews-actions .btn {
        width: 100%;
    }

    .site-footer {
        padding: 20px 0;
        margin-top: 32px;
    }

    .site-footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .site-footer-links {
        justify-content: center;
        gap: 16px;
    }

    .share-input-group {
        flex-direction: column;
        align-items: stretch;
        padding: 8px;
        gap: 8px;
    }

    .share-url-input {
        padding: 6px 4px;
    }

    .share-copy-btn {
        width: 100%;
        justify-content: center;
    }

    #adpnful, #adpnful2 { 
        min-height: 355px; 
    }

    .app-header {
        padding: 8px 14px;
    }

    .app-title {
        font-size: 17px;
    }

    .app-date-badge {
        font-size: 12px;
        padding: 3px 8px;
    }

    .app-modal-body {
        padding: 16px;
    }

    .app-result-content {
        padding: 12px 14px;
        font-size: 13px;
    }
}

/* -------------------------------------------------------------
   Word Games - Color Scheme Switch & Scheme B Overrides
   ------------------------------------------------------------- */
.color-scheme-switch {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin: 0 auto 8px;
    max-width: 500px;
    width: 100%;
    padding: 0 4px;
    box-sizing: border-box;
}

.color-scheme-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.color-scheme-pills {
    display: inline-flex;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm, 6px);
    padding: 2px;
    gap: 2px;
}

.color-scheme-btn {
    padding: 3px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1.2;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.color-scheme-btn:hover {
    color: var(--text-main);
}

.color-scheme-btn.active {
    background-color: var(--primary);
    color: #ffffff;
}

/* Scheme B: Colorblind / High-Contrast Mode */
.color-scheme-b .word-tile.tile-correct {
    background-color: #4a7be0 !important;
    border-color: #4a7be0 !important;
    color: #ffffff !important;
}

.color-scheme-b .word-tile.tile-present {
    background-color: #e65100 !important;
    border-color: #e65100 !important;
    color: #ffffff !important;
}

.color-scheme-b .word-tile.tile-absent {
    background-color: #c2185b !important;
    border-color: #c2185b !important;
    color: #ffffff !important;
}

.color-scheme-b .keyButton.key-correct {
    background-color: #4a7be0 !important;
    border-color: #4a7be0 !important;
    color: #ffffff !important;
}

.color-scheme-b .keyButton.key-present {
    background-color: #e65100 !important;
    border-color: #e65100 !important;
    color: #ffffff !important;
}

.color-scheme-b .keyButton.key-absent {
    background-color: #c2185b !important;
    border-color: #c2185b !important;
    color: #ffffff !important;
}

/* -------------------------------------------------------------
   Game Components: Unified Input Panels & Fields
   ------------------------------------------------------------- */
.input-panel_a {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.input-form_a {
    display: flex;
    gap: 6px;
    width: 100%;
    max-width: 440px;
}

.input_a {
    flex: 1;
    width: 100%;
    height: 40px;
    padding: 0 14px;
    background-color: var(--bg-dark, #0f1115);
    border: 2px solid var(--border-color, #272c38);
    border-radius: var(--radius-full, 9999px);
    color: var(--text-main, #f3f4f6);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: center;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input_a:focus {
    border-color: var(--border-focus, #3bb166);
}

.input_a:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

