body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #111;
    color: white;
    font-family: 'Segoe UI', sans-serif;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

img {
    pointer-events: none;
    -webkit-user-drag: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

hr {
    border: 0;
    border-top: 1px solid #444;
    margin: 15px 0;
}

a {
    text-decoration: none;
    color: inherit;
}

/* 螢幕切換 */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.5s ease, visibility 0.5s;
    background-color: transparent;
    z-index: 0;
    overflow: hidden;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 10;
}

.bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.3;
    background-color: #111;
}

/* Splash Screen */
.splash-bg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.scrolling-bg {
    display: flex;
    height: 100%;
    width: 200%;
    animation: move-bg 60s linear infinite;
}

.scrolling-bg img {
    width: 50vw;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
}

@keyframes move-bg {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.splash-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: inset 0 0 200px rgba(0, 0, 0, 0.9);
    z-index: 1;
}

.cinematic-bar {
    position: absolute;
    left: 0;
    width: 100%;
    height: 10vh;
    background: black;
    z-index: 2;
}

.cinematic-bar.top {
    top: 0;
}

.cinematic-bar.bottom {
    bottom: 0;
}

.cinematic-line {
    position: absolute;
    top: 0;
    width: 1px;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    z-index: 3;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.cinematic-line.left {
    left: 5%;
}

.cinematic-line.right {
    right: 5%;
}

.logo-container {
    z-index: 5;
    text-align: center;
}

.logo-text {
    font-size: 5rem;
    font-weight: 900;
    margin: 0;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 40px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 5px;
    backdrop-filter: blur(5px);
}

.subtitle {
    font-size: 1.2rem;
    margin-top: 15px;
    letter-spacing: 2px;
    animation: blink 2s infinite;
}

.subtitle::before {
    content: "▶ ";
    font-size: 0.8rem;
    vertical-align: middle;
}

.subtitle::after {
    content: " ◀";
    font-size: 0.8rem;
    vertical-align: middle;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.glow-btn {
    padding: 15px 60px;
    border: 2px solid white;
    background: transparent;
    color: white;
    font-size: 1.5rem;
    letter-spacing: 3px;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 50px;
    position: relative;
    z-index: 5;
    font-weight: bold;
}

.glow-btn:hover {
    background: white;
    color: black;
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.8);
}

.copyright-text {
    position: fixed;
    bottom: 10px;
    right: 15px;
    color: #888;
    font-size: 0.8rem;
    z-index: 100000;
    font-family: monospace;
    pointer-events: none;
    text-shadow: 0 0 5px black;
}

.music-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 20000;
    background: rgba(0, 0, 0, 0.7);
    color: #00d2ff;
    border: 1px solid #00d2ff;
    padding: 10px 15px;
    border-radius: 20px;
    font-weight: bold;
    transition: 0.3s;
}

.music-btn:hover {
    background: #00d2ff;
    color: black;
}

.nav-btn-group {
    position: absolute;
    bottom: 30px;
    display: flex;
    gap: 20px;
    z-index: 9999;
    width: 100%;
    justify-content: center;
    pointer-events: none;
}

.nav-float-btn {
    position: relative;
    pointer-events: auto !important;
    min-width: 120px;
    text-align: center;
    padding: 15px 25px;
    background: black;
    border-radius: 30px;
    border: 2px solid white;
    cursor: pointer;
    transition: 0.3s;
    color: white;
    font-weight: bold;
    letter-spacing: 1px;
}

.nav-float-btn:hover {
    background: white;
    color: black;
    border-color: white;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

.tabs-container {
    position: absolute;
    top: 10%;
    width: 90%;
    display: flex;
    justify-content: center;
    gap: 10px;
    z-index: 20;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: 1px solid #444;
    color: #888;
    font-size: 1.1rem;
    padding: 8px 25px;
    cursor: pointer;
    transition: 0.3s;
    border-radius: 4px;
    white-space: nowrap;
}

.tab-btn:hover {
    border-color: #00d2ff;
    color: #ccc;
}

.tab-btn.active {
    color: #00d2ff;
    border-color: #00d2ff;
    background: rgba(0, 210, 255, 0.1);
    font-weight: bold;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.2);
}

.carousel-container {
    position: relative;
    width: 90%;
    height: 65%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 5%;
}

.char-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 2rem;
    padding: 20px 10px;
    z-index: 50;
    transition: 0.3s;
    border-radius: 5px;
    opacity: 0;
    pointer-events: none;
}

.char-nav-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.char-nav-btn:hover {
    background: #00d2ff;
    color: black;
}

.char-nav-btn.left {
    left: 0;
}

.char-nav-btn.right {
    right: 0;
}

.char-slide {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    opacity: 0;
    position: absolute;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.char-slide.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 5;
}

.char-visual {
    width: 45%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.char-img {
    max-height: 100%;
    max-width: 100%;
    filter: drop-shadow(0 0 20px rgba(0, 210, 255, 0.3));
    object-fit: contain;
}

.char-info {
    width: 50%;
    height: 80%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 40px;
}

.char-name-block {
    margin-bottom: 20px;
    border-bottom: 2px solid white;
    padding-bottom: 10px;
    display: inline-block;
    width: fit-content;
}

.char-name {
    font-size: 3.5rem;
    margin: 0;
    font-weight: bold;
    line-height: 1.1;
}

.char-role {
    font-size: 1.8rem;
    color: #ccc;
    margin: 5px 0 0 0;
    font-weight: normal;
}

.info-toggle-group {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.info-btn {
    background: transparent;
    border: 1px solid #00d2ff;
    color: #00d2ff;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 1rem;
    transition: 0.3s;
}

.info-btn:hover,
.info-btn.active {
    background: #00d2ff;
    color: black;
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.5);
}

.info-display-box {
    background: rgba(0, 0, 0, 0.6);
    border-left: 3px solid #00d2ff;
    padding: 20px;
    min-height: 150px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #ddd;
    white-space: pre-wrap;
}

.world-container {
    display: flex;
    width: 80%;
    height: 60%;
    align-items: center;
    gap: 40px;
}

.world-visual {
    width: 50%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
}

.image-frame {
    width: 100%;
    height: 100%;
    border: 1px solid #444;
    overflow: hidden;
    position: relative;
    background: #000;
    display: flex;
    justify-content: center;
}

.image-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.nav-arrow {
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0 15px;
    height: 100%;
    position: absolute;
    top: 0;
    z-index: 50;
    transition: 0.2s;
}

.nav-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nav-arrow.left {
    left: 0;
}

.nav-arrow.right {
    right: 0;
}

.world-text {
    width: 40%;
}

#world-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid white;
    display: inline-block;
}

#world-desc {
    font-size: 1.2rem;
    line-height: 1.6;
    color: #ccc;
}

#profile-stage {
    background: linear-gradient(to bottom, #111, #1a1a1a);
}

.profile-card {
    display: flex;
    width: 80%;
    height: 70%;
    max-height: 80vh;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    padding: 40px;
    padding-bottom: 40px;
    gap: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 50;
    overflow-y: auto;
}

.profile-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 25%;
    min-width: 200px;
    border-right: 1px solid #333;
    padding-right: 30px;
}

.profile-right {
    width: 75%;
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
}

.avatar-frame {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 4px solid #00d2ff;
    overflow: hidden;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.avatar-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.social-dashboard {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
}

.dash-btn {
    background: black;
    border: 1px solid #555;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.dash-btn:hover {
    border-color: white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.dash-btn.disabled {
    opacity: 0.3;
    filter: grayscale(1);
    pointer-events: none;
    border-color: transparent !important;
    background: transparent !important;
}

.social-row-wide .dash-btn {
    width: 100%;
    padding: 10px;
    font-weight: bold;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.social-square {
    aspect-ratio: 1 / 1;
    padding: 10px;
}

.social-square img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.social-separator {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
    margin: 5px 0;
}

.social-list-item {
    width: 100%;
    padding: 8px;
    font-size: 1rem;
    font-weight: bold;
}

.social-row-media {
    display: flex;
    gap: 10px;
}

.media-btn {
    flex: 1;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    border: 1px solid #333;
    background: #111;
}

.media-btn img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.media-status {
    font-size: 0.7rem;
    padding: 2px 5px;
    border-radius: 3px;
    background: #333;
    color: #888;
}

.media-btn.active {
    border-color: #00d2ff;
}

.media-btn.active .media-status {
    background: #00d2ff;
    color: black;
}

.profile-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
}

.name-box {
    display: flex;
    flex-direction: column;
}

#creator-name {
    margin: 0;
    font-size: 2.5rem;
    color: white;
}

.tagline-text {
    color: #00d2ff;
    font-size: 1.1rem;
    margin-top: 5px;
    font-weight: bold;
    letter-spacing: 1px;
}

.stats-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

#share-btn {
    margin-top: 0;
}

.stat-badge {
    background: #222;
    border: 1px solid #444;
    color: #ccc;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s;
}

.stat-badge:hover {
    border-color: white;
    color: white;
    background: #333;
}

.bio-text {
    color: #aaa;
    line-height: 1.8;
    flex-grow: 1;
    overflow-y: auto;
    font-size: 1rem;
    margin-bottom: 20px;
}

.action-buttons-row {
    display: flex;
    gap: 20px;
    margin-top: auto;
    height: 60px;
    pointer-events: auto;
    z-index: 100;
    flex-shrink: 0;
}

.big-action-btn {
    flex: 1;
    background: transparent;
    border: 2px solid #ccc;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 8px;
    transition: 0.2s;
}

.big-action-btn:hover {
    background: white;
    color: black;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

.big-action-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #444;
    color: #666;
    background: #111;
}

.big-action-btn.disabled:hover {
    transform: none;
    box-shadow: none;
    color: #666;
    background: #111;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-content {
    background: #1a1a1a;
    border: 1px solid #00d2ff;
    width: 90%;
    max-width: 600px;
    padding: 30px;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 210, 255, 0.2);
}

.shop-style {
    border-color: #ff4444;
    box-shadow: 0 0 50px rgba(255, 68, 68, 0.2);
}

.business-contact-box {
    background: rgba(0, 210, 255, 0.05);
    border: 1px solid #00d2ff;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: center;
}

.contact-label {
    color: #00d2ff;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.contact-email {
    color: white;
    font-family: 'Consolas', monospace;
    font-size: 1.5rem;
    margin: 0;
    font-weight: bold;
    user-select: text;
    -webkit-user-select: text;
}

.close-x {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #666;
    font-size: 1.5rem;
    cursor: pointer;
}

.close-x:hover {
    color: white;
}

.shop-buttons-grid {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.custom-shop-btn {
    padding: 10px 25px;
    background: #333;
    color: white;
    text-decoration: none;
    border-radius: 20px;
    border: 1px solid #555;
    transition: 0.2s;
}

.custom-shop-btn:hover {
    background: #ff4444;
    border-color: #ff4444;
}

.marquee-container {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px 0;
    border-radius: 10px;
}

.marquee-track {
    display: inline-block;
    animation: scroll 15s linear infinite;
}

.marquee-item {
    display: inline-block;
    width: 120px;
    height: 160px;
    margin: 0 15px;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid #444;
    vertical-align: middle;
}

.marquee-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

@keyframes scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

@media (min-width: 769px) {
    .social-dashboard {
        gap: 8px;
    }

    .social-square {
        padding: 8px;
    }

    .avatar-frame {
        width: 160px;
        height: 160px;
    }

    .mobile-only {
        display: none;
    }

    .desktop-only {
        display: block;
        position: fixed;
        bottom: 10px;
        right: 15px;
    }

    .safe-area-spacer {
        display: none;
    }

    /* 電腦版不需要防撞墊 */
}

@media (max-width: 768px) {

    body,
    html {
        overflow: auto;
        height: auto;
    }

    .screen {
        position: relative;
        height: auto;
        min-height: 100vh;
        overflow: visible;
        display: none;
        padding-top: 60px;
    }

    .screen.active {
        display: flex;
    }

    .scrolling-bg img {
        width: auto;
        height: 100%;
        max-width: none;
    }

    .logo-text {
        font-size: 3.5rem;
    }

    .cinematic-line {
        width: 1px;
        left: 15px;
        right: auto;
    }

    .cinematic-line.right {
        left: auto;
        right: 15px;
    }

    .tabs-container {
        position: relative;
        top: 0;
        margin-top: 20px;
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding-left: 20px;
        width: 100%;
        padding-bottom: 10px;
    }

    .tab-btn {
        flex-shrink: 0;
        white-space: nowrap;
        margin-right: 10px;
    }

    .carousel-container {
        flex-direction: column;
        height: auto;
        width: 100%;
        margin-top: 20px;
        padding-bottom: 250px;
        display: block;
    }

    .char-slide {
        position: relative;
        flex-direction: column;
        opacity: 1;
        margin-bottom: 20px;
        display: none;
    }

    .char-slide.active {
        display: flex;
    }

    .char-visual {
        width: 100%;
        height: 400px;
        margin-bottom: 20px;
        flex-shrink: 0;
    }

    .char-info {
        width: 90%;
        height: auto;
        padding: 0 5%;
        align-items: center;
        text-align: center;
        margin-top: 40px;
    }

    .info-display-box {
        width: 100%;
        min-height: auto;
        text-align: left;
        box-sizing: border-box;
        display: block;
        white-space: pre-line;
    }

    .world-container {
        flex-direction: column;
        height: auto;
        margin-top: 20px;
        padding-bottom: 250px;
    }

    .world-visual {
        width: 100%;
        height: 300px;
        margin-bottom: 30px;
    }

    .world-text {
        width: 90%;
        text-align: center;
        margin-bottom: 50px;
    }

    /* Mobile 灰色區塊修復 */
    .profile-card {
        flex-direction: column;
        width: 90%;
        height: auto;
        min-height: auto;
        padding: 20px;
        margin-bottom: 0;
        /* 改為 0，讓 spacer 發揮作用 */
        padding-bottom: 20px;
        overflow: visible;
    }

    .profile-left {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #333;
        padding-bottom: 20px;
        margin-bottom: 20px;
        padding-right: 0;
    }

    .profile-right {
        width: 100%;
    }

    /* 防撞墊設定：高度 200px，確保有足夠空間 */
    .safe-area-spacer {
        width: 100%;
        height: 200px;
        display: block;
        flex-shrink: 0;
    }

    /* 頂部間距調整 */
    .profile-header-row {
        flex-direction: column;
        align-items: center;
        gap: 25px;
        text-align: center;
        height: auto;
        margin-bottom: 30px;
        padding-top: 20px;
        /* 增加內部上距 */
        margin-top: 20px;
        /* 增加外部上距 */
    }

    .stats-stack {
        width: 100%;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        margin-top: 0;
    }

    .action-buttons-row {
        height: auto;
        flex-direction: column;
        width: 100%;
        gap: 15px;
        margin-top: 40px;
        margin-bottom: 0;
    }

    .nav-btn-group {
        position: fixed;
        bottom: 20px;
        background: rgba(17, 17, 17, 0.95);
        padding: 12px 25px;
        border-radius: 50px;
        border: 1px solid #444;
        width: auto;
        gap: 15px;
        z-index: 99999;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(5px);
    }

    .nav-float-btn {
        min-width: 90px;
        padding: 10px 15px;
        font-size: 0.9rem;
        margin: 0;
    }

    .copyright-text {
        position: fixed;
        /* 手機版也維持 Fixed 比較好，只要不擋到就好 */
        bottom: 5px;
        left: 0;
        width: 100%;
        text-align: center;
        background: rgba(0, 0, 0, 0.8);
        padding: 5px 0;
        right: auto;
        z-index: 100000;
    }
}