:root {
    --bg-color: #fdf2f8;
    --accent-color: #fb7185;
    --correct-color: #2ecc71;
    --incorrect-color: #e74c3c;
    --text-color: #1e293b;
    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-border: rgba(255, 255, 255, 0.7);
    --shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background-color: var(--bg-color);
    background-image: url('background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
    overflow: hidden;
}

#app {
    width: 100%;
    max-width: 500px;
    height: 100%;
    position: relative;
}

.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.page.active {
    display: flex;
    opacity: 1;
}

/* Cover Page */
#cover-page {
    justify-content: center;
    align-items: center;
    background-image: linear-gradient(135deg, #fdf2f8 0%, #ffe4e6 100%);
}

.cover-content {
    padding: 3rem 2rem;
    text-align: center;
    width: 80%;
}

.logo {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 1rem;
    letter-spacing: 0.2rem;
}

.subtitle {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2.5rem;
    opacity: 0.8;
}

/* Calendar Page */
header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.nav-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--accent-color);
    cursor: pointer;
    padding: 0.5rem;
}

header h2 {
    font-weight: 300;
    font-size: 1.3rem;
    letter-spacing: 0.1rem;
}

main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    box-shadow: var(--shadow);
}

.card-container {
    width: 100%;
    aspect-ratio: 3/4.5;
    position: relative;
    overflow: hidden;
    padding: 1.5rem;
    perspective: 1000px;
}

.page-curl {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, transparent 50%, rgba(255, 255, 255, 0.8) 50%);
    box-shadow: -5px -5px 15px rgba(0, 0, 0, 0.1);
    z-index: 5;
    pointer-events: none;
    border-bottom-right-radius: 30px;
}

.page-curl::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 60px 60px;
    border-color: transparent transparent var(--glass-bg) transparent;
    filter: drop-shadow(-2px -2px 5px rgba(0, 0, 0, 0.1));
}

.card-state {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 1.5rem;
    display: none;
    flex-direction: column;
    transition: all 0.5s ease;
}

.card-state.active {
    display: flex;
}

/* Front State */
.calendar-header {
    text-align: center;
    margin-bottom: 0.5rem;
}

#day-of-week {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2rem;
    color: var(--accent-color);
}

.date-display {
    text-align: center;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}

.date-container {
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.5rem;
}

.day-number {
    font-size: 6.5rem;
    font-weight: 800;
    color: var(--text-color);
    margin: 0;
    letter-spacing: -2px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Page Peeling Animation */
.card-content.peeling-next {
    animation: peel-next 0.8s cubic-bezier(0.645, 0.045, 0.355, 1) forwards;
}

.card-content.peeling-prev {
    animation: peel-prev 0.8s cubic-bezier(0.645, 0.045, 0.355, 1) forwards;
}

@keyframes peel-next {
    0% {
        transform: rotate(0) translate(0);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    }

    100% {
        transform: rotate(-30deg) translate(-120%, -50%) skewX(-5deg);
        box-shadow: 50px 50px 100px rgba(0, 0, 0, 0.2);
        opacity: 0;
    }
}

@keyframes peel-prev {
    0% {
        transform: rotate(0) translate(0);
        border-radius: 24px;
    }

    100% {
        transform: rotate(30deg) translate(120%, -50%) skewX(5deg);
        box-shadow: -50px 50px 100px rgba(0, 0, 0, 0.2);
        opacity: 0;
    }
}

.quiz-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}

.quiz-question {
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.option-btn {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.4));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem 1.2rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.option-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
}

.option-btn:active {
    transform: scale(0.98);
}

.calendar-footer {
    text-align: center;
    margin-top: 1rem;
}

#japanese-date {
    font-size: 0.9rem;
    opacity: 0.6;
}

/* Explanation State */
.explanation-content h3 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

#explanation-text {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.author-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.3);
    padding: 1rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
}

.author-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}

.author-name {
    font-weight: 700;
    font-size: 1rem;
}

.author-title {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Feedback Overlay */
#feedback-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.feedback-icon {
    font-size: 8rem;
    font-weight: 700;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.feedback-icon.correct::before {
    content: '🎉';
    display: block;
    animation: bounce 0.6s infinite alternate;
}

.feedback-icon.incorrect::before {
    content: '🤔';
    display: block;
    animation: shake 0.4s;
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-20px);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

.hidden {
    display: none !important;
}

/* Buttons */
.glass-btn {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 0.8rem 1.5rem;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.glass-btn.primary {
    background: var(--accent-color);
    color: white;
    border: none;
    font-weight: 700;
}

.glass-btn.small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    align-self: flex-end;
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Seasonal variations (24 Sekki) */
body.shunbun {
    --bg-color: #fff1f2;
    --accent-color: #fb7185;
}

body.seimei {
    --bg-color: #f0fdf4;
    --accent-color: #4ade80;
}

body.risshun {
    --bg-color: #fdf2f8;
    --accent-color: #f472b6;
}

/* Base style for switching background image via seasonal class */
body {
    background-image: url('seasonal/default.png');
    /* Default */
}

body.shunbun {
    background-image: url('seasonal/background.png');
}

body.seimei {
    background-image: url('seasonal/seimei.png');
}

/* etc. */
.guidance-fixed-text {
    line-height: 2;
    margin-bottom: 2rem;
}

.guidance-links {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--accent-color);
}