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

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #1a1a2e;
    color: #eee;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#app {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    background: #16213e;
    position: relative;
    overflow: hidden;
}

/* Главный экран */
#main-screen {
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

header h1 {
    font-size: 24px;
    color: #e94560;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

.header-buttons button {
    background: #0f3460;
    border: none;
    color: #eee;
    font-size: 20px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
}

.header-buttons button:hover {
    background: #e94560;
}

/* Категории */
.category-section {
    margin-bottom: 28px;
}

.category-title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #a0a0b0;
    margin-bottom: 12px;
    padding-left: 4px;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.game-card {
    background: #0f3460;
    border-radius: 16px;
    padding: 16px 8px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
}

.game-card:hover {
    background: #1a4a8a;
    transform: scale(1.03);
}

.game-card:active {
    transform: scale(0.95);
}

.game-card .icon {
    font-size: 32px;
    display: block;
    margin-bottom: 6px;
}

.game-card .name {
    font-size: 12px;
    color: #ccc;
}

/* Модальное окно */
.modal {
    position: absolute;
    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: 10;
}

.modal-content {
    background: #1a1a2e;
    border: 2px solid #0f3460;
    border-radius: 20px;
    padding: 28px 24px;
    width: 85%;
    text-align: center;
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 20px;
    cursor: pointer;
    color: #888;
}

#game-info-icon {
    font-size: 56px;
    margin-bottom: 8px;
}

#game-info-title {
    font-size: 22px;
    margin-bottom: 12px;
    color: #e94560;
}

#game-info-description {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 18px;
    line-height: 1.5;
}

.game-info-stats {
    background: #0f3460;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 20px;
    font-size: 13px;
    line-height: 1.8;
    text-align: left;
}

#game-info-play-btn {
    background: #e94560;
    color: #fff;
    border: none;
    padding: 14px 48px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

#game-info-play-btn:hover {
    background: #c23152;
}

/* Экран игры */
#game-screen {
    padding: 0;
    height: 100%;
}

#game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #0f3460;
    font-size: 14px;
}

#game-title {
    font-weight: bold;
    color: #e94560;
}

#game-timer {
    color: #ffd700;
}

#game-score {
    color: #4ecca3;
}

#game-container {
    padding: 16px;
    height: calc(100% - 52px);
}

/* Экран результата */
#result-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 30px;
    text-align: center;
}

#result-icon {
    font-size: 64px;
    margin-bottom: 12px;
}

#result-title {
    font-size: 20px;
    color: #e94560;
    margin-bottom: 8px;
}

#result-score {
    font-size: 52px;
    font-weight: bold;
    color: #4ecca3;
    margin-bottom: 6px;
}

#result-message {
    font-size: 14px;
    color: #ffd700;
    margin-bottom: 28px;
}

#result-retry-btn,
#result-menu-btn {
    width: 80%;
    padding: 14px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 10px;
    border: none;
}

#result-retry-btn {
    background: #e94560;
    color: #fff;
}

#result-menu-btn {
    background: #0f3460;
    color: #ccc;
}

#result-retry-btn:hover {
    background: #c23152;
}

#result-menu-btn:hover {
    background: #1a4a8a;
}

/* Служебные */
.hidden {
    display: none !important;
}

.fullscreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.game-card.locked {
    opacity: 0.4;
    filter: grayscale(100%);
    pointer-events: none;
}

.game-card.ready {
    border: 1px solid #4ecca3;
}

.game-card.ready:hover {
    border-color: #e94560;
}
