/* style.css */
body {
    background-color: #0f172a;
    color: white;
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden; /* Скроллду өчүрүү */
}

/* Негизги контейнер - экрандын 95% бийиктигин гана ээлейт */
.battle-container {
    display: flex;
    width: 98vw;
    height: 90vh; /* Бийиктигин чектедик */
    gap: 5px;
    background: #161e2e;
    border: 1px solid #38bdf8;
    border-radius: 10px;
}

.player-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    position: relative;
    box-sizing: border-box;
}

.divider { width: 2px; background: #38bdf8; opacity: 0.5; }

.side-header {
    text-align: center;
    font-size: 1.1rem;
    color: #38bdf8;
    margin-bottom: 5px;
    font-weight: bold;
}

/* Статистика бөлүгүн өтө компакттуу кылуу */
.stats-container {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
}

.stat-box {
    flex: 1;
    background: #1d4ed8;
    padding: 4px;
    border-radius: 4px;
    text-align: center;
    font-size: 0.75rem;
}

.info-bar {
    background: rgba(255, 255, 255, 0.05);
    padding: 5px 10px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.status-text { font-size: 0.8rem; }

.ready-btn {
    background: #22c55e;
    border: none;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.7rem;
}

/* СЕТКАНЫ ОҢДОО: Экранга толук батыруу */
.game-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr); /* 4 катарды тең батыруу */
    gap: 5px;
    flex-grow: 1; /* Калган бош орунду ээлейт */
    max-height: 65vh; /* Бийиктикти катуу чектөө */
}

/* Квадраттардын өлчөмүн экранга жараша өзгөртүү */
.card {
    width: 100%;
    height: 100%;
    background: #1e293b;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem; /* Сандардын чоңдугу */
    font-weight: 800;
    user-select: none;
    border: 1px solid rgba(255,255,255,0.03);
}

.card.active { 
    background: #38bdf8; 
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
    color: white;
}

.card.hidden { background: #f8fafc; color: transparent; }
.card.correct { visibility: hidden; }

/* Натыйжа модалы */
.side-modal {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.98);
    z-index: 100;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px;
    text-align: center;
}

.result-img { width: 70px; height: 70px; border-radius: 8px; margin-bottom: 5px; }
.percent-display { color: #00ff00; font-size: 1rem; font-weight: bold; }
.motivation-text { font-size: 0.75rem; margin: 5px 0; line-height: 1.2; }
.restart-btn { padding: 6px 12px; font-size: 0.8rem; background: #38bdf8; color: white; border: none; border-radius: 4px; cursor: pointer; }