:root {
    /* Color Palette - Cyberpunk / Deep Ocean */
    --bg-color: #050a14;
    --bg-gradient: radial-gradient(circle at top center, #0a1f35 0%, #050a14 100%);
    --card-bg: rgba(16, 28, 45, 0.7);
    --card-border: rgba(64, 224, 208, 0.2);
    --text-color: #e0f7fa;
    --text-muted: #8090a0;

    --primary: #00ffff;
    --primary-glow: 0 0 15px rgba(0, 255, 255, 0.4);
    --accent: #00d2ff;
    --accent-gradient: linear-gradient(135deg, #00ffff 0%, #0077ff 100%);

    --success: #00ff9d;
    --danger: #ff4081;
    --warning: #ffd740;

    --font-heading: 'Orbitron', 'Roboto', sans-serif;
    --font-body: 'Noto Sans JP', sans-serif;

    --header-height: 60px;
    --container-width: 1000px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    /* Mobile optimization */
}

body {
    margin: 0;
    font-family: var(--font-body);
    background-color: var(--bg-color);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
}

/* Typography & Utilities */
h1,
h2,
h3 {
    margin: 0;
    font-family: var(--font-heading);
    letter-spacing: 1px;
}

.text-gradient {
    background: var(--accent-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.empty {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}

/* Header */
header,
.lp-header {
    height: var(--header-height);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #111b1d;
    /* Force black to match logo background better */
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header h1,
.lp-header .logo {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--primary);
    text-shadow: var(--primary-glow);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.header-btn {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid var(--primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--primary);
}

.header-btn:active {
    background: rgba(0, 255, 255, 0.3);
}

/* Layout */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 20px 16px 80px;
    /* Bottom padding for scroll space */
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-muted);
    transition: color 0.2s;
}

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

.breadcrumb .separator {
    font-size: 0.7rem;
    opacity: 0.5;
}

.breadcrumb .current {
    color: var(--text-color);
    font-weight: bold;
}

.lp-body .container {
    padding-bottom: 0;
}

/* Cards & Lists */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.card h2 {
    font-size: 1rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    /* Mobile friendly grid */
    gap: 12px;
}

.race-list-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* 2 cols on mobile */
    gap: 10px;
}

/* Interactive Card Styles */
a.card {
    display: block;
    border-left: 4px solid transparent;
}

a.card:active,
a.card:hover {
    background: rgba(16, 28, 45, 0.9);
    border-color: var(--primary);
    transform: translateY(-2px);
}

a.card.live {
    border-left-color: var(--warning);
    border-color: rgba(255, 215, 64, 0.3);
}

a.card.finished {
    opacity: 0.6;
    border-left-color: var(--text-muted);
}

a.card.disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* Meta status */
.meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-top: 8px;
}

.status-live {
    color: var(--warning);
    font-weight: bold;
}

.status-end {
    color: var(--text-muted);
}

/* Navigation Back Link */
.back,
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

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

/* Filter inputs */
.filter {
    background: var(--card-bg);
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    /* Stack on mobile */
    gap: 10px;
}

.filter input[type="date"] {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--text-muted);
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    font-size: 1rem;
    width: 100%;
}

.filter button {
    background: var(--accent-gradient);
    border: none;
    padding: 10px;
    color: #000;
    font-weight: bold;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    /* Full width on mobile */
}

/* Detail Page specific */
.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.9rem;
}

.meta-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bet-grid {
    display: grid;
    gap: 12px;
}

.bet-card {
    background: linear-gradient(135deg, rgba(0, 210, 255, 0.1), rgba(0, 0, 0, 0.2));
    border: 1px solid var(--accent);
    padding: 12px;
    border-radius: 10px;
}

.bet-card .bet-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.bet-combo {
    font-size: 1.2rem;
    font-weight: bold;
    font-family: var(--font-heading);
}

.bet-meta {
    font-size: 0.8rem;
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    opacity: 0.8;
}

.bet-tech {
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: bold;
}

.bet-reason {
    font-size: 0.85rem;
    line-height: 1.4;
    color: #ccc;
}

.pill {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    background: rgba(0, 255, 157, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.pill.red {
    background: rgba(255, 64, 129, 0.2);
    color: var(--danger);
    border-color: var(--danger);
}

.badge {
    background: #000;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Boat Colors */
.boat-1 {
    color: #fff;
    text-shadow: 0 0 5px #fff;
}

.boat-2 {
    color: #222;
    text-shadow: 0 0 5px #fff;
    background: #aaa;
    padding: 0 4px;
    border-radius: 2px;
}

.boat-3 {
    color: #ff4040;
    text-shadow: 0 0 5px #ff4040;
}

.boat-4 {
    color: #40a0ff;
    text-shadow: 0 0 5px #40a0ff;
}

.boat-5 {
    color: #ffeb3b;
    text-shadow: 0 0 5px #ffeb3b;
}

.boat-6 {
    color: #00e676;
    text-shadow: 0 0 5px #00e676;
}

/* Header Logo adjustment */
header h1,
.lp-header .logo {
    display: flex;
    align-items: center;
}

header h1 img,
.lp-header .logo img {
    display: block;
    /* height is set in HTML but ensure max-height */
    max-height: 60px;
    height: auto;
    width: auto;
    /* Force larger size visually if needed by overriding HTML attribute via CSS scale or just explicit width */
    min-height: 50px;
    /* Blend logo black background with header */
    mix-blend-mode: screen;
}



/* LP Styles */
.hero {
    min-height: 600px;
    /* Reduced height to remove empty space */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 20px;
    position: relative;
    overflow: hidden;
    /* Hero Image Background via pseudo-element */
    z-index: 0;
    /* Safer stacking context */
    background-color: #050a14;
}

#hero-canvas {
    display: none;
}

/* Background Image Layer */
.hero::after {
    content: '';
    position: absolute;
    inset: -2px;
    /* Relative path for better compatibility */
    background: linear-gradient(to bottom, rgba(5, 10, 20, 0.3), rgba(5, 10, 20, 0.9)), url('../img/hero.png');
    background-size: cover;
    background-position: center var(--parallax-y, 0px);
    pointer-events: none;
    z-index: -1;
    animation: hero-bg-zoom 25s ease-in-out infinite alternate;
    will-change: transform, background-position;
}

@keyframes hero-bg-zoom {
    0% {
        transform: scale(1) translateY(0);
    }

    100% {
        transform: scale(1.15) translateY(2%);
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(30px);
}

.hero-title {
    font-size: 4rem;
    line-height: 1;
    margin-bottom: 20px;
    letter-spacing: -2px;
    font-weight: 900;
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

.hero-title .text-gradient {
    display: inline-block;
    padding: 0 10px;
}

.hero-sub {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 40px;
    letter-spacing: 2px;
    font-family: var(--font-body);
    background: rgba(0, 0, 0, 0.4);
    padding: 5px 15px;
    border-radius: 4px;
    display: inline-block;
}

/* Hide the separate visual div since we are using a background layer */
.hero-visual {
    display: none;
}

/* Info Table Styles */
.info-table {
    width: 100%;
    margin-top: 10px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.info-table th,
.info-table td {
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
}

.info-table th {
    background: rgba(0, 210, 255, 0.1);
    color: var(--primary);
    width: 20%;
    white-space: nowrap;
}

.info-table td {
    background: rgba(0, 0, 0, 0.2);
}

/* Remove the old blur effect or keep it if it adds to the cyber feel. 
   The pseudo-element below was for a blob. Let's make it a subtle overlay instead. 
*/
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(0, 210, 255, 0.03) 1px, transparent 1px),
        linear-gradient(rgba(0, 210, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 1;
    mask-image: radial-gradient(circle at center, black 40%, transparent 90%);
}

.hero-content {
    position: relative;
    z-index: 2;
    opacity: 0;
    /* JS will fade in */
    transform: translateY(30px);
}

/* Hide the separate visual div since we are using background */
.hero-visual {
    display: none;
}

.hero-title {
    font-size: 3rem;
    /* Mobile Size */
    line-height: 1.1;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    letter-spacing: 2px;
    position: relative;
    display: block;
}

/* Glitch Effect Keyframes */
@keyframes glitch {
    0% {
        transform: translate(0)
    }

    20% {
        transform: translate(-2px, 2px)
    }

    40% {
        transform: translate(-2px, -2px)
    }

    60% {
        transform: translate(2px, 2px)
    }

    80% {
        transform: translate(2px, -2px)
    }

    100% {
        transform: translate(0)
    }
}

.hero-sub {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    background: rgba(0, 0, 0, 0.4);
    display: inline-block;
    padding: 5px 15px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

.scroll-down {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.8;
    animation: bounce 2s infinite;
    z-index: 10;
}

.scroll-down span {
    letter-spacing: 2px;
    font-size: 0.7rem;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    color: #050a14;
    padding: 16px 32px;
    border-radius: 50px;
    font-weight: 900;
    font-size: 1.1rem;
    box-shadow: 0 4px 20px rgba(0, 210, 255, 0.4);
    gap: 10px;
}

.btn-primary:active {
    transform: scale(0.98);
}

.glow-effect {
    animation: glow-pulse 2s infinite;
}

@keyframes glow-pulse {
    0% {
        box-shadow: 0 0 10px rgba(0, 210, 255, 0.4);
    }

    50% {
        box-shadow: 0 0 25px rgba(0, 210, 255, 0.7);
    }

    100% {
        box-shadow: 0 0 10px rgba(0, 210, 255, 0.4);
    }
}

.hero-status {
    margin-top: 30px;
    font-size: 0.9rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.live-indicator {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success);
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        opacity: 0.4;
    }
}

.features {
    padding: 60px 20px;
    background: rgba(0, 0, 0, 0.2);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    max-width: var(--container-width);
    margin: 0 auto;
}

.feature-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.feature-card .icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.cta-section {
    padding: 80px 20px;
    text-align: center;
}

.cta-section h2 {
    font-size: 2rem;
    margin-bottom: 16px;
}

.cta-section p {
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* [NEW] Logic Section */
.logic-section {
    padding: 60px 20px;
    background: #080f1a;
    position: relative;
    z-index: 0;
    overflow: hidden;
}

.logic-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom, rgba(5, 10, 20, 0.55), rgba(5, 10, 20, 0.92)),
        url('../img/hero2.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center calc(50% + var(--parallax-y, 0px));
    transform: scale(1.05);
    will-change: background-position;
    pointer-events: none;
    z-index: -1;
}

.logic-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* 1 col on mobile */
    gap: 15px;
    max-width: 800px;
    margin: 0 auto;
}

.logic-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 210, 255, 0.1);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.2s;
}

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

.l-icon {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 10px;
}

.logic-item h4 {
    color: #fff;
    margin-bottom: 5px;
}

.logic-item p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* [NEW] Usage Section */
.usage-section {
    padding: 60px 20px;
}

.usage-steps {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
    align-items: center;
}

.step {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.step-num {
    font-family: var(--font-heading);
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.05);
    position: absolute;
    top: -10px;
    right: 10px;
    font-weight: 900;
}

.step h3 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.step p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.step-arrow {
    color: var(--text-muted);
    font-size: 1.5rem;
    transform: rotate(90deg);
    /* Downward on mobile */
}

/* [NEW] FAQ Section */
.faq-section {
    padding: 60px 20px;
    background: rgba(0, 0, 0, 0.3);
}

.faq-container {
    max-width: 600px;
    margin: 0 auto;
}

.faq-item {
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
}

.faq-item summary {
    padding: 15px 20px;
    cursor: pointer;
    font-weight: bold;
    color: var(--text-color);
    list-style: none;
    /* Hide default arrow */
    position: relative;
    padding-right: 40px;
}

.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 20px;
    color: var(--primary);
    font-weight: 900;
}

.faq-item[open] summary::after {
    content: '-';
}

.faq-body {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

@media (min-width: 480px) {
    .logic-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .logic-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .usage-steps {
        flex-direction: row;
        align-items: stretch;
    }

    .step-arrow {
        transform: rotate(0deg);
        display: flex;
        align-items: center;
    }
}

/* Updated CTA Space */
footer,
.lp-footer {
    padding: 40px 20px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid var(--card-border);
    background: rgba(5, 10, 20, 0.95);
    margin-top: auto;
    /* Push to bottom if flex column */
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-links a {
    color: var(--text-color);
    font-weight: bold;
}

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

.disclaimer {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.copyright {
    font-size: 0.8rem;
    opacity: 0.6;
}


/* Tables - Refined */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--text-color);
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    overflow: hidden;
}

th,
td {
    padding: 12px 10px;
    /* More padding */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

th {
    text-align: left;
    background: rgba(255, 255, 255, 0.05);
    /* Proper header bg */
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Racer Grid Refinement */
.racer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    /* Wider cards */
    gap: 16px;
}

.racer-card {
    background: rgba(25, 35, 50, 0.6);
    border: 1px solid rgba(0, 210, 255, 0.2);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.racer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.racer-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-color);
}

.racer-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.racer-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.racer-card table {
    margin-top: 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.racer-card th,
.racer-card td {
    padding: 6px;
    text-align: center;
}

/* Tablet & Desktop Tweaks */
@media (min-width: 768px) {
    .filter {
        flex-direction: row;
        align-items: center;
    }

    .filter input[type="date"] {
        width: auto;
    }

    .filter button {
        width: auto;
    }

    .hero-title {
        font-size: 4.5rem;
    }

    .race-list-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
