:root {
    --jordan: #FFEB3B;
    --julian: #42A5F5;
    --bg: #FFEB3B;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body, html { 
    margin: 0; padding: 0; height: 100%; width: 100%; 
    background: var(--bg); font-family: 'Comic Sans MS', sans-serif; 
    overflow: hidden; touch-action: none;
}

#start-overlay { 
    position: fixed; inset: 0; background: var(--jordan); 
    display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 2000;
    text-align: center;
}

.big-start-btn { 
    padding: 20px 50px; font-size: 28px; font-weight: bold;
    border-radius: 50px; border: 4px solid #333; background: white; 
    box-shadow: 0 8px 0 #999; cursor: pointer;
}

#app { 
    height: 100dvh; width: 100%; display: flex; flex-direction: column; 
    background: white; max-width: 500px; margin: 0 auto;
}

header { 
    height: 70px; display: flex; justify-content: space-between; 
    align-items: center; padding: 0 15px; background: #f0f0f0; 
    border-bottom: 4px solid rgba(0,0,0,0.1);
}

.score-pill { background: #333; color: white; padding: 4px 12px; border-radius: 20px; font-size: 16px; margin-left: 10px; }
.timer-display { font-family: monospace; font-size: 22px; font-weight: bold; background: #222; color: #0f0; padding: 5px 10px; border-radius: 8px; }

nav { 
    height: 70px; display: flex; gap: 8px; overflow-x: auto; 
    padding: 10px; background: #fafafa; border-bottom: 2px solid #ddd;
}

nav button { 
    flex: 1; min-width: 90px; border-radius: 15px; 
    border: 2px solid #ccc; background: white; font-size: 16px;
}

nav button.active { background: var(--bg); border: 2px solid #333; font-weight: bold; }

#game-stage { flex: 1; position: relative; width: 100%; overflow: hidden; background: #fff; }
.game-view { display: none; height: 100%; width: 100%; flex-direction: column; align-items: center; justify-content: center; padding: 15px; }
.game-view.active { display: flex; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.card { 
    width: 75px; height: 75px; background: #f8f8f8; 
    border: 3px solid #ddd; border-radius: 12px; 
    display: flex; align-items: center; justify-content: center; 
    font-size: 32px; font-weight: bold; color: #333;
}

#tracing-canvas { background: white; border: 4px dashed #ccc; width: 320px; height: 320px; border-radius: 20px; touch-action: none; }
.action-btn { margin-top: 15px; padding: 12px 25px; border-radius: 15px; background: #333; color: white; border: none; font-size: 18px; }

#balloon-stage { width: 100%; height: 100%; position: relative; background: #e3f2fd; border-radius: 20px; overflow: hidden; }
.balloon { 
    position: absolute; width: 70px; height: 90px; border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; 
    color: white; font-weight: bold; font-size: 24px; 
    animation: floatUp 6s linear forwards; 
}
@keyframes floatUp { from { bottom: -100px; } to { bottom: 110%; } }

#timeout-overlay { 
    position: fixed; inset: 0; background: rgba(0,0,0,0.95); 
    color: white; display: none; flex-direction: column; 
    align-items: center; justify-content: center; z-index: 1500; text-align: center;
}