﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: none;
    background: linear-gradient(180deg, #87CEEB 0%, #E0F7FA 50%, #B2EBF2 100%);
    font-family: "Comic Sans MS", "Chalkboard SE", "Marker Felt", "Segoe Print", cursive, sans-serif;
}

#game-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #87CEEB 0%, #B2EBF2 40%, #C8E6C9 70%, #A5D6A7 100%);
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

#score {
    position: absolute;
    top: max(60px, env(safe-area-inset-top, 60px));
    left: 50%;
    transform: translateX(-50%);
    font-size: 72px;
    font-weight: bold;
    color: #FF6F00;
    text-shadow: 0 4px 0 #FFB300, 0 6px 12px rgba(0,0,0,0.15);
    z-index: 10;
    transition: transform 0.15s ease;
    pointer-events: none;
    font-family: "Comic Sans MS", cursive;
    letter-spacing: 2px;
}

#combo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 56px;
    font-weight: bold;
    color: #FF4081;
    text-shadow: 0 3px 0 #FF80AB, 0 6px 20px rgba(255,64,129,0.5);
    z-index: 20;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    font-family: "Comic Sans MS", cursive;
}

#combo.show {
    opacity: 1;
    animation: comboPop 0.5s ease;
}

.hidden {
    display: none !important;
}
#flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
    opacity: 0;
    background: transparent;
}

#flash.flash-white {
    animation: gentleFlash 0.6s ease-out forwards;
}

@keyframes gentleFlash {
    0% { opacity: 0; background: transparent; }
    15% { opacity: 0.08; background: radial-gradient(circle, rgba(255,255,200,0.4), transparent); }
    50% { opacity: 0.03; background: radial-gradient(circle, rgba(255,255,200,0.2), transparent); }
    100% { opacity: 0; background: transparent; }
}

/* =====================================
   Start Screen - Super Cute Cartoon
   ===================================== */
#start-screen{
  position:fixed;inset:0;z-index:100;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  background:linear-gradient(180deg,#87CEEB 0%,#E1F5FE 40%,#FFF9C4 70%,#FFE0B2 100%);
  overflow:hidden;
  transition:opacity 0.5s ease,transform 0.5s ease;
}
#start-screen.fade-out{opacity:0;transform:scale(1.1)}

/* Cloud decorations */
.cloud {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.7;
    animation: cloudFloat 6s ease-in-out infinite;
}
.cloud::before, .cloud::after {
    content: '';
    position: absolute;
    background: white;
    border-radius: 50%;
}
.cloud1 { width: 120px; height: 50px; top: 8%; left: 5%; animation-delay: 0s; }
.cloud1::before { width: 60px; height: 60px; top: -30px; left: 15px; }
.cloud1::after { width: 80px; height: 55px; top: -25px; left: 40px; }
.cloud2 { width: 100px; height: 40px; top: 12%; right: 8%; animation-delay: -2s; }
.cloud2::before { width: 50px; height: 50px; top: -25px; left: 10px; }
.cloud2::after { width: 65px; height: 45px; top: -20px; left: 30px; }
.cloud3 { width: 80px; height: 35px; top: 5%; left: 40%; animation-delay: -4s; }
.cloud3::before { width: 40px; height: 40px; top: -20px; left: 8px; }
.cloud3::after { width: 55px; height: 38px; top: -18px; left: 25px; }

@keyframes cloudFloat {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(20px); }
}

/* Grass at bottom of start */
.start-grass {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(180deg, #81C784, #4CAF50);
    border-radius: 50% 50% 0 0 / 40px 40px 0 0;
}

/* Start content */
.start-content{
  position:relative;z-index:10;
  display:flex;flex-direction:column;align-items:center;gap:6px;
  animation:contentFadeIn 0.8s ease-out;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  padding: 30px 40px;
  border-radius: 60px;
  border: 3px dashed rgba(255,255,255,0.5);
}
@keyframes contentFadeIn{
  0%{opacity:0;transform:translateY(30px)scale(0.9)}
  100%{opacity:1;transform:translateY(0)scale(1)}
}

.start-icon{font-size:90px;animation:superBounce 1.2s ease-in-out infinite;filter:drop-shadow(0 6px 16px rgba(255,215,0,0.5))}
@keyframes superBounce{
  0%,100%{transform:translateY(0) scale(1)}
  25%{transform:translateY(-12px) scale(1.05) rotate(-5deg)}
  50%{transform:translateY(-18px) scale(1.1)}
  75%{transform:translateY(-8px) scale(1.05) rotate(5deg)}
}

.start-title{
  font-size:52px;font-weight:900;color:#FF6F00;
  text-shadow:0 4px 0 #FFB300,0 6px 20px rgba(255,111,0,0.3);
  letter-spacing:0.05em;margin-top:2px;
  animation:titleWiggle 2s ease-in-out infinite;
  font-family:"Comic Sans MS",cursive;
}
@keyframes titleWiggle{
  0%,100%{transform:rotate(0deg)}
  25%{transform:rotate(-3deg)}
  75%{transform:rotate(3deg)}
}

.start-subtitle{
  font-size:20px;color:#FF80AB;
  letter-spacing:0.2em;margin-bottom:4px;
  font-weight:bold;
}

.start-btn{
  padding:18px 55px;border:none;border-radius:50px;
  background:linear-gradient(135deg,#FF6B8A,#FFB300);
  color:#fff;font-size:30px;font-weight:700;
  cursor:pointer;box-shadow:0 6px 0 #E65100,0 8px 20px rgba(255,107,138,0.4);
  animation:btnBounce 1.5s ease-in-out infinite;
  transition:transform 0.1s ease;
  -webkit-tap-highlight-color:transparent;
  font-family:"Comic Sans MS",cursive;
  border:3px solid rgba(255,255,255,0.3);
}
.start-btn:active{transform:scale(0.9) translateY(4px);box-shadow:0 2px 0 #E65100;}
@keyframes btnBounce{
  0%,100%{transform:translateY(0)}
  40%{transform:translateY(-6px)}
  60%{transform:translateY(-3px)}
}

.start-hint{
  font-size:16px;color:rgba(255,64,129,0.5);
  margin-top:6px;animation:fadeHint 2s ease-in-out infinite;
  font-weight:bold;
}
@keyframes fadeHint{
  0%,100%{opacity:0.4}
  50%{opacity:0.8}
}

/* Countdown */
#countdown{
  position:fixed;inset:0;z-index:200;
  display:flex;align-items:center;justify-content:center;
  background:rgba(255,255,255,0.3);
  backdrop-filter:blur(4px);
}
#countdown-num{
  font-size:220px;font-weight:900;color:#FF6F00;
  text-shadow:0 8px 0 #FFB300,0 0 40px rgba(255,111,0,0.3);
  animation:countPop 0.8s ease-out;
  font-family:"Comic Sans MS",cursive;
}
@keyframes countPop{
  0%{transform:scale(0.3)translateY(20px)rotate(-20deg);opacity:0}
  50%{transform:scale(1.3)translateY(0)rotate(5deg);opacity:1}
  100%{transform:scale(1)translateY(0)rotate(0deg);opacity:1}
}

@keyframes comboPop {
    0% { transform: translate(-50%, -50%) scale(0.5) rotate(-10deg); }
    50% { transform: translate(-50%, -50%) scale(1.3) rotate(5deg); }
    100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); }
}
/* =====================================
   Start screen decorations - Balloons & Stars
   ===================================== */
.start-balloon {
    position: absolute;
    width: 40px;
    height: 50px;
    border-radius: 50%;
    animation: floatBalloon 3s ease-in-out infinite;
    z-index: 1;
}
.start-balloon::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 12px;
    background: #888;
}
.sb1 { left: 8%; top: 20%; width: 35px; height: 44px; background: linear-gradient(135deg, #FF6B6B, #FF8E8E); animation-delay: 0s; }
.sb2 { right: 10%; top: 25%; width: 42px; height: 52px; background: linear-gradient(135deg, #FFD93D, #FFE066); animation-delay: -0.8s; }
.sb3 { left: 20%; top: 50%; width: 30px; height: 38px; background: linear-gradient(135deg, #6BCB77, #81D88A); animation-delay: -1.6s; }
.sb4 { right: 22%; top: 55%; width: 36px; height: 45px; background: linear-gradient(135deg, #4D96FF, #6BAAFF); animation-delay: -2.4s; }
.sb5 { left: 50%; top: 15%; width: 32px; height: 40px; background: linear-gradient(135deg, #C084FC, #D09AFF); animation-delay: -3.2s; }

@keyframes floatBalloon {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(-3deg); }
    50% { transform: translateY(-18px) rotate(0deg); }
    75% { transform: translateY(-6px) rotate(3deg); }
}

/* Stars decoration */
.start-star {
    position: absolute;
    width: 20px;
    height: 20px;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    animation: twinkleStar 1.5s ease-in-out infinite;
    z-index: 1;
}
.ss1 { left: 12%; top: 8%; width: 18px; height: 18px; background: #FFD700; animation-delay: 0s; }
.ss2 { right: 18%; top: 5%; width: 14px; height: 14px; background: #FF80AB; animation-delay: -0.4s; }
.ss3 { left: 35%; top: 3%; width: 16px; height: 16px; background: #81D4FA; animation-delay: -0.8s; }
.ss4 { right: 35%; top: 12%; width: 12px; height: 12px; background: #CE93D8; animation-delay: -1.2s; }
.ss5 { left: 5%; top: 45%; width: 15px; height: 15px; background: #FFAB91; animation-delay: -1.6s; }
.ss6 { right: 5%; top: 40%; width: 13px; height: 13px; background: #A5D6A7; animation-delay: -2.0s; }

@keyframes twinkleStar {
    0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
    50% { opacity: 0.15; transform: scale(0.7) rotate(180deg); }
}

