﻿@import url('https://fonts.googleapis.com/css2?family=LINE+Seed+JP:wght@400;700;800&family=WDXL+Lubrifont+JP+N&display=swap');

/* ============================================================
   SPACE ERRORS! v5 窶・Full Immersive Design
   Inspired by: 繝溘Ν繧ｭ繝ｼ繧ｵ繝悶え繧ｧ繧､ / 雜・°縺舌ｄ蟋ｫ
   ============================================================ */
:root {
    --bg: #0D0D0D;
    --pink: #F280DF;
    --emerald: #03A678;
    --teal: #038C73;
    --blue: #056CF2;
    --lime: #E7F294;
    --salmon: #F2A594;
    --crimson: #D91438;
    --burgundy: #590725;
}

body.metaverse {
    --bg: #050014;
    --pink: #ff00ff;
    --emerald: #00ffcc;
    --teal: #00ffff;
    --blue: #0088ff;
    --lime: #ccff00;
    --salmon: #ff3366;
    --crimson: #ff0000;
    --burgundy: #990033;
    background: radial-gradient(circle at 50% 50%, #1a0b3c, #000);
}

body.metaverse .section-label {
    text-shadow: 0 0 10px var(--emerald), 0 0 20px var(--emerald);
}

body.metaverse .hero-title {
    filter: drop-shadow(0 0 10px var(--pink)) drop-shadow(0 0 30px var(--blue));
}

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

html {
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
}

body {
    background: var(--bg);
    color: #eee;
    font-family: 'LINE Seed JP', sans-serif;
    overflow-x: hidden;
    line-height: 1.8;
}

/* === NAV (Floating Side) === */
.side-nav {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.side-nav a {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    display: block;
    transition: 0.3s;
    position: relative;
}

.side-nav a:hover,
.side-nav a.active {
    background: var(--pink);
    border-color: var(--pink);
    box-shadow: 0 0 12px var(--pink);
}

.side-nav a::after {
    content: attr(data-label);
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: 0.2s;
}

.side-nav a:hover::after {
    opacity: 1;
}

/* === FULL-VIEWPORT SECTIONS === */
.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    scroll-snap-align: start;
    padding: 60px 40px;
}

.section-inner {
    max-width: 900px;
    width: 100%;
    position: relative;
    z-index: 2;
}

/* ============================================================
   SECTION 1: HERO
   ============================================================ */
.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(242, 128, 223, 0.15), transparent 60%),
        radial-gradient(ellipse at 70% 30%, rgba(5, 108, 242, 0.12), transparent 60%),
        radial-gradient(ellipse at 50% 80%, rgba(3, 166, 120, 0.1), transparent 60%);
    z-index: 0;
}

/* Star particles via CSS */
.stars {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.stars span {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0% {
        opacity: 0.2;
        transform: scale(1);
    }

    100% {
        opacity: 1;
        transform: scale(1.5);
    }
}

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

/* Logo Image — responsive, centered */
.hero-logo {
    display: block;
    max-width: min(90vw, 700px);
    width: 100%;
    height: auto;
    margin: 0 auto 20px;
    filter: drop-shadow(0 0 30px rgba(242, 128, 223, 0.3)) drop-shadow(0 0 60px rgba(5, 108, 242, 0.15));
}

/* Accessibility: hidden but readable by screen readers */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.hero-catch {
    margin-top: 24px;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 700;
}

.scroll-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
    animation: bounce 2s infinite;
    z-index: 2;
}

.scroll-hint span {
    display: block;
    font-size: 1.5rem;
    margin-top: 5px;
}

@keyframes bounce {

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

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

/* ============================================================
   SECTION 2: NEWS (Ticker + Recent)
   ============================================================ */
.s-news {
    background: linear-gradient(180deg, var(--bg) 0%, #0a0a2e 100%);
}

.news-ticker-bar {
    background: var(--lime);
    color: var(--bg);
    padding: 10px 0;
    font-weight: 900;
    font-size: 1rem;
    overflow: hidden;
    white-space: nowrap;
    position: absolute;
    top: 0;
    left: -5%;
    width: 110%;
    transform: rotate(-1deg);
    border-bottom: 3px solid var(--emerald);
    z-index: 5;
}

.ticker-scroll {
    display: inline-block;
    animation: ticker 20s linear infinite;
}

@keyframes ticker {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.section-label {
    font-family: 'WDXL Lubrifont JP N', cursive;
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
}

.section-label::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 4px;
    border-radius: 2px;
}

.s-news .section-label {
    color: var(--lime);
}

.s-news .section-label::after {
    background: var(--lime);
}

.news-list {
    list-style: none;
    max-width: 700px;
}

.news-list li {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    align-items: baseline;
}

.news-date {
    color: var(--emerald);
    font-weight: 900;
    font-size: 0.85rem;
    flex-shrink: 0;
    width: 110px;
}

.news-title {
    font-weight: 700;
}

/* ============================================================
   SECTION 3: STORY (World Intro)
   ============================================================ */
.s-story {
    background: linear-gradient(135deg, var(--teal), #0a2e1e);
}

.s-story .section-label {
    color: var(--lime);
}

.s-story .section-label::after {
    background: var(--lime);
}

.story-text {
    font-size: 1.1rem;
    line-height: 2.2;
    max-width: 700px;
    color: rgba(255, 255, 255, 0.88);
}

.story-text strong {
    color: var(--pink);
}

.story-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 30px;
}

.story-tag {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    transition: 0.3s;
    cursor: default;
}

.story-tag:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* ============================================================
   SECTION 4: CHARACTERS (Selector Style)
   ============================================================ */
.s-char {
    background: linear-gradient(180deg, #0a0a2e, var(--bg));
}

.s-char .section-label {
    color: var(--pink);
}

.s-char .section-label::after {
    background: var(--pink);
}

.char-selector {
    display: flex;
    gap: 0;
    margin-top: 20px;
    width: 100%;
}

.char-tab {
    flex: 1;
    text-align: center;
    padding: 20px 10px;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-right: none;
    background: rgba(255, 255, 255, 0.03);
    transition: 0.3s;
    position: relative;
}

.char-tab:last-child {
    border-right: 2px solid rgba(255, 255, 255, 0.1);
}

.char-tab:first-child {
    border-radius: 12px 0 0 12px;
}

.char-tab:last-child {
    border-radius: 0 12px 12px 0;
}

.char-tab:hover {
    background: rgba(255, 255, 255, 0.06);
}

.char-tab.active {
    background: rgba(242, 128, 223, 0.1);
    border-color: var(--pink);
}

.char-tab.active+.char-tab {
    border-left-color: var(--pink);
}

.char-tab-emoji {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 8px;
    transition: 0.3s;
}

.char-tab:hover .char-tab-emoji {
    transform: scale(1.2);
}

.char-tab.active .char-tab-emoji {
    transform: scale(1.3);
}

.char-tab-name {
    font-family: 'WDXL Lubrifont JP N', cursive;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    transition: 0.3s;
}

.char-tab.active .char-tab-name {
    color: var(--pink);
}

/* Character Detail Panel */
.char-detail {
    margin-top: 24px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    display: none;
    animation: fadeIn 0.4s ease;
}

.char-detail.active {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.char-visual {
    width: 200px;
    height: 260px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    flex-shrink: 0;
}

.char-info h3 {
    font-family: 'WDXL Lubrifont JP N', cursive;
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.char-info .char-role {
    font-size: 0.9rem;
    color: var(--emerald);
    font-weight: 700;
    margin-bottom: 12px;
    display: block;
}

.char-info .char-quote {
    font-style: italic;
    color: var(--salmon);
    margin-top: 12px;
    padding-left: 12px;
    border-left: 3px solid var(--salmon);
}

/* Per-character accent */
.char-detail[data-char="nanase"] {
    border-color: rgba(217, 20, 56, 0.3);
}

.char-detail[data-char="nanase"] h3 {
    color: var(--crimson);
}

.char-detail[data-char="cash"] {
    border-color: rgba(5, 108, 242, 0.3);
}

.char-detail[data-char="cash"] h3 {
    color: var(--blue);
}

.char-detail[data-char="maggie"] {
    border-color: rgba(3, 166, 120, 0.3);
}

.char-detail[data-char="maggie"] h3 {
    color: var(--emerald);
}

.char-detail[data-char="laki"] {
    border-color: rgba(242, 128, 223, 0.3);
}

.char-detail[data-char="laki"] h3 {
    color: var(--pink);
}

/* ============================================================
   SECTION 5: NOVELS
   ============================================================ */
.s-novels {
    background: linear-gradient(180deg, var(--bg), #1a0a0a);
}

.s-novels .section-label {
    color: var(--salmon);
}

.s-novels .section-label::after {
    background: var(--salmon);
}

.novel-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 30px;
    margin-top: 20px;
    display: flex;
    gap: 24px;
    align-items: center;
}

.novel-badge {
    background: linear-gradient(135deg, var(--crimson), var(--pink));
    color: #fff;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 900;
    font-size: 0.85rem;
    flex-shrink: 0;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 2px;
}

.novel-info h3 {
    font-family: 'WDXL Lubrifont JP N', cursive;
    font-size: 1.4rem;
    color: var(--salmon);
    margin-bottom: 8px;
}

.novel-info p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

.platform-links {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.platform-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: 0.3s;
}

.platform-link:hover {
    background: var(--emerald);
    border-color: var(--emerald);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(3, 166, 120, 0.3);
}

/* ============================================================
   SECTION 6: MEDIA MIX
   ============================================================ */
.s-media {
    background: linear-gradient(180deg, #0a0a2e, var(--bg));
}

.s-media .section-label {
    color: var(--blue);
}

.s-media .section-label::after {
    background: var(--blue);
}

.media-locked {
    text-align: center;
    padding: 60px;
    border: 2px dashed rgba(5, 108, 242, 0.3);
    border-radius: 20px;
    margin-top: 20px;
    position: relative;
}

.lock-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

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

.lock-text {
    font-family: 'WDXL Lubrifont JP N', cursive;
    font-size: 1.5rem;
    background: linear-gradient(90deg, var(--blue), var(--pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lock-sub {
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.9rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    text-align: center;
    padding: 60px 20px;
    background: #050505;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

footer p {
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.8rem;
}

.footer-share {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.footer-share a {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    text-decoration: none;
    transition: 0.3s;
    font-size: 1.1rem;
}

.footer-share a:hover {
    transform: scale(1.15) rotate(5deg);
}

.btn-x {
    background: #1da1f2;
    color: #fff;
}

.btn-line {
    background: #06c755;
    color: #fff;
}

.btn-copy {
    background: var(--pink);
    color: #fff;
    cursor: pointer;
}

/* ============================================================
   SUPERCHAT (floating)
   ============================================================ */
#superchat-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--crimson), var(--burgundy));
    color: #fff;
    font-family: 'LINE Seed JP', sans-serif;
    font-weight: 900;
    font-size: 0.9rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    z-index: 200;
    box-shadow: 0 0 25px rgba(217, 20, 56, 0.4);
    transition: 0.3s;
}

#superchat-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 0 40px rgba(217, 20, 56, 0.6);
}

/* Splatter */
.splatter {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transform: scale(0);
    animation: pop 0.5s ease-out forwards;
}

@keyframes pop {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    50% {
        transform: scale(2.5);
        opacity: 0.6;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .section {
        padding: 40px 20px;
        min-height: auto;
        min-height: 100dvh;
    }

    .char-selector {
        flex-direction: column;
    }

    .char-tab {
        border-right: 2px solid rgba(255, 255, 255, 0.1);
        border-bottom: none;
    }

    .char-tab:last-child {
        border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    }

    .char-tab:first-child {
        border-radius: 12px 12px 0 0;
    }

    .char-tab:last-child {
        border-radius: 0 0 12px 12px;
    }

    .char-detail.active {
        flex-direction: column;
    }

    .char-visual {
        width: 100%;
        height: 180px;
    }

    .novel-card {
        flex-direction: column;
    }

    .novel-badge {
        writing-mode: horizontal-tb;
    }

    .side-nav {
        display: none;
    }

    .side-nav {
        display: none;
    }
}

/* === MODE TOGGLE BTN === */
#mode-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: linear-gradient(45deg, var(--blue), var(--pink));
    color: #fff;
    border: 2px solid #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 800;
    font-family: 'WDXL Lubrifont JP N', sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: 0.3s;
    font-size: 1rem;
}

#mode-toggle-btn:hover {
    transform: scale(1.1) rotate(-2deg);
    box-shadow: 0 0 20px var(--pink);
}

body.metaverse #mode-toggle-btn {
    background: linear-gradient(45deg, var(--lime), var(--emerald));
    color: #000;
    border-color: #000;
    box-shadow: 0 0 20px var(--lime);
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.05);
    }
}

/* === METAVERSE SPECIFIC STYLES === */
body.metaverse .stars span {
    border-radius: 0;
    /* Digital squares */
    background-color: var(--lime);
    box-shadow: 0 0 5px var(--emerald);
    animation-duration: 0.5s !important;
    /* Faster chaotic movement */
}

body.metaverse .novel-card,
body.metaverse .char-detail,
body.metaverse .news-ticker-bar,
body.metaverse .scroll-hint {
    border: 1px solid var(--pink);
    box-shadow: 0 0 10px var(--pink), inset 0 0 20px rgba(255, 0, 255, 0.1);
    background: rgba(5, 0, 20, 0.8);
    background-image: linear-gradient(0deg, transparent 50%, rgba(0, 255, 255, 0.05) 50%);
    background-size: 100% 4px;
    /* Scanline effect */
}

body.metaverse .news-ticker-bar {
    border-color: var(--lime);
    box-shadow: 0 0 15px var(--lime);
    color: var(--lime);
    text-shadow: 0 0 5px var(--emerald);
}

body.metaverse .hero-catch {
    color: #fff;
    text-shadow: 2px 0 var(--crimson), -2px 0 var(--blue);
}