/* ============================================
   Brick Break Mini - Main Styles
   ============================================ */

:root {
    --bg-dark: #001201;
    --bg-surface: #00420c;
    --bg-game: #001201;
    --paddle: #fad900;
    --ball: #ffffff;
    --brick-normal: #fad900;
    --brick-strong: #f97316;
    --brick-bonus: #fad900;
    --brick-explosive: #dc2626;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --gold: #fad900;
    --gold-dark: #b8860b;
    --accent: #fad900;
    --accent-light: #fff8dc;
    --lives: #ef4444;
}

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

html {
    width: 100%;
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: transparent;
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    min-height: calc(100dvh - 3.5rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Screen states */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    z-index: 100;
}

.screen.hidden { display: none; }

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--bg-surface);
    border-top-color: #fad900;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

#loading-screen p {
    margin-top: 20px;
    color: var(--text-secondary);
}

.login-content {
    text-align: center;
    padding: 40px;
}

.login-icon { font-size: 4rem; margin-bottom: 20px; }
.login-content h2 { font-size: 1.5rem; margin-bottom: 10px; }
.login-content p { color: var(--text-secondary); }

/* Game Container */
#game-container {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    padding: 10px;
    padding-bottom: 20px;
}

#game-container.hidden { display: none; }

/* Header */
#game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: var(--bg-surface);
    border-radius: 12px;
    margin-bottom: 10px;
}

.header-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

#balance-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
}

#lives-display {
    font-size: 1.2rem;
    color: var(--lives);
    letter-spacing: 2px;
}

#score-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Game Area */
#game-area {
    position: relative;
    background: var(--bg-game);
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden;
    touch-action: none;
}

#game-canvas {
    display: block;
    width: 100%;
}

/* Start Overlay */
#start-overlay {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 20px;
    animation: pulse 1.5s ease infinite;
}

#start-overlay.hidden { display: none; }

.start-hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Game Over Overlay */
#gameover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10;
}

#gameover-overlay.hidden { display: none; }

.gameover-content {
    text-align: center;
    padding: 20px;
}

.gameover-icon {
    display: block;
    font-size: 4rem;
    margin-bottom: 10px;
}

.gameover-title {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 20px;
}

.gameover-stats {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px 30px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-row:last-child { border-bottom: none; }

.stat-row .stat-label {
    color: var(--text-secondary);
}

#final-score {
    font-weight: 700;
    color: var(--text-primary);
}

#final-multiplier {
    font-weight: 700;
    color: var(--accent);
}

.win-row {
    margin-top: 10px;
    padding-top: 15px;
}

#final-win {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gold);
}

/* Bet Controls */
#bet-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg-surface);
    border-radius: 12px;
    margin-bottom: 10px;
}

#bet-controls.hidden { display: none; }

.bet-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.bet-buttons { display: flex; gap: 8px; }

.amount-btn {
    padding: 10px 16px;
    background: var(--bg-dark);
    border: 2px solid transparent;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.amount-btn:hover { background: #003a0a; }
.amount-btn.active { background: #fad900; border-color: #fff8dc; color: #001201; }
.amount-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Start Button */
#start-button {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #fad900 0%, #fff8dc 100%);
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

#start-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(250, 217, 0, 0.4);
}

#start-button:disabled {
    background: var(--bg-dark);
    cursor: not-allowed;
    transform: none;
}

#start-button.hidden { display: none; }

/* Game Title */
.game-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    opacity: 0.6;
}

.title-icon { font-size: 1.5rem; }
.title-text { font-size: 1rem; font-weight: 600; letter-spacing: 1px; }

/* Win Display */
#win-display {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    padding: 25px 50px;
    border-radius: 20px;
    text-align: center;
    z-index: 50;
    opacity: 0;
    transition: all 0.3s ease;
}

#win-display.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

#win-display.hidden { display: none; }
.win-label { display: block; font-size: 1.2rem; color: var(--bg-dark); margin-bottom: 5px; }
#win-amount { font-size: 2.5rem; font-weight: 700; color: var(--bg-dark); }

/* Message Display */
#message-display {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 20px 40px;
    border-radius: 12px;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#message-display.visible { opacity: 1; }
#message-display.hidden { display: none; }
#message-text { color: var(--text-primary); font-size: 1.1rem; }

/* Particles */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 60;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: particleFall 1.5s ease-out forwards;
}

@keyframes particleFall {
    0% { opacity: 1; transform: translateY(0) rotate(0deg); }
    100% { opacity: 0; transform: translateY(200px) rotate(720deg); }
}

/* Responsive */
@media (max-width: 380px) {
    .amount-btn { padding: 8px 12px; font-size: 0.85rem; }
}

.hidden { display: none !important; }
