/* minor styles for combo/slowmo/wave */
#gameContainer.slowmo {
  filter: saturate(1.2) brightness(1.05);
}
.effect-badge.pulse {
  animation: pulse 0.6s ease;
}
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.wave-banner { transition: opacity .2s ease; }
.pickup-toast { font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #87CEEB 0%, #E0F6FF 100%);
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    user-select: none;
    touch-action: none;
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
}

/* Top HUD for Telegram compact layout */
#ui {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    z-index: 120;
    pointer-events: none; /* allow game drag */
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

#hudTop {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.hud-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 60vw;
    flex: 1 1 auto;
    min-width: 0;
}

.hud-pill {
    pointer-events: auto;
    backdrop-filter: blur(12px) saturate(1.05);
    background: linear-gradient(180deg, rgba(15, 23, 42, .9), rgba(15, 23, 42, .78));
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 18px;
    padding: 12px 16px;
    color: #fff;
    box-shadow: 0 10px 30px rgba(2, 6, 23, .25);
}

.pill-row { display: flex; align-items: center; gap: 8px; }
.pill-row .icon { font-size: 22px; line-height: 1; }
.pill-row.score .score-number { font-size: 28px; font-weight: 900; color: #FFE082; text-shadow: 0 1px 2px rgba(0,0,0,.85); }
.pill-row.level .level-text { font-size: 14px; font-weight: 800; color: #D1FAE5; opacity: .95; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.pill-row.hp .hp-number { font-size: 22px; font-weight: 900; }
.pill-row.time .time-text { font-size: 14px; font-weight: 800; opacity: .95; }

.score-line {
    font-size: 22px;
    font-weight: 800;
    color: #FFD700;
    text-shadow: 0 1px 2px rgba(0,0,0,.8);
    line-height: 1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.level-line {
    font-size: 13px;
    font-weight: 700;
    color: #9AE6B4;
    opacity: .95;
    text-shadow: 0 1px 2px rgba(0,0,0,.6);
    line-height: 1.1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.hud-right { 
    display: flex; 
    flex-direction: column; 
    align-items: flex-end; 
    gap: 4px; 
}

.hud-right-row { 
    display: flex; 
    gap: 6px; 
    flex-wrap: wrap;
}

.hp-pill, .time-pill {
    pointer-events: auto; /* allow language select overlay later if needed */
    background: rgba(2, 6, 23, .6);
    border: 1px solid rgba(226,232,240,.18);
    color: #fff;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0,0,0,.5);
    backdrop-filter: blur(10px) saturate(1.05);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.effects-row { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

/* Reuse effect badge style but compact */
.effect-badge {
    padding: 3px 6px;
    border-radius: 8px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

#gameOver {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    display: none;
    z-index: 200;
    backdrop-filter: blur(20px);
    border: 2px solid #4ECDC4;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

#gameOver h2 {
    color: #FF6B6B;
    margin-bottom: 20px;
    font-size: 32px;
}

#gameOver button {
    background: linear-gradient(45deg, #4ECDC4, #44A08D);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    cursor: pointer;
    margin: 10px;
    font-size: 18px;
    font-weight: bold;
    transition: transform 0.2s;
}

#gameOver button:hover { transform: scale(1.05); }

#powerUp {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    display: none;
    z-index: 150;
    backdrop-filter: blur(20px);
    border: 2px solid #FFD700;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.powerUpButton {
    background: linear-gradient(45deg, #4ECDC4, #44A08D);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    margin: 8px;
    font-size: 16px;
    font-weight: bold;
    transition: transform 0.2s;
}

.powerUpButton:hover { transform: scale(1.05); }

#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    text-align: center;
    z-index: 300;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255,255,255,0.3);
    border-top: 5px solid #4ECDC4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.block-label {
    position: absolute;
    color: white;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    pointer-events: none;
    z-index: 50;
}

/* Pickup feedback toast */
#notifications {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 160;
    pointer-events: none;
}
.pickup-toast {
    color: #fff;
    font-weight: 800;
    font-size: 22px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    margin-top: 8px;
    opacity: 0;
    transform: translateY(10px);
    animation: floatUp 900ms ease-out forwards;
    background: rgba(0,0,0,0.55);
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.25);
}
@keyframes floatUp {
    0% { opacity: 0; transform: translateY(10px); }
    20% { opacity: 1; transform: translateY(0px); }
    100% { opacity: 0; transform: translateY(-18px); }
}

.pulse { animation: pulseScale 400ms ease-in-out 0s 1; }
@keyframes pulseScale {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Bottom booster bar */
#boosterBar {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 10px;
    z-index: 130;
    display: flex;
    justify-content: center;
    gap: 12px;
    pointer-events: auto; /* touchable */
}

.booster-btn {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.2);
    background: linear-gradient(180deg, rgba(2, 6, 23, .75), rgba(2, 6, 23, .65));
    color: #fff;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(2,6,23,.35);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.booster-btn:active { transform: scale(0.98); }

.booster-btn .cd {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 0%;
    width: 100%;
    background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.22));
    border-radius: 0 0 16px 16px;
    transition: height 0.2s linear;
    pointer-events: none;
}

.booster-btn.disabled { opacity: .55; }

/* Compact tweaks for small screens */
@media (max-width: 480px) {
    .hud-left { max-width: 58vw; }
    .hud-right { max-width: 38vw; }
    .pill-row .icon { font-size: 22px; }
    .pill-row.score .score-number { font-size: 30px; }
    .pill-row.level .level-text { font-size: 15px; }
    .pill-row.hp .hp-number { font-size: 22px; }
    .pill-row.time .time-text { font-size: 15px; }
    /* Booster buttons like white cards */
    .booster-btn { width: 96px; height: 96px; font-size: 0; background: #ffffff; color: #111827; border: 2px solid #111827; border-radius: 16px; box-shadow: 0 8px 20px rgba(0,0,0,.15); }
    .booster-btn .icon { font-size: 34px; }
}
@media (max-width: 360px) {
    /* Keep text size adaptive; only slightly reduce booster footprint */
    .booster-btn { width: 64px; height: 64px; font-size: 24px; }
}


