:root {
    --bg-color: #0b0c10;
    --text-main: #ffffff;
    --text-muted: #c5c6c7;
    --accent: #66fcf1;
    --accent-dark: #45a29e;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.05);
}

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

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

/* Фоновые анимированные градиенты */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #66fcf1;
    top: -100px;
    left: -100px;
    border-radius: 50%;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: #7b2cbf;
    bottom: -150px;
    right: -100px;
    border-radius: 50%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 50px) scale(1.2); }
}

/* Glassmorphism контейнер */
.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    background: linear-gradient(to right, #ffffff, #66fcf1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.widgets {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.widget {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease;
}

.widget:hover {
    transform: translateY(-5px);
}

#clock {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 2px;
}

#date, .weather-city {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.weather-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    margin-top: 5px;
}

#weather-temp {
    font-size: 2.5rem;
    font-weight: 600;
    color: #fff;
}

#weather-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 5px;
}

.game-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-section h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-muted);
}

.game-container {
    position: relative;
    width: 300px;
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(102, 252, 241, 0.1);
    border: 2px solid rgba(102, 252, 241, 0.3);
}

canvas {
    background-color: #111;
    display: block;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
    z-index: 10;
}

button {
    background: var(--accent);
    color: var(--bg-color);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s ease;
}

button:hover {
    background: #fff;
    box-shadow: 0 0 15px var(--accent);
    transform: translateY(-2px);
}

#score-text {
    margin-top: 15px;
    font-size: 1.2rem;
    color: #fff;
}

#score {
    color: var(--accent);
    font-weight: bold;
}

.controls {
    margin-top: 15px;
    font-size: 0.85rem;
    color: #888;
}

.mobile-controls {
    display: none;
    margin-top: 15px;
}

.mobile-controls div {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.mobile-controls button {
    width: 45px;
    height: 45px;
    padding: 0;
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
    font-size: 1.2rem;
    border-radius: 8px;
}

@media (max-width: 600px) {
    .glass-container {
        padding: 30px 20px;
    }
    
    .widgets {
        flex-direction: column;
    }
    
    .mobile-controls {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

/* Эффект при проигрыше */
@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.body-game-over .blob-1 { background: #ff4b4b; animation: float 1s infinite alternate; }
.body-game-over .blob-2 { background: #ff0000; animation: float 1s infinite alternate; }
.body-game-over .glass-container { 
    animation: shake 0.5s; 
    box-shadow: 0 0 50px rgba(255, 75, 75, 0.5); 
    border-color: rgba(255, 75, 75, 0.5); 
}

/* Инпуты и модальные окна */
#player-name {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--accent);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-family: 'Outfit', sans-serif;
    outline: none;
    text-align: center;
}

.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: 100;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-color);
    border: 1px solid var(--glass-border);
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    position: relative;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.close {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}
.close:hover { color: white; }

.stats-table-container {
    margin-top: 20px;
    max-height: 250px;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
th {
    color: var(--accent);
    font-weight: 600;
}
