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

body {
    font-family: 'Caveat', cursive;
    background-color: #F3EDE0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s;
    background-color: #F9F3E7;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow-y: auto;
}

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

.sketch-border {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 2px solid #4A4A4A;
    border-radius: 20px;
    pointer-events: none;
    opacity: 0.3;
    stroke-dasharray: 10 5;
}

.handwritten {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: #2C3E2C;
}

.handwritten.large {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
}

#page-cover {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.title-handwritten {
    font-family: 'Caveat', cursive;
    font-size: 3rem;
    color: #2C3E2C;
    margin: 0.2rem 0;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.05);
}

.title-handwritten.large {
    font-size: 5rem;
}

.wonder-cover-container {
    margin: 2rem 0;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.wonder-cover-container:hover {
    transform: scale(1.02);
}

.wonder-cover-container:hover .wonder-svg {
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.1));
}

.wonder-svg {
    width: 100%;
    max-width: 300px;
    height: auto;
}

.click-prompt {
    font-size: 1.5rem;
    color: #6B4F3C;
    margin-top: 1rem;
    animation: gentle-pulse 2s infinite;
}

@keyframes gentle-pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

.decorative-border {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.toy {
    font-size: 2rem;
    opacity: 0.6;
    transform: rotate(5deg);
}

.toy:nth-child(even) {
    transform: rotate(-5deg) translateY(5px);
}

#page-setup {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.setup-content {
    max-width: 600px;
    width: 100%;
    background: rgba(255,255,255,0.4);
    padding: 2rem;
    border-radius: 30px;
    position: relative;
    z-index: 10;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

.underline-sketch {
    width: 200px;
    height: 2px;
    background: repeating-linear-gradient(90deg, #4A4A4A 0px, #4A4A4A 10px, transparent 10px, transparent 15px);
    margin: 0 auto 2rem auto;
}

.players-container {
    margin-bottom: 2rem;
}

.player-input-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    border-bottom: 1px dashed #4A4A4A;
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #4A4A4A;
    background-size: cover;
}

.player-avatar.tabby { background-color: #D68B5C; }
.player-avatar.ginger { background-color: #E88A3D; }
.player-avatar.tuxedo { background-color: #2C2C2C; }
.player-avatar.calico { background-color: #B85C3A; }

.sketch-input {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 2px dashed #4A4A4A;
    font-family: 'Caveat', cursive;
    font-size: 1.5rem;
    padding: 0.3rem 0.5rem;
    outline: none;
}

.sketch-input:focus {
    border-bottom: 2px solid #8A9EA3;
}

.avatar-selector {
    cursor: pointer;
    font-size: 1.2rem;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #4A4A4A;
    border-radius: 50%;
}

.hidden {
    display: none;
}

.sketch-button-small {
    background: transparent;
    border: 2px dashed #4A4A4A;
    border-radius: 30px;
    padding: 0.5rem 1.5rem;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    margin: 1rem auto;
    display: block;
}

.sketch-button-small:hover {
    border: 2px solid #8A9EA3;
    background: rgba(138, 158, 163, 0.1);
}

.mode-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin: 1.5rem 0;
}

.sketch-radio {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.sketch-radio input {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #4A4A4A;
    border-radius: 50%;
    display: inline-block;
    position: relative;
}

.sketch-radio input:checked + .radio-custom::after {
    content: "🐾";
    position: absolute;
    top: -8px;
    left: -2px;
    font-size: 16px;
}

.setup-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.sketch-button {
    background: transparent;
    border: 2px solid #4A4A4A;
    border-radius: 40px;
    padding: 0.8rem 2rem;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s;
}

.sketch-button.primary {
    background: #8A9EA3;
    color: white;
    border: 2px solid #4A4A4A;
}

.sketch-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}

.wonder-watching {
    position: absolute;
    bottom: 20px;
    right: 20px;
    opacity: 0.5;
}

#page-game {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.game-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(255,255,255,0.6);
    border-bottom: 2px dashed #4A4A4A;
    z-index: 20;
    position: relative;
}

.game-title {
    font-size: 1.8rem;
}

.players-score {
    display: flex;
    gap: 1.5rem;
}

.player-score-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.3rem;
}

.player-score-item .score-circle {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid #4A4A4A;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

.player-score-item.current-turn .score-circle {
    border: 3px solid #FFD700;
    box-shadow: 0 0 0 2px #B22234;
}

.game-main-area {
    display: grid;
    grid-template-columns: 200px 1fr 100px;
    flex: 1;
    min-height: calc(100vh - 80px);
    position: relative;
    z-index: 10;
}

.energy-meter-container {
    padding: 2rem 1rem;
    border-right: 2px dashed #4A4A4A;
    background: rgba(255,255,255,0.3);
}

.meter-label {
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 1rem;
}

.meter-wrapper {
    width: 100%;
    height: 250px;
    border: 3px solid #4A4A4A;
    border-radius: 30px;
    position: relative;
    background: white;
    overflow: hidden;
}

.meter-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65%;
    background: linear-gradient(0deg, #B22234, #FF8C69);
    transition: height 0.5s ease;
}

.energy-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 1rem;
    gap: 0.3rem;
}

.status-icon {
    font-size: 2rem;
}

.status-text {
    font-size: 1.3rem;
}

.percentage {
    font-size: 1.5rem;
    font-weight: bold;
}

.game-center {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-weather-container {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem 1.5rem;
    border: 2px dashed #4A4A4A;
    border-radius: 40px;
    background: rgba(255,255,255,0.4);
}

.time-display, .weather-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.time-icon, .weather-icon {
    font-size: 1.8rem;
}

.time-text, .weather-text {
    font-size: 1.3rem;
}

.wonder-card {
    width: 280px;
    height: 320px;
    margin: 1rem 0;
}

.card-sketch-border {
    width: 100%;
    height: 100%;
    border: 3px solid #4A4A4A;
    border-radius: 30px;
    background: white;
    padding: 1rem;
    position: relative;
    box-shadow: 8px 8px 0 rgba(0,0,0,0.1);
}

.card-header {
    font-size: 1.5rem;
    border-bottom: 2px dashed #4A4A4A;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.card-image {
    height: 140px;
    background: #F0EAD6;
    border-radius: 15px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.card-text {
    font-size: 1.6rem;
    text-align: center;
}

.wonder-peek {
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 50px;
    height: 50px;
    background: white;
    border: 2px solid #4A4A4A;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.answers-container {
    width: 100%;
    max-width: 800px;
    margin-top: 1rem;
}

.answers-prompt {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 1rem;
}

.answer-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.answer-box {
    flex: 1;
    min-width: 200px;
    border: 3px solid #4A4A4A;
    border-radius: 20px;
    padding: 1.2rem 0.5rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.answer-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 0 rgba(0,0,0,0.1);
}

.answer-box.selected {
    border: 4px solid #FFD700;
    background: #FFF9E6;
}

.answer-letter {
    font-size: 1.8rem;
    font-weight: bold;
    position: absolute;
    top: -15px;
    left: -15px;
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid #4A4A4A;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.answer-text {
    font-size: 1.2rem;
    text-align: center;
    padding: 0 0.5rem;
}

.answer-icon {
    font-size: 2rem;
}

.game-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.timer-container {
    width: 200px;
    height: 30px;
    border: 2px solid #4A4A4A;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    background: white;
}

.timer-bar {
    height: 100%;
    width: 100%;
    background: #8A9EA3;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    font-weight: bold;
    color: #2C3E2C;
}

.lock-btn {
    font-size: 1.3rem;
    padding: 0.5rem 2rem;
}

.background-window {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    transition: background 0.8s ease;
}

.background-window.dawn { background: linear-gradient(135deg, #FFDAB9, #FFB347); }
.background-window.morning { background: linear-gradient(135deg, #B5D6E9, #F0E68C); }
.background-window.midday { background: linear-gradient(135deg, #87CEEB, #FFFFFF); }
.background-window.afternoon { background: linear-gradient(135deg, #FFD700, #FFA07A); }
.background-window.sunset { background: linear-gradient(135deg, #E6D4E3, #FFAA88); }
.background-window.evening { background: linear-gradient(135deg, #2C3E50, #4A4A6A); }
.background-window.night { background: linear-gradient(135deg, #0A0F1E, #1A2A3A); }

.wonder-silhouette {
    position: fixed;
    bottom: 20px;
    left: -100px;
    width: 60px;
    height: 40px;
    background: #2C3E2C;
    border-radius: 50%;
    opacity: 0.3;
    z-index: 5;
}

#page-victory {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.victory-content {
    text-align: center;
    z-index: 10;
}

.winner-title {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #B22234;
}

.victory-illustration {
    margin: 2rem 0;
}

.final-scores {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.final-score-item {
    padding: 1rem 2rem;
    border: 2px dashed #4A4A4A;
    border-radius: 30px;
    background: white;
    font-size: 1.5rem;
}

.victory-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.floating-text {
    position: absolute;
    font-size: 8rem;
    font-weight: bold;
    color: rgba(178, 34, 52, 0.1);
    white-space: nowrap;
    bottom: 50px;
    left: 0;
    right: 0;
    text-align: center;
    pointer-events: none;
    transform: rotate(-5deg);
    z-index: 1;
}

@media (max-width: 768px) {
    .game-main-area {
        grid-template-columns: 1fr;
    }

    .energy-meter-container {
        border-right: none;
        border-bottom: 2px dashed #4A4A4A;
    }

    .answer-options {
        flex-direction: column;
    }

    .game-controls {
        flex-direction: column;
    }

    .title-handwritten.large {
        font-size: 3rem;
    }

    .winner-title {
        font-size: 3rem;
    }

    .floating-text {
        font-size: 4rem;
    }
}
