/* ================================
   DRS GDEV - Global Styles
   ================================ */

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

:root {
    --primary: #6c5ce7;
    --primary-dark: #5541d7;
    --secondary: #00cec9;
    --accent: #fd79a8;
    --bg-dark: #1a1a2e;
    --bg-card: #16213e;
    --bg-card-hover: #1f3460;
    --text: #ffffff;
    --text-muted: #a0a0b0;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #e74c3c;
    --shadow: rgba(0, 0, 0, 0.3);
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* ================================
   App Container
   ================================ */

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

/* ================================
   Header
   ================================ */

.header {
    text-align: center;
    padding: 2rem 1rem;
}

.logo {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text);
}

.logo span {
    color: var(--primary);
}

.tagline {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* ================================
   Games Section
   ================================ */

.games-container {
    flex: 1;
    padding: 1rem 0;
}

.section-title {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

.games-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ================================
   Game Card
   ================================ */

.game-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.25rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.game-card:active {
    transform: scale(0.98);
    background: var(--bg-card-hover);
}

@media (hover: hover) {
    .game-card:hover {
        background: var(--bg-card-hover);
        border-color: var(--primary);
        transform: translateY(-2px);
        box-shadow: 0 8px 24px var(--shadow);
    }
}

.game-card.coming-soon {
    opacity: 0.5;
    pointer-events: none;
}

.game-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
}

.game-info {
    flex: 1;
}

.game-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.game-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.game-time {
    display: inline-block;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    margin-top: 0.5rem;
    font-weight: 500;
}

/* ================================
   Footer
   ================================ */

.footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ================================
   Game Page Common Styles
   ================================ */

.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-card);
}

.back-btn {
    width: 44px;
    height: 44px;
    background: var(--bg-dark);
    border: none;
    border-radius: 12px;
    color: var(--text);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.back-btn:active {
    background: var(--primary);
}

.game-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.game-score {
    font-size: 1.1rem;
    color: var(--secondary);
    font-weight: 600;
}

/* ================================
   Game Canvas Container
   ================================ */

.game-canvas-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    overflow: hidden;
}

.game-canvas-container canvas {
    max-width: 100%;
    max-height: 100%;
}

/* ================================
   Modal / Overlay
   ================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    max-width: 320px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.modal-score {
    font-size: 3rem;
    font-weight: 800;
    color: var(--secondary);
    margin: 1rem 0;
}

.modal-best {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* ================================
   Buttons
   ================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: white;
}

.btn-primary {
    background: var(--primary);
}

.btn-primary:active {
    background: var(--primary-dark);
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--bg-dark);
    color: var(--text);
}

.btn-block {
    width: 100%;
}

.btn + .btn {
    margin-top: 0.75rem;
}

/* ================================
   Utilities
   ================================ */

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* ================================
   Animations
   ================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pop {
    0% { transform: scale(0); }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease;
}

.animate-slide-up {
    animation: slideUp 0.4s ease;
}

.animate-pop {
    animation: pop 0.3s ease;
}
