/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    color: #333;
}

.hidden {
    display: none !important;
}

/* Password Lock Screen */
.lock-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    padding: 20px;
}

.lock-container {
    text-align: center;
    color: white;
}

.lock-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: pulse 2s ease infinite;
}

.lock-container h2 {
    font-family: 'Dancing Script', cursive;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.lock-container > p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
}

.lock-input-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

#lock-input {
    padding: 14px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.1rem;
    text-align: center;
    width: 180px;
    outline: none;
    transition: border-color 0.3s ease;
}

#lock-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#lock-input:focus {
    border-color: #f093fb;
}

#lock-btn {
    padding: 14px 25px;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#lock-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(245, 87, 108, 0.4);
}

.lock-hint {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    font-style: italic;
}

.lock-error {
    color: #ff6b6b;
    margin-top: 15px;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Landing / Envelope */
.landing {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    position: relative;
}

.landing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('shinchan.png') center center / contain no-repeat;
    opacity: 0.15;
    pointer-events: none;
}

.envelope {
    width: 300px;
    height: 200px;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.envelope:hover {
    transform: scale(1.05);
}

.envelope-body {
    width: 100%;
    height: 100%;
    background: #f5e6d3;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.envelope-body p {
    font-size: 1.1rem;
    color: #764ba2;
    font-weight: 600;
    text-align: center;
    padding: 20px;
}

.envelope-flap {
    width: 0;
    height: 0;
    border-left: 150px solid transparent;
    border-right: 150px solid transparent;
    border-top: 100px solid #e8d5c0;
    position: absolute;
    top: 0;
    z-index: 2;
    transform-origin: top;
    transition: transform 0.5s ease;
}

.envelope:hover .envelope-flap {
    transform: rotateX(180deg);
}

/* Confetti Canvas */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 100px 20px 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.birthday-title {
    font-family: 'Dancing Script', cursive;
    font-size: 4rem;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    animation: fadeInDown 1s ease;
}

.name {
    font-family: 'Dancing Script', cursive;
    font-size: 2.5rem;
    color: #ffd700;
    margin-top: 15px;
    animation: fadeInUp 1s ease 0.3s both;
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 15px;
    animation: fadeInUp 1s ease 0.6s both;
}

/* Message Section */
.message-section {
    padding: 80px 20px;
    display: flex;
    justify-content: center;
    background: #fff5f5;
}

.message-card {
    max-width: 600px;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    animation: fadeIn 1s ease;
}

.message-card h3 {
    font-family: 'Dancing Script', cursive;
    font-size: 2rem;
    color: #764ba2;
    margin-bottom: 20px;
}

.message-card p {
    font-size: 1rem;
    line-height: 1.8;
    color: #555;
    margin-bottom: 15px;
}

.signature {
    display: block;
    font-family: 'Dancing Script', cursive;
    font-size: 1.3rem;
    color: #f5576c;
    margin-top: 20px;
}

/* Reasons Section */
.reasons-section {
    padding: 100px 20px;
    text-align: center;
    background: linear-gradient(160deg, #e8cfe8 0%, #f7d1e0 30%, #dab8f3 70%, #c9a8f0 100%);
    position: relative;
    overflow: hidden;
}

.reasons-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(255,255,255,0.1) 0%, transparent 40%);
    pointer-events: none;
}

.reasons-section h3 {
    font-family: 'Dancing Script', cursive;
    font-size: 2.8rem;
    color: #fff;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(118, 75, 162, 0.3);
    position: relative;
}

.reasons-subtitle {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 50px;
    font-size: 1rem;
    letter-spacing: 0.3px;
    position: relative;
}

.reasons-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 28px;
    max-width: 950px;
    margin: 0 auto;
    position: relative;
}

.reason-scratch-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    width: 260px;
    box-shadow: 0 8px 32px rgba(118, 75, 162, 0.15), 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease;
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.reason-scratch-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #a18cd1, #f093fb, #fbc2eb);
    border-radius: 20px 20px 0 0;
}

.reason-scratch-card:nth-child(1) { animation-delay: 0.1s; }
.reason-scratch-card:nth-child(2) { animation-delay: 0.2s; }
.reason-scratch-card:nth-child(3) { animation-delay: 0.3s; }
.reason-scratch-card:nth-child(4) { animation-delay: 0.4s; }
.reason-scratch-card:nth-child(5) { animation-delay: 0.5s; }

.reason-scratch-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 48px rgba(118, 75, 162, 0.25), 0 4px 12px rgba(0,0,0,0.08);
}

.reason-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #764ba2, #667eea);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.35);
}

.scratch-area {
    position: relative;
    width: 100%;
    height: 85px;
    border-radius: 10px;
    overflow: hidden;
}

.reason-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    border-radius: 10px;
    z-index: 2;
}

.reason-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    color: #555;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px 12px;
    line-height: 1.5;
    font-weight: 400;
    background: #faf5ff;
    border-radius: 10px;
    z-index: 1;
    margin: 0;
}

/* Quiz Section */
.quiz-section {
    padding: 80px 20px;
    text-align: center;
    background: linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%);
}

.quiz-section h3 {
    font-family: 'Dancing Script', cursive;
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 10px;
}

.quiz-subtitle {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
}

.quiz-container {
    max-width: 550px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.quiz-progress {
    margin-bottom: 25px;
}

#quiz-progress-text {
    font-size: 0.9rem;
    color: #888;
    display: block;
    margin-bottom: 8px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: width 0.4s ease;
    width: 20%;
}

.quiz-question {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 25px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-option {
    padding: 14px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.quiz-option:hover {
    border-color: #764ba2;
    background: #f8f0ff;
    transform: translateX(5px);
}

.quiz-option.correct {
    border-color: #4caf50;
    background: #e8f5e9;
    color: #2e7d32;
}

.quiz-option.wrong {
    border-color: #f44336;
    background: #ffebee;
    color: #c62828;
}

.quiz-result {
    text-align: center;
    padding: 20px;
}

.result-emoji {
    font-size: 4rem;
    margin-bottom: 15px;
}

#result-text {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 25px;
}

.btn-restart {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-restart:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(118, 75, 162, 0.4);
}

/* Cake Section */
.cake-section {
    padding: 80px 20px;
    text-align: center;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.cake-section h3 {
    font-family: 'Dancing Script', cursive;
    font-size: 2.5rem;
    color: #764ba2;
    margin-bottom: 10px;
}

.cake-section > p {
    color: #666;
    margin-bottom: 30px;
}

.cake {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
    position: relative;
}

.candles {
    display: flex;
    gap: 28px;
    margin-bottom: 0;
    position: relative;
    z-index: 5;
}

.candle {
    width: 8px;
    height: 40px;
    background: linear-gradient(to bottom, #fff3cd, #ffb347);
    border-radius: 3px 3px 2px 2px;
    position: relative;
    cursor: pointer;
    transition: opacity 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.flame {
    width: 12px;
    height: 18px;
    background: radial-gradient(ellipse at bottom, #ffeb3b, #ff5722, transparent);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    animation: flicker 0.3s ease-in-out infinite alternate;
    box-shadow: 0 0 8px rgba(255, 87, 34, 0.4);
}

.candle:not(.lit) .flame { display: none; }
.candle:not(.lit) { opacity: 0.4; }

/* Cake Structure - Two halves side by side */
.cake-split-wrapper {
    display: flex;
    gap: 0;
    overflow: hidden;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.cake-half {
    width: 130px;
    overflow: hidden;
    transition: transform 1.2s ease, border-radius 1.2s ease, box-shadow 1.2s ease;
}

.cake-left {
    border-radius: 14px 0 0 14px;
}

.cake-right {
    border-radius: 0 14px 14px 0;
}

.cake-top-layer {
    height: 25px;
    background: #fff8f0;
    border-bottom: 2px solid #f0e0d0;
}

.cake-frosting {
    height: 8px;
    background: linear-gradient(to bottom, #ff85a2, #ff5c8a);
}

.cake-layer {
    height: 35px;
}

.cream-layer {
    background: linear-gradient(to bottom, #fff8f0, #fff3e6);
}

.sponge-layer {
    background: linear-gradient(to bottom, #ffe8a8, #ffd96a);
}

.cake-base {
    height: 20px;
    background: linear-gradient(to bottom, #fff3e6, #ffe8cc);
    border-top: 2px solid #f0e0d0;
}

.cake-plate {
    width: 300px;
    height: 16px;
    background: linear-gradient(to bottom, #f5f5f5, #e0e0e0);
    border-radius: 50%;
    margin-top: 2px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* After split - left goes left, right goes right */
.cake.split .cake-split-wrapper {
    overflow: visible;
    box-shadow: none;
}

.cake.split .cake-left {
    transform: translateX(-15px);
    border-radius: 14px;
    box-shadow: -4px 4px 15px rgba(0, 0, 0, 0.1);
}

.cake.split .cake-right {
    transform: translateX(15px);
    border-radius: 14px;
    box-shadow: 4px 4px 15px rgba(0, 0, 0, 0.1);
}

.cake.split .candles {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    to { opacity: 0; }
}

.wish-message {
    font-size: 1.5rem;
    color: #764ba2;
    margin-top: 30px;
    animation: pulse 1s ease infinite;
}

/* Cut the Cake */
.btn-cut-cake {
    margin-top: 25px;
    padding: 15px 35px;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: pulse 1.5s ease infinite;
}

.btn-cut-cake:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 30px rgba(245, 87, 108, 0.5);
}

.cake-knife {
    font-size: 4.5rem;
    cursor: pointer;
    z-index: 10;
    margin-top: 15px;
    transition: transform 0.3s ease;
    animation: knifeHover 1.5s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.cake-knife:hover {
    transform: scale(1.15);
}

@keyframes knifeHover {
    0%, 100% { transform: translateY(0) rotate(-10deg); }
    50% { transform: translateY(-8px) rotate(-10deg); }
}

.cake-knife.cutting {
    animation: cuttingMotion 0.9s ease forwards;
}

@keyframes cuttingMotion {
    0% { transform: translateY(0) rotate(-10deg); }
    40% { transform: translateY(-30px) rotate(-45deg); }
    100% { transform: translateY(80px) rotate(0deg); opacity: 0; }
}

/* Cake split animation - vertical cut down the middle */
.cake.split .cake-body {
    position: relative;
    overflow: visible;
}

.cake.split .cake-top-layer,
.cake.split .top-frosting,
.cake.split .cream-layer {
    animation: slideHalfLeft 1.5s ease 0.3s forwards;
}

.cake.split .bottom-frosting,
.cake.split .sponge-layer,
.cake.split .cake-base {
    animation: slideHalfRight 1.5s ease 0.3s forwards;
}

.cake.split .candles {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes slideHalfLeft {
    0% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(-50px); opacity: 0.7; }
}

@keyframes slideHalfRight {
    0% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(50px); opacity: 0.7; }
}

@keyframes fadeOut {
    to { opacity: 0; }
}

/* Celebration & Popup Card */
.cake-celebration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 998;
}

/* Birthday Popup Card */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    animation: fadeIn 0.5s ease;
    padding: 20px;
}

.popup-card {
    background: white;
    border-radius: 30px;
    padding: 50px 40px;
    max-width: 450px;
    width: 100%;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    animation: popIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popIn {
    0% { transform: scale(0.3) rotate(-5deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.popup-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #f093fb, #f5576c, #ffd700, #667eea, #764ba2);
}

.popup-emojis {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.popup-emoji-float {
    position: absolute;
    font-size: 1.8rem;
    animation: emojiRise 3s ease forwards;
    opacity: 0;
}

@keyframes emojiRise {
    0% { transform: translateY(100px) scale(0); opacity: 0; }
    20% { opacity: 1; transform: translateY(50px) scale(1); }
    100% { transform: translateY(-200px) scale(0.5); opacity: 0; }
}

.popup-content {
    position: relative;
    z-index: 2;
}

.popup-title {
    font-family: 'Dancing Script', cursive;
    font-size: 2.8rem;
    background: linear-gradient(135deg, #764ba2, #f5576c, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    background-size: 200% 200%;
    animation: titleBounce 1s ease 0.5s both, gradientShift 3s ease infinite;
}

@keyframes titleBounce {
    0% { transform: translateY(20px); opacity: 0; }
    60% { transform: translateY(-5px); }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.popup-subtitle {
    font-size: 1rem;
    color: #666;
    margin-bottom: 15px;
    animation: fadeInUp 0.8s ease 0.8s both;
}

.popup-hearts {
    font-size: 1.5rem;
    margin: 15px 0;
    animation: fadeInUp 0.8s ease 1s both, pulse 2s ease 1.8s infinite;
}

.popup-message {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 25px;
    animation: fadeInUp 0.8s ease 1.2s both;
}

.popup-close {
    padding: 14px 35px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.8s ease 1.4s both;
    font-family: 'Poppins', sans-serif;
}

.popup-close:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(118, 75, 162, 0.4);
}

/* Balloons */
.balloons-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

.balloon {
    position: absolute;
    bottom: -100px;
    font-size: 3rem;
    animation: floatUp 4s ease forwards;
}

@keyframes floatUp {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    50% { opacity: 1; }
    100% { transform: translateY(-120vh) rotate(20deg); opacity: 0.7; }
}

/* Footer */
.footer {
    padding: 40px 20px;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.floating-hearts {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes flicker {
    0% { transform: translateX(-50%) scale(1) rotate(-2deg); }
    100% { transform: translateX(-50%) scale(1.1) rotate(2deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes float-up {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-200px) scale(0.5); }
}

.heart-float {
    position: absolute;
    font-size: 1.5rem;
    animation: float-up 3s ease forwards;
}

/* Responsive */
@media (max-width: 768px) {
    .birthday-title { font-size: 2.5rem; }
    .name { font-size: 1.8rem; }
    .reasons-container { flex-direction: column; align-items: center; }
    .envelope { width: 250px; height: 170px; }
    .envelope-flap {
        border-left: 125px solid transparent;
        border-right: 125px solid transparent;
        border-top: 85px solid #e8d5c0;
    }
}
