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

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'ヒラギノ角ゴ ProN W3', 'Meiryo', 'メイリオ', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1e 100%);
    color: #fff;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 雪のパーティクル */
#snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.snowflake {
    position: absolute;
    top: -10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1em;
    animation: fall linear infinite;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

/* 画面切り替え */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease, visibility 1s ease;
    z-index: 10;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

.content {
    text-align: center;
    padding: 2rem;
    z-index: 2;
}

/* カウントダウン画面 */
.title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 3rem;
    font-weight: 300;
    letter-spacing: 0.3em;
    background: linear-gradient(45deg, #ff6b6b, #ffd93d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        filter: drop-shadow(0 0 10px rgba(255, 107, 107, 0.5));
    }
    to {
        filter: drop-shadow(0 0 20px rgba(255, 217, 61, 0.8));
    }
}

.countdown-display {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
}

.number {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700;
    background: linear-gradient(180deg, #ffffff 0%, #e0e0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.label {
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    color: #ffd93d;
    margin-top: 0.5rem;
    letter-spacing: 0.2em;
}

.year-label {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: #ff6b6b;
    letter-spacing: 0.3em;
    font-weight: 300;
}

/* 新年画面 */
.newyear-title {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 700;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.newyear-line {
    display: inline-block;
    white-space: nowrap;
    background: linear-gradient(45deg, #ff6b6b, #ffd93d, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% auto;
    animation: shine 3s linear infinite, slideIn 0.8s ease-out backwards;
    letter-spacing: 0.2em;
}

.newyear-line:nth-child(1) {
    animation-delay: 0s, 0s;
}

.newyear-line:nth-child(2) {
    animation-delay: 0s, 0.3s;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

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

.year-label-large {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    background: linear-gradient(180deg, #ffd93d 0%, #ff6b6b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 3rem;
    letter-spacing: 0.3em;
}

.omikuji-button {
    background: linear-gradient(135deg, #c92a2a 0%, #e03131 100%);
    color: #fff;
    border: 3px solid #ffd93d;
    padding: 1.5rem 4rem;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 16px rgba(201, 42, 42, 0.4);
    letter-spacing: 0.2em;
    font-family: inherit;
    animation: pulse 2s ease-in-out infinite;
}

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

.omikuji-button:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 24px rgba(201, 42, 42, 0.6);
    border-color: #fff;
}

.omikuji-button:active {
    transform: scale(0.98);
}

/* おみくじ画面 */
#omikuji-screen {
    flex-direction: column;
    gap: 2rem;
}

.omikuji-scroll {
    background: linear-gradient(135deg, #ffffff 0%, #fff8e7 100%);
    border-radius: 8px;
    padding: 2.5rem 2rem;
    max-width: 500px;
    width: 85%;
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3), 0 0 0 3px #ffd93d;
    position: relative;
    animation: scrollAppear 0.8s ease-out;
}

@keyframes scrollAppear {
    from {
        opacity: 0;
        transform: scale(0.8) rotateX(-10deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotateX(0);
    }
}

.scroll-top,
.scroll-bottom {
    display: none;
}

.scroll-content {
    color: #2d1810;
}

.omikuji-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 1.5rem;
    color: #c92a2a;
    letter-spacing: 0.3em;
    text-align: center;
    border-bottom: 2px solid #ffd93d;
    padding-bottom: 1rem;
}

.fortune-result {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    text-align: center;
    margin: 2rem 0;
    padding: 1rem;
    border-radius: 10px;
    animation: fortuneReveal 0.6s ease-out 0.3s backwards;
}

@keyframes fortuneReveal {
    from {
        opacity: 0;
        transform: scale(1.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fortune-result.daikichi {
    background: linear-gradient(135deg, #ff6b6b, #ff8787);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.fortune-result.kichi {
    background: linear-gradient(135deg, #ffd93d, #ffe066);
    color: #1a1a2e;
    box-shadow: 0 4px 12px rgba(255, 217, 61, 0.4);
}

.fortune-result.chukichi {
    background: linear-gradient(135deg, #ff922b, #ffa94d);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 146, 43, 0.4);
}

.fortune-result.shokichi {
    background: linear-gradient(135deg, #4ecdc4, #6ee7df);
    color: #1a1a2e;
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.4);
}

.fortune-result.suekichi {
    background: linear-gradient(135deg, #95e1d3, #b4f0e8);
    color: #1a1a2e;
    box-shadow: 0 4px 12px rgba(149, 225, 211, 0.4);
}

.fortune-result.kyo {
    background: linear-gradient(135deg, #6c757d, #868e96);
    color: #fff;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

.fortune-result.daikyo {
    background: linear-gradient(135deg, #495057, #5c636a);
    color: #fff;
    box-shadow: 0 4px 12px rgba(73, 80, 87, 0.4);
}

.fortune-message {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    line-height: 1.8;
    margin: 1.5rem 0;
    text-align: center;
    padding: 1rem;
    background: rgba(139, 69, 19, 0.1);
    border-radius: 10px;
    animation: messageAppear 0.6s ease-out 0.5s backwards;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fortune-details {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fortune-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    border-left: 4px solid #8b4513;
    animation: itemAppear 0.4s ease-out backwards;
}

.fortune-item:nth-child(1) {
    animation-delay: 0.7s;
}

.fortune-item:nth-child(2) {
    animation-delay: 0.8s;
}

.fortune-item:nth-child(3) {
    animation-delay: 0.9s;
}

.fortune-item:nth-child(4) {
    animation-delay: 1s;
}

@keyframes itemAppear {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fortune-label {
    font-weight: 700;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
}

.fortune-value {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
}

.retry-button {
    background: linear-gradient(135deg, #364fc7 0%, #4c6ef5 100%);
    color: #fff;
    border: 2px solid #fff;
    padding: 1rem 3rem;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 12px rgba(54, 79, 199, 0.4);
    font-family: inherit;
    letter-spacing: 0.1em;
    z-index: 2;
}

.retry-button:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(54, 79, 199, 0.6);
}

.retry-button:active {
    transform: scale(0.98);
}

/* レスポンシブ */
@media (max-width: 768px) {
    .content {
        padding: 1rem 1.5rem;
    }

    .title {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
        margin-bottom: 2rem;
    }

    .countdown-display {
        gap: 1em;
        flex-wrap: nowrap;
        font-size: 1rem;
    }

    .time-unit {
        flex: 1 1 0;
        min-width: 0;
    }

    .number {
        font-size: 2em;
        line-height: 1.2;
    }

    .label {
        font-size: 0.75em;
        margin-top: 0.4em;
    }

    .newyear-title {
        font-size: clamp(1.6rem, 6vw, 2.8rem);
    }

    .newyear-line {
        letter-spacing: 0.05em;
    }

    .year-label-large {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }

    .omikuji-button {
        padding: 1.2rem 2.5rem;
        font-size: clamp(1rem, 4vw, 1.5rem);
    }

    #omikuji-screen {
        gap: 1rem;
    }

    .omikuji-scroll {
        padding: 1.5rem 1rem;
        width: 90%;
        max-width: 100%;
        max-height: 65vh;
        overflow-y: auto;
    }

    .fortune-result {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
        margin: 1rem 0;
        padding: 0.8rem;
    }

    .fortune-message {
        font-size: clamp(0.85rem, 2.5vw, 1rem);
        margin: 1rem 0;
        padding: 0.8rem;
    }

    .fortune-details {
        gap: 0.6rem;
        margin-top: 1rem;
    }

    .fortune-item {
        padding: 0.6rem 0.8rem;
    }

    .retry-button {
        padding: 0.9rem 2rem;
        font-size: clamp(0.9rem, 3vw, 1.2rem);
    }
}
