/* ============================================================
   style.css — Flip Bottle Run styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800&display=swap');

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0f0c29;
    font-family: 'Outfit', 'Segoe UI', Arial, sans-serif;
    touch-action: none;
}


/* ---- Canvas ---- */
#gameCanvas {
    display: block;
    margin: 0 auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

/* ---- Overlay screens ---- */
.screen {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    width: 100%;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.screen.active {
    display: flex;
    pointer-events: auto;
}

/* ---- Menu Screen ---- */
#menuScreen {
    background: linear-gradient(180deg, rgba(15,12,41,0.92) 0%, rgba(48,43,99,0.95) 100%);
    gap: 18px;
}

.menu-title {
    font-size: 38px;
    font-weight: 800;
    color: #fff;
    text-align: center;
    text-shadow: 0 0 30px rgba(52,152,219,0.6), 0 0 60px rgba(52,152,219,0.3);
    line-height: 1.1;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.menu-subtitle {
    font-size: 14px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 24px;
    font-weight: 400;
}

#bestScore, #menuCoins {
    font-size: 18px;
    color: rgba(255,255,255,0.8);
    margin: 4px 0;
}

/* ---- Buttons ---- */
.btn {
    min-width: 200px;
    padding: 16px 36px;
    border: none;
    border-radius: 16px;
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.95);
}

.btn-play {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
    box-shadow: 0 6px 24px rgba(52,152,219,0.4);
}

.btn-play:active {
    box-shadow: 0 2px 12px rgba(52,152,219,0.3);
}

.btn-shop {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
    box-shadow: 0 6px 24px rgba(243,156,18,0.4);
}

.btn-restart {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #fff;
    box-shadow: 0 6px 24px rgba(46,204,113,0.4);
}

.btn-back {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

/* ---- Game HUD ---- */
#gameScreen {
    pointer-events: none;
}

#gameScreen.active {
    pointer-events: none;
}

.hud-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    pointer-events: auto;
    z-index: 20;
}

.btn-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    pointer-events: auto;
}

.btn-icon:active {
    background: rgba(255,255,255,0.25);
}

/* ---- Game Over ---- */
#gameOverScreen {
    background: linear-gradient(180deg, rgba(15,12,41,0.95) 0%, rgba(48,43,99,0.97) 100%);
    gap: 14px;
}

.go-title {
    font-size: 36px;
    font-weight: 800;
    color: #e74c3c;
    text-shadow: 0 0 25px rgba(231,76,60,0.5);
    margin-bottom: 10px;
}

#goScore, #goCoins, #goBest {
    font-size: 20px;
    color: rgba(255,255,255,0.85);
    margin: 4px 0;
}

#goCoins {
    color: #f1c40f;
}

.go-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ---- Shop Screen ---- */
#shopScreen {
    background: linear-gradient(180deg, rgba(15,12,41,0.97) 0%, rgba(48,43,99,0.98) 100%);
    gap: 12px;
    padding: 20px;
    overflow-y: auto;
}

.shop-header {
    font-size: 30px;
    font-weight: 800;
    color: #f39c12;
    text-shadow: 0 0 20px rgba(243,156,18,0.4);
    margin-bottom: 4px;
}

#shopCoins {
    font-size: 20px;
    color: #f1c40f;
    margin-bottom: 12px;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 340px;
    overflow-y: auto;
    padding-bottom: 20px;
}

.shop-card {
    background: rgba(255,255,255,0.07);
    border-radius: 16px;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.15s;
}

.shop-card.selected {
    border-color: #3498db;
    box-shadow: 0 0 20px rgba(52,152,219,0.3);
}

.shop-bottle-preview {
    width: 60px;
    height: 90px;
    image-rendering: auto;
}

.shop-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.shop-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.shop-btn:active {
    transform: scale(0.95);
}

.btn-buy {
    background: linear-gradient(135deg, #f39c12, #d35400);
    color: #fff;
}

.btn-select {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #fff;
}

.btn-selected {
    background: rgba(52,152,219,0.3);
    color: rgba(255,255,255,0.6);
    cursor: default;
}

.btn-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---- Pause Overlay ---- */
#pauseOverlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15,12,41,0.85);
    z-index: 30;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

#pauseOverlay.visible {
    display: flex;
}

.pause-title {
    font-size: 32px;
    font-weight: 800;
    color: #fff;
}

/* ---- Animations ---- */
@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}


.screen.active {
    animation: fadeIn 0.25s ease-out;
}

/* ---- Responsive ---- */
@media (max-width: 380px) {
    .menu-title { font-size: 30px; }
    .btn { min-width: 170px; padding: 14px 28px; font-size: 16px; }
    .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

@media (min-width: 600px) {
    .menu-title { font-size: 46px; }
    .shop-grid { max-width: 500px; }
}
