/* ==========================================
   RESET & BASE STYLES
   ========================================== */

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

:root {
    /* Color Palette */
    --primary-color: #FFD700;
    --primary-light: #FFF4CC;
    --secondary-color: #FFA500;
    --background-color: #87CEEB;
    --text-color: #333;
    --hive-color: #8B4513;
    --success-color: #4CAF50;
    --shadow: rgba(0, 0, 0, 0.2);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;

    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-base: 16px;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2rem;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(to bottom, #87CEEB 0%, #98D8E8 100%);
    min-height: 100vh;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    touch-action: none; /* Prevent default touch behaviors */
}

/* ==========================================
   GAME CONTAINER
   ========================================== */

.game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 100%;
    margin: 0 auto;
}

/* ==========================================
   HEADER
   ========================================== */

.game-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: 0 2px 10px var(--shadow);
    padding: var(--spacing-sm);
    z-index: 10;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.game-header h1 {
    font-size: var(--font-size-xl);
    color: white;
    text-shadow: 2px 2px 4px var(--shadow);
    margin: 0;
}

.stats {
    display: flex;
    gap: var(--spacing-md);
}

.stat-item {
    background: rgba(255, 255, 255, 0.9);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 20px;
    box-shadow: 0 2px 5px var(--shadow);
}

.stat-label {
    font-weight: 600;
    margin-right: var(--spacing-xs);
}

.stat-value {
    font-weight: 700;
    color: var(--secondary-color);
    font-size: var(--font-size-lg);
}

/* ==========================================
   GAME MAIN
   ========================================== */

.game-main {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: none; /* Hide cursor for immersion */
    touch-action: none;
}

/* ==========================================
   OVERLAYS
   ========================================== */

.start-screen,
.game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.3s ease-in;
}

/* Level Up Notification */
.level-up-notification {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    pointer-events: none;
}

.level-up-notification.show {
    animation: levelUpFade 2.5s ease-out forwards;
}

.level-up-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}

.level-up-text {
    font-size: 4rem;
    font-weight: 900;
    color: white;
    text-shadow:
        0 0 10px rgba(255, 215, 0, 0.8),
        0 0 20px rgba(255, 215, 0, 0.6),
        0 0 30px rgba(255, 215, 0, 0.4),
        4px 4px 8px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.1em;
    transform: scale(0.5);
}

.level-up-notification.show .level-up-text {
    animation: levelUpScale 2.5s ease-out forwards;
}

.level-up-subtitle {
    font-size: 3rem;
    opacity: 0;
}

.level-up-notification.show .level-up-subtitle {
    animation: levelUpSubtitle 2.5s ease-out forwards;
}

/* Honey Conversion Notification */
.honey-conversion {
    position: absolute;
    bottom: 100px;
    left: 60px;
    z-index: 40;
    pointer-events: none;
}

.honey-conversion-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 215, 0, 0.95);
    padding: 0.75rem 1.25rem;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 3px solid #FFA500;
}

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

.honey-amount {
    font-size: 1.75rem;
    font-weight: 900;
    color: #8B4513;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

.honey-conversion.show {
    animation: honeyFloat 1.5s ease-out forwards;
}

/* Bucket Full Notification */
.bucket-full-notification {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    pointer-events: none;
}

.bucket-full-notification.show {
    animation: bucketFullFade 2s ease-out forwards;
}

.bucket-full-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bucket-full-text {
    font-size: 5rem;
    font-weight: 900;
    color: white;
    text-shadow:
        0 0 10px rgba(255, 100, 0, 0.8),
        0 0 20px rgba(255, 100, 0, 0.6),
        0 0 30px rgba(255, 100, 0, 0.4),
        0 0 40px rgba(255, 0, 0, 0.3),
        4px 4px 8px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.1em;
    transform: scale(0.5);
}

.bucket-full-notification.show .bucket-full-text {
    animation: bucketFullScale 2s ease-out forwards;
}

/* Gadget Pickup Notification */
.gadget-pickup-notification {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 45;
    pointer-events: none;
}

.gadget-pickup-notification.show {
    animation: gadgetPickupFade 1.8s ease-out forwards;
}

.gadget-pickup-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.gadget-pickup-notification .gadget-icon {
    font-size: 3.5rem;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
    transform: scale(0.5);
    display: none;
}

.gadget-pickup-notification.show .gadget-icon {
    animation: gadgetIconScale 1.8s ease-out forwards;
}

.gadget-pickup-notification .gadget-name {
    font-size: 3.5rem;
    font-weight: 900;
    color: #FFB000 !important;
    text-shadow:
        0 0 15px rgba(255, 176, 0, 1),
        0 0 30px rgba(255, 165, 0, 0.8),
        0 0 45px rgba(255, 140, 0, 0.6),
        0 0 60px rgba(218, 165, 32, 0.4),
        3px 3px 6px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.08em;
    opacity: 0;
    transform: translateY(10px);
}

.gadget-pickup-notification.show .gadget-name {
    animation: gadgetNameFade 1.8s ease-out forwards;
}

/* Life Loss Notification */
.life-loss-notification {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 46;
    pointer-events: none;
}

.life-loss-notification.show {
    animation: lifeLossFade 2s ease-out forwards;
}

.life-loss-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.life-loss-text {
    font-size: 4rem;
    font-weight: 900;
    color: #FF0000 !important;
    text-shadow:
        0 0 20px rgba(255, 0, 0, 1),
        0 0 40px rgba(255, 0, 0, 0.8),
        0 0 60px rgba(255, 0, 0, 0.6),
        0 0 80px rgba(220, 0, 0, 0.4),
        4px 4px 8px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.08em;
    opacity: 0;
    transform: scale(0.5);
}

.life-loss-notification.show .life-loss-text {
    animation: lifeLossScale 2s ease-out forwards;
}

.start-content,
.game-over-content {
    background: white;
    padding: var(--spacing-lg);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 90%;
    width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.start-content h2,
.game-over-content h2 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-md);
    color: var(--secondary-color);
}

.start-content p,
.game-over-content p {
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-lg);
}

.controls-info {
    background: #f0f0f0;
    padding: var(--spacing-sm);
    border-radius: 10px;
    margin-top: var(--spacing-md);
    font-size: var(--font-size-base);
}

/* ==========================================
   GADGETS INFO SECTION
   ========================================== */

.btn-toggle-powerups {
    width: 100%;
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm);
    background: linear-gradient(135deg, #fff8e1 0%, #ffe082 100%);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.btn-toggle-powerups:hover {
    background: linear-gradient(135deg, #ffe082 0%, #ffd54f 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-toggle-powerups:active {
    transform: translateY(0);
}

#powerupsToggleIcon {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

#powerupsToggleIcon.expanded {
    transform: rotate(90deg);
}

.gadgets-info {
    margin-top: var(--spacing-sm);
    background: linear-gradient(135deg, #fff8e1 0%, #ffe082 100%);
    padding: var(--spacing-md);
    border-radius: 15px;
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
}

.gadgets-info.hidden {
    max-height: 0 !important;
    padding: 0 var(--spacing-md);
    margin: 0;
    opacity: 0;
    border-width: 0;
}

.gadgets-info h3 {
    font-size: var(--font-size-xl);
    color: var(--secondary-color);
    margin-bottom: var(--spacing-md);
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.gadgets-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-xs);
    max-height: 300px;
    overflow-y: auto;
    padding: var(--spacing-xs);
}

.gadget-item {
    display: grid;
    grid-template-columns: 30px 1fr;
    grid-template-rows: auto auto;
    gap: 0.25rem var(--spacing-sm);
    padding: var(--spacing-xs);
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    align-items: center;
}

.gadget-item:hover {
    transform: translateX(3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.gadget-icon {
    grid-row: 1 / 3;
    font-size: 1.5rem;
    text-align: center;
}

.gadget-name {
    font-weight: 700;
    color: var(--text-color);
    font-size: 0.9rem;
    align-self: end;
}

.gadget-desc {
    font-size: 0.75rem;
    color: #666;
    line-height: 1.2;
    align-self: start;
}

.final-score {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--success-color);
}

.hidden {
    display: none !important;
}

/* ==========================================
   BUTTONS
   ========================================== */

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--font-size-lg);
    font-weight: 700;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 10px var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px var(--shadow);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px var(--shadow);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 1rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 10px var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px var(--shadow);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px var(--shadow);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 2px 8px var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow);
}

.btn-danger:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px var(--shadow);
}

/* ==========================================
   HIGH SCORE INPUT
   ========================================== */

.high-score-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.high-score-input-content {
    background: white;
    padding: var(--spacing-lg);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: slideIn 0.4s ease-out;
}

.high-score-input-content h2 {
    font-size: var(--font-size-2xl);
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    text-shadow: 2px 2px 4px var(--shadow);
}

.high-score-rank {
    font-size: var(--font-size-xl);
    color: #FFD700;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    text-shadow: 1px 1px 2px var(--shadow);
}

.high-score-stats {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-lg);
    color: var(--text-color);
    line-height: 1.8;
}

.name-input-section {
    margin: var(--spacing-lg) 0;
}

.name-input-section label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-color);
}

#playerName {
    width: 150px;
    padding: var(--spacing-sm);
    font-size: var(--font-size-2xl);
    text-align: center;
    text-transform: uppercase;
    border: 3px solid var(--primary-color);
    border-radius: 10px;
    font-weight: 700;
    letter-spacing: 8px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#playerName:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.5);
}

#playerName::placeholder {
    color: #ccc;
    letter-spacing: 8px;
}

.input-hint {
    font-size: 0.85rem;
    color: #666;
    margin-top: var(--spacing-xs);
}

.high-score-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

/* ==========================================
   LEADERBOARD
   ========================================== */

.leaderboard-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    overflow-y: auto;
}

.leaderboard-content {
    background: white;
    padding: var(--spacing-lg);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.4s ease-out;
}

.leaderboard-content h2 {
    font-size: var(--font-size-2xl);
    color: var(--primary-color);
    margin-bottom: var(--spacing-lg);
    text-align: center;
    text-shadow: 2px 2px 4px var(--shadow);
}

.difficulty-tabs {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    margin-bottom: var(--spacing-lg);
}

.difficulty-tab {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.difficulty-tab:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

.difficulty-tab.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.leaderboard-table {
    margin-bottom: var(--spacing-lg);
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.leaderboard-entry:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px var(--shadow);
}

.leaderboard-entry.rank-1 {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.leaderboard-entry.rank-2 {
    background: linear-gradient(135deg, #C0C0C0 0%, #A8A8A8 100%);
    font-weight: 600;
}

.leaderboard-entry.rank-3 {
    background: linear-gradient(135deg, #CD7F32 0%, #B8732D 100%);
    font-weight: 600;
}

.leaderboard-rank {
    font-size: var(--font-size-lg);
    font-weight: 700;
    min-width: 40px;
    text-align: center;
}

.leaderboard-name {
    font-size: var(--font-size-lg);
    font-weight: 700;
    letter-spacing: 2px;
    min-width: 60px;
}

.leaderboard-stats {
    display: flex;
    gap: var(--spacing-md);
    flex: 1;
    justify-content: flex-end;
    align-items: center;
}

.leaderboard-honey,
.leaderboard-level {
    font-size: 1rem;
    white-space: nowrap;
}

.leaderboard-difficulty {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.leaderboard-empty {
    text-align: center;
    padding: var(--spacing-lg);
    color: #666;
    font-style: italic;
}

.leaderboard-buttons {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
}

/* ==========================================
   DIFFICULTY SELECTION
   ========================================== */

.difficulty-selection {
    margin-top: var(--spacing-lg);
}

.difficulty-selection h3 {
    font-size: var(--font-size-xl);
    color: var(--text-color);
    margin-bottom: var(--spacing-md);
}

.difficulty-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.btn-difficulty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    border: 3px solid transparent;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 8px var(--shadow);
}

.btn-difficulty:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px var(--shadow);
}

.btn-difficulty:active {
    transform: translateY(-2px);
}

.difficulty-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-xs);
}

.difficulty-name {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.difficulty-desc {
    font-size: 0.9rem;
    color: #666;
}

/* Difficulty-specific colors */
.btn-easy {
    border-color: #4CAF50;
}

.btn-easy:hover {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-color: #2E7D32;
}

.btn-easy .difficulty-name {
    color: #4CAF50;
}

.btn-medium {
    border-color: #FFA500;
}

.btn-medium:hover {
    background: linear-gradient(135deg, #fff8e1 0%, #ffe082 100%);
    border-color: #F57C00;
}

.btn-medium .difficulty-name {
    color: #FFA500;
}

.btn-hard {
    border-color: #F44336;
}

.btn-hard:hover {
    background: linear-gradient(135deg, #ffebee 0%, #ef9a9a 100%);
    border-color: #C62828;
}

.btn-hard .difficulty-name {
    color: #F44336;
}

/* ==========================================
   LEVEL INDICATOR
   ========================================== */

.level-indicator {
    background: linear-gradient(135deg, #9C27B0 0%, #E91E63 100%) !important;
    color: white;
}

.level-indicator .stat-label,
.level-indicator .stat-value {
    color: white;
}

/* ==========================================
   LIVES INDICATOR
   ========================================== */

.lives-indicator {
    background: linear-gradient(135deg, #E91E63 0%, #F44336 100%) !important;
    color: white;
}

.lives-indicator .stat-label {
    color: white;
}

.lives-hearts {
    font-size: 1.2rem;
    line-height: 1;
    letter-spacing: 0.1rem;
}

/* ==========================================
   GAME OVER STATS
   ========================================== */

.game-over-message {
    font-size: var(--font-size-lg);
    color: #F44336;
    font-weight: 600;
    margin: var(--spacing-sm) 0;
}

.final-stats {
    background: #f0f0f0;
    padding: var(--spacing-md);
    border-radius: 10px;
    margin-top: var(--spacing-md);
    font-size: var(--font-size-base);
    line-height: 1.8;
}

.final-stats span {
    font-weight: 700;
    color: var(--secondary-color);
}

/* ==========================================
   FOOTER
   ========================================== */

.game-footer {
    background: rgba(255, 255, 255, 0.9);
    padding: var(--spacing-sm);
    text-align: center;
    box-shadow: 0 -2px 10px var(--shadow);
}

.game-footer p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-color);
}

/* ==========================================
   ANIMATIONS
   ========================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes levelUpFade {
    0% {
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes levelUpScale {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    20% {
        transform: scale(1.2);
        opacity: 1;
    }
    30% {
        transform: scale(1);
    }
    80% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.1);
        opacity: 0;
    }
}

@keyframes levelUpSubtitle {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    30% {
        opacity: 0;
    }
    40% {
        opacity: 1;
        transform: translateY(0);
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes bucketFullFade {
    0% {
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes bucketFullScale {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    15% {
        transform: scale(1.3);
        opacity: 1;
    }
    25% {
        transform: scale(1);
    }
    75% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

@keyframes honeyFloat {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.8);
    }
    20% {
        opacity: 1;
        transform: translateY(-10px) scale(1);
    }
    70% {
        opacity: 1;
        transform: translateY(-60px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-80px) scale(0.9);
    }
}

@keyframes gadgetPickupFade {
    0% {
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    85% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes gadgetIconScale {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    15% {
        transform: scale(1.3);
        opacity: 1;
    }
    25% {
        transform: scale(1);
    }
    85% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.1);
        opacity: 0;
    }
}

@keyframes gadgetNameFade {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    20% {
        opacity: 0;
    }
    30% {
        opacity: 1;
        transform: translateY(0);
    }
    85% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes lifeLossFade {
    0% {
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    85% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes lifeLossScale {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    15% {
        transform: scale(1.3);
        opacity: 1;
    }
    25% {
        transform: scale(1);
    }
    85% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.1);
        opacity: 0;
    }
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

/* Tablet and up */
@media (min-width: 768px) {
    .game-header h1 {
        font-size: var(--font-size-2xl);
    }

    .start-content,
    .game-over-content {
        padding: var(--spacing-lg) calc(var(--spacing-lg) * 1.5);
        width: 500px;
    }

    .difficulty-buttons {
        flex-direction: row;
    }

    .btn-difficulty {
        flex: 1;
    }
}

/* Desktop and up */
@media (min-width: 1024px) {
    .game-container {
        max-width: 1200px;
        box-shadow: 0 0 30px var(--shadow);
    }

    #gameCanvas {
        cursor: none;
    }
}

/* Landscape mobile - reduce header/footer size */
@media (max-height: 600px) and (orientation: landscape) {
    .game-header {
        padding: var(--spacing-xs);
    }

    .game-header h1 {
        font-size: var(--font-size-lg);
    }

    .game-footer {
        display: none;
    }

    .stat-item {
        padding: 0.25rem 0.5rem;
    }

    .level-up-text {
        font-size: 2.5rem;
    }

    .level-up-subtitle {
        font-size: 2rem;
    }
}

/* Mobile - smaller level up text and optimized scroll areas */
@media (max-width: 480px) {
    .level-up-text {
        font-size: 3rem;
    }

    .level-up-subtitle {
        font-size: 2.5rem;
    }

    .life-loss-text {
        font-size: 2.5rem;
    }

    .start-content,
    .game-over-content {
        padding: var(--spacing-md);
        max-height: 85vh;
    }

    .difficulty-selection {
        margin-top: var(--spacing-sm);
    }

    .difficulty-selection h3 {
        font-size: var(--font-size-lg);
        margin-bottom: var(--spacing-sm);
    }

    .game-footer {
        display: none;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
    }

    .game-footer,
    .btn-primary {
        display: none;
    }
}
