/* style.css — 桜英語 神域の試練 */

:root {
    --sakura-pink: #f8c3cd;
    --sakura-deep: #e8a0b4;
    --vermillion: #c53d43;
    --vermillion-dark: #9b2d32;
    --kin-gold: #c9a96e;
    --kin-bright: #d4b87a;
    --sumi-ink: #1b1a2e;
    --sumi-deep: #0d0c1a;
    --washi-white: #f5efe6;
    --washi-cream: #ede4d8;
    --matcha-green: #7d8a6e;
    --lantern-red: #e85d3a;
    --lantern-glow: #ff9a76;
    --correct-green: #6b9e6b;
    --wrong-red: #d94f4f;
    --golden-yellow: #f0c060;
    --font-main: 'Noto Serif JP', 'Hiragino Mincho Pro', serif;
    --font-display: 'Yuji Syuku', 'Noto Serif JP', serif;
    --ema-width: 220px;
    --transition-fast: 0.25s;
    --transition-normal: 0.4s;
    --transition-slow: 0.7s;
    --cursor-sakura: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><g transform='translate(16,16)'><path d='M0,-10 C6,-10 10,-6 10,0 C10,6 6,10 0,10 C-6,10 -10,6 -10,0 C-10,-6 -6,-10 0,-10Z' fill='%23f8c3cd' opacity='0.9' stroke='%23e8a0b4' stroke-width='0.8'/><path d='M0,-10 L0,3' stroke='%23e8a0b4' stroke-width='0.6' opacity='0.7'/><path d='M-3,-8 L3,-3' stroke='%23e8a0b4' stroke-width='0.5' opacity='0.6'/><path d='M3,-8 L-3,-3' stroke='%23e8a0b4' stroke-width='0.5' opacity='0.6'/></g></svg>") 16 16, auto;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    cursor: var(--cursor-sakura);
}

body {
    font-family: var(--font-main);
    background: var(--sumi-deep);
    color: var(--washi-white);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    cursor: var(--cursor-sakura);
}

button,
.option-ema,
.btn-start,
.dialogue-next {
    cursor: var(--cursor-sakura);
}

/* === 背景層 === */
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: linear-gradient(180deg, #0d0c1a 0%, #14132a 15%, #1a1835 30%, #1b1a2e 50%, #1e1c38 70%, #1a1830 100%);
    pointer-events: none;
    transition: background 1.5s ease;
}

.bg-layer.chapter-2 {
    background: linear-gradient(180deg, #0f0e1f 0%, #181635 20%, #1d1a3a 40%, #1b1a2e 60%, #221f40 80%, #1a1830 100%);
}

.bg-layer.chapter-3 {
    background: linear-gradient(180deg, #120f1a 0%, #1a1430 25%, #1b1838 50%, #15132a 70%, #1a1830 100%);
}

.moon {
    position: absolute;
    top: 7%;
    right: 14%;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle at 55% 45%, #fefae0 0%, #f5e6c8 30%, #e8d5b0 60%, #d4c49a 100%);
    border-radius: 50%;
    box-shadow: 0 0 50px rgba(254, 250, 224, 0.5), 0 0 130px rgba(254, 250, 224, 0.28), 0 0 220px rgba(254, 250, 224, 0.12);
    animation: moonGlow 6s ease-in-out infinite;
    z-index: 1;
    transition: all 1.5s ease;
}

@keyframes moonGlow {

    0%,
    100% {
        box-shadow: 0 0 50px rgba(254, 250, 224, 0.5), 0 0 130px rgba(254, 250, 224, 0.28);
    }

    50% {
        box-shadow: 0 0 65px rgba(254, 250, 224, 0.65), 0 0 160px rgba(254, 250, 224, 0.38);
    }
}

.stars-container {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    animation: twinkle var(--twinkle-dur) ease-in-out infinite;
    animation-delay: var(--twinkle-delay);
    opacity: 0;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.25;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(2.4);
    }
}

.distant-mountain {
    position: absolute;
    bottom: 25%;
    left: 5%;
    right: 5%;
    height: 60px;
    background: linear-gradient(180deg, transparent 0%, rgba(30, 25, 50, 0.5) 40%, rgba(20, 18, 38, 0.7) 100%);
    border-radius: 50% 50% 0 0;
    opacity: 0.4;
    z-index: 0;
}

/* === 櫻花花瓣 === */
.petals-layer {
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
}

.petal {
    position: absolute;
    top: -40px;
    font-size: var(--petal-size, 18px);
    opacity: 0;
    animation: petalFall var(--fall-dur, 6s) linear forwards;
    animation-delay: var(--fall-delay, 0s);
    filter: blur(0.3px);
    pointer-events: none;
    will-change: transform;
}

@keyframes petalFall {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }

    4% {
        opacity: 0.9;
    }

    30% {
        transform: translateY(30vh) translateX(var(--sway-1, 30px)) rotate(100deg);
    }

    60% {
        transform: translateY(60vh) translateX(var(--sway-2, -25px)) rotate(230deg);
        opacity: 0.7;
    }

    85% {
        transform: translateY(85vh) translateX(var(--sway-3, 18px)) rotate(340deg);
        opacity: 0.35;
    }

    100% {
        transform: translateY(108vh) translateX(var(--sway-4, -12px)) rotate(450deg);
        opacity: 0;
    }
}

/* === 地面層 === */
.ground-layer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 32%;
    z-index: 1;
    pointer-events: none;
}

.ground-silhouette {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, rgba(14, 12, 28, 0.5) 18%, rgba(13, 11, 26, 0.8) 50%, #0a0918 100%);
}

.lantern {
    position: absolute;
    bottom: 20%;
    z-index: 2;
    animation: lanternSway 5s ease-in-out infinite;
}

.lantern-left {
    left: 10%;
    animation-delay: 0s;
}

.lantern-right {
    right: 10%;
    animation-delay: -2.5s;
}

.lantern-body {
    width: 34px;
    height: 46px;
    background: radial-gradient(ellipse at center, #ff6b4a 0%, #e85d3a 40%, #c44a2e 100%);
    border-radius: 50%/55%;
    margin: 0 auto;
    box-shadow: 0 0 28px rgba(255, 107, 74, 0.65), 0 0 65px rgba(255, 107, 74, 0.3);
    animation: lanternFlicker 3s ease-in-out infinite;
}

.lantern-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 55px;
    height: 55px;
    background: radial-gradient(circle, rgba(255, 154, 118, 0.45) 0%, rgba(255, 107, 74, 0.18) 40%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: glowPulse 2s ease-in-out infinite;
}

.lantern-string {
    width: 2px;
    height: 65px;
    background: linear-gradient(to bottom, transparent, rgba(200, 180, 150, 0.55), rgba(200, 180, 150, 0.75));
    margin: 0 auto;
}

@keyframes lanternSway {

    0%,
    100% {
        transform: rotate(-2deg);
    }

    50% {
        transform: rotate(2.5deg);
    }
}

@keyframes lanternFlicker {

    0%,
    100% {
        opacity: 1;
    }

    28% {
        opacity: 0.82;
    }

    58% {
        opacity: 0.94;
    }
}

@keyframes glowPulse {

    0%,
    100% {
        opacity: 0.55;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.85;
        transform: translate(-50%, -50%) scale(1.3);
    }
}

/* 櫻花樹 */
.sakura-tree {
    position: absolute;
    bottom: 13%;
    z-index: 1;
}

.sakura-tree-left {
    left: 2%;
}

.sakura-tree-right {
    right: 2%;
}

.tree-trunk {
    width: 16px;
    height: 90px;
    background: linear-gradient(to right, #3d2b1f, #5a3d2e, #4a3025);
    margin: 0 auto;
    border-radius: 40% 40% 20% 20%;
}

.tree-canopy {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.canopy-blob {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #fde4ec 0%, #f8c3cd 40%, #e8a0b4 80%, #d4899e 100%);
    opacity: 0.7;
    filter: blur(1.5px);
}

.sakura-tree-left .c1 {
    width: 55px;
    height: 50px;
    top: -30px;
    left: -22px;
}

.sakura-tree-left .c2 {
    width: 45px;
    height: 42px;
    top: -24px;
    left: 6px;
}

.sakura-tree-left .c3 {
    width: 50px;
    height: 46px;
    top: -12px;
    left: -12px;
}

.sakura-tree-left .c4 {
    width: 36px;
    height: 34px;
    top: -36px;
    left: 2px;
}

.sakura-tree-left .c5 {
    width: 30px;
    height: 28px;
    top: -6px;
    left: -26px;
}

.sakura-tree-right .c1 {
    width: 50px;
    height: 48px;
    top: -28px;
    left: -18px;
}

.sakura-tree-right .c2 {
    width: 42px;
    height: 40px;
    top: -22px;
    left: 8px;
}

.sakura-tree-right .c3 {
    width: 48px;
    height: 44px;
    top: -10px;
    left: -10px;
}

.sakura-tree-right .c4 {
    width: 34px;
    height: 32px;
    top: -34px;
    left: 4px;
}

.sakura-tree-right .c5 {
    width: 28px;
    height: 26px;
    top: -4px;
    left: -24px;
}

/* === 前景鳥居 === */
.torii-foreground {
    position: fixed;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.8s ease;
}

.torii-pillar {
    width: 13px;
    height: 150px;
    background: linear-gradient(to right, #8b2d30, #c53d43 20%, #d94f4f 50%, #c53d43 80%, #8b2d30);
    position: absolute;
    bottom: 0;
    border-radius: 3px 3px 0 0;
    box-shadow: 0 0 18px rgba(197, 61, 67, 0.3);
}

.torii-pillar-left {
    left: -50px;
}

.torii-pillar-right {
    right: -50px;
}

.torii-top-beam {
    width: 150px;
    height: 15px;
    background: linear-gradient(to bottom, #c53d43, #d94f4f 40%, #b8353b 100%);
    position: absolute;
    bottom: 140px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.torii-second-beam {
    width: 130px;
    height: 9px;
    background: linear-gradient(to bottom, #a8353b, #c53d43, #a8353b);
    position: absolute;
    bottom: 125px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 3px;
}

/* === 主容器 === */
.game-container {
    position: relative;
    z-index: 5;
    max-width: 720px;
    margin: 0 auto;
    padding: 16px 16px 45px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* === 標題 === */
.game-header {
    text-align: center;
    padding: 20px 0 6px;
}

.game-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.title-sakura {
    font-size: 2rem;
    animation: sakuraBounce 2s ease-in-out infinite;
    display: inline-block;
}

@keyframes sakuraBounce {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    30% {
        transform: translateY(-7px) rotate(5deg);
    }

    60% {
        transform: translateY(-3px) rotate(-3deg);
    }
}

.title-main {
    font-size: 2.6rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    background: linear-gradient(180deg, #fff 0%, #f8c3cd 30%, #e8a0b4 60%, #c97d90 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 8px rgba(248, 195, 205, 0.5));
    line-height: 1.2;
}

.title-sub {
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    color: var(--kin-gold);
    display: block;
    margin-top: 2px;
}

/* === 繪馬展示 === */
.ema-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin: 8px 0 16px;
    width: 100%;
}

.ema-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.5));
    transition: transform var(--transition-normal) ease;
}

.ema-card.ema-question {
    animation: emaFloat 4s ease-in-out infinite;
}

@keyframes emaFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.ema-roof {
    position: relative;
    width: 190px;
    height: 36px;
    z-index: 1;
}

.ema-roof-triangle {
    width: 0;
    height: 0;
    border-left: 95px solid transparent;
    border-right: 95px solid transparent;
    border-bottom: 34px solid #d4a76a;
    margin: 0 auto;
    filter: drop-shadow(0 -2px 4px rgba(0, 0, 0, 0.3));
    position: relative;
}

.ema-roof-triangle::after {
    content: '';
    position: absolute;
    top: 5px;
    left: -85px;
    width: 0;
    height: 0;
    border-left: 85px solid transparent;
    border-right: 85px solid transparent;
    border-bottom: 27px solid #c49a5c;
}

.ema-roof-ridge {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 14px;
    background: #b8863e;
    border-radius: 40% 40% 10% 10%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.ema-body {
    width: 170px;
    min-height: 110px;
    background: linear-gradient(180deg, #f7efe0 0%, #ede4d4 30%, #e8ddcc 60%, #dfd3c0 100%);
    border-radius: 6px 6px 16px 16px;
    padding: 14px 16px 18px;
    text-align: center;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 2px solid #d4c4a8;
    transition: all 0.5s ease;
}

.ema-kumihimo {
    position: absolute;
    top: 7px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 3px;
    background: repeating-linear-gradient(90deg, #c53d43 0px, #c53d43 4px, #f5efe6 4px, #f5efe6 5px, #c9a96e 5px, #c9a96e 9px, #f5efe6 9px, #f5efe6 10px);
    border-radius: 2px;
}

.ema-label {
    display: inline-block;
    font-size: 0.65rem;
    color: var(--vermillion);
    background: rgba(197, 61, 67, 0.07);
    padding: 2px 10px;
    border-radius: 20px;
    letter-spacing: 0.18em;
    margin-top: 6px;
    border: 1px solid rgba(197, 61, 67, 0.2);
    font-weight: 500;
}

.ema-jp-word {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--sumi-ink);
    margin: 6px 0 0;
    letter-spacing: 0.07em;
    line-height: 1.3;
    transition: all 0.35s ease;
}

.ema-hint {
    font-size: 0.7rem;
    color: #8a7a6a;
    margin-top: 3px;
    font-style: italic;
    min-height: 16px;
    transition: all 0.35s ease;
}

.ema-bottom-knot {
    width: 14px;
    height: 14px;
    background: radial-gradient(circle, #c9a96e, #a08050);
    border-radius: 50%;
    margin-top: -5px;
    position: relative;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
}

/* 注連繩進度 */
.shimenawa-progress {
    width: 100%;
    max-width: 380px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}

.shimenawa-track {
    flex: 1;
    height: 7px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
}

.shimenawa-fill {
    height: 100%;
    background: linear-gradient(90deg, #c53d43 0%, #e85d3a 30%, #f0c060 60%, #f8c3cd 100%);
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

.shimenawa-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: #f0c060;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(240, 192, 96, 0.6);
}

.shimenawa-count {
    font-size: 0.75rem;
    color: var(--kin-gold);
    letter-spacing: 0.08em;
    white-space: nowrap;
    font-weight: 500;
    min-width: 50px;
    text-align: center;
}

/* === 選項網格 === */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 480px;
    margin: 4px 0 16px;
}

.option-ema {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: var(--cursor-sakura);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease, opacity 0.45s ease;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.42));
    outline: none;
}

.option-ema:hover {
    transform: translateY(-5px) scale(1.05);
    filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.5));
}

.option-ema:active {
    transform: translateY(-2px) scale(1.02);
}

.option-ema .ema-roof {
    width: 130px;
    height: 26px;
}

.option-ema .ema-roof-triangle {
    border-left-width: 65px;
    border-right-width: 65px;
    border-bottom-width: 26px;
    border-bottom-color: #c9a96e;
}

.option-ema .ema-roof-triangle::after {
    border-left-width: 57px;
    border-right-width: 57px;
    border-bottom-width: 20px;
    border-bottom-color: #b8944c;
    top: 4px;
    left: -57px;
}

.option-ema .ema-body {
    width: 120px;
    min-height: 62px;
    padding: 8px 10px 12px;
    border-radius: 4px 4px 11px 11px;
}

.option-ema .ema-en-word {
    font-size: 1rem;
    font-weight: 600;
    color: var(--sumi-ink);
    letter-spacing: 0.03em;
    line-height: 1.3;
    word-break: break-word;
}

.option-ema .ema-index-dot {
    position: absolute;
    top: 5px;
    right: 8px;
    font-size: 0.55rem;
    color: #b8a080;
    opacity: 0.55;
}

.option-ema .ema-bottom-knot {
    width: 10px;
    height: 10px;
    margin-top: -3px;
}

.option-ema.correct-flash .ema-body {
    background: linear-gradient(180deg, #e8f5e8 0%, #c8e6c8 30%, #b8dbb8 100%) !important;
    border-color: #6b9e6b !important;
    box-shadow: 0 0 28px rgba(107, 158, 107, 0.55), inset 0 2px 4px rgba(255, 255, 255, 0.5) !important;
    transition: all 0.3s ease;
}

.option-ema.wrong-flash .ema-body {
    background: linear-gradient(180deg, #fde8e8 0%, #f5c8c8 30%, #e8b0b0 100%) !important;
    border-color: #d94f4f !important;
    box-shadow: 0 0 28px rgba(217, 79, 79, 0.55), inset 0 2px 4px rgba(255, 255, 255, 0.5) !important;
    transition: all 0.3s ease;
}

.option-ema.selected-correct {
    animation: correctPulse 0.55s ease-out;
}

.option-ema.selected-wrong {
    animation: wrongShake 0.45s ease-out;
}

@keyframes correctPulse {
    0% {
        transform: scale(1);
    }

    35% {
        transform: scale(1.12);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes wrongShake {

    0%,
    100% {
        transform: translateX(0);
    }

    22% {
        transform: translateX(-7px);
    }

    44% {
        transform: translateX(7px);
    }

    66% {
        transform: translateX(-4px);
    }

    88% {
        transform: translateX(4px);
    }
}

/* === 分數區 === */
.score-area {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 9px 18px;
    background: rgba(27, 26, 46, 0.65);
    border-radius: 35px;
    border: 1px solid rgba(201, 169, 110, 0.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    margin-bottom: 8px;
    transition: all 0.4s ease;
}

.score-display,
.combo-display,
.chapter-display {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
}

.score-icon,
.combo-icon,
.chapter-icon {
    font-size: 1.2rem;
}

.score-label,
.combo-label,
.chapter-label {
    font-size: 0.65rem;
    color: var(--usukumo-gray, #c8c4be);
    letter-spacing: 0.08em;
}

.score-value,
.combo-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--kin-bright);
    letter-spacing: 0.04em;
    min-width: 35px;
    text-align: center;
    transition: transform 0.2s ease;
}

.combo-value.combo-active {
    color: #f0c060;
    animation: comboGlow 0.6s ease-in-out infinite;
}

@keyframes comboGlow {

    0%,
    100% {
        text-shadow: 0 0 6px rgba(240, 192, 96, 0.5);
    }

    50% {
        text-shadow: 0 0 18px rgba(240, 192, 96, 1), 0 0 35px rgba(240, 192, 96, 0.55);
    }
}

.chapter-label {
    font-size: 0.7rem;
    color: var(--sakura-pink);
    letter-spacing: 0.06em;
    font-weight: 500;
}

.omamori-display {
    display: flex;
    gap: 5px;
    align-items: center;
}

/* 御守徽章 - 纯CSS文字印章 */
.omamori-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    margin: 0 3px;
    animation: omamoriAppear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), inset 0 1px 2px rgba(255, 255, 255, 0.4);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    letter-spacing: 0;
    line-height: 1;
    font-family: var(--font-main);  /* 使用日系字体显示汉字 */
    cursor: default;
}

/* 不同御守的颜色 */
.omamori-badge[data-type="集中"] {
    background: linear-gradient(135deg, #e85d3a, #c53d2a);
}
.omamori-badge[data-type="知識"] {
    background: linear-gradient(135deg, #4a90d9, #3570b0);
}
.omamori-badge[data-type="達人"] {
    background: linear-gradient(135deg, #d4a017, #b8860b);
}
.omamori-badge[data-type="努力"] {
    background: linear-gradient(135deg, #6b9e6b, #4a7a4a);
}
.omamori-badge[data-type="精進"] {
    background: linear-gradient(135deg, #8e44ad, #6c3483);
}

@keyframes omamoriAppear {
    0% {
        transform: scale(0) rotate(-30deg);
        opacity: 0;
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* === 對話框 === */
.dialogue-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 25;
    padding: 0 16px 24px;
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.dialogue-overlay.hidden {
    opacity: 0;
    transform: translateY(60px);
    pointer-events: none;
}

.dialogue-overlay:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dialogue-box {
    max-width: 600px;
    margin: 0 auto;
    background: rgba(20, 18, 35, 0.92);
    border: 2px solid rgba(201, 169, 110, 0.4);
    border-radius: 16px;
    padding: 16px 20px 14px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    position: relative;
}

.dialogue-speaker {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--kin-bright);
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.dialogue-text {
    font-size: 0.95rem;
    color: var(--washi-cream);
    line-height: 1.7;
    letter-spacing: 0.04em;
    min-height: 40px;
}

.dialogue-next {
    display: block;
    margin: 10px auto 0;
    padding: 6px 22px;
    font-family: var(--font-main);
    font-size: 0.8rem;
    color: var(--kin-gold);
    background: rgba(201, 169, 110, 0.1);
    border: 1px solid rgba(201, 169, 110, 0.3);
    border-radius: 20px;
    cursor: var(--cursor-sakura);
    transition: all 0.3s ease;
    letter-spacing: 0.06em;
}

.dialogue-next:hover {
    background: rgba(201, 169, 110, 0.2);
    border-color: rgba(201, 169, 110, 0.55);
}

/* === 轉場覆蓋層 === */
.transition-overlay {
    position: fixed;
    inset: 0;
    z-index: 22;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 9, 20, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: opacity 0.6s ease, visibility 0.6s ease;
    pointer-events: none;
}

.transition-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.transition-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.transition-content {
    text-align: center;
    animation: transitionIn 0.7s ease-out;
}

@keyframes transitionIn {
    0% {
        transform: scale(0.85);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.transition-icon {
    font-size: 3rem;
    animation: iconPulse 1.5s ease-in-out infinite;
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.15);
        opacity: 1;
    }
}

.transition-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--sakura-pink);
    letter-spacing: 0.12em;
    margin: 8px 0 4px;
    text-shadow: 0 0 20px rgba(248, 195, 205, 0.5);
}

.transition-sub {
    font-size: 0.85rem;
    color: var(--kin-gold);
    letter-spacing: 0.08em;
}

.transition-sakura-row {
    margin-top: 10px;
    font-size: 1.5rem;
    letter-spacing: 8px;
    animation: sakuraRowFlow 2s ease-in-out infinite;
}

@keyframes sakuraRowFlow {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* === 覆蓋層（開始/結束） === */
.overlay {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 9, 18, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
}

.start-ema .ema-body,
.result-ema .ema-body {
    width: 230px;
    min-height: 145px;
    padding: 18px 18px 22px;
}

.start-greeting {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--sumi-ink);
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.start-desc {
    font-size: 0.8rem;
    color: #5a4a3a;
    line-height: 1.7;
    letter-spacing: 0.04em;
}

.start-omikuji {
    font-size: 0.75rem;
    color: var(--vermillion);
    margin-top: 8px;
    letter-spacing: 0.06em;
}

.btn-start {
    position: relative;
    padding: 13px 36px;
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: #fff;
    background: linear-gradient(180deg, #c53d43 0%, #9b2d32 100%);
    border: none;
    border-radius: 45px;
    cursor: var(--cursor-sakura);
    overflow: hidden;
    box-shadow: 0 5px 18px rgba(197, 61, 67, 0.45), 0 0 0 3px rgba(197, 61, 67, 0.18);
    transition: all 0.35s ease;
    outline: none;
}

.btn-start:hover {
    transform: translateY(-3px);
    box-shadow: 0 9px 26px rgba(197, 61, 67, 0.6), 0 0 0 5px rgba(197, 61, 67, 0.25);
    background: linear-gradient(180deg, #d94f4f 0%, #b03a3f 100%);
}

.btn-start:active {
    transform: translateY(0);
}

.btn-start-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 55%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    transform: skewX(-20deg);
    animation: btnShine 3s ease-in-out infinite;
}

@keyframes btnShine {
    0% {
        left: -100%;
    }

    45% {
        left: 150%;
    }

    100% {
        left: 150%;
    }
}

.start-footer {
    font-size: 0.7rem;
    color: var(--kin-gold);
    letter-spacing: 0.12em;
    opacity: 0.65;
}

.result-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--sumi-ink);
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.result-score {
    font-size: 0.95rem;
    font-weight: 600;
    color: #5a4a3a;
    margin: 3px 0;
}

.result-combo {
    font-size: 0.85rem;
    color: #8a7a6a;
    margin: 2px 0 6px;
}

.result-ending {
    font-size: 0.8rem;
    color: var(--vermillion);
    margin: 4px 0;
    letter-spacing: 0.04em;
}

.result-omamori {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 1.5rem;
}

.btn-retry {
    background: linear-gradient(180deg, #6b9e6b 0%, #4a7a4a 100%);
    box-shadow: 0 5px 18px rgba(107, 158, 107, 0.45), 0 0 0 3px rgba(107, 158, 107, 0.18);
}

.btn-retry:hover {
    box-shadow: 0 9px 26px rgba(107, 158, 107, 0.6), 0 0 0 5px rgba(107, 158, 107, 0.25);
    background: linear-gradient(180deg, #7dae7d 0%, #5a8a5a 100%);
}

/* === 特效層 === */
.fx-layer {
    position: fixed;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    overflow: hidden;
}

.fx-particle {
    position: absolute;
    pointer-events: none;
    animation: fxBurst 1s ease-out forwards;
    font-size: var(--fx-size, 20px);
}

@keyframes fxBurst {
    0% {
        transform: translate(0, 0) scale(0.5);
        opacity: 1;
    }

    100% {
        transform: translate(var(--fx-dx), var(--fx-dy)) scale(1.4);
        opacity: 0;
    }
}

/* === 鼠標跟隨 === */
.cursor-sakura {
    position: fixed;
    pointer-events: none;
    z-index: 100;
    font-size: 20px;
    transform: translate(-50%, -50%) rotate(0deg);
    transition: transform 0.07s ease-out;
    opacity: 0.65;
    filter: drop-shadow(0 0 5px rgba(248, 195, 205, 0.5));
    will-change: transform;
    animation: cursorRotate 4s linear infinite;
}

@keyframes cursorRotate {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* === 響應式 === */
@media (max-width: 600px) {
    .title-main {
        font-size: 1.9rem;
    }

    .options-grid {
        gap: 10px;
        max-width: 340px;
    }

    .option-ema .ema-roof {
        width: 100px;
        height: 20px;
    }

    .option-ema .ema-roof-triangle {
        border-left-width: 50px;
        border-right-width: 50px;
        border-bottom-width: 20px;
    }

    .option-ema .ema-roof-triangle::after {
        border-left-width: 43px;
        border-right-width: 43px;
        border-bottom-width: 15px;
        top: 3px;
        left: -43px;
    }

    .option-ema .ema-body {
        width: 95px;
        min-height: 50px;
        padding: 6px 8px 8px;
    }

    .option-ema .ema-en-word {
        font-size: 0.8rem;
    }

    .ema-card.ema-question .ema-body {
        width: 140px;
        min-height: 90px;
        padding: 10px 12px 14px;
    }

    .ema-card.ema-question .ema-roof {
        width: 155px;
        height: 28px;
    }

    .ema-card.ema-question .ema-roof-triangle {
        border-left-width: 77px;
        border-right-width: 77px;
        border-bottom-width: 28px;
    }

    .torii-pillar {
        height: 90px;
    }

    .torii-pillar-left {
        left: -30px;
    }

    .torii-pillar-right {
        right: -30px;
    }

    .torii-top-beam {
        width: 100px;
        height: 9px;
        bottom: 85px;
    }

    .torii-second-beam {
        width: 85px;
        height: 6px;
        bottom: 76px;
    }

    .moon {
        width: 50px;
        height: 50px;
        top: 4%;
        right: 6%;
    }
}