/* ==========================================================
   RPG HUB - BRIGHT MODERN RETRO DESIGN SYSTEM
   ========================================================== */

:root {
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --card-border: #e2e8f0;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --accent: #10b981;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --font-ui: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-pixel: 'Press Start 2P', monospace;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.light-theme {
    font-family: var(--font-ui);
    color: var(--text-main);
    background-color: var(--bg-page);
    line-height: 1.5;
    overflow-x: hidden;
}

/* ==========================================================
   TOP HERO: BRIGHT RPG TILE MAP WITH GRADIENT FADE
   ========================================================== */
.hero-wrapper {
    position: relative;
    width: 100%;
    min-height: 560px;
    overflow: hidden;
    background-color: #ecfdf5;
}

.hero-tile-bg {
    position: absolute;
    top: 0;
    left: 0;
    /* One extra tile of overhang on the right and bottom, so the scroll never
       runs off the edge. The travel distance below is exactly one tile. */
    width: calc(100% + 520px);
    height: calc(100% + 364px);
    background-image: url('assets/rpg_tile_map.jpg');
    background-repeat: repeat;
    background-size: 520px 364px;
    image-rendering: pixelated;
    filter: brightness(0.92) contrast(1.05) saturate(1.1);
    animation: slowTileFloat 60s linear infinite;
    will-change: transform;
    z-index: 1;
}

@keyframes slowTileFloat {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-520px, -364px, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-tile-bg {
        animation: none;
    }
}

/* Soft light gradient overlay that fades into page background */
.hero-gradient-fade {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg, 
        rgba(255, 255, 255, 0.45) 0%, 
        rgba(255, 255, 255, 0.75) 45%, 
        rgba(248, 250, 252, 0.98) 85%, 
        #f8fafc 100%
    );
    z-index: 2;
    pointer-events: none;
}

/* Container */
.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 3;
}

.text-center {
    text-align: center;
}

/* Navbar */
.navbar {
    position: relative;
    z-index: 10;
    padding: 20px 0;
}

.nav-container {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-main);
}

.pixel-badge {
    font-family: var(--font-pixel);
    font-size: 10px;
    background: var(--primary);
    color: #fff;
    padding: 4px 6px;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.brand-text {
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 28px;
}

.nav-link {
    color: #334155;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.15s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 10px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
}

.btn-lg {
    padding: 13px 24px;
    font-size: 15px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.btn-white {
    background: #ffffff;
    color: var(--text-main);
    border: 1px solid var(--card-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.btn-white:hover {
    background: #f1f5f9;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-main);
}

.btn-outline:hover {
    background: #f1f5f9;
}

.btn-outline-dark {
    background: transparent;
    border: 1px solid #0f172a;
    color: #0f172a;
}

.btn-outline-dark:hover {
    background: #0f172a;
    color: #fff;
}

.btn-block {
    width: 100%;
}

/* Hero Content */
.hero-content {
    padding: 50px 0 80px;
}

.hero-tag {
    font-family: var(--font-pixel);
    font-size: 9px;
    background: #e0e7ff;
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.hero-title {
    font-size: clamp(38px, 6vw, 60px);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -1.5px;
    margin-bottom: 16px;
    color: #0f172a;
}

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

.hero-lead {
    font-size: 18px;
    color: #475569;
    margin-bottom: 32px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Page Body & Sections */
.page-body {
    background-color: var(--bg-page);
    position: relative;
    z-index: 5;
}

.section {
    padding: 60px 0;
}

.section-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    color: #0f172a;
}

.section-sub {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 36px;
}

/* ==========================================================
   VISUAL SAVE SYNC CONTINUITY STAGE (MOTION-BASED)
   ========================================================== */
.visual-sync-stage {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 20px;
    max-width: 820px;
    margin: 0 auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
}

.device {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.device:hover {
    transform: translateY(-2px);
}

.device-label {
    margin-top: 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.04em;
}

/* ---- MacBook ---- */
.mac-lid {
    width: 100%;
    background: #1f2937;
    border-radius: 10px 10px 4px 4px;
    padding: 8px 8px 10px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
}

.mac-screen {
    border-radius: 4px;
    overflow: hidden;
    background: #0f172a;
}

.mac-menubar {
    background: #e2e8f0;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    color: #475569;
}

.dot-red,
.dot-yellow,
.dot-green {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.win-title {
    margin-left: auto;
    font-family: var(--font-mono);
}

.mac-base {
    width: 118%;
    height: 12px;
    background: linear-gradient(#cbd5e1, #94a3b8);
    border-radius: 0 0 8px 8px;
    box-shadow: inset 0 1px 0 #e2e8f0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.mac-notch {
    width: 22%;
    height: 5px;
    background: #94a3b8;
    border-radius: 0 0 6px 6px;
}

/* ---- iPad ---- */
.ipad-body {
    width: 100%;
    background: #1f2937;
    border-radius: 18px;
    padding: 18px 10px;
    position: relative;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
}

.ipad-camera {
    position: absolute;
    top: 7px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #0f172a;
    box-shadow: inset 0 0 0 1px #475569;
}

.ipad-screen {
    border-radius: 4px;
    overflow: hidden;
    background: #0f172a;
}

.ios-statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 10px;
    background: #f8fafc;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    color: #334155;
}

.ios-right {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ios-wifi {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 7px solid #334155;
}

.ios-battery {
    width: 16px;
    height: 8px;
    border: 1px solid #334155;
    border-radius: 2px;
    background: linear-gradient(to right, #10b981 100%, transparent 0);
}

.ios-home {
    display: block;
    width: 34%;
    height: 3px;
    margin: 6px auto 2px;
    border-radius: 2px;
    background: #cbd5e1;
}

/* ---- Shared screen ---- */
.mini-game-screen {
    height: 150px;
    position: relative;
    overflow: hidden;
    background: #dcfce7;
}

.mini-map {
    width: 100%;
    height: 100%;
    background-image: url('assets/rpg_tile_map.jpg');
    background-size: 340px auto;
    image-rendering: pixelated;
}

/* Kenney Tiny Dungeon hero (CC0) — see assets/KENNEY-LICENSE.txt */
.hero-sprite {
    width: 32px;
    height: 32px;
    position: absolute;
    background-image: url('assets/hero.png');
    background-size: 100% 100%;
    image-rendering: pixelated;
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.35));
}

.mac-hero {
    top: 46%;
    left: 46%;
    animation: gentleBob 1s infinite alternate;
}

.ipad-hero {
    top: 46%;
    left: 46%;
    display: none; /* revealed on sync */
}

@keyframes gentleBob {
    0% { transform: translateY(0); }
    100% { transform: translateY(-4px); }
}

/* Touch controls on the iPad screen */
.touch-pad {
    position: absolute;
    left: 10px;
    bottom: 10px;
    width: 42px;
    height: 42px;
}

.touch-pad span {
    position: absolute;
    box-sizing: border-box;
    width: 14px;
    height: 14px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 3px;
}

.pad-up { top: 0; left: 14px; }
.pad-down { bottom: 0; left: 14px; }
.pad-left { left: 0; top: 14px; }
.pad-right { right: 0; top: 14px; }

.touch-buttons {
    position: absolute;
    right: 10px;
    bottom: 12px;
    display: flex;
    gap: 6px;
}

.touch-buttons span {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.save-flash-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(16, 185, 129, 0.9);
    color: #fff;
    font-family: var(--font-pixel);
    font-size: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.save-flash-indicator.show {
    opacity: 1;
}

/* Sync Transfer Hub */
.sync-transfer-hub {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 80px;
}

.sync-beam {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.pulse-packet {
    position: absolute;
    top: 0;
    left: -20px;
    width: 20px;
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
}

.pulse-packet.travel {
    animation: sendPacket 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes sendPacket {
    0% { left: 0%; width: 20px; }
    50% { width: 40px; }
    100% { left: 100%; width: 20px; }
}

.sync-trigger-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid var(--primary);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2);
    margin-top: 10px;
    transition: all 0.2s ease;
}

.sync-trigger-btn:hover {
    background: var(--primary);
    color: #fff;
    transform: scale(1.08);
}

.sync-trigger-btn.spinning svg {
    animation: rotateForever 0.8s linear infinite;
}

@keyframes rotateForever {
    100% { transform: rotate(360deg); }
}

.icon-refresh {
    width: 20px;
    height: 20px;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.feature-item {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--card-shadow);
}

.feature-icon {
    font-size: 30px;
    margin-bottom: 14px;
}

.feature-item h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #0f172a;
}

.feature-item p {
    font-size: 14px;
    color: var(--text-muted);
}

/* Download CTA Card */
.cta-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 50px 24px;
    box-shadow: var(--card-shadow);
    max-width: 760px;
    margin: 0 auto;
}

.cta-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
}

.cta-sub {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 24px;
}

.cta-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ==========================================================
   PRICING PAGE STYLES (pricing.html)
   ========================================================== */
.pricing-hero {
    padding: 60px 0 100px;
}

.page-title {
    font-size: clamp(34px, 5vw, 50px);
    font-weight: 800;
    margin-bottom: 12px;
    color: #0f172a;
}

.page-subtitle {
    font-size: 17px;
    color: var(--text-muted);
    max-width: 540px;
    margin: 0 auto 50px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 760px;
    margin: 0 auto;
    text-align: left;
}

.price-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 36px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
}

.price-card.featured {
    border: 2px solid var(--primary);
    position: relative;
    box-shadow: 0 16px 36px -10px rgba(79, 70, 229, 0.2);
}

.badge-pill {
    position: absolute;
    top: -12px;
    right: 24px;
    background: var(--primary);
    color: #fff;
    font-family: var(--font-pixel);
    font-size: 8px;
    padding: 4px 8px;
    border-radius: 4px;
}

.plan-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.plan-tag.tag-primary {
    color: var(--primary);
}

.plan-title {
    font-size: 22px;
    font-weight: 800;
    margin: 6px 0 12px;
    color: #0f172a;
}

.price-val {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 12px;
}

.price-val .num {
    font-size: 44px;
    font-weight: 800;
    line-height: 1;
    color: #0f172a;
}

.price-val .unit {
    color: var(--text-muted);
    font-size: 14px;
}

.plan-summary {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
    min-height: 42px;
}

.plan-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
    font-size: 14px;
}

.plan-list li {
    display: flex;
    gap: 10px;
    color: #334155;
}

.plan-list .check {
    color: var(--accent);
    font-weight: bold;
}

.plan-list .disabled {
    color: var(--text-light);
}

/* Footer */
.footer {
    padding: 36px 0;
    border-top: 1px solid var(--card-border);
    background: #ffffff;
    font-size: 13px;
    color: var(--text-muted);
}

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

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
}

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

/* Mobile */
@media (max-width: 640px) {
    .visual-sync-stage {
        flex-direction: column;
        align-items: center;
        padding: 20px;
    }
    .device {
        width: 100%;
        max-width: 320px;
    }
    .sync-transfer-hub {
        width: 100%;
        margin: 10px 0;
    }
    .sync-beam {
        width: 4px;
        height: 30px;
    }
    .pulse-packet.travel {
        animation: sendPacketVertical 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    }
    @keyframes sendPacketVertical {
        0% { top: 0%; height: 15px; }
        100% { top: 100%; height: 15px; }
    }
}

/* Coming-soon button state */
.btn-soon {
    background: #f1f5f9;
    color: #94a3b8;
    border: 1px dashed #cbd5e1;
    cursor: default;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-soon em {
    font-style: normal;
    font-family: var(--font-mono);
    font-size: 0.75em;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ==========================================================
   FAQ
   ========================================================== */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
    text-align: left;
}

.faq-item {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--card-shadow);
}

.faq-item h3 {
    font-size: 17px;
    margin-bottom: 10px;
}

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

.faq-table {
    width: 100%;
    margin-top: 18px;
    border-collapse: collapse;
    font-size: 14px;
}

.faq-table td {
    padding: 8px 0;
    border-top: 1px solid var(--card-border);
}

.faq-table td:last-child {
    text-align: right;
    font-family: var(--font-mono);
    font-size: 12px;
}

.faq-table .ok { color: #059669; }
.faq-table .wip { color: #94a3b8; }

@media (max-width: 768px) {
    .faq-grid {
        grid-template-columns: 1fr;
    }
}
