:root {
    --bg: #0f172a;
    --primary: #10b981;
    --danger: #ef4444;
    --accent: #3b82f6;
    --text: #f8fafc;
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #1e293b, #020617);
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(2, 6, 23, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 10;
    text-align: center;
    padding: 2rem;
    transition: opacity 0.3s ease;
}

.hidden {
    display: none !important;
}

h1 {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 900;
    margin-bottom: 1rem;
    color: var(--primary);
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
    letter-spacing: 2px;
}

h1.red {
    color: var(--danger);
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

p {
    font-size: clamp(1rem, 4vw, 1.25rem);
    margin-bottom: 2.5rem;
    max-width: 600px;
    width: 90%;
    opacity: 0.8;
}

.buttons {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

button {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    border: 2px solid var(--primary);
    color: var(--text);
    padding: clamp(0.8rem, 3vw, 1.5rem) clamp(1.5rem, 5vw, 3rem);
    font-size: clamp(1rem, 4vw, 1.5rem);
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.1), inset 0 0 10px rgba(16, 185, 129, 0.1);
}

button:hover {
    background: linear-gradient(135deg, var(--primary), #059669);
    color: #000;
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.8), inset 0 0 20px rgba(255, 255, 255, 0.4);
    transform: translateY(-5px) scale(1.05);
}

button:active {
    transform: translateY(2px) scale(0.95);
}

#btn-die {
    border-color: var(--danger);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.1);
}

#btn-die:hover {
    background: linear-gradient(135deg, var(--danger), #b91c1c);
    color: white;
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.8);
}

#btn-shop {
    border-color: #fbbf24;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(251, 191, 36, 0.05));
    color: #fbbf24;
}

#btn-shop:hover {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #000;
    box-shadow: 0 0 40px rgba(251, 191, 36, 0.8);
}

#btn-school {
    border-color: #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
    color: #3b82f6;
}

#btn-school:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.8);
}

/* Shop Styles */
.avatar-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    max-width: 1000px;
    max-height: 50vh;
    overflow-y: auto;
    padding: 1rem;
    margin-bottom: 1rem;
}

.avatar-grid::-webkit-scrollbar { width: 8px; }
.avatar-grid::-webkit-scrollbar-thumb { background: #fbbf24; border-radius: 4px; }

.avatar-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #334155;
    border-radius: 12px;
    padding: 1rem;
    width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
}

.avatar-card.owned {
    border-color: #10b981;
}

.avatar-card.equipped {
    border-color: #fbbf24;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
    background: rgba(251, 191, 36, 0.1);
}

.avatar-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-preview {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    border-radius: 50%;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5);
}

.avatar-card button {
    padding: 0.5rem;
    font-size: 1rem;
    width: 100%;
}

.avatar-card button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text) !important;
    border-color: #334155 !important;
    box-shadow: none !important;
}

/* ===== INPUT STYLES ===== */
.custom-input {
    width: 100%;
    padding: 1rem;
    font-size: 1.5rem;
    font-family: 'Outfit', sans-serif;
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #334155;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
}

.custom-input:focus {
    border-color: #38bdf8;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.custom-input::placeholder {
    color: #64748b;
}

/* ===== MOBILE CONTROLS ===== */
#mobile-controls {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 100%;
    z-index: 500;
    pointer-events: none; /* Propustí kliky na canvas */
}

/* Joystick zóna - spodní levá půlka */
#joystick-zone {
    position: absolute;
    bottom: 30px;
    left: 30px;
    width: 150px;
    height: 150px;
    pointer-events: all;
    border-radius: 50%;
    /* Může sloužit i jako dotyková plocha, nebo jen držák grafiky */
}

#joystick-base {
    position: absolute;
    width: 120px;
    height: 120px;
    top: 15px; left: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    backdrop-filter: blur(4px);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

#joystick-knob {
    position: absolute;
    width: 60px;
    height: 60px;
    top: 30px; left: 30px; /* Center */
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.6);
    transition: transform 0.05s linear;
}

/* Přebít - pravý spodní roh */
#btn-mobile-reload {
    position: absolute;
    bottom: 40px;
    right: 40px;
    width: 90px; height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24, #d97706) !important;
    border: 3px solid #fde047 !important;
    color: #000 !important;
    font-size: 1rem !important;
    font-weight: 900 !important;
    box-shadow: 0 0 20px rgba(251,191,36,0.6) !important;
    pointer-events: all;
    line-height: 1.2;
}

/* Zobrazit na dotykových zařízeních */
@media (pointer: coarse) {
    #mobile-controls {
        display: block;
    }
}

