﻿/* ChronoMirror Car Demo - Web Display（大画面サイネージ）スタイルシート */
:root {
    --bg-base: #060b16;
    --accent-red: #ef4444;
    --accent-orange: #f97316;
    --accent-blue: #0ea5e9;
    --accent-green: #10b981;
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-base);
    color: var(--text-main);
    font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
}

.hidden {
    display: none !important;
}

/* 背景アンビエントレイヤー */
.ambient-bg {
    position: fixed;
    inset: -30px;
    background-size: cover;
    background-position: center;
    filter: blur(28px) saturate(1.25) brightness(0.42);
    transition: background-image 1.2s ease;
    z-index: 1;
}

.ambient-vignette {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, rgba(6, 11, 22, 0.2) 0%, rgba(6, 11, 22, 0.82) 100%);
    z-index: 2;
}

/* 1. ウェルカム待機画面 */
.welcome-layer {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    padding: 32px;
}

.welcome-box {
    max-width: 760px;
    width: 100%;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 32px;
    padding: 0 40px 44px;
    text-align: center;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.checker-ribbon {
    height: 22px;
    margin: 0 -40px 32px;
    background-image:
        linear-gradient(45deg, #ffffff 25%, transparent 25%),
        linear-gradient(-45deg, #ffffff 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ffffff 75%),
        linear-gradient(-45deg, transparent 75%, #ffffff 75%);
    background-size: 22px 22px;
    background-position: 0 0, 0 11px, 11px -11px, -11px 0;
    background-color: #0f172a;
}

.welcome-badge {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    margin-bottom: 18px;
}

.welcome-title {
    font-size: clamp(2rem, 4.2vw, 3.4rem);
    font-weight: 900;
    line-height: 1.3;
    margin-bottom: 16px;
}

.welcome-desc {
    font-size: clamp(1rem, 1.8vw, 1.35rem);
    color: var(--text-muted);
    margin-bottom: 28px;
}

.welcome-pulse {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 9999px;
    background: rgba(14, 165, 233, 0.18);
    border: 1px solid rgba(56, 189, 248, 0.45);
    color: #38bdf8;
    font-size: 1.1rem;
    font-weight: 800;
    animation: pulseGlow 2.2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.65; transform: scale(0.98); }
    50% { opacity: 1; transform: scale(1.03); }
}

/* 2. 待機スライドショーレイヤー */
.slideshow-layer {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.gallery-header {
    position: fixed;
    top: 22px;
    left: 28px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 15;
}

.gallery-badge {
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.gallery-counter {
    background: rgba(14, 165, 233, 0.25);
    color: #7dd3fc;
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 800;
}

.slide-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
}

.slide-slot {
    position: absolute;
    height: min(88vh, 920px);
    aspect-ratio: 3 / 5;
    border-radius: 26px;
    overflow: hidden;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.72);
    border: 3px solid rgba(255, 255, 255, 0.18);
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 1.1s ease, transform 7s ease-out;
    pointer-events: none;
}

.slide-slot.active {
    opacity: 1;
    transform: scale(1.03);
}

.slide-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slide-qr-mini {
    position: absolute;
    right: 16px;
    bottom: 16px;
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    border-radius: 14px;
    padding: 8px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

.slide-qr-mini img {
    width: 82px;
    height: 82px;
    display: block;
}

.slide-qr-mini span {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    margin-top: 2px;
}

/* 3. 新着割り込みスポットライトレイヤー */
.spotlight-layer {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

.spotlight-layer.visible {
    opacity: 1;
    pointer-events: auto;
}

.spotlight-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 10, 22, 0.88);
    backdrop-filter: blur(18px);
}

.spotlight-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(24px, 4vw, 56px);
    padding: 28px 36px;
    max-width: 1280px;
    width: 100%;
    cursor: pointer;
    transform: scale(0.95);
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.spotlight-layer.visible .spotlight-content {
    transform: scale(1);
}

.spotlight-frame {
    position: relative;
    height: min(86vh, 880px);
    aspect-ratio: 3 / 5;
    border-radius: 26px;
    overflow: hidden;
    border: 4px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), 0 0 40px rgba(56, 189, 248, 0.35);
    background: #020617;
}

.spotlight-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 一時停止オーバーレイ */
.pause-overlay {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.58);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    padding: 20px;
}

.pause-badge {
    background: rgba(239, 68, 68, 0.95);
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 900;
    padding: 12px 26px;
    border-radius: 9999px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
}

.pause-overlay p {
    font-size: 1rem;
    font-weight: 700;
    color: #f8fafc;
}

.spotlight-info-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    max-width: 420px;
}

.new-badge {
    background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
    color: #ffffff;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    padding: 8px 22px;
    border-radius: 9999px;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.45);
}

.spotlight-heading {
    font-size: clamp(1.5rem, 2.8vw, 2.3rem);
    font-weight: 900;
    line-height: 1.35;
}

.spotlight-qr-card {
    background: #ffffff;
    color: #0f172a;
    border-radius: 24px;
    padding: 20px 24px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}

.qr-label {
    font-size: 0.98rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.spotlight-qr-card img {
    width: clamp(170px, 20vw, 230px);
    height: clamp(170px, 20vw, 230px);
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* カウントダウン表示 */
.countdown-panel {
    width: 100%;
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 18px;
    padding: 14px 20px;
}

.countdown-text {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.countdown-text strong {
    font-size: 1.7rem;
    color: #38bdf8;
    margin: 0 4px;
}

.progress-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #38bdf8, #f97316);
    transition: width 0.1s linear;
}

.pause-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* 4. 右上の運用コントロールバー */
.hud-toolbar {
    position: fixed;
    top: 18px;
    right: 22px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 9999px;
    padding: 6px 12px;
    transition: opacity 0.4s ease;
}

.hud-toolbar.idle {
    opacity: 0.12;
}

.hud-toolbar:hover {
    opacity: 1 !important;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

.status-dot.offline {
    background: var(--accent-red);
    box-shadow: 0 0 8px var(--accent-red);
}

.hud-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-right: 4px;
}

.hud-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 9999px;
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

.hud-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* 縦長モニター対応 */
@media (max-width: 820px) {
    .spotlight-content {
        flex-direction: column;
        gap: 18px;
    }

    .spotlight-frame {
        height: 52vh;
    }

    .spotlight-qr-card img {
        width: 130px;
        height: 130px;
    }
}
