* {
    box-sizing: border-box;
}

/* Responsive adjustments for tablet and mobile */

/* Tablet and small laptops */
@media (max-width: 900px) {
    .header-content { padding: 16px 20px; }
    .header-title { font-size: 22px; }
    .nav-tab { padding: 8px 12px; font-size: 13px; }
    .together { padding: 40px 20px; }
    .together h1 { font-size: 32px; }
    .together h2 { font-size: 18px; }
    #togetherTimer { font-size: 20px; }
    .center-area { padding: 30px 16px; }
    .card, .quiz-big { padding: 30px 20px; max-width: 760px; }
    #startBox button, .photo-start-btn { padding: 16px 40px; font-size: 18px; }
    .options-big { grid-template-columns: 1fr; gap: 18px; }
    .photo-quiz-container { gap: 20px; }
    .quiz-photo { max-height: 360px; }
    .nav-buttons a, .nav-buttons button { min-width: 120px; padding: 14px 20px; font-size: 16px; }
}

/* Mobile phones */
@media (max-width: 480px) {
    .header-content { padding: 12px 14px; }
    .header-title { font-size: 18px; }
    .header-nav { gap: 8px; }
    .nav-tab { padding: 6px 8px; font-size: 13px; border-radius: 10px; }
    .together { padding: 28px 12px; }
    .together h1 { font-size: 24px; }
    .together h2 { font-size: 16px; }
    #togetherTimer { font-size: 16px; }
    .center-area { padding: 18px 12px; }
    .card, .quiz-big { padding: 20px 16px; border-radius: 18px; width: 100%; }
    .card { max-width: 100%; }
    .nav-buttons { flex-direction: column; align-items: stretch; }
    .nav-buttons a, .nav-buttons button { width: 100%; padding: 14px 18px; font-size: 16px; }
    #startBox button, .photo-start-btn { padding: 14px 18px; font-size: 16px; }
    .options-big { grid-template-columns: 1fr; gap: 14px; }
    .option-big { padding: 18px; font-size: 16px; }
    .final-score { font-size: 64px; }
    .score-percentage { font-size: 36px; }

    /* Make images and canvas responsive */
    img, .quiz-photo, canvas { max-width: 100%; height: auto; }

    /* Password and inputs full-width and easy tap targets */
    .password-input-wrapper input, .puzzle-password-input, #answer, #passwordField {
        padding: 14px 16px; font-size: 16px;
    }

    /* Puzzle area responsiveness */
    .puzzle-canvas-wrapper { width: 100%; overflow: auto; }
    #puzzleCanvas { width: 100% !important; height: auto !important; }
    .puzzle-pieces-area { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .puzzle-piece { min-width: 64px; min-height: 64px; padding: 6px; font-size: 12px; }

    /* Baby name display adjustments */
    .name-display { font-size: 20px; padding: 12px; }
    .name-display.circle { width: 140px; height: 140px; }
    .name-display.large { width: auto; font-size: 16px; padding: 12px; }

    .fishing-boy {
        top: 82px;
        left: 80px;
        font-size: 28px;
    }

    .fishing-line-wrap {
        top: 112px;
        left: 56px;
        height: calc(100vh - 200px);
        width: 80px;
    }

    .fishing-progress {
        font-size: 12px;
        left: calc(50% + 14px);
        padding: 4px 8px;
    }

    .rain-toggle-btn {
        right: 12px;
        bottom: 12px;
        padding: 8px 12px;
        font-size: 12px;
    }

    /* Tighten footer */
    footer { padding: 18px; font-size: 14px; }
}

/* Minor utility: make header nav horizontally scrollable on very small widths */
@media (max-width: 360px) {
    .header-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .header-nav::-webkit-scrollbar { display: none; }
}

/* Rain canvas layering: keep header and content above the rain */
.rain-canvas, #rainCanvasInternal {
    position: fixed !important;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}
.top-header { position: relative; z-index: 3; }
.center-area { position: relative; z-index: 3; }
.card { position: relative; z-index: 4; }
footer { position: relative; z-index: 3; }

.rain-toggle-btn {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 8;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(7, 24, 38, 0.86);
    color: #e6f7ff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(2, 8, 18, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.rain-toggle-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(2, 8, 18, 0.6);
}

.rain-toggle-btn[data-rain-enabled="0"] {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(35, 54, 74, 0.18);
    color: #203449;
    box-shadow: 0 8px 20px rgba(22, 36, 50, 0.2);
}

body.night .rain-toggle-btn[data-rain-enabled="0"] {
    background: rgba(245, 249, 252, 0.92);
    color: #173049;
}

/* Night mode overrides for Home page (applied via `body.night`) */
body.night {
    background: linear-gradient(180deg, #071426 0%, #0b1b2a 100%);
    color: #e6f7ff;
}

body.night .top-header {
    background: linear-gradient(135deg, #09263a, #0f3350);
    box-shadow: 0 6px 24px rgba(5, 20, 30, 0.6);
}

body.night .header-title, body.night .nav-tab {
    color: #ffffff;
}

body.night .card,
body.night .quiz-big {
    background: rgba(255,255,255,0.04);
    color: #e6f7ff;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 12px 40px rgba(2, 8, 18, 0.6);
}

body.night .nav-tab {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.04);
}

body.night .nav-tab:hover {
    background: rgba(255,255,255,0.06);
}

body.night button, body.night .timeline-link, body.night .copy-btn {
    box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}

/* Make text inputs visible on dark background */
body.night input, body.night textarea {
    background: rgba(255,255,255,0.06);
    color: #ffffff;
    border: 1.5px solid rgba(100,180,255,0.3);
}

body.night input::placeholder {
    color: rgba(230,247,255,0.5);
}

body.night input::-webkit-input-placeholder {
    color: rgba(230,247,255,0.5);
}

body.night input:-moz-placeholder {
    color: rgba(230,247,255,0.5);
}

body.night .password-input-wrapper input,
body.night .puzzle-password-input,
body.night #answer {
    background: rgba(255,255,255,0.08);
    color: #ffffff;
    border: 1.5px solid rgba(100,180,255,0.4);
    font-size: 16px;
}

body.night .password-input-wrapper input:focus,
body.night .puzzle-password-input:focus,
body.night #answer:focus {
    box-shadow: 0 0 0 6px rgba(20,120,200,0.2);
    background: rgba(255,255,255,0.1);
    border-color: rgba(150,210,255,0.6);
}

/* Force readable text for password fields when shown as plain text */
body.night #answer,
body.night #timelinePassword,
body.night #pictureplayPassword,
body.night #babynamePassword {
    color: #f2fbff !important;
    -webkit-text-fill-color: #f2fbff !important;
    background: rgba(255,255,255,0.08) !important;
    border-color: rgba(100,180,255,0.45) !important;
}

/* Quiz readability fixes in night/rain theme */
body.night .rules li {
    color: #e6f7ff;
    background: rgba(255,255,255,0.06);
    border-left-color: #5cb9ff;
}

body.night .rules li:before {
    color: #8fd4ff;
}

body.night .scoring-section {
    background: rgba(255,255,255,0.04);
    border-color: rgba(120,190,255,0.22);
}

body.night .score-item,
body.night .score-item .points,
body.night .score-item .label {
    color: #1d2b35;
}

body.night .option-big {
    background: rgba(255,255,255,0.08);
    color: #e6f7ff;
    border-color: rgba(120,190,255,0.22);
}

body.night .option-big.green,
body.night .option-big.orange,
body.night .option-big.blue,
body.night .option-big.red {
    color: #1d2b35;
}

body.night .option-big.green {
    background: #b6f2c2;
    border-color: #89d39c;
}

body.night .option-big.orange {
    background: #ffd8a8;
    border-color: #e8b87e;
}

body.night .option-big.blue {
    background: #cfe4ff;
    border-color: #a8c9f5;
}

body.night .option-big.red {
    background: #ffc1c1;
    border-color: #eaa2a2;
}

/* Couple under umbrella decoration on Home page */
.umbrella-decoration {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 280px;
    height: 300px;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.umbrella-decoration img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: left bottom;
}

/* Mobile adjustments for umbrella */
@media (max-width: 480px) {
    .umbrella-decoration {
        width: 200px;
        height: 220px;
    }
}

@media (max-width: 360px) {
    .umbrella-decoration {
        width: 160px;
        height: 180px;
    }
}


body {
    margin: 0;
    font-family: "Segoe UI", sans-serif;
    background: linear-gradient(135deg, #fff5f7 0%, #ffe4ec 100%);
    min-height: 100vh;
}

.top-header {
    background: linear-gradient(135deg, #ff5f9e, #ff8fb1);
    color: white;
    padding: 0;
    font-size: 24px;
    font-weight: bold;
    box-shadow: 0 5px 20px rgba(255, 95, 158, 0.3);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.header-title {
    font-size: 28px;
    font-weight: bold;
    color: white;
}

.header-nav {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.nav-tab {
    color: white;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
    border: 2px solid transparent;
}

.nav-tab:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    border-color: white;
}

.together {
    background: linear-gradient(135deg, rgba(255, 95, 158, 0.1), rgba(255, 143, 177, 0.1));
    padding: 60px 30px;
    text-align: center;
    border-bottom: 2px solid #ff5f9e;
}

.together h1 {
    font-size: 42px;
    color: #ff5f9e;
    margin: 10px 0;
    font-weight: bold;
}

.together h2 {
    font-size: 22px;
    color: #666;
    margin: 10px 0;
}

#togetherTimer {
    font-size: 28px;
    font-weight: bold;
    color: #ff5f9e;
    margin-top: 20px;
    letter-spacing: 1px;
}

.center-area {
    display: flex;
    justify-content: center;
    padding: 50px 30px;
    min-height: calc(100vh - 200px);
}

.home-center {
    position: relative;
    justify-content: center;
    align-items: center;
    gap: 0;
}

.home-card-stack {
    width: 95%;
    max-width: 900px;
    margin: 0 auto;
}

.home-card-stack .card {
    width: 100%;
    max-width: none;
}

.hands-inline {
    position: absolute;
    right: clamp(18px, 4vw, 72px);
    top: 50%;
    transform: translateY(-50%);
    width: clamp(220px, 23vw, 350px);
    opacity: 0.3;
    pointer-events: none;
    user-select: none;
    z-index: 2;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.25));
}

.hands-inline img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

body.night .hands-inline {
    opacity: 0.3;
}

@media (max-width: 1180px) {
    .home-center {
        flex-direction: column;
        gap: 12px;
    }

    .home-card-stack {
        width: 100%;
        max-width: 900px;
    }

    .hands-inline {
        position: static;
        transform: none;
        width: min(46vw, 320px);
        opacity: 0.3;
        margin-top: 4px;
    }
}

@media (max-width: 480px) {
    .hands-inline {
        width: min(64vw, 230px);
    }
}

@media (max-width: 360px) {
    .hands-inline {
        width: min(66vw, 190px);
    }
}

.card, .quiz-big {
    background: white;
    padding: 50px 45px;
    border-radius: 25px;
    width: 95%;
    max-width: 900px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    text-align: center;
    animation: slideIn 0.5s ease-out;
}

/* Quiz fishing overlay */
.fishing-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}

.fishing-boy {
    position: absolute;
    top: 72px;
    left: clamp(120px, 14vw, 260px);
    transform: translateX(-50%);
    font-size: clamp(28px, 2.4vw, 40px);
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.18));
}

.fishing-line-wrap {
    position: absolute;
    top: 108px;
    left: clamp(90px, 12vw, 220px);
    height: calc(100vh - 190px);
    width: 100px;
}

.fishing-line {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, #ffc2d6, #ff5f9e);
    border-radius: 999px;
}

.fishing-hook {
    position: absolute;
    left: 50%;
    top: -10px;
    transform: translateX(-50%);
    font-size: 20px;
}

.fishing-girl {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    font-size: clamp(26px, 2.2vw, 36px);
    transition: bottom 0.7s ease;
    filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.16));
}

.fishing-progress {
    position: absolute;
    left: calc(50% + 20px);
    bottom: 0;
    background: rgba(255, 255, 255, 0.88);
    color: #ff5f9e;
    font-weight: 700;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 95, 158, 0.3);
    transition: bottom 0.7s ease;
    white-space: nowrap;
}

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

.quiz-top {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    margin-bottom: 30px;
    font-size: 18px;
    color: #ff5f9e;
}

#score, #photoScore {
    background: linear-gradient(135deg, rgba(255, 95, 158, 0.1), rgba(255, 143, 177, 0.1));
    padding: 12px 25px;
    border-radius: 12px;
}

#timer, #photoTimer {
    background: linear-gradient(135deg, #ff5f9e, #ff8fb1);
    color: white;
    padding: 12px 25px;
    border-radius: 12px;
    font-size: 18px;
}

#question, #photoQuestion {
    font-size: 26px;
    color: #ff5f9e;
    margin: 20px 0 30px 0;
    font-weight: bold;
    line-height: 1.4;
}

.options-big {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 25px;
    margin-top: 40px;
}

.option-big {
    padding: 30px;
    background: white;
    border-radius: 18px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.25s;
    border: 2px solid transparent;
    font-weight: 500;
}

.option-big:hover {
    transform: scale(1.04);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.green { background: #b6f2c2; }
.orange { background: #ffd8a8; }
.blue { background: #cfe4ff; }
.red { background: #ffc1c1; }

.final-score {
    font-size: 120px;
    font-weight: bold;
    margin-top: 30px;
    color: #ff5f9e;
    text-shadow: 0 5px 15px rgba(255, 95, 158, 0.2);
}

.score-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.score-percentage {
    font-size: 64px;
    font-weight: bold;
    color: #ff8fb1;
    min-width: 150px;
}

.result-message {
    font-size: 24px;
    color: #666;
    margin: 25px 0 35px 0;
    font-weight: 500;
}

.password-section {
    background: linear-gradient(135deg, rgba(255, 95, 158, 0.08), rgba(255, 143, 177, 0.08));
    padding: 35px;
    border-radius: 20px;
    margin: 30px 0;
    border: 2px solid rgba(255, 95, 158, 0.2);
}

.password-section h3 {
    font-size: 28px;
    color: #ff5f9e;
    margin: 0 0 15px 0;
    font-weight: bold;
}

.password-section p {
    font-size: 16px;
    color: #666;
    margin: 10px 0;
}

.password-display {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    align-items: center;
    flex-wrap: wrap;
}

#passwordField {
    flex: 1;
    min-width: 250px;
    padding: 16px 20px;
    font-size: 18px;
    border: 2px solid #ff5f9e;
    border-radius: 12px;
    background: white;
    color: #ff5f9e;
    font-weight: bold;
    letter-spacing: 1px;
    font-family: monospace;
}

.copy-btn {
    padding: 14px 28px;
    background: linear-gradient(135deg, #ff5f9e, #ff8fb1);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
    white-space: nowrap;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 95, 158, 0.4);
}

.password-hint {
    font-size: 14px;
    color: #999;
    margin: 15px 0 0 0;
    font-style: italic;
}

.result-actions {
    display: flex;
    gap: 20px;
    margin-top: 35px;
    justify-content: center;
    flex-wrap: wrap;
}

.result-actions button {
    flex: 1;
    min-width: 160px;
    padding: 18px 35px;
    font-size: 18px;
}

.timeline-link {
    display: inline-block;
    padding: 18px 35px;
    background: linear-gradient(135deg, #ff5f9e, #ff8fb1);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(255, 95, 158, 0.3);
}

.timeline-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 95, 158, 0.4);
}

#resultBox {
    max-width: 900px;
}

#resultBox h1 {
    font-size: 42px;
    color: #ff5f9e;
    margin: 0 0 30px 0;
}

button {
    padding: 16px 32px;
    background: linear-gradient(135deg, #ff5f9e, #ff8fb1);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 95, 158, 0.3);
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 95, 158, 0.4);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.checkbox {
    display: block;
    margin: 25px 0;
    font-size: 16px;
}

.checkbox input {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #ff5f9e;
}

.hidden {
    display: none;
}

/* HOME PAGE STYLES */
#startBox {
    max-width: 600px;
}

#startBox h2 {
    font-size: 36px;
    color: #ff5f9e;
    margin: 0 0 20px 0;
    font-weight: bold;
}

#startBox p {
    font-size: 18px;
    color: #666;
    margin: 15px 0;
}

#startBox button {
    padding: 20px 60px;
    font-size: 20px;
    margin-top: 25px;
    width: 100%;
}

/* VERIFICATION SECTION */
#verifyBox {
    max-width: 650px;
}

#verifyBox .card-header {
    display: flex;
    justify-content: center;
    margin-bottom: 35px;
}

#verifyTimer {
    font-size: 48px;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #ff5f9e, #ff8fb1);
    padding: 25px 50px;
    border-radius: 18px;
    display: inline-block;
    box-shadow: 0 10px 30px rgba(255, 95, 158, 0.3);
}

#verifyBox h3 {
    font-size: 32px;
    color: #ff5f9e;
    margin: 25px 0;
    font-weight: bold;
}

#verifyBox > p {
    font-size: 18px;
    color: #666;
    margin: 18px 0;
    line-height: 1.6;
}

#verifyBox b {
    color: #ff5f9e;
}

#answer {
    width: 100%;
    padding: 18px 20px;
    font-size: 18px;
    border: 2px solid #ff5f9e;
    border-radius: 15px;
    margin: 25px 0;
    transition: all 0.3s;
    background: white;
}

#answer:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(255, 95, 158, 0.15);
    border-color: #ff8fb1;
    background: #fff5f7;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin: 25px 0;
    gap: 0;
}

.password-input-wrapper input,
.puzzle-password-input {
    flex: 1;
    min-width: 200px;
    padding: 18px 50px 18px 20px;
    font-size: 18px;
    border: 2px solid #ff5f9e;
    border-radius: 15px;
    transition: all 0.3s;
    background: white;
    color: #333;
    z-index: 1;
    pointer-events: auto;
}

.password-input-wrapper input:focus,
.puzzle-password-input:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(255, 95, 158, 0.15);
    border-color: #ff8fb1;
    background: #fff5f7;
}

.password-toggle {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    opacity: 0.7;
    transition: all 0.3s;
    z-index: 2;
    pointer-events: auto;
    opacity: 0.7;
    transition: all 0.3s;
}

.password-toggle:hover {
    opacity: 1;
    transform: scale(1.1);
}

#verifyBox button {
    margin: 12px 8px;
    min-width: 140px;
}

.outline {
    background: white;
    color: #ff5f9e;
    border: 2px solid #ff5f9e;
    box-shadow: none;
}

.outline:hover {
    background: #fff5f7;
    box-shadow: 0 5px 15px rgba(255, 95, 158, 0.2);
}

#hintText {
    font-size: 28px;
    color: #ff5f9e;
    margin-top: 25px;
    font-weight: bold;
    background: linear-gradient(135deg, rgba(255, 95, 158, 0.1), rgba(255, 143, 177, 0.1));
    padding: 20px;
    border-radius: 15px;
}

/* SUCCESS SECTION */
#successBox {
    max-width: 700px;
}

#successBox h2 {
    font-size: 36px;
    color: #ff5f9e;
    margin-bottom: 40px;
}

.nav-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

.nav-buttons a,
.nav-buttons button {
    flex: 1;
    min-width: 150px;
    padding: 18px 30px;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    text-align: center;
    border-radius: 15px;
    transition: all 0.3s;
}

.nav-buttons a {
    background: linear-gradient(135deg, #ff5f9e, #ff8fb1);
    color: white;
    display: inline-block;
    border: none;
    box-shadow: 0 5px 15px rgba(255, 95, 158, 0.3);
}

.nav-buttons a:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 95, 158, 0.4);
}

.nav-buttons button:disabled {
    background: #e0e0e0;
    color: #999;
    box-shadow: none;
    cursor: not-allowed;
}

/* FOOTER */
footer {
    text-align: center;
    padding: 30px;
    color: #ff5f9e;
    font-size: 16px;
    font-weight: bold;
}

/* RULES PAGE STYLES */
#rulesBox {
    max-width: 950px;
}

#rulesBox h2 {
    font-size: 38px;
    color: #ff5f9e;
    margin: 0 0 40px 0;
    font-weight: bold;
}

.rules {
    list-style: none;
    padding: 0;
    margin: 0 0 40px 0;
}

.rules li {
    background: linear-gradient(135deg, rgba(255, 95, 158, 0.05), rgba(255, 143, 177, 0.05));
    padding: 20px 25px;
    margin: 15px 0;
    border-radius: 15px;
    font-size: 18px;
    color: #333;
    border-left: 5px solid #ff5f9e;
    transition: all 0.3s;
    text-align: left;
}

.rules li:hover {
    background: linear-gradient(135deg, rgba(255, 95, 158, 0.1), rgba(255, 143, 177, 0.1));
    transform: translateX(10px);
    box-shadow: 0 5px 15px rgba(255, 95, 158, 0.2);
}

.rules li:before {
    content: "✓";
    color: #ff5f9e;
    font-weight: bold;
    margin-right: 15px;
    font-size: 20px;
}

/* SCORING SYSTEM */
.scoring-section {
    background: linear-gradient(135deg, rgba(255, 95, 158, 0.08), rgba(255, 143, 177, 0.08));
    padding: 35px;
    border-radius: 20px;
    margin: 30px 0 40px 0;
    border: 2px solid rgba(255, 95, 158, 0.2);
}

.scoring-section h3 {
    font-size: 24px;
    color: #ff5f9e;
    margin: 0 0 25px 0;
    font-weight: bold;
}

.scoring-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.score-item {
    padding: 25px 20px;
    border-radius: 15px;
    text-align: center;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.score-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.score-item .points {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 8px;
}

.score-item .label {
    font-size: 16px;
    opacity: 0.9;
}

#rulesBox #startQuiz {
    padding: 20px 50px;
    font-size: 18px;
    margin-top: 30px;
}

#rulesBox #startQuiz:disabled {
    opacity: 0.5;
}
#photoTransitionBox {
    text-align: center;
    max-width: 700px;
}

#photoTransitionBox h2 {
    font-size: 42px;
    color: #ff5f9e;
    margin: 0 0 20px 0;
    font-weight: bold;
}

#photoTransitionBox p {
    font-size: 20px;
    color: #666;
    margin-bottom: 35px;
    line-height: 1.5;
}

.photo-start-btn {
    padding: 22px 60px;
    background: linear-gradient(135deg, #ff5f9e, #ff8fb1);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 22px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(255, 95, 158, 0.3);
    width: 100%;
}

.photo-start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(255, 95, 158, 0.4);
}

/* PHOTO QUIZ LAYOUT */
#photoQuizBox {
    max-width: 1000px;
}

.photo-quiz-container {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    margin: 30px 0 40px 0;
    justify-content: center;
    flex-wrap: wrap;
}

.photo-section {
    flex: 1;
    min-width: 320px;
    max-width: 550px;
}

.quiz-photo {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    object-fit: cover;
    max-height: 450px;
    border: 3px solid white;
    display: block;
}

/* TIMELINE PAGE STYLES */
#passwordVerifyBox {
    max-width: 600px;
}

#passwordVerifyBox h2 {
    font-size: 36px;
    color: #ff5f9e;
    margin: 0 0 15px 0;
    font-weight: bold;
}

#passwordVerifyBox p {
    font-size: 18px;
    color: #666;
    margin: 10px 0 30px 0;
}

.password-input-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 25px 0;
}

.timeline-password-input {
    padding: 18px 20px;
    font-size: 18px;
    border: 2px solid #ff5f9e;
    border-radius: 15px;
    background: white;
    color: #333;
    transition: all 0.3s;
    font-family: monospace;
}

.timeline-password-input:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(255, 95, 158, 0.15);
    border-color: #ff8fb1;
    background: #fff5f7;
}

#passwordVerifyBox button {
    padding: 16px 32px;
    font-size: 18px;
    width: 100%;
}

.password-error {
    color: #e74c3c;
    font-size: 16px;
    margin-top: 15px;
    display: none;
    font-weight: bold;
}

/* Baby name generator styles */
.gender-buttons {
    display: flex;
    gap: 12px;
    margin: 18px 0;
}
.gen-btn {
    background: linear-gradient(135deg,#ff8fb1,#ff5f9e);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
}
.name-area {
    margin-top: 18px;
}
.thinking {
    font-size: 20px;
    color: #ff5f9e;
    font-weight: bold;
    margin-bottom: 12px;
}
.name-display {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #333;
    background: white;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}
.name-display.circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    padding: 12px;
    font-size: 16px;
    text-align: center;
    align-items: center;
    justify-content: center;
    word-break: break-word;
}

.name-display.large {
    max-width: 460px;
    width: 100%;
    height: auto;
    border-radius: 12px;
    font-size: 18px;
}

.name-index {
    margin-top: 8px;
    color: #ff5f9e;
    font-weight: bold;
}
.name-controls { margin-top: 12px; }
.next-btn { padding: 10px 18px; border-radius: 8px; background:#ff5f9e; color:white; border:none; cursor:pointer; }

/* TIMELINE SECTION */
.timeline-section {
    width: 100%;
    max-width: 1200px;
}

.timeline-header {
    text-align: center;
    margin-bottom: 40px;
}

.timeline-header h2 {
    font-size: 42px;
    color: #ff5f9e;
    margin: 0 0 15px 0;
    font-weight: bold;
}

.timeline-header p {
    font-size: 18px;
    color: #666;
    margin: 10px 0;
}

.scroll-hint {
    font-size: 14px;
    color: #ff5f9e;
    margin-top: 15px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

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

/* HORIZONTAL SCROLLING TIMELINE */
.timeline-wrapper {
    background: linear-gradient(135deg, rgba(255, 95, 158, 0.05), rgba(255, 143, 177, 0.05));
    padding: 40px 20px;
    border-radius: 25px;
    overflow: hidden;
    margin: 30px 0;
    box-shadow: inset 0 5px 15px rgba(0, 0, 0, 0.05);
}

.timeline-container {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 20px;
    cursor: grab;
    user-select: none;
}

.timeline-container::-webkit-scrollbar {
    height: 8px;
}

.timeline-container::-webkit-scrollbar-track {
    background: rgba(255, 95, 158, 0.1);
    border-radius: 10px;
}

.timeline-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ff5f9e, #ff8fb1);
    border-radius: 10px;
}

.timeline-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ff8fb1, #ffb3c1);
}

.timeline-item {
    flex-shrink: 0;
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

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

.timeline-card {
    background: white;
    padding: 35px 30px;
    border-radius: 20px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.1);
    min-width: 320px;
    max-width: 350px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.timeline-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 50px rgba(255, 95, 158, 0.2);
    border-color: #ff5f9e;
}

.timeline-emoji {
    font-size: 56px;
    margin-bottom: 20px;
    display: inline-block;
    animation: bounce 2s infinite;
}

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

.timeline-emoji:hover {
    animation: none;
}

.timeline-card:hover .timeline-emoji {
    animation: rotateScale 0.6s ease-out;
}

@keyframes rotateScale {
    from { transform: scale(1) rotate(0deg); }
    to { transform: scale(1.2) rotate(360deg); }
}

.timeline-date {
    font-size: 14px;
    color: #ff5f9e;
    font-weight: bold;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.timeline-title {
    font-size: 24px;
    color: #ff5f9e;
    margin: 15px 0;
    font-weight: bold;
}

.timeline-description {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    margin: 15px 0 0 0;
}

/* TIMELINE FOOTER */
.timeline-footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 16px 32px;
    background: linear-gradient(135deg, #ff5f9e, #ff8fb1);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 95, 158, 0.3);
}

.nav-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 95, 158, 0.4);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .timeline-card {
        min-width: 290px;
        max-width: 320px;
        padding: 25px 20px;
    }
    
    .timeline-emoji {
        font-size: 48px;
    }
    
    .timeline-title {
        font-size: 20px;
    }
    
    .timeline-header h2 {
        font-size: 32px;
    }
}

/* PICTURE PLAY PAGE STYLES */
.puzzle-password-input {
    width: 100%;
    padding: 18px 20px;
    font-size: 18px;
    border: 2px solid #ff5f9e;
    border-radius: 15px;
    background: white;
    color: #333;
    transition: all 0.3s;
    margin: 15px 0;
}

.puzzle-password-input:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(255, 95, 158, 0.15);
    border-color: #ff8fb1;
    background: #fff5f7;
}

.password-input-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}
.puzzle-password-input {
    flex: 1;
    min-width: 250px;
    padding: 16px 20px;
    font-size: 18px;
    border: 2px solid #ff5f9e;
    border-radius: 12px;
    background: white;
    color: #333;
    transition: all 0.3s;
}

.puzzle-password-input:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(255, 95, 158, 0.15);
    border-color: #ff8fb1;
    background: #fff5f7;
}

/* DIFFICULTY GRID */
.difficulty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    margin: 40px 0;
}

.difficulty-card {
    background: white;
    padding: 40px 25px;
    border-radius: 18px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 3px solid transparent;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.difficulty-card:hover {
    transform: translateY(-10px);
    border-color: #ff5f9e;
    box-shadow: 0 20px 50px rgba(255, 95, 158, 0.2);
}

.difficulty-emoji {
    font-size: 56px;
    margin-bottom: 15px;
    display: inline-block;
    animation: bounce 2s infinite;
}

.difficulty-card:hover .difficulty-emoji {
    animation: none;
    transform: scale(1.2) rotate(10deg);
}

.difficulty-card h3 {
    font-size: 28px;
    color: #ff5f9e;
    margin: 15px 0;
    font-weight: bold;
}

.difficulty-card p {
    font-size: 18px;
    color: #666;
    margin: 10px 0;
    font-weight: 500;
}

.difficulty-time {
    font-size: 14px;
    color: #999;
    display: block;
    margin-top: 15px;
}

/* PUZZLE SECTION */
.puzzle-section {
    width: 100%;
    max-width: 1400px;
}

.puzzle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
    background: linear-gradient(135deg, rgba(255, 95, 158, 0.1), rgba(255, 143, 177, 0.1));
    padding: 25px;
    border-radius: 15px;
}

.puzzle-info {
    display: flex;
    gap: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.puzzle-title {
    font-size: 24px;
    color: #ff5f9e;
    font-weight: bold;
}

.puzzle-pieces {
    font-size: 18px;
    color: #ff8fb1;
    font-weight: bold;
    background: white;
    padding: 10px 20px;
    border-radius: 10px;
}

.change-difficulty-btn {
    padding: 12px 25px;
    background: linear-gradient(135deg, #ff5f9e, #ff8fb1);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
}

.change-difficulty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 95, 158, 0.4);
}

/* PUZZLE CONTAINER */
.puzzle-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 30px 0;
    align-items: start;
}

.puzzle-preview {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.puzzle-preview img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 10px;
}

.puzzle-canvas-wrapper {
    position: relative;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: visible;
    min-height: 450px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

#puzzleCanvas {
    display: block;
    width: auto;
    height: 400px;
    border: 2px dashed #ff8fb1;
    border-radius: 15px;
    cursor: crosshair;
    background: white;
    max-width: 600px;
}

.puzzle-pieces-area {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-height: 150px;
    overflow-y: auto;
    background: linear-gradient(135deg, rgba(255, 95, 158, 0.05), rgba(255, 143, 177, 0.05));
    padding: 15px;
    border-radius: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    border: 2px dashed #ff5f9e;
}

.puzzle-piece {
    position: static;
    border: 2px solid #ff5f9e;
    border-radius: 8px;
    cursor: grab;
    background-repeat: no-repeat;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
    min-width: 55px;
    min-height: 55px;
    user-select: none;
}

.puzzle-piece[style*="position: absolute"] {
    position: absolute !important;
}

.puzzle-piece:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 95, 158, 0.3);
}

.puzzle-piece:active {
    cursor: grabbing;
}

/* PUZZLE FOOTER */
.puzzle-footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.puzzle-footer button {
    padding: 16px 35px;
    background: linear-gradient(135deg, #ff5f9e, #ff8fb1);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
}

.puzzle-footer button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 95, 158, 0.4);
}

/* COMING SOON STYLE */
.coming-soon {
    text-align: center;
    padding: 60px 40px;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .puzzle-container {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-nav {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .header-title {
        font-size: 20px;
    }
    
    .nav-tab {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .difficulty-grid {
        grid-template-columns: 1fr;
    }
    
    .puzzle-pieces-area {
        height: 100px;
    }
    
    .puzzle-footer {
        flex-direction: column;
    }
    
    .puzzle-footer button {
        width: 100%;
    }
}
