/* ========================================
   神社首頁 (Shrine Home)
   朵朵巫女的領地
   ======================================== */



/* ========================================
   Loading 畫面
   ======================================== */
.shrine-loading {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, #1a1410 0%, #2d1f1a 50%, #1a1410 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.shrine-loading.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loading-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.loading-duoduo {
    width: 200px;
    height: auto;
    animation: float 2s ease-in-out infinite;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.loading-info {
    text-align: center;
}

.loading-text {
    color: #d4a574;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-family: 'Yuji Syuku', serif;
    letter-spacing: 0.1em;
}

.loading-bar {
    width: 250px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(212, 165, 116, 0.3);
}

.loading-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #8B4513, #d4a574, #8B4513);
    border-radius: 4px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(212, 165, 116, 0.5);
}

/* 未登入提示 */
.shrine-login-prompt {
    min-height: 100vh;
    background: #1a1410;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.shrine-login-prompt .shrine-stage {
    position: relative;
    width: 100%;
    max-width: 1600px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.shrine-login-prompt .guest-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 248, 240, 0.95);
    border-radius: 16px;
    padding: 2.5rem 3rem;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border: 3px solid #8B4513;
    z-index: 10;
}

.shrine-login-prompt h2 {
    color: #3E2723;
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
}

.shrine-login-prompt p {
    color: #5D4037;
    margin-bottom: 1.2rem;
    line-height: 1.5;
    font-size: 0.95rem;
}

.shrine-login-prompt .btn-login {
    display: inline-block;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

.shrine-login-prompt .btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 69, 19, 0.4);
}

/* 頁面容器 */
.shrine-home-page {
    min-height: 100vh;
    background: #1a1410;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* 場景舞台 (16:9 固定比例) */
.shrine-stage {
    position: relative;
    width: 100%;
    max-width: 1600px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* 背景圖 */
.shrine-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* ========================================
   朵朵巫女（中央）
   ======================================== */

.duoduo-miko {
    position: absolute;
    bottom: 12%;
    left: 50%;
    transform: translateX(-50%);
    width: 28%;
    z-index: 10;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.duoduo-miko:hover {
    transform: translateX(-50%) scale(1.03);
}

.duoduo-miko img {
    width: 100%;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.4));
}

/* 朵朵對話氣泡 */
.duoduo-bubble {
    position: absolute;
    top: -130px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 0.8rem 1.4rem;
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
    border: 3px solid #e8a0b0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    min-width: 240px;
    max-width: 380px;
}

.duoduo-bubble.active {
    opacity: 1;
    visibility: visible;
    animation: bubble-bounce 0.5s ease-out;
}

@keyframes bubble-bounce {
    0% { transform: translateX(-50%) translateY(10px); opacity: 0; }
    100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.duoduo-text {
    font-family: 'Yuji Syuku', serif;
    font-size: 1.3rem;
    color: #8b5a6b;
    margin: 0;
    line-height: 1.8;
    text-align: left;
}

.bubble-arrow {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

.bubble-arrow::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #e8a0b0;
}

/* ========================================
   互動提示氣泡 (Interact Bubble)
   ======================================== */

.interact-bubble {
    position: absolute;
    top: -5%;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    z-index: 30;
    animation: bubble-float 3s ease-in-out infinite;
    pointer-events: auto;
}

.interact-bubble img {
    width: 100%;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}

@keyframes bubble-float {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

/* ========================================
   朵朵選單
   ======================================== */

.duoduo-menu {
    position: absolute;
    bottom: 70%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    animation: menu-appear 0.3s ease-out;
}

@keyframes menu-appear {
    from { transform: translateX(-50%) translateY(10px) scale(0.95); opacity: 0; }
    to { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
}

/* 卷軸容器 - 使用 border-image 九宮格切圖 */
.menu-container {
    position: relative;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    
    /* 邊框設定 */
    border-width: 0px 60px 0px 60px;
    border-style: solid;
    border-color: transparent;
    
    /* 九宮格切圖魔法 */
    border-image-source: url('/images/shrine/Makimono.png');
    border-image-slice: 0 150 0 150 fill;
    border-image-repeat: stretch;
    
    /* 陰影效果 */
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
}

.menu-buttons {
    position: relative;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.duoduo-menu-btn {
    position: relative;
    background: transparent !important;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
    z-index: 100;
    outline: none;
}

.duoduo-menu-btn:hover,
.duoduo-menu-btn:focus,
.duoduo-menu-btn:active {
    transform: scale(1.15);
    background: transparent !important;
    outline: none;
    box-shadow: none;
}

.duoduo-menu-btn img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.duoduo-menu-btn:hover img {
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
}

.menu-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.5);
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ========================================
   頂部 UI
   ======================================== */

.shrine-top-bar {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 勾玉顯示 */
.magatama-display {
    display: flex;
    gap: 4px;
    background: rgba(45, 35, 25, 0.8);
    border: 2px solid #8b7355;
    border-radius: 20px;
    padding: 6px 12px;
    cursor: pointer;
}

.magatama-display:hover {
    background: rgba(45, 35, 25, 0.95);
}

.magatama {
    width: 24px;
    height: 24px;
    object-fit: contain;
    transition: all 0.3s ease;
}

.magatama.empty {
    opacity: 0.4;
    filter: grayscale(100%);
}

.magatama.full {
    filter: drop-shadow(0 0 4px rgba(100, 200, 150, 0.6));
}

/* 錢幣顯示 */
.coin-display {
    display: flex;
    gap: 8px;
}

.coin-slot {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(45, 35, 25, 0.9);
    border: 2px solid #d4a853;
    border-radius: 20px;
    padding: 6px 14px;
}

.coin-slot img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.coin-slot span {
    color: #ffd700;
    font-weight: bold;
    font-size: 0.95rem;
}

.coin-slot.neko img {
    width: 28px;
    height: 28px;
}

/* 御神酒選單數量 */
.menu-count {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(139, 90, 107, 0.9);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 8px;
    min-width: 18px;
    text-align: center;
}

/* ========================================
   開光 Modal
   ======================================== */

.shrine-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: relative;
    z-index: 1;
    background: linear-gradient(180deg, #fdfbf7, #f5f0e6);
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border: 3px solid #c9a86c;
    animation: modal-appear 0.3s ease-out;
}

@keyframes modal-appear {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.kaika-header {
    text-align: center;
    margin-bottom: 20px;
}

.kaika-header h2 {
    font-family: 'Yuji Syuku', serif;
    color: #8b5a6b;
    margin: 0 0 8px;
    font-size: 1.6rem;
}

.kaika-header p {
    color: #6b5a4a;
    margin: 0;
    font-size: 0.9rem;
}

/* 分頁 Tabs */
.kaika-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    border-bottom: 2px solid #e8e0d8;
    padding-bottom: 8px;
}

.kaika-tab {
    flex: 1;
    background: #f5f0ea;
    border: none;
    padding: 10px 8px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 0.85rem;
    color: #7b6b5b;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.kaika-tab:hover {
    background: #ebe5dd;
}

.kaika-tab.active {
    background: #8b5a6b;
    color: white;
}

.tab-badge {
    background: #e74c3c;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.kaika-tab.active .tab-badge {
    background: white;
    color: #8b5a6b;
}

.tab-badge:empty,
.tab-badge[data-count="0"] {
    display: none;
}

/* 朵朵推薦提示 */
.kaika-duoduo-tip {
    background: linear-gradient(135deg, #fff5f8, #fff0f5);
    border: 1px dashed #e8a0b0;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.kaika-duoduo-tip img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.kaika-duoduo-tip p {
    margin: 0;
    font-size: 0.9rem;
    color: #8b5a6b;
    line-height: 1.4;
}

/* 折疊選單 */
.kaika-accordion {
    border: 1px solid #e8e0d8;
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}

.kaika-accordion-header {
    background: #f8f5f2;
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    color: #6b5a4a;
}

.kaika-accordion-header:hover {
    background: #f0ebe5;
}

.kaika-accordion-header .arrow {
    transition: transform 0.2s ease;
}

.kaika-accordion.open .arrow {
    transform: rotate(180deg);
}

.kaika-accordion-content {
    display: none;
    padding: 8px;
    background: white;
}

.kaika-accordion.open .kaika-accordion-content {
    display: block;
}

.kaika-body {
    margin-bottom: 20px;
}

.kaika-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.kaika-empty {
    color: #888;
    text-align: center;
    padding: 40px 20px;
    line-height: 1.8;
}

/* 開光分區 */
.kaika-section {
    margin-bottom: 1.5rem;
}

.kaika-section-title {
    font-family: 'Yuji Syuku', serif;
    font-size: 1.1rem;
    color: #8b5a6b;
    margin: 0 0 4px 0;
}

.kaika-section-desc {
    font-size: 0.85rem;
    color: #9a8a7a;
    margin: 0 0 12px 0;
}

.kaika-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(139, 90, 107, 0.1);
    border: 2px solid #e8a0b0;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
}

.kaika-item.free {
    background: rgba(76, 175, 80, 0.1);
    border-color: #81c784;
}

.kaika-item.paid {
    background: rgba(255, 193, 7, 0.1);
    border-color: #ffc107;
}

.kaika-item-kana {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kaika-item-kana .kana {
    font-family: 'Yuji Syuku', serif;
    font-size: 2.2rem;
    color: #8b5a6b;
}

.kaika-item-kana .romaji {
    color: #6b5a4a;
    font-size: 1rem;
}

.kaika-item-kana .streak {
    font-size: 0.8rem;
    color: #9a8a7a;
    background: rgba(0,0,0,0.05);
    padding: 2px 8px;
    border-radius: 10px;
}

.kaika-btn {
    background: linear-gradient(135deg, #e8a0b0 0%, #d4869a 100%);
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kaika-btn.free {
    background: linear-gradient(135deg, #81c784 0%, #4caf50 100%);
}

.kaika-btn.paid {
    background: linear-gradient(135deg, #ffca28 0%, #ffa000 100%);
    color: #5d4037;
}

.kaika-btn.omiki {
    background: linear-gradient(135deg, #e1bee7 0%, #ba68c8 100%);
    color: white;
}

.kaika-btn.disabled {
    background: #ccc;
    color: #888;
    cursor: not-allowed;
}

.kaika-btn img {
    width: 20px;
    height: 20px;
}

.kaika-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.kaika-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.kaika-more {
    text-align: center;
    color: #9a8a7a;
    font-size: 0.9rem;
    margin-top: 8px;
}

.kaika-hint-box {
    background: rgba(186, 104, 200, 0.1);
    border: 1px dashed #ba68c8;
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
    font-size: 0.9rem;
    color: #7b1fa2;
    text-align: center;
}

.kaika-btns {
    display: flex;
    gap: 8px;
}

/* 御神酒確認對話框 */
.omiki-confirm-content {
    max-width: 360px;
    text-align: center;
}

.omiki-confirm-header img {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

.omiki-confirm-body {
    padding: 16px 0;
}

.omiki-confirm-text {
    font-family: 'Yuji Syuku', serif;
    font-size: 1.1rem;
    color: #8b5a6b;
    line-height: 1.6;
    margin: 0;
}

.omiki-confirm-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.omiki-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.omiki-btn.cancel {
    background: #f5f0ea;
    color: #7b6b5b;
    border: 2px solid #d4c4a8;
}

.omiki-btn.confirm {
    background: linear-gradient(135deg, #e1bee7 0%, #ba68c8 100%);
    color: white;
}

.omiki-btn:hover {
    transform: scale(1.02);
}

.omiki-tip {
    background: linear-gradient(135deg, #f3e5f5, #e8daef);
    border-color: #ba68c8;
}

/* 搜尋框 */
.kaika-search-box {
    margin-bottom: 16px;
}

.kaika-search-box input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e8d5c0;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.kaika-search-box input:focus {
    border-color: #c9a86c;
}

/* 隨機開光按鈕 */
.kaika-random-section {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px dashed #e8d5c0;
}

.kaika-random-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #ffd54f 0%, #ffb300 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 179, 0, 0.3);
}

.kaika-random-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 179, 0, 0.4);
}

.random-icon {
    font-size: 1.8rem;
}

.random-text {
    font-size: 1.2rem;
    font-weight: bold;
    color: #5d4037;
}

.random-desc {
    margin: 10px 0 0;
    font-size: 0.85rem;
    color: #8b7355;
}

/* 老虎機動畫 */
.slot-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.slot-fullscreen.active {
    opacity: 1;
    visibility: visible;
}

.slot-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
}

.slot-content {
    position: relative;
    text-align: center;
    z-index: 1;
}

.slot-title {
    font-family: 'Yuji Syuku', serif;
    font-size: 2rem;
    color: #ffd54f;
    margin-bottom: 30px;
    text-shadow: 0 2px 10px rgba(255, 213, 79, 0.5);
}

.slot-machine {
    background: linear-gradient(135deg, #2d2319, #1a1510);
    border: 4px solid #c9a86c;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 0 30px rgba(201, 168, 108, 0.3);
}

.slot-window {
    width: 200px;
    height: 80px;
    overflow: hidden;
    background: #fff;
    border-radius: 8px;
    border: 3px solid #8b7355;
}

.slot-reel {
    transition: transform 0.08s linear;
}

.slot-item {
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f0ea, #ebe5dd);
}

.slot-kana {
    font-size: 2.5rem;
    font-weight: bold;
    color: #5d4037;
}

.slot-romaji {
    font-size: 0.9rem;
    color: #8b7355;
}

.slot-machine.selected {
    animation: slot-flash 0.3s ease 3;
}

@keyframes slot-flash {
    0%, 100% { box-shadow: 0 0 30px rgba(201, 168, 108, 0.3); }
    50% { box-shadow: 0 0 50px rgba(255, 215, 0, 0.8); }
}

.slot-hint {
    margin-top: 20px;
    font-size: 1.1rem;
    color: #c9a86c;
}

.kaika-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 2px solid #e8d5c0;
}

.kaika-item-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b5a4a;
    font-weight: 500;
}

.kaika-item-info img {
    width: 32px;
    height: 32px;
}

.modal-btn-secondary {
    background: transparent;
    border: 2px solid #c9a86c;
    color: #6b5a4a;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.modal-btn-secondary:hover {
    background: rgba(201, 168, 108, 0.2);
}

/* ========================================
   開光儀式 - 全螢幕朵朵演出
   ======================================== */

.kaigen-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.kaigen-fullscreen.active {
    opacity: 1;
    pointer-events: auto;
}

.kaigen-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
}

/* 對話內容區 */
.kaigen-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    max-width: 90vw;
}

/* 朵朵大圖 */
.kaigen-duoduo {
    width: 280px;
    height: 280px;
    animation: duoduo-appear 0.5s ease-out;
}

@media (min-width: 768px) {
    .kaigen-duoduo {
        width: 350px;
        height: 350px;
    }
}

@keyframes duoduo-appear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.kaigen-duoduo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.3));
}

.kaigen-duoduo img.casting-intense {
    animation: casting-glow 0.5s ease-in-out infinite alternate;
}

@keyframes casting-glow {
    from {
        filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.3));
    }
    to {
        filter: drop-shadow(0 0 50px rgba(250, 204, 21, 0.8))
                drop-shadow(0 0 80px rgba(250, 204, 21, 0.5));
    }
}

/* 對話氣泡 */
.kaigen-bubble {
    background: white;
    border-radius: 20px;
    padding: 1.5rem 2rem;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: kaigen-bubble-appear 0.4s ease-out 0.2s both;
    transition: opacity 0.3s ease;
}

@keyframes kaigen-bubble-appear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kaigen-text {
    font-family: 'Yuji Syuku', serif;
    font-size: 1.3rem;
    color: #1c1917;
    line-height: 1.6;
    min-height: 2.5rem;
}

@media (min-width: 768px) {
    .kaigen-text {
        font-size: 1.5rem;
    }
}

.kaigen-hint {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #9ca3af;
}

/* 慶祝狀態 */
.kaigen-content.celebrate .kaigen-duoduo {
    animation: celebrate-bounce 0.6s ease-out;
}

@keyframes celebrate-bounce {
    0% { transform: scale(0.5); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* 展示模式 - 批量開光結果 */
.kaigen-reveal {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.kaigen-reveal.active {
    opacity: 1;
    transform: scale(1);
}

.kaigen-spotlight {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(
        circle at center,
        rgba(250, 204, 21, 0.3) 0%,
        rgba(250, 204, 21, 0.1) 40%,
        transparent 70%
    );
    animation: spotlight-pulse 2s ease-in-out infinite;
}

@keyframes spotlight-pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
}

/* 批量繪馬展示 */
.kaigen-ema-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    max-width: 500px;
    animation: ema-grid-reveal 0.8s ease-out;
}

@keyframes ema-grid-reveal {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-10deg);
    }
    60% {
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

.kaigen-ema-item {
    position: relative;
    width: 80px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ema-item-pop 0.5s ease-out backwards;
}

.kaigen-ema-item:nth-child(1) { animation-delay: 0.1s; }
.kaigen-ema-item:nth-child(2) { animation-delay: 0.2s; }
.kaigen-ema-item:nth-child(3) { animation-delay: 0.3s; }
.kaigen-ema-item:nth-child(4) { animation-delay: 0.4s; }
.kaigen-ema-item:nth-child(5) { animation-delay: 0.5s; }
.kaigen-ema-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes ema-item-pop {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    70% {
        transform: scale(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.kaigen-ema-item img {
    width: 70px;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(250, 204, 21, 0.8));
}

.kaigen-ema-item .kana {
    position: absolute;
    font-family: 'Yuji Syuku', serif;
    font-size: 2rem;
    font-weight: 700;
    color: transparent;
    background: linear-gradient(180deg, #fde047 0%, #d97706 100%);
    -webkit-background-clip: text;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

/* 結算文字 */
.kaigen-result-text {
    margin-top: 1.5rem;
    font-family: 'Yuji Syuku', serif;
    font-size: 1.5rem;
    color: #ffd700;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

@media (min-width: 768px) {
    .kaigen-result-text {
        font-size: 1.8rem;
    }
}

/* 單一繪馬展示（向下相容） */
.kaigen-ema-display {
    position: relative;
    animation: ema-reveal 0.8s ease-out;
}

@keyframes ema-reveal {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    60% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

.kaigen-ema-display img {
    width: 200px;
    height: auto;
    filter: drop-shadow(0 0 40px rgba(250, 204, 21, 0.8))
            drop-shadow(0 0 80px rgba(250, 204, 21, 0.5));
    animation: ssr-float 3s ease-in-out infinite;
}

@keyframes ssr-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@media (min-width: 768px) {
    .kaigen-ema-display img {
        width: 250px;
    }
}

.kaigen-ema-kana {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -30%);
    font-size: 4rem;
    font-weight: 700;
    color: transparent;
    background: linear-gradient(180deg, #fde047 0%, #d97706 100%);
    -webkit-background-clip: text;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
    /* 拗音橫向排列 */
    writing-mode: horizontal-tb;
    white-space: nowrap;
    letter-spacing: -0.1em;
}

@media (min-width: 768px) {
    .kaigen-ema-kana {
        font-size: 5rem;
    }
}

/* ========================================
   響應式
   ======================================== */

@media (max-width: 768px) {
    .shrine-home-page {
        padding: 0;
    }
    
    .shrine-stage {
        border-radius: 0;
        aspect-ratio: 9 / 16;
        max-width: 100%;
    }
    
    .duoduo-miko {
        width: 45%;
        bottom: 25%;
    }
    
    .duoduo-bubble {
        top: -80px;
        padding: 0.75rem 1.25rem;
        min-width: 220px;
        max-width: 300px;
    }
    
    .duoduo-text {
        font-size: 1.1rem;
    }
    
    .duoduo-menu {
        bottom: 55%;
    }
    
    .menu-container {
        padding: 1.5rem 2rem;
        min-width: 280px;
    }
    
    .menu-buttons {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .menu-icon {
        width: 50px;
        height: 50px;
        font-size: 1.6rem;
    }
    
    .menu-label {
        font-size: 0.75rem;
    }
    
    .interact-bubble {
        width: 40px;
    }
    
    .interact-bubble span {
        height: 40px;
        font-size: 1.2rem;
    }
    
    .shrine-top-bar {
        top: 10px;
        right: 10px;
    }
    
    .item-slot {
        padding: 4px 10px;
    }
    
    .item-slot img {
        width: 22px;
        height: 22px;
    }
    
    .item-slot span {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .duoduo-bubble {
        top: -70px;
        min-width: 180px;
        max-width: 260px;
        padding: 0.6rem 1rem;
    }
    
    .duoduo-text {
        font-size: 1rem;
    }
    
    .menu-icon {
        width: 45px;
        height: 45px;
        font-size: 1.4rem;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 0.5rem;
    }
    
    .kaika-header h2 {
        font-size: 1.3rem;
    }
    
    .kaika-item-kana .kana {
        font-size: 1.8rem;
    }
}

/* ========================================
   神社封印狀態（Q北擋路）
   ======================================== */

.shrine-locked-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 1.5rem;
    text-align: center;
}

.shrine-locked-avatar {
    width: 180px;
    height: 180px;
    margin-bottom: 1.5rem;
}

.shrine-locked-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.shrine-locked-dialog {
    background: linear-gradient(180deg, #fdfbf7 0%, #f5f0e8 100%);
    border: 2px solid #8B0000;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.shrine-locked-text {
    font-size: 1rem;
    line-height: 1.8;
    color: #3d3425;
    margin-bottom: 1.5rem;
    white-space: pre-line;
    font-family: 'Yuji Syuku', serif;
}

.shrine-locked-btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: linear-gradient(135deg, #8B0000 0%, #6B0000 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.3);
}

.shrine-locked-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 0, 0, 0.4);
}

/* 深色模式 */
[data-theme="dark"] .shrine-locked-dialog {
    background: linear-gradient(180deg, #2a2520 0%, #1f1a16 100%);
    border-color: #8B0000;
}

[data-theme="dark"] .shrine-locked-text {
    color: #e8e0d5;
}
