/* ==========================================================================
   Retro Dino Runner - Modern Glassmorphic Arcade Styles
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800&family=Press+Start+2P&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-dark: #090d16;
    --bg-panel: rgba(15, 23, 42, 0.75);
    --bg-panel-solid: #0f172a;
    --border-glass: rgba(255, 255, 255, 0.12);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #38bdf8;
    --primary-glow: rgba(56, 189, 248, 0.4);
    --accent: #f59e0b;
    --accent-glow: rgba(245, 158, 11, 0.4);
    --success: #10b981;
    --danger: #ef4444;
    --font-retro: 'Press Start 2P', monospace, sans-serif;
    --font-ui: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(244, 63, 94, 0.1) 0px, transparent 50%);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.75;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 1.25rem;
    overflow-x: hidden;
}

/* Page Layout Container */
.app-container {
    width: 100%;
    max-width: 1040px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin: 0 auto;
}

/* Top App Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 1rem;
    padding: 0.85rem 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.logo-icon {
    font-size: 1.75rem;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.6));
    animation: dinoFloat 3s ease-in-out infinite;
}

@keyframes dinoFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-3px) rotate(4deg); }
}

.logo-title {
    font-family: var(--font-retro);
    font-size: 1.05rem;
    letter-spacing: -0.5px;
    color: #fff;
    text-shadow: 0 0 12px var(--primary-glow);
}

.logo-subtitle {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.header-actions {
    display: flex;
    gap: 0.6rem;
}

/* Iconic Arcade Buttons */
.btn-icon-action {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.55rem 0.95rem;
    border-radius: 0.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-icon-action:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-icon-action:active {
    transform: translateY(0);
}

/* Main Game Wrapper - Strict Aspect Ratio for 0 CLS */
.game-viewport-card {
    position: relative;
    width: 100%;
    aspect-ratio: 960 / 360;
    min-height: 280px;
    background: #000;
    border-radius: 1rem;
    border: 2px solid var(--border-glass);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.15);
}

canvas#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    cursor: pointer;
}

/* Glassmorphism HUD Bar Overlay */
.game-hud-bar {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 10;
}

.hud-left, .hud-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hud-pill {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-glass);
    padding: 0.4rem 0.75rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-retro);
    font-size: 0.72rem;
    color: #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.hud-pill .label {
    color: var(--text-muted);
    font-size: 0.6rem;
}

.hud-pill .value {
    color: #38bdf8;
}

.hud-pill.coins .value {
    color: #facc15;
}

.multiplier-badge {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    font-family: var(--font-retro);
    font-size: 0.65rem;
    padding: 0.4rem 0.6rem;
    border-radius: 0.5rem;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.25s ease;
}

.multiplier-badge.active {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
}

.powerup-badge {
    background: rgba(56, 189, 248, 0.2);
    border: 1px solid var(--primary);
    color: #38bdf8;
    font-family: var(--font-retro);
    font-size: 0.6rem;
    padding: 0.35rem 0.65rem;
    border-radius: 0.5rem;
    animation: pulseGlow 1.2s infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Game State Overlay Screens */
.game-overlay {
    position: absolute;
    inset: 0;
    background: rgba(9, 13, 22, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 20;
    padding: 1.5rem;
    text-align: center;
}

.game-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.overlay-title {
    font-family: var(--font-retro);
    font-size: 1.65rem;
    margin-bottom: 0.75rem;
    color: #fff;
    text-shadow: 0 0 20px var(--primary-glow);
}

.overlay-subtitle {
    font-family: var(--font-ui);
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    max-width: 480px;
}

/* Modern Glow Action Buttons */
.btn-primary-action {
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    border: none;
    color: #fff;
    font-family: var(--font-retro);
    font-size: 0.85rem;
    padding: 0.9rem 1.8rem;
    border-radius: 0.75rem;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.btn-primary-action:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 30px rgba(56, 189, 248, 0.6);
}

.btn-primary-action:active {
    transform: translateY(0) scale(1.0);
}

/* Game Over Stats Box */
.go-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    width: 100%;
    max-width: 450px;
    margin-bottom: 1.5rem;
}

.go-stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: 0.6rem;
    padding: 0.75rem 0.5rem;
}

.go-stat-card .label {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
}

.go-stat-card .val {
    font-family: var(--font-retro);
    font-size: 1.0rem;
    color: #fff;
    margin-top: 0.25rem;
}

.high-tag {
    background: #f59e0b;
    color: #000;
    font-family: var(--font-retro);
    font-size: 0.55rem;
    padding: 0.2rem 0.4rem;
    border-radius: 0.3rem;
    margin-left: 0.4rem;
    vertical-align: middle;
}

/* Mobile Virtual Controller Bar */
.mobile-controls-bar {
    display: none;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    padding: 0.5rem 0;
}

.touch-btn {
    flex: 1;
    height: 70px;
    background: var(--bg-panel);
    border: 1px solid var(--border-glass);
    border-radius: 1rem;
    color: #fff;
    font-family: var(--font-retro);
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    touch-action: manipulation;
}

.touch-btn:active {
    background: rgba(56, 189, 248, 0.3);
    border-color: var(--primary);
    transform: scale(0.96);
}

.touch-btn .sub {
    font-family: var(--font-ui);
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* Info & Controls Cards */
.info-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.25rem;
}

.info-card {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
}

.info-card h3 {
    font-family: var(--font-ui);
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.key-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.key-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

kbd {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom-width: 2px;
    border-radius: 0.35rem;
    padding: 0.2rem 0.5rem;
    font-family: var(--font-retro);
    font-size: 0.65rem;
    color: #38bdf8;
}

/* Modal Popups (Shop, Settings, Stats) */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 100;
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-dialog {
    background: var(--bg-panel-solid);
    border: 1px solid var(--border-glass);
    border-radius: 1.25rem;
    width: 100%;
    max-width: 580px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1.75rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.85rem;
}

.modal-title {
    font-family: var(--font-retro);
    font-size: 1.05rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #fff;
}

/* Shop Grid */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.85rem;
}

.shop-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    border-radius: 0.8rem;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.shop-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.shop-card.selected {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.08);
}

.shop-preview {
    width: 44px;
    height: 44px;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
}

.shop-name {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
}

.shop-cost {
    font-family: var(--font-retro);
    font-size: 0.65rem;
    color: #facc15;
}

.btn-shop-action {
    width: 100%;
    background: #1e293b;
    border: 1px solid var(--border-glass);
    color: #fff;
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.4rem;
    border-radius: 0.4rem;
    cursor: pointer;
    margin-top: 0.35rem;
    transition: background 0.2s ease;
}

.btn-shop-action:hover {
    background: var(--primary);
    color: #000;
}

.shop-card.selected .btn-shop-action {
    background: var(--success);
    color: #000;
}

/* Settings Form Controls */
.settings-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.setting-label {
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 0.95rem;
    color: #e2e8f0;
}

.setting-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #334155;
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.custom-select {
    background: #1e293b;
    border: 1px solid var(--border-glass);
    color: #fff;
    font-family: var(--font-ui);
    padding: 0.45rem 0.85rem;
    border-radius: 0.5rem;
    outline: none;
    font-size: 0.85rem;
}

/* Stats list */
.stat-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.5rem;
}

.stat-item .k {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.stat-item .v {
    font-family: var(--font-retro);
    font-size: 0.8rem;
    color: #38bdf8;
}

/* ==========================================================================
   SEO Article, Guide & Typography Section
   ========================================================================== */

.seo-article-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1.5rem;
    margin-bottom: 3rem;
}

.seo-content-card {
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 1.25rem;
    padding: 2.25rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.seo-content-card h2 {
    font-family: var(--font-ui);
    font-size: 1.45rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.75rem;
}

.seo-content-card h3 {
    font-family: var(--font-ui);
    font-size: 1.15rem;
    font-weight: 700;
    color: #38bdf8;
    margin-top: 1.75rem;
    margin-bottom: 0.85rem;
}

.seo-content-card p {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.8;
    color: #cbd5e1;
    margin-bottom: 1.5rem;
}

.seo-content-card p:last-child {
    margin-bottom: 0;
}

.seo-content-card strong {
    color: #f8fafc;
    font-weight: 600;
}

.seo-content-card ul, .seo-content-card ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.seo-content-card li {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.75;
    color: #cbd5e1;
}

/* Feature Comparison Table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 0.75rem;
    border: 1px solid var(--border-glass);
}

.seo-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-body);
    font-size: 0.9rem;
    text-align: left;
}

.seo-table th {
    background: rgba(15, 23, 42, 0.95);
    color: #38bdf8;
    font-family: var(--font-ui);
    font-weight: 700;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-glass);
}

.seo-table td {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    line-height: 1.6;
}

.seo-table tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

.seo-table tr:hover td {
    background: rgba(56, 189, 248, 0.05);
}

/* SEO Strategy Highlights Grid */
.strategy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.strategy-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 0.85rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.strategy-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.strategy-item .badge {
    align-self: flex-start;
    font-family: var(--font-retro);
    font-size: 0.65rem;
    background: rgba(56, 189, 248, 0.15);
    color: var(--primary);
    padding: 0.3rem 0.6rem;
    border-radius: 0.4rem;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.strategy-item h4 {
    font-family: var(--font-ui);
    font-size: 1.05rem;
    color: #fff;
    font-weight: 700;
}

.strategy-item p {
    font-size: 0.88rem;
    line-height: 1.7;
    margin-bottom: 0;
    color: var(--text-muted);
}

/* FAQ Accordion */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.faq-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 0.85rem;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.faq-item:hover {
    border-color: rgba(56, 189, 248, 0.4);
}

.faq-question {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 1.25rem 1.5rem;
    font-family: var(--font-ui);
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.faq-icon {
    font-size: 1.2rem;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), padding 0.35s ease;
    padding: 0 1.5rem;
}

.faq-item.active .faq-answer {
    max-height: 300px;
    padding: 0 1.5rem 1.25rem 1.5rem;
}

.faq-answer p {
    font-size: 0.92rem;
    line-height: 1.8;
    color: #cbd5e1;
    margin: 0;
}

/* Footer Note */
.app-footer {
    text-align: center;
    padding: 1.5rem 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-glass);
    margin-top: 2rem;
}

/* Mobile Responsive Breakpoints */
@media (max-width: 768px) {
    body {
        padding: 0.6rem;
    }
    .app-header {
        padding: 0.65rem 1rem;
    }
    .logo-title {
        font-size: 0.85rem;
    }
    .header-actions .btn-icon-action span {
        display: none;
    }
    .mobile-controls-bar {
        display: flex;
    }
    .info-section {
        grid-template-columns: 1fr;
    }
    .overlay-title {
        font-size: 1.25rem;
    }
    .go-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .seo-content-card {
        padding: 1.5rem 1rem;
    }
    .strategy-grid {
        grid-template-columns: 1fr;
    }
}

