/* ============================================
   GyroPlay - Game Settings CMS Styles
   Modern, Dark Gaming Theme
   ============================================ */

/* === CSS Variables === */
:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a2332;
    --bg-card-hover: #1f2b3d;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #7c8b9e;
    --accent: #00d4ff;
    --accent-glow: rgba(0, 212, 255, 0.3);
    --accent-secondary: #7c3aed;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --border: #1e293b;
    --border-light: #334155;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(0, 212, 255, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* === Responsive tokens === */
    --container-max: 1200px;       /* default container width (Laptop and below) */
    --container-max-wide: 1440px;  /* Large_Desktop container width */
    --touch-min: 44px;             /* minimum touch-target size */
}

/* === Reset & Base === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

/* Global media safety: keep images within their container (Req 12.3) */
img {
    max-width: 100%;
    height: auto;
}

/* === Navbar === */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.5px;
}

/* Navbar logo image — sits inside the fixed 64px navbar */
.logo-img {
    height: 40px;
    width: auto;
    display: block;
    object-fit: contain;
}

/* === Logo ring: circular crop + subtle animated RGB border === */
.logo-ring {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    padding: 2px;                /* ring thickness */
    isolation: isolate;
    flex-shrink: 0;
}

/* Rotating colorful gradient ring (subtle, low opacity) */
.logo-ring::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        #00d4ff,
        #7c3aed,
        #ec4899,
        #f59e0b,
        #10b981,
        #00d4ff
    );
    z-index: -2;
    opacity: 0.55;               /* dim / korimsiz */
    animation: spin-ring 5s linear infinite;
}

/* Inner mask so only a thin ring shows around the round logo */
.logo-ring::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: var(--bg-primary);
    z-index: -1;
}

.logo-ring .logo-img {
    height: 100%;
    width: 100%;
    border-radius: 50%;
    object-fit: cover;           /* fills the circle, crops rectangle edges */
}

/* Footer brand logo image */
.footer-logo-img {
    height: 100%;
    width: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Footer logo ring — smaller version of the navbar ring */
.footer-logo-ring {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    padding: 2px;
    margin-right: 8px;
    vertical-align: middle;
    isolation: isolate;
}

.footer-logo-ring::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        #00d4ff,
        #7c3aed,
        #ec4899,
        #f59e0b,
        #10b981,
        #00d4ff
    );
    z-index: -2;
    opacity: 0.5;
    animation: spin-ring 5s linear infinite;
}

.footer-logo-ring::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: var(--bg-secondary);
    z-index: -1;
}

.logo i {
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent);
    background: rgba(0, 212, 255, 0.08);
}

/* === Language switcher (lives inside .nav-links) === */
.lang-switch {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lang-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    transition: var(--transition);
}

/* Flag icon sizing inside a language option */
.lang-option .fi {
    border-radius: 2px;
    font-size: 0.95rem;
    line-height: 1;
}

.lang-option:hover {
    color: var(--accent);
}

.lang-option.active {
    color: var(--accent);
    background: rgba(0, 212, 255, 0.12);
    border-color: rgba(0, 212, 255, 0.35);
}

.mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: var(--touch-min);
    min-height: var(--touch-min);
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
}

/* === Hero Section === */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 20px 80px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(0, 212, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
    z-index: 0;
}

.hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    letter-spacing: -2px;
}

.hero h1 i {
    -webkit-text-fill-color: var(--accent);
}

.hero p {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.hero-sub {
    font-size: 1rem !important;
    color: var(--text-muted) !important;
    margin-bottom: 32px !important;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #0099cc);
    color: #000;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.5);
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* === Page Header === */
.page-header {
    padding: 100px 0 40px;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.page-header h1 i {
    color: var(--accent);
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

/* === Section === */
.section {
    padding: 60px 0;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 40px;
}

.section-title i {
    color: var(--accent);
    margin-right: 8px;
}

/* === Grid === */
.grid {
    display: grid;
    /* Laptop base = 3 columns; phones/tablet/large-desktop overridden in RESPONSIVE LAYERS (Req 4.3) */
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    justify-content: center;
}

/* Center single card on wide screens so it doesn't look orphaned */
.grid:has(> .card:only-child) {
    grid-template-columns: minmax(260px, 360px);
    justify-content: center;
}

/* === Placeholder card (Coming soon) === */
.card-placeholder {
    cursor: default;
    opacity: 0.55;
    background: linear-gradient(135deg, rgba(26, 35, 50, 0.4), rgba(26, 35, 50, 0.7));
    border-style: dashed;
    border-color: var(--border);
}

.card-placeholder:hover {
    opacity: 0.7;
    transform: none;
    box-shadow: none;
    border-color: var(--border-light);
}

.card-placeholder:hover::before {
    opacity: 0;
}

.card-icon-muted {
    background: rgba(148, 163, 184, 0.1);
}

.card-icon-muted i {
    color: var(--text-muted);
}

.card-placeholder h3,
.card-placeholder p {
    color: var(--text-muted);
}

.badge-soon {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-warning);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* === Card === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    opacity: 0;
    transition: var(--transition);
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.card:hover::before {
    opacity: 1;
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    background: rgba(0, 212, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.card-icon i {
    font-size: 1.5rem;
    color: var(--accent);
}

.card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.card .badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 12px;
}

.badge-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success);
}

.badge-inactive {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-danger);
}

/* === Config Card === */
.config-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    transition: var(--transition);
    cursor: pointer;
}

.config-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

.config-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-card h3 i {
    color: var(--accent);
}

.config-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.config-meta {
    display: flex;
    flex-wrap: wrap; /* Wrap metadata items across lines when they exceed width (Req 5.2); harmless at all sizes */
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.config-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* === Config Data Display === */
.config-data {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin-top: 16px;
    overflow: hidden;
}

.config-data pre {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.85rem;
    color: var(--accent);
    white-space: pre-wrap;
    word-break: break-all;
}

.config-data .data-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.config-data .data-row:last-child {
    border-bottom: none;
}

.config-data .data-key {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    flex: 1;
}

.config-data .data-value {
    color: var(--accent);
    font-family: 'Fira Code', monospace;
    font-weight: 700;
    font-size: 0.95rem;
    text-align: right;
    flex-shrink: 0;
    min-width: 32px;
}

/* === Modal === */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 600px;
    /* Cap modal height at 90% of the viewport; body scrolls within (Req 6.2) */
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
}

.modal-close {
    position: relative;
    background: var(--bg-card);
    border: none;
    color: var(--text-primary);
    font-size: 1.1rem;
    cursor: pointer;
    /* >=44x44px touch target (Req 6.4, 10.1); ring (::before/::after) scales via inset */
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 1;
    isolation: isolate;
}

/* Rotating colorful gradient ring around the X button */
.modal-close::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        #00d4ff,
        #7c3aed,
        #ec4899,
        #f59e0b,
        #10b981,
        #00d4ff
    );
    z-index: -2;
    animation: spin-ring 3s linear infinite;
}

/* Inner mask so only a thin border ring shows */
.modal-close::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--bg-card);
    z-index: -1;
}

.modal-close:hover {
    color: var(--accent);
    transform: scale(1.05);
}

.modal-close:hover::before {
    animation-duration: 1.2s;
}

@keyframes spin-ring {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.modal-body {
    padding: 24px;
    overflow-x: hidden;
}

/* === Loading === */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 1.1rem;
    grid-column: 1 / -1;
}

.loading i {
    font-size: 2rem;
    margin-right: 8px;
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* === Footer === */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 24px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: auto;
}

/* === Responsive === */
@media (max-width: 767px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 16px;
        border-bottom: 1px solid var(--border);
        gap: 8px;
    }

    .nav-links.active {
        display: flex;
    }

    /* Vertical menu links: >=44px tap height (Req 10.1); >=8px spacing via gap (Req 10.2) */
    .nav-links.active a {
        min-height: var(--touch-min);
        padding: 10px 16px;
    }

    /* Language switcher stays a horizontal row inside the collapsed menu */
    .nav-links .lang-switch {
        justify-content: flex-start;
        gap: 8px;
        padding-top: 4px;
    }

    .nav-links.active .lang-option {
        min-height: var(--touch-min);
        padding: 8px 14px;
    }

    .mobile-toggle {
        display: flex;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .page-header h1 {
        font-size: 1.6rem;
    }
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* === Animations === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.config-card {
    animation: fadeInUp 0.4s ease-out;
}

/* === Copy Button === */
.copy-btn {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* >=44px touch-target height (Req 6.4) */
    min-height: 44px;
    gap: 6px;
}

.copy-btn:hover {
    background: var(--accent);
    color: #000;
}

.copy-btn.copied {
    background: var(--accent-success);
    border-color: var(--accent-success);
    color: #000;
}

/* === Configs List === */
.configs-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}


/* === Hero Buttons === */
.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* === Stats Section === */
.stats-section {
    padding: 40px 0;
}

.stats-grid {
    display: grid;
    /* Exactly 3 stat cards -> deterministic 3 columns at Laptop and Large_Desktop (Req 9.3).
       Phones/Tablet reinforced in RESPONSIVE LAYERS / phones-shared block. */
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.stat-card i {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 8px;
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.stat-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* === Features Section === */
.features-section {
    background: var(--bg-secondary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.feature-icon i {
    font-size: 1.5rem;
    color: var(--accent);
}

.feature-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* === Search Bar === */
.search-section {
    padding: 24px 0;
}

.search-bar {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-bar i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-bar input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    min-height: var(--touch-min); /* >=44px touch-target height (Req 10.1) */
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

/* === Breadcrumb === */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: var(--text-muted);
    justify-content: center;
}

.breadcrumb a {
    color: var(--text-secondary);
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: var(--accent);
}

.breadcrumb i {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* === Footer Grid === */
/* Multi-column layout at >=768px (Tablet and up) per Req 8.1 */
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 24px;
    text-align: left;
}

.footer-brand h3 {
    color: var(--accent);
    margin-bottom: 8px;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links h4 {
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.footer-links a {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 4px 0;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-links a i {
    font-size: 0.7rem;
    margin-right: 6px;
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

@media (max-width: 767px) {
    /* Single column, centered text below 768px (phones) per Req 8.2 */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        text-align: center;
    }

    .breadcrumb {
        font-size: 0.8rem;
    }

    .stats-grid {
        /* 3 columns on Large_Phone and Small_Phone (Req 9.1, 9.2) — fixes prior 2-col conflict */
        grid-template-columns: repeat(3, 1fr);
    }

    .stat-card h3 {
        font-size: 1.5rem;
    }
}


/* === Config Screenshot === */
.config-card-inner {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.config-avatar {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border-light);
}

.config-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.config-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent);
    font-size: 1.5rem;
}

.config-card-content {
    flex: 1;
    min-width: 0;
}

.modal-avatar {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.modal-avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}


/* === Data Section Title === */
.config-data .data-section-title,
.data-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #22c55e;
    text-shadow: 0 0 12px rgba(34, 197, 94, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 0 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
    display: block;
    width: 100%;
}


/* === Code list (key/value entries) === */
.code-list {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.code-list .code-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.code-list .code-row:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
}

.code-list .code-row-copied {
    border-color: var(--accent-success);
    background: rgba(16, 185, 129, 0.1);
}

.code-list .code-key {
    font-weight: 800;
    color: var(--text-primary);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.code-list .code-value {
    flex: 1;
    color: var(--accent);
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.code-list .code-copy-icon {
    color: var(--text-muted);
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: var(--transition);
}

.code-list .code-row:hover .code-copy-icon {
    color: var(--accent);
}

/* === Toast notification === */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-card);
    border: 1px solid var(--accent);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-glow);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 3000;
    max-width: 90vw;
    text-align: center;
}

.toast-notification.toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


/* === Notify subscription button === */
.notify-btn {
    width: 100%;
    margin-top: 16px;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    /* >=44px touch-target height (Req 6.4) */
    min-height: 44px;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.25);
}

.notify-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.45);
}

.notify-btn:disabled {
    cursor: default;
    opacity: 0.85;
}

.notify-btn.notify-active {
    background: linear-gradient(135deg, var(--accent-success), #059669);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.35);
}


/* === Config TEXT mode (free-form text instead of JSON) === */
.config-text {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin-top: 16px;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
}


/* === Files list (downloadable attachments) === */
.files-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    margin-bottom: 4px;
}

.file-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.file-btn:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 212, 255, 0.18);
}

.file-btn i {
    font-size: 1.05rem;
    color: var(--accent);
    flex-shrink: 0;
}

.file-btn span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* === Links list (external URL buttons) === */
.links-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    margin-bottom: 8px;
}

.link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
    animation: link-glow 2.4s ease-in-out infinite;
}

.link-btn:hover {
    transform: translateY(-1px);
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.link-btn i {
    font-size: 1.05rem;
    color: var(--accent);
    flex-shrink: 0;
}

.link-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@keyframes link-glow {
    0%, 100% {
        border-color: #06b6d4;
        box-shadow: 0 0 14px rgba(6, 182, 212, 0.45);
    }
    25% {
        border-color: #8b5cf6;
        box-shadow: 0 0 14px rgba(139, 92, 246, 0.45);
    }
    50% {
        border-color: #ec4899;
        box-shadow: 0 0 14px rgba(236, 72, 153, 0.45);
    }
    75% {
        border-color: #ef4444;
        box-shadow: 0 0 14px rgba(239, 68, 68, 0.45);
    }
}


/* === Infinite scroll sentinel === */
.feed-sentinel {
    text-align: center;
    padding: 24px 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
    min-height: 24px;
}

.feed-sentinel i {
    margin-right: 8px;
}


/* ===========================================================
   Info pages: About / Contact / Privacy
   =========================================================== */

.info-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    position: relative;
    transition: var(--transition);
}

.info-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow);
}

.info-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 16px;
}

.info-card h2 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.info-card h2 i {
    color: var(--accent);
    margin-right: 8px;
}

.info-card p {
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 12px;
}

.info-card a {
    color: var(--accent);
    text-decoration: none;
}

.info-card a:hover {
    text-decoration: underline;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}

.info-list li {
    color: var(--text-secondary);
    padding: 8px 0 8px 4px;
    line-height: 1.6;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.info-list li i.fa-check {
    color: var(--accent-success);
    font-size: 0.9rem;
    margin-top: 6px;
    flex-shrink: 0;
}

.info-list li strong {
    color: var(--text-primary);
}

.legal-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

/* === Founder card === */
.founder-card .founder-info {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-top: 8px;
}

.founder-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 24px rgba(0, 212, 255, 0.25);
}

.founder-avatar i {
    font-size: 2.6rem;
    color: #0a0e17;
}

.founder-text {
    flex: 1;
    min-width: 240px;
}

.founder-text h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.founder-role {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.founder-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.founder-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    min-height: 44px;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.founder-links a:hover {
    background: var(--accent);
    color: #0a0e17;
    text-decoration: none;
}

/* === Contact grid === */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    min-height: 44px;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.contact-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

.contact-card-static {
    cursor: default;
}

.contact-card-static:hover {
    transform: none;
    border-color: var(--border);
    box-shadow: none;
}

.contact-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.contact-card h3 {
    font-size: 1.05rem;
    color: var(--text-primary);
    margin: 0;
}

.contact-value {
    color: var(--accent);
    font-weight: 700;
    font-size: 1rem;
    margin: 4px 0;
    word-break: break-all;
}

.contact-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* === Contact form (Audit #26) === */
.contact-form-card {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 8px;
}

.contact-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.contact-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.contact-form label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.contact-form .form-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
}

.contact-form textarea.form-input {
    resize: vertical;
    min-height: 120px;
}

.contact-form .form-input::placeholder {
    color: var(--text-muted);
}

.contact-form .form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.contact-form .form-input.input-invalid {
    border-color: var(--accent-danger);
}

.contact-form .form-error {
    min-height: 16px;
    font-size: 0.8rem;
    color: var(--accent-danger);
}

.contact-form #contactSubmit {
    align-self: flex-start;
}

.contact-form #contactSubmit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.contact-form-feedback {
    min-height: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.contact-form-feedback.is-success {
    color: var(--accent-success, #10b981);
}

.contact-form-feedback.is-error {
    color: var(--accent-danger);
}

@media (max-width: 640px) {
    .contact-form .form-row {
        grid-template-columns: 1fr;
    }
}

/* === FAQ === */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.faq-item {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition);
}

.faq-item[open] {
    border-color: var(--accent);
}

.faq-item summary {
    padding: 14px 16px;
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 600;
    list-style: none;
    position: relative;
    padding-right: 40px;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
    font-size: 1.4rem;
    font-weight: 300;
    transition: var(--transition);
}

.faq-item[open] summary::after {
    transform: translateY(-50%) rotate(45deg);
}

.faq-item p {
    padding: 0 16px 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 767px) {
    .info-card {
        padding: 20px;
    }
    .info-card h2 {
        font-size: 1.2rem;
    }
    .founder-card .founder-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}


/* === Social networks === */
.socials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.social-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    min-height: 44px;
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.social-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--social-bg, transparent) 0%, transparent 60%);
    opacity: 0.15;
    transition: var(--transition);
    pointer-events: none;
}

.social-card:hover {
    transform: translateY(-3px);
    border-color: var(--social-color, var(--accent));
    box-shadow: 0 8px 24px var(--social-shadow, rgba(0, 212, 255, 0.25));
    color: var(--text-primary);
    text-decoration: none;
}

.social-card:hover::before {
    opacity: 0.3;
}

.social-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--social-color, var(--accent));
    color: #fff;
    font-size: 1.5rem;
    box-shadow: 0 4px 14px var(--social-shadow, rgba(0, 212, 255, 0.35));
}

.social-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.social-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
}

.social-handle {
    font-size: 0.85rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Brand colours */
.social-telegram {
    --social-color: #0088cc;
    --social-bg: #0088cc;
    --social-shadow: rgba(0, 136, 204, 0.4);
}

.social-youtube {
    --social-color: #ff0000;
    --social-bg: #ff0000;
    --social-shadow: rgba(255, 0, 0, 0.4);
}

.social-instagram {
    --social-color: #e4405f;
    --social-bg: #e4405f;
    --social-shadow: rgba(228, 64, 95, 0.4);
}
.social-instagram .social-icon {
    background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.social-tiktok {
    --social-color: #00f2ea;
    --social-bg: #ff0050;
    --social-shadow: rgba(255, 0, 80, 0.4);
}
.social-tiktok .social-icon {
    background: #000;
    color: #00f2ea;
    box-shadow: 0 0 0 2px #ff0050, 0 4px 14px rgba(255, 0, 80, 0.35);
}

@media (max-width: 479px) {
    .socials-grid {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
   CINEMATIC HERO
   ============================================================ */

.hero-cinematic {
    min-height: 100vh;
    padding: 120px 20px 80px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(124, 58, 237, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 100%, rgba(0, 212, 255, 0.15) 0%, transparent 55%),
        var(--bg-primary);
    isolation: isolate;
}

/* Animated grid floor — perspective grid scrolling toward viewer */
.hero-grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    perspective: 600px;
    overflow: hidden;
    opacity: 0.55;
}

.hero-grid::before {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.18) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: rotateX(60deg);
    transform-origin: 50% 50%;
    animation: grid-flow 14s linear infinite;
    /* Keep the perspective grid on its own GPU layer (scroll perf). */
    will-change: background-position;
}

.hero-grid::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        var(--bg-primary) 0%,
        transparent 25%,
        transparent 60%,
        var(--bg-primary) 95%
    );
}

@keyframes grid-flow {
    from { background-position: 0 0; }
    to   { background-position: 0 50px; }
}

/* Soft colored glows */
.hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 1;
    opacity: 0.55;
    /* Promote to its own GPU layer so the expensive blur(80px) is composited
       once and NOT repainted while the page scrolls (fixes scroll jank on the
       homepage). */
    will-change: transform;
    transform: translateZ(0);
}

.hero-glow-cyan {
    width: 380px;
    height: 380px;
    background: #00d4ff;
    top: 10%;
    left: 8%;
    animation: float-slow 9s ease-in-out infinite;
}

.hero-glow-purple {
    width: 320px;
    height: 320px;
    background: #7c3aed;
    top: 30%;
    right: 12%;
    animation: float-slow 11s ease-in-out infinite reverse;
}

.hero-glow-pink {
    width: 260px;
    height: 260px;
    background: #ec4899;
    bottom: 10%;
    left: 35%;
    opacity: 0.35;
    animation: float-slow 13s ease-in-out infinite;
}

@keyframes float-slow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(40px, -30px) scale(1.05); }
}

/* Floating bright orbs */
.hero-orb {
    position: absolute;
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
    /* Composite on the GPU so the infinite float animation doesn't trigger
       layout/paint on the main thread during scroll. */
    will-change: transform;
}

.hero-orb-1 {
    width: 8px;
    height: 8px;
    background: #00d4ff;
    box-shadow: 0 0 20px #00d4ff, 0 0 40px #00d4ff;
    top: 20%;
    left: 18%;
    animation: orb-float 8s ease-in-out infinite;
}

.hero-orb-2 {
    width: 6px;
    height: 6px;
    background: #7c3aed;
    box-shadow: 0 0 20px #7c3aed, 0 0 40px #7c3aed;
    top: 70%;
    left: 75%;
    animation: orb-float 10s ease-in-out infinite reverse;
}

.hero-orb-3 {
    width: 5px;
    height: 5px;
    background: #ec4899;
    box-shadow: 0 0 16px #ec4899;
    top: 50%;
    left: 50%;
    animation: orb-float 12s ease-in-out infinite;
}

@keyframes orb-float {
    0%, 100% { transform: translate(0, 0); opacity: 0.9; }
    25%      { transform: translate(60px, -40px); opacity: 0.4; }
    50%      { transform: translate(-30px, 50px); opacity: 1; }
    75%      { transform: translate(40px, 30px); opacity: 0.6; }
}

/* === Hero content === */
.hero-cinematic .hero-content {
    position: relative;
    z-index: 5;
    max-width: 900px;
    text-align: center;
}

/* Live ticker */
.hero-ticker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #10b981;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 28px;
    backdrop-filter: blur(10px);
    animation: ticker-fade-in 0.8s ease-out;
}

.ticker-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: ticker-pulse 2s infinite;
}

@keyframes ticker-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70%  { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes ticker-fade-in {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Title */
.hero-title {
    font-size: clamp(3.2rem, 9vw, 7rem);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: -0.04em;
    margin: 0 0 20px;
    color: #fff;
    display: flex;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
}

.hero-title-line {
    background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.4) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: title-slide-in 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
    /* Force a dedicated compositing layer (like .accent's drop-shadow) so the
       -webkit-background-clip:text gradient is NOT dropped when the light/dark
       theme repaints. Without this, the "GYRO" span turns transparent on theme
       switch in WebKit/Chromium. The drop-shadow is near-invisible. */
    filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.12));
}

.hero-title-line.accent {
    background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation-delay: 0.2s;
    text-shadow: 0 0 60px rgba(0, 212, 255, 0.4);
    filter: drop-shadow(0 0 40px rgba(124, 58, 237, 0.3));
}

@keyframes title-slide-in {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Subtitle */
.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.35rem);
    color: var(--text-secondary);
    margin: 0 0 36px;
    font-weight: 500;
    min-height: 1.6em;
    animation: title-slide-in 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.hero-subtitle-static {
    color: var(--text-primary);
    font-weight: 600;
}

.hero-subtitle-typed {
    color: var(--accent);
    font-weight: 700;
}

.hero-typed-caret {
    color: var(--accent);
    animation: caret-blink 1s step-end infinite;
    margin-left: 2px;
}

@keyframes caret-blink {
    0%, 50%   { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Buttons */
.hero-cinematic .hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 48px;
    animation: title-slide-in 1s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, #00d4ff, #7c3aed, #ec4899, #00d4ff);
    background-size: 300% 300%;
    z-index: -1;
    animation: btn-glow-rotate 4s linear infinite;
    filter: blur(8px);
    opacity: 0.7;
}

@keyframes btn-glow-rotate {
    0%   { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    color: var(--accent);
}

/* Game pills — supported titles */
.hero-games {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    animation: title-slide-in 1s cubic-bezier(0.16, 1, 0.3, 1) 0.7s both;
}

.game-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.game-pill:hover {
    background: rgba(0, 212, 255, 0.08);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.game-pill i {
    color: var(--accent);
    font-size: 0.85rem;
}

/* Scroll indicator */
.hero-scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    animation: scroll-bounce 2s ease-in-out infinite;
    z-index: 5;
}

.hero-scroll-indicator i {
    font-size: 1rem;
    color: var(--accent);
}

@keyframes scroll-bounce {
    0%, 100% { transform: translate(-50%, 0); opacity: 0.6; }
    50%      { transform: translate(-50%, 8px); opacity: 1; }
}

/* Stats: bigger and more cinematic */
.stats-section {
    position: relative;
    z-index: 6;
}

.stat-card {
    backdrop-filter: blur(20px);
    background: rgba(26, 35, 50, 0.7);
}

@media (max-width: 767px) {
    .hero-cinematic {
        min-height: 90vh;
        padding: 100px 16px 60px;
    }
    .hero-glow {
        filter: blur(60px);
    }
    .hero-scroll-indicator {
        display: none;
    }
}


/* === Card footer (badge + arrow) === */
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    gap: 12px;
}

.card-footer .badge {
    margin-top: 0;
}

.card-arrow {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: var(--transition);
}

.card:hover .card-arrow {
    background: var(--accent);
    color: #0a0e17;
    border-color: var(--accent);
    transform: translateX(4px);
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.45);
}

/* Hide arrow on placeholder cards (they aren't clickable) */
.card-placeholder .card-arrow {
    display: none;
}


/* ============================================================
   RESPONSIVE LAYERS  (single source of truth for breakpoints)
   ------------------------------------------------------------
   Device classes (ordered smallest to largest):
     Small_Phone    320-479px    @media (max-width: 479px)
     Large_Phone    480-767px    @media (min-width: 480px) and (max-width: 767px)
     Phones-shared  <=767px      @media (max-width: 767px)
     Tablet         768-1023px   @media (min-width: 768px) and (max-width: 1023px)
     Laptop         1024-1439px  base styles (no media query)
     Large_Desktop  >=1440px     @media (min-width: 1440px)
   Blocks below are placeholders to be filled by later tasks.
   ============================================================ */

/* --- Small_Phone: max-width 479px --- */
@media (max-width: 479px) {
    /* Hero title: cap at <=2.5rem so it fits without horizontal overflow (Req 3.1) */
    .hero-title {
        font-size: clamp(1.9rem, 8vw, 2.5rem);
        flex-wrap: wrap;
    }
    /* Hero CTA buttons: keep each button within the viewport (Req 3.2) */
    .hero-cinematic .hero-buttons .btn,
    .hero-cinematic .hero-buttons .btn-lg {
        width: 100%;
        max-width: 320px;
        justify-content: center;
    }
    /* Game pills: wrap across multiple lines, no overflow (Req 3.3) */
    .hero-games {
        flex-wrap: wrap;
        max-width: 100%;
    }
    .game-pill {
        max-width: 100%;
    }
    /* Config modal data rows: wrap so key/value stay within modal width (Req 6.3) */
    .config-data .data-row {
        flex-wrap: wrap;
    }
    /* When wrapped, align the value under the key for readability (Req 6.3) */
    .config-data .data-value {
        text-align: left;
    }
    /* Code/file/link rows: allow flexible children to shrink so ellipsis/overflow
       containment keeps them within the modal width (Req 6.5) */
    .code-list .code-row,
    .file-btn,
    .link-btn {
        min-width: 0;
    }
    .file-btn span,
    .link-btn span {
        min-width: 0;
    }
    /* Info card body text: keep readable at >=0.875rem on Small_Phone (Req 7.4, 12.2) */
    .info-card p {
        font-size: 0.9rem;
    }
    /* Page header titles: cap at <=1.6rem on Small_Phone (Req 12.1).
       The shared max-width:767px rule already sets 1.6rem; this explicit
       smaller value (<=1.6rem) tightens it for the smallest screens. */
    .page-header h1 {
        font-size: 1.5rem;
    }
    /* Body/paragraph text floor: bump the smallest text up to >=0.875rem so
       readable body/paragraph text never drops below the minimum (Req 12.2).
       Only items currently below 0.875rem are raised; uppercase micro-labels
       are left untouched to avoid breaking layout. */
    .config-meta,
    .footer-links a,
    .stat-card p,
    .config-data .data-key {
        font-size: 0.875rem;
    }
    /* Info sub-grids: single column on Small_Phone (Req 7.1).
       Generalizes the legacy socials-only 479px rule above to all three grids. */
    .socials-grid,
    .features-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }
    /* Stats grid: keep 3 compact columns within 320px without overflow (Req 9.1).
       Reduce gap, card padding, and number size so 3 cards fit on the smallest phones.
       Single-column fallback documented in design if 320px proves too tight. */
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .stat-card {
        padding: 16px 8px;
    }
    .stat-card h3 {
        font-size: 1.25rem;
    }
}

/* --- Large_Phone: 480-767px --- */
@media (min-width: 480px) and (max-width: 767px) {
    /* Placeholder: Large_Phone rules added in later tasks */
}

/* --- Phones (shared): max-width 767px --- */
@media (max-width: 767px) {
    /* Hero CTA buttons wrap and meet the 44px touch-target height (Req 3.2, 3.5) */
    .hero-cinematic .hero-buttons {
        flex-wrap: wrap;
    }
    .hero-cinematic .hero-buttons .btn,
    .hero-cinematic .hero-buttons .btn-lg {
        min-height: 44px;
    }
    /* Info sub-grids: single column across both phone classes (Req 7.1) */
    .socials-grid,
    .features-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Tablet: 768-1023px --- */
@media (min-width: 768px) and (max-width: 1023px) {
    /* Hero title: scale between the Small_Phone size and the Laptop/base size (Req 3.4) */
    .hero-title {
        font-size: clamp(3rem, 7vw, 4.5rem);
    }
    /* Card grid: exactly 2 columns on Tablet (Req 4.2) */
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
    /* Info sub-grids: exactly 2 columns on Tablet (Req 7.2) */
    .socials-grid,
    .features-grid,
    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    /* Stats grid: exactly 3 columns on Tablet (Req 9.3) */
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- Large_Desktop: min-width 1440px --- */
@media (min-width: 1440px) {
    /* Wider container, still centered via base `margin: 0 auto` (Req 11.1) */
    .container {
        max-width: var(--container-max-wide);
    }

    /* Card grid: 4 columns using the increased container width (Req 4.4, 11.2) */
    .grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* === Cookie consent banner (Task 8) === */
.cookie-consent {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%) translateY(140%);
    z-index: 2500;
    width: calc(100% - 32px);
    max-width: 760px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow), var(--shadow-glow);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

/* Slide up into view when JS adds .show (consent not yet stored). */
.cookie-consent.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.cookie-consent-text {
    flex: 1;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.cookie-consent-link {
    color: var(--accent);
    font-weight: 600;
    white-space: nowrap;
}

.cookie-consent-link:hover {
    text-decoration: underline;
}

.cookie-consent-accept {
    flex-shrink: 0;
    min-height: var(--touch-min);
    min-width: var(--touch-min);
    padding: 0 22px;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    color: #0a0e17;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.cookie-consent-accept:hover {
    box-shadow: 0 0 18px var(--accent-glow);
    transform: translateY(-1px);
}

.cookie-consent-accept:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Mobile: stack text above a full-width button, anchored to the bottom edge. */
@media (max-width: 640px) {
    .cookie-consent {
        left: 0;
        right: 0;
        bottom: 0;
        transform: translateY(140%);
        width: 100%;
        max-width: none;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        border-radius: var(--radius) var(--radius) 0 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
    }

    .cookie-consent.show {
        transform: translateY(0);
    }

    .cookie-consent-accept {
        width: 100%;
    }
}

/* ============================================================
   UX widgets (Task 9): light theme, theme toggle,
   back-to-top button, social share row
   ============================================================ */

/* === Light theme variable overrides ===
   Default (:root) is the dark theme. When the user opts into light mode,
   <html data-theme="light"> swaps the backgrounds to light and the text to
   dark while keeping the cyan accent for brand continuity. */
[data-theme="light"] {
    --bg-primary: #f1f5f9;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #5b6b7f;
    --accent: #0284c7;
    --accent-glow: rgba(2, 132, 199, 0.25);
    --accent-secondary: #7c3aed;
    --border: #e2e8f0;
    --border-light: #cbd5e1;
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.12);
    --shadow-glow: 0 0 30px rgba(2, 132, 199, 0.12);
}

/* Light-mode component fixes: surfaces that used hard-coded dark rgba/colors
   need readable light equivalents. */
[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.85);
}

[data-theme="light"] .nav-links a:hover,
[data-theme="light"] .nav-links a.active {
    background: rgba(2, 132, 199, 0.10);
}

[data-theme="light"] .lang-option.active {
    background: rgba(2, 132, 199, 0.12);
    border-color: rgba(2, 132, 199, 0.35);
}

[data-theme="light"] .modal-overlay {
    background: rgba(15, 23, 42, 0.45);
}

[data-theme="light"] .site-search {
    background: rgba(15, 23, 42, 0.45);
}

[data-theme="light"] .copy-btn {
    background: rgba(2, 132, 199, 0.10);
}

/* Hero headline uses a gradient text clip; keep it legible on light bg. */
[data-theme="light"] .hero p,
[data-theme="light"] .page-header p {
    color: var(--text-secondary);
}

/* === Light-theme: keep the cinematic hero + stats section DARK ===
   The cinematic hero's white title gradient, animated grid, colored glows and
   floating orbs are designed for a dark canvas, and the stat cards use a
   hardcoded dark-navy surface. On a light page these would render as
   white-on-light (invisible title) and dark-on-dark (unreadable stat numbers).
   Rather than recolor every effect, we re-scope the dark palette variables onto
   just these two sections so they stay intentionally dark and fully legible in
   light mode. Everything else on the page follows the light palette. */
[data-theme="light"] .hero-cinematic,
[data-theme="light"] .stats-section {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a2332;
    --bg-card-hover: #1f2b3d;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #7c8b9e;
    --border: #1e293b;
    --border-light: #334155;
}

/* === Theme toggle button (navbar) === */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    margin-left: 4px;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle:hover {
    color: var(--accent);
    background: rgba(0, 212, 255, 0.08);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Icon swap: show the moon in dark mode (click → go light), the sun in light
   mode (click → go dark). */
.theme-toggle .theme-toggle-icon-light { display: none; }
.theme-toggle .theme-toggle-icon-dark { display: inline-block; }

[data-theme="light"] .theme-toggle .theme-toggle-icon-light { display: inline-block; }
[data-theme="light"] .theme-toggle .theme-toggle-icon-dark { display: none; }

/* === Global site search (Task 10) === */
/* Navbar trigger button — mirrors the theme-toggle sizing/hover. */
.search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    margin-left: 4px;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1.05rem;
    cursor: pointer;
    transition: var(--transition);
}

.search-toggle:hover {
    color: var(--accent);
    background: rgba(0, 212, 255, 0.08);
}

.search-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Overlay backdrop — fixed, dims the page, blurs behind the panel. */
.site-search {
    position: fixed;
    inset: 0;
    z-index: 2200;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 88px 20px 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.site-search.show {
    opacity: 1;
}

.site-search[hidden] {
    display: none;
}

/* The search panel — sits near the top, like a command palette. */
.site-search-panel {
    width: 100%;
    max-width: 620px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transform: translateY(-12px);
    transition: transform 0.2s ease;
}

.site-search.show .site-search-panel {
    transform: translateY(0);
}

.site-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}

.site-search-bar > i {
    color: var(--text-muted);
    font-size: 1.05rem;
    flex-shrink: 0;
}

.site-search-input {
    flex: 1;
    min-width: 0;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1.05rem;
    font-family: inherit;
}

.site-search-input::placeholder {
    color: var(--text-muted);
}

.site-search-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.site-search-close:hover {
    color: var(--accent);
    border-color: var(--border-light);
}

.site-search-close:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.site-search-results {
    max-height: min(60vh, 460px);
    overflow-y: auto;
    padding: 8px;
}

.site-search-hint,
.site-search-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 28px 16px;
    font-size: 0.92rem;
}

.site-search-empty i {
    display: block;
    font-size: 1.8rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

.site-search-empty p {
    margin: 0;
}

.site-search-result {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.site-search-result:hover,
.site-search-result:focus-visible {
    background: var(--bg-card);
    border-color: var(--border-light);
    outline: none;
}

.site-search-result-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    background: rgba(0, 212, 255, 0.10);
    color: var(--accent);
    font-size: 0.95rem;
}

.site-search-result-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.site-search-result-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-search-result-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-search-result-type {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px 10px;
}

@media (max-width: 640px) {
    .site-search {
        padding: 72px 12px 12px;
    }
    .site-search-result-type {
        display: none;
    }
}

/* === Back-to-top button === */
.back-to-top {
    position: fixed;
    right: 20px;
    /* Sit above the cookie banner (bottom: 20px, ~64px tall on desktop) so the
       two never overlap. */
    bottom: 96px;
    z-index: 1500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--border-light);
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--accent);
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease;
}

.back-to-top.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 18px var(--accent-glow);
}

.back-to-top:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* On small screens nudge it up so it clears the full-width bottom cookie bar. */
@media (max-width: 640px) {
    .back-to-top {
        right: 16px;
        bottom: 84px;
        width: 44px;
        height: 44px;
    }
}

/* === Social share row (config detail modal) === */
.share-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.share-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    min-height: var(--touch-min);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.share-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}

.share-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.share-btn-telegram:hover {
    border-color: #229ED9;
    color: #229ED9;
}

.share-btn i {
    font-size: 1rem;
}

/* === Favorites heart toggle (config cards + modal) — Task 11 === */
.config-card {
    /* Anchor the absolutely-positioned heart button to each card. */
    position: relative;
}

.fav-toggle {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border-light);
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.fav-toggle:hover {
    border-color: var(--accent-danger, #ff4d6d);
    color: var(--accent-danger, #ff4d6d);
    transform: translateY(-1px);
}

.fav-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.fav-toggle.fav-active {
    border-color: var(--accent-danger, #ff4d6d);
    color: var(--accent-danger, #ff4d6d);
}

.fav-toggle.fav-active i {
    animation: favPop 0.3s ease-out;
}

@keyframes favPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

/* Modal stats row: view count + favorite toggle, above the description. */
.modal-stats-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.modal-views {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.modal-views i {
    color: var(--accent);
}

.modal-views-label {
    color: var(--text-secondary);
}

/* The modal favorite is a labelled pill (not the round card variant). */
.fav-toggle-modal {
    position: static;
    width: auto;
    height: auto;
    gap: 8px;
    padding: 8px 14px;
    min-height: var(--touch-min);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
}

/* Favorites filter button on the configs page. */
.config-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.fav-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    min-height: var(--touch-min);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.fav-filter-btn:hover {
    border-color: var(--accent-danger, #ff4d6d);
    color: var(--accent-danger, #ff4d6d);
}

.fav-filter-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.fav-filter-btn.active {
    background: var(--accent-danger, #ff4d6d);
    border-color: var(--accent-danger, #ff4d6d);
    color: #fff;
}

/* === Related configs (config detail modal) — Task 11 === */
.related-configs {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.related-configs-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--accent);
    font-size: 1rem;
}

.related-configs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.related-config-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.related-config-item:hover {
    border-color: var(--accent);
    transform: translateX(2px);
}

.related-config-item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.related-config-avatar {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-card);
    color: var(--accent);
}

.related-config-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-config-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.related-config-title {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-config-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.related-config-arrow {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ============================================================
   Accessibility (Task 12, Audit #20): global keyboard focus
   ============================================================ */

/* Visible keyboard focus indicator for every interactive element. Uses
   :focus-visible so it only shows for keyboard navigation (not mouse clicks),
   keeping the visual design clean while remaining fully accessible. The
   accent-colored outline + offset mirrors the per-widget rules already defined
   above so the look is consistent. Component-specific :focus-visible rules
   (theme-toggle, search-toggle, back-to-top, share-btn, fav-toggle, etc.)
   still apply; this is the catch-all baseline. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
.card:focus-visible,
.config-card:focus-visible,
.lang-option:focus-visible,
.nav-links a:focus-visible,
.copy-btn:focus-visible,
.notify-btn:focus-visible,
.fav-toggle:focus-visible,
.theme-toggle:focus-visible,
.search-toggle:focus-visible,
.back-to-top:focus-visible,
.modal-close:focus-visible,
.related-config-item:focus-visible,
.file-btn:focus-visible,
.link-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Search inputs already render a glow ring on :focus; give keyboard users an
   explicit outline too without doubling the box-shadow. */
.search-bar input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}


/* ============================================================
   Reduced motion: respect the OS "reduce motion" setting and
   cut the heaviest homepage hero animations. This eliminates
   scroll jank on low-power devices for users who opt in.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .hero-grid::before,
    .hero-glow,
    .hero-orb,
    .hero-title-line,
    .ticker-dot,
    .btn-glow::after {
        animation: none !important;
    }
    .hero-typed-caret {
        animation: none !important;
    }
    html {
        scroll-behavior: auto;
    }
}
