/* ============================================
   Tank Shot - Main Styles
   ============================================ */

/* CSS Variables */
:root {
    --bg-dark: #001201;
    --bg-surface: #00420c;
    --bg-board: #001201;
    --tank-body: #3d5c3d;
    --tank-barrel: #4a6a4a;
    --target-bg: #001201;
    --bullseye: #dc2626;
    --inner: #f97316;
    --middle: #eab308;
    --outer: #22c55e;
    --edge: #fad900;
    --laser: #ef4444;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --gold: #fad900;
    --gold-dark: #b8860b;
    --accent: #fad900;
    --accent-light: #fff8dc;
}

/* Reset */
* {
    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 Screen */
.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 Screen */
.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: center;
    align-items: center;
    padding: 10px 15px;
    background: var(--bg-surface);
    border-radius: 12px;
    margin-bottom: 10px;
}

.balance-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

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

.balance-currency {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Game Area */
#game-area {
    position: relative;
    background: var(--bg-board);
    border-radius: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#game-canvas {
    display: block;
}

/* Hit Result */
#hit-result {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    text-align: center;
    z-index: 10;
    opacity: 0;
    transition: all 0.3s ease;
}

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

#hit-result.hidden {
    display: none;
}

#hit-zone {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    margin-bottom: 5px;
}

#hit-multiplier {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* Zone Legend */
#zone-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background: var(--bg-surface);
    border-radius: 10px;
    margin-bottom: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 0.75rem;
}

.zone-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-item.bullseye .zone-color { background: var(--bullseye); }
.legend-item.inner .zone-color { background: var(--inner); }
.legend-item.middle .zone-color { background: var(--middle); }
.legend-item.outer .zone-color { background: var(--outer); }
.legend-item.edge .zone-color { background: var(--edge); }

.zone-name {
    color: var(--text-secondary);
}

.zone-mult {
    color: var(--gold);
    font-weight: 600;
}

/* 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-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

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

.amount-btn {
    padding: 10px 16px;
    background: var(--bg-board);
    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: var(--tank-body);
}

.amount-btn.active {
    background: #fad900;
    border-color: #fff8dc;
    color: #001201;
}

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

/* Fire Button */
#fire-button {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, var(--bullseye) 0%, #b91c1c 100%);
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 10px;
}

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

#fire-button:disabled {
    background: var(--bg-board);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#fire-button.firing {
    animation: fireButton 0.1s ease;
}

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

/* 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;
    }

    .legend-item {
        padding: 3px 6px;
        font-size: 0.7rem;
    }
}

/* Hidden utility */
.hidden {
    display: none !important;
}
