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

html {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #ffd1dc 0%, #ffb6c1 50%, #ffc0cb 100%);
    background-attachment: fixed;
    height: 100%;
    margin: 0;
    padding: 0;
    padding-top: 70px;
    position: relative;
    overflow: hidden;
    transition: background 0.5s ease;
}

/* ===== GARDEN THEME ===== */
body.theme-garden {
    background-image: url('./images/Garden desktop.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

@media (max-width: 768px) {
    body.theme-garden {
        background-image: url('./images/Garden mobile.png');
    }
}

/* ===== FOREST THEME ===== */
body.theme-forest {
    background-image: url('./images/forestdesktop.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

@media (max-width: 768px) {
    body.theme-forest {
        background-image: url('./images/Forest mobie.png');
    }
}

@keyframes forestWalk {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===== SNOWY THEME ===== */
body.theme-snowy {
    background-image: url('./images/Snow desktop.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

@media (max-width: 768px) {
    body.theme-snowy {
        background-image: url('./images/Snow mobile.png');
    }
}

@keyframes snowfall-theme {
    0% { transform: translateY(-50px); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(100vh); opacity: 0; }
}

/* ===== BEACH THEME ===== */
body.theme-beach {
    background-image: url('./images/beachdesktop.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

@media (max-width: 768px) {
    body.theme-beach {
        background-image: url('./images/Beach mobile.png');
    }
}

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

/* ===== STARRY NIGHT THEME ===== */
body.theme-starry {
    background-image: url('./images/Starry desktop.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

@media (max-width: 768px) {
    body.theme-starry {
        background-image: url('./images/starry mobile.png');
    }
}

@keyframes twinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

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

@keyframes sway {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}

/* ===== DREAMYLAND THEME ===== */
body.theme-dreamyland {
    background-image: url('./images/dreamydesktop.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

@media (max-width: 768px) {
    body.theme-dreamyland {
        background-image: url('./images/dreamymobile.png');
    }
}

@keyframes sparkle {
    0%, 100% { background-position: 0% 0%; opacity: 0.6; }
    50% { background-position: 100% 100%; opacity: 0.8; }
}

@keyframes dreamfall {
    0% { transform: translateY(-50px) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

/* Global Header */
.global-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 182, 193, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 60px;
    z-index: 1001;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.logo-diamond {
    font-size: 1.8rem;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
}

.logo-text {
    color: #ffffff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
    font-weight: 700;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a,
.nav-links a:visited,
.nav-links a:link,
.nav-links a:active {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
}

.nav-links a:hover {
    color: #ffffff;
}

/* Screens */
.screen {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    height: calc(100% - 70px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Login Screen */
.login-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    padding: 40px;
    max-width: 450px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.login-title {
    font-size: 2.5rem;
    color: #ff69b4;
    margin-bottom: 10px;
}

.login-subtitle {
    color: #666;
    margin-bottom: 30px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-input {
    padding: 15px;
    border: 2px solid #ff69b4;
    border-radius: 15px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

.form-input:focus {
    border-color: #ff1493;
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.3);
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.full-width {
    width: 100%;
}

/* Start Screen */
.start-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 30px;
    padding: 40px;
    max-width: 700px;
    width: 100%;
    text-align: center;
}

.welcome-header {
    display: flex;
    justify-content: space-between;
    padding-bottom: 15px;
    border-bottom: 2px solid #ff69b4;
}

.welcome-header h2 {
    color: #ff69b4;
    font-size: 1.3rem;
}

.logout-btn {
    padding: 8px 20px;
    background: white;
    border: 2px solid #ff69b4;
    border-radius: 20px;
    color: #ff69b4;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: #ff69b4;
    color: white;
}

/* Theme Selection */
.theme-selection {
    margin: 25px 0;
    padding: 20px;
    background: rgba(255, 182, 193, 0.1);
    border-radius: 20px;
}

.theme-selection h3 {
    color: #ff69b4;
    margin-bottom: 15px;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
}

.theme-btn {
    padding: 15px 10px;
    border: 3px solid #ddd;
    border-radius: 15px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.theme-btn:hover {
    transform: scale(1.05);
    border-color: #ff69b4;
}

.theme-btn.active {
    border-color: #ff69b4;
    background: #ffe4e1;
    box-shadow: 0 5px 15px rgba(255, 105, 180, 0.3);
}

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

.theme-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
}

/* Kawaii Rabbit Logo */
.rabbit-logo {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

.logo-rabbit,
.rabbit .logo-rabbit {
    position: relative;
    width: 100px;
    height: 100px;
    animation: hop 1.5s infinite ease-in-out;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.logo-rabbit::before,
.rabbit .logo-rabbit::before {
    content: '☁️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 70px;
    line-height: 1;
}

/* Try to load image if available, otherwise emoji shows */
.logo-rabbit::after,
.rabbit .logo-rabbit::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('./cinnamoroll.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1;
}

@keyframes hop {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-15px) scale(1.1); }
}

/* Hide all the CSS-drawn elements */
.ear,
.face,
.eye,
.pupil,
.nose,
.mouth,
.cheek {
    display: none !important;
}

.game-title {
    font-size: 2.5rem;
    color: #ff69b4;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.game-desc {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
}

.level-selection {
    margin: 30px 0;
}

.level-selection h3 {
    color: #ff69b4;
    margin-bottom: 20px;
}

.level-btn {
    display: block;
    width: 100%;
    padding: 20px;
    margin: 15px 0;
    border: 3px solid;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.2rem;
    font-weight: 600;
}

.level-btn .emoji {
    font-size: 2rem;
    display: block;
    margin-bottom: 5px;
}

.level-btn small {
    display: block;
    font-size: 0.9rem;
    font-weight: normal;
    margin-top: 5px;
}

.level-btn.easy {
    border-color: #98d8c8;
    color: #98d8c8;
}

.level-btn.easy:hover {
    background: #98d8c8;
    color: white;
    transform: scale(1.05);
}

.level-btn.medium {
    border-color: #ffd93d;
    color: #f4a261;
}

.level-btn.medium:hover {
    background: #ffd93d;
    color: white;
    transform: scale(1.05);
}

.level-btn.hard {
    border-color: #ff6b9d;
    color: #ff6b9d;
}

.level-btn.hard:hover {
    background: #ff6b9d;
    color: white;
    transform: scale(1.05);
}

.high-scores {
    margin-top: 30px;
    padding: 20px;
    background: rgba(255, 182, 193, 0.2);
    border-radius: 15px;
}

.high-scores h4 {
    color: #ff69b4;
    margin-bottom: 15px;
}

.score-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-weight: 500;
    color: #666;
}

/* Game Screen */
#gameScreen {
    padding: 0;
}

.game-stats {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.stat-box {
    text-align: center;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ff69b4;
}

.game-area {
    position: absolute;
    top: 160px;
    left: 0;
    right: 0;
    bottom: 80px;
    overflow: hidden;
}

/* Clickable Rabbit */
.rabbit {
    position: absolute;
    cursor: pointer;
    transition: transform 0.1s;
    animation: rabbitAppear 0.3s ease-out;
}

@keyframes rabbitAppear {
    from {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    to {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.rabbit:hover {
    transform: scale(1.1);
}

.rabbit:active {
    transform: scale(0.9);
}

.rabbit-caught {
    animation: caught 0.5s ease-out forwards;
}

@keyframes caught {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.3) rotate(180deg);
    }
    100% {
        transform: scale(0) rotate(360deg);
        opacity: 0;
    }
}

.quit-btn {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 30px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #ff69b4;
    border-radius: 25px;
    color: #ff69b4;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 100;
}

.quit-btn:hover {
    background: #ff69b4;
    color: white;
}

/* Game Over Screen */
.gameover-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.gameover-title {
    font-size: 2.5rem;
    color: #ff69b4;
    margin-bottom: 30px;
}

.final-score {
    margin: 30px 0;
}

.score-label {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 10px;
}

.score-big {
    font-size: 4rem;
    font-weight: 700;
    color: #ff69b4;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.stat-item {
    padding: 20px;
    background: rgba(255, 182, 193, 0.2);
    border-radius: 15px;
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.stat-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ff69b4;
    margin-bottom: 5px;
}

.stat-text {
    font-size: 0.9rem;
    color: #666;
}

.new-record {
    padding: 15px;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    border-radius: 15px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #ff69b4;
    margin: 20px 0;
    animation: pulse 1s infinite;
}

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

.gameover-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 105, 180, 0.4);
}

.btn-secondary {
    background: white;
    color: #ff69b4;
    border: 2px solid #ff69b4;
}

.btn-secondary:hover {
    background: #ff69b4;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .global-header {
        padding: 12px 20px;
        gap: 30px;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .nav-links {
        gap: 15px;
    }
    
    .nav-links a {
        font-size: 0.9rem;
    }
    
    .start-container,
    .gameover-container {
        padding: 25px;
        margin: 10px;
    }
    
    .game-title {
        font-size: 2rem;
    }
    
    .game-stats {
        gap: 10px;
        padding: 10px;
    }
    
    .stat-value {
        font-size: 1.4rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .gameover-buttons {
        flex-direction: column;
    }
}
