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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #fff;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    font-size: 2.5rem;
    background: linear-gradient(90deg, #00d4ff, #00ff88);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #888;
    font-size: 1rem;
}

#game-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

#date-display {
    color: #888;
}

#moves-display {
    font-weight: bold;
    color: #00d4ff;
}

.target-info {
    text-align: center;
    font-size: 1.1rem;
    color: #ffcc00;
}

#game-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

#game-canvas {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 15px;
    max-width: 100%;
}

#controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.button-pair {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
    border-radius: 12px;
}

.transfer-btn {
    background: linear-gradient(135deg, #0066cc, #0044aa);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.transfer-btn .btn-label {
    font-weight: 600;
}

.transfer-btn .btn-amount {
    font-size: 0.8rem;
    opacity: 0.8;
    color: #aaffaa;
}

.transfer-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.4);
}

.transfer-btn:active:not(:disabled) {
    transform: translateY(0);
}

.transfer-btn:disabled,
.transfer-btn.disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.5;
}

.transfer-btn:disabled .btn-amount,
.transfer-btn.disabled .btn-amount {
    display: none;
}

#message-area {
    text-align: center;
    min-height: 30px;
    font-size: 1.1rem;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 30px;
    max-width: 400px;
    text-align: center;
}

.modal-content h2 {
    margin-bottom: 15px;
    color: #00ff88;
}

.modal-content p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.modal-content ul {
    text-align: left;
    margin: 15px 0;
    padding-left: 20px;
}

.modal-content li {
    margin-bottom: 10px;
    color: #ccc;
}

.btn {
    background: linear-gradient(135deg, #0066cc, #0044aa);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn.primary {
    background: linear-gradient(135deg, #00cc66, #00aa44);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.4);
}

#countdown-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#countdown {
    font-weight: bold;
    color: #00d4ff;
}

footer {
    margin-top: auto;
    padding-top: 20px;
    display: flex;
    justify-content: center;
    gap: 30px;
}

.btn-link {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
}

.btn-link:hover {
    color: #fff;
}

/* Battery styles in canvas are drawn via JS, but we define some animation classes */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.target-battery {
    animation: pulse 2s infinite;
}

/* Responsive */
@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }

    .transfer-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
        min-width: 70px;
    }

    .modal-content {
        margin: 20px;
        padding: 20px;
    }
}
