/* ==========================================
 * AR Experience Styles
 * ========================================== */

:root {
    /* 配色設定 */
    --bg-top: #F9F7F2;        /* 生成り色 */
    --bg-bottom: #E2E8F0;     /* 薄雲色 */
    --main-color: #333333;    /* モノトーン（濃いグレー） */
    --white: #ffffff;         /* 白 */
    --accent-color: #005CAF;  /* 瑠璃色 */
}

/* --- Animations --- */

/* 開始ボタンの脈動 */
@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); }
    50% { transform: scale(1.05); box-shadow: 0 8px 25px rgba(0, 92, 175, 0.5); }
    100% { transform: scale(1); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); }
}

/* ソナー（スキャン）アニメーション */
@keyframes sonar-scan {
    0% { transform: translateX(-50%) scale(1); box-shadow: 0 0 0 0 rgba(0, 92, 175, 0.7); }
    70% { transform: translateX(-50%) scale(1.1); box-shadow: 0 0 0 20px rgba(0, 92, 175, 0); }
    100% { transform: translateX(-50%) scale(1); box-shadow: 0 0 0 0 rgba(0, 92, 175, 0); }
}

/* --- Base Components --- */

#start-btn {
    background-color: var(--accent-color);
    color: var(--white);
    border: none;
    padding: 12px 24px;
    font-size: 1.1rem;
    font-weight: bold;
    line-height: 1.2;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    margin: 15px 0 10px;
    font-family: 'Shippori Mincho', serif;
    animation: pulse 2s infinite ease-in-out;
    will-change: transform, box-shadow;
}

.btn-note {
    display: block;
    font-size: 0.65rem;
    font-weight: normal;
    margin-top: 4px;
    opacity: 0.9;
}

#start-btn:hover {
    transform: scale(1.05);
    background-color: #004080; /* 少し濃い瑠璃色 */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* --- AR HUD Elements --- */

#ui {
    position: fixed;
    top: 20px;
    left: 20px;
    color: white;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px;
    z-index: 100;
    font-family: sans-serif;
    /* デバッグ用display：必要に応じて表示 */
    display: none;
}

#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    font-family: sans-serif;
    color: white;
    text-shadow: 0 0 5px black;
}

#guide-msg {
    position: absolute;
    top: 40%;
    width: 100%;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    transition: opacity 0.5s;
}

#caption-panel {
    position: absolute;
    bottom: 10%;
    left: 5%;
    width: 90%;
    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 1s;
}

#cap-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

#cap-detail {
    font-size: 14px;
    line-height: 1.4;
    color: #ddd;
}

#interaction-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: auto !important;
}

#interaction-panel p {
    margin: 0;
    font-size: 14px;
    color: #fff;
    white-space: nowrap;
}

.link-buttons {
    display: none;
}

#close-btn {
    display: none; /* キャプション同期のため閉じるボタンは非表示 */
}

.sns-link {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 4px 12px;
    border-radius: 25px;
    text-decoration: none;
    color: white;
    font-size: 12px;
}

.x-link { background: #000; }
.ig-link { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }

/* --- Making Modal --- */
#making-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    pointer-events: auto;
}

#making-modal.hidden {
    display: none;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    text-align: center;
    color: white;
}

#making-modal-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #fffdd1;
}

.horizontal-scroll {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10px;
    margin-bottom: 15px;
    -webkit-overflow-scrolling: touch;
}

.horizontal-scroll img {
    width: 100%;
    flex-shrink: 0;
    scroll-snap-align: start;
    border-radius: 8px;
    border: 1px solid #444;
}

.making-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 4px;
    margin-bottom: 15px;
    gap: 4px;
}

.making-tab {
    flex: 1;
    padding: 6px 0;
    font-size: 12px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.6);
}

.making-tab.active {
    background: #fffdd1;
    color: #333;
    font-weight: bold;
}

.making-info {
    margin-top: 15px;
    min-height: 80px;
}

#making-step-text {
    font-weight: bold;
    font-size: 1.1em;
    color: #fffdd1;
    margin-bottom: 5px;
}

#close-making-btn {
    margin-top: 20px;
    padding: 10px 30px;
    background: #444;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
}

/* --- SNS Modal & Buttons --- */
.social-btn-floating {
    position: fixed;
    bottom: 30px;
    left: 50%;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: white;
    border: none;
    z-index: 2500;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: sonar-scan 2s infinite ease-in-out;
    transition: opacity 0.4s, visibility 0.4s;
    transform: translateX(-50%);
}

.social-btn-floating.hidden {
    opacity: 0;
    visibility: hidden;
}

.modal-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.icon-btn-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.3s;
}

.icon-btn-circle:hover {
    background: var(--accent-color);
}

#social-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

#social-modal.hidden {
    display: none;
}

.social-content {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 30px 20px;
    border-radius: 20px;
}

.social-artist-name {
    font-family: 'Shippori Mincho', serif;
    font-size: 1.2rem;
    color: #fffdd1;
    margin-bottom: 15px;
}

.social-msg {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 25px;
    color: #eee;
}

.social-links-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.social-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 20px;
    border-radius: 16px;
    text-decoration: none;
    color: white;
    transition: background 0.3s;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-item svg,
.social-item .lucide {
    width: 24px;
    height: 24px;
    color: var(--white);
    opacity: 1;
}

.social-item.highlight-btn {
    background: rgba(0, 92, 175, 0.3);
    border-color: var(--accent-color);
}

.social-item:hover {
    background: rgba(255, 255, 255, 0.2);
}

.social-text {
    display: flex;
    flex-direction: column;
}

.social-label {
    font-weight: bold;
    font-size: 1rem;
}

.social-desc {
    font-size: 0.75rem;
    opacity: 0.7;
}

#close-social-btn {
    background: none;
    color: rgba(255, 255, 255, 0.5);
    border: none;
    text-decoration: underline;
    font-size: 0.9rem;
    cursor: pointer;
}

/* A-Frame Overrides */
.a-enter-vr-button {
    display: none !important;
}

/* --- Start Screen --- */
#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #000;
    color: white;
    text-align: center;
}

.bg-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 2s ease-in-out;
    filter: brightness(0.4);
}

.bg-image.active {
    opacity: 1;
}

.start-content {
    z-index: 1;
    padding: 25px 20px;
    max-width: 400px;
    width: 90%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    /* 実機で溢れないよう、内容が多い場合は内部スクロールを許可 */
    max-height: 90vh;
    overflow-y: auto;
}

.start-title {
    font-family: 'Shippori Mincho', serif;
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.start-title .highlight {
    color: #fffdd1;
    font-weight: bold;
}

.start-title small {
    display: block;
    font-size: 0.9rem;
    margin-top: 5px;
    color: #eee;
}

.start-visual {
    width: 100%;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.2);
    background: #000;
    position: relative;
}

.start-visual video,
.start-visual img {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    opacity: 0.8;
}

.scan-guide {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid var(--accent-color);
    pointer-events: none;
    z-index: 2;
    filter: drop-shadow(0 0 4px rgba(0, 92, 175, 0.8));
}
.scan-guide.top-left { top: 12px; left: 12px; border-right: none; border-bottom: none; }
.scan-guide.top-right { top: 12px; right: 12px; border-left: none; border-bottom: none; }
.scan-guide.bottom-left { bottom: 32px; left: 12px; border-right: none; border-top: none; }
.scan-guide.bottom-right { bottom: 32px; right: 12px; border-left: none; border-top: none; }

.visual-caption {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(0,0,0,0.5);
    font-size: 0.7rem;
    padding: 4px 0;
    color: #fffdd1;
}

.instruction-list {
    text-align: left;
    list-style: none;
    margin: 0 auto 15px;
    padding: 0;
    font-size: 1rem;
    display: inline-block;
}

.instruction-list li {
    margin-bottom: 12px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 12px;
}

.step-num {
    background: var(--accent-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    flex-shrink: 0;
}

.share-note {
    font-size: 0.85rem;
    color: #fffdd1;
    margin-bottom: 15px;
    opacity: 0.9;
}

.privacy-footer {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.7rem;
    margin-top: 20px;
}

.privacy-footer a {
    color: inherit;
    text-decoration: underline;
}
