/* Games Launcher — N-Gage / Lebedev Style */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Tahoma', 'Arial', 'Helvetica', sans-serif;
    background: #fff;
    color: #111;
    min-height: 100vh;
}

/* === HEADER === */
.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 40px;
    background: #000;
    color: #fff;
    border-bottom: 4px solid #d00;
}

.header-logo { display: flex; align-items: center; gap: 12px; }
.logo-icon { font-size: 28px; }
.header-logo h1 { font-size: 1.2em; font-weight: 900; text-transform: uppercase; letter-spacing: 2px; }
.header-subtitle { font-size: 0.7em; color: #999; letter-spacing: 1px; margin-top: 2px; }

.header-auth { display: flex; align-items: center; gap: 8px; }

.header-auth .btn {
    padding: 8px 20px;
    border: 2px solid #d00;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    font-family: 'Tahoma', 'Arial', sans-serif;
    transition: none;
}

.btn-login { background: transparent; color: #fff; }
.btn-login:hover { background: #d00; }

.btn-register { background: #d00; color: #fff; }
.btn-register:hover { background: #b00; }

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border: 2px solid #d00;
    border-radius: 3px;
    cursor: pointer;
}

.user-badge:hover { background: #d00; }
.user-badge .avatar { font-size: 1.5em; }
.user-badge .info { line-height: 1.3; }
.user-badge .nickname { font-weight: 700; font-size: 0.85em; }
.user-badge .level { font-size: 0.65em; color: #999; }

/* === HERO === */
.hero {
    text-align: center;
    padding: 40px 20px 24px;
    background: #f5f5f5;
    border-bottom: 4px solid #d00;
}

.hero h2 {
    font-size: 1.6em;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #000;
}

.hero p {
    color: #666;
    font-size: 0.9em;
    margin-top: 8px;
    line-height: 1.5;
}

/* === GAMES GRID === */
.games-grid {
    display: flex;
    gap: 0;
    justify-content: center;
    padding: 0;
    flex-wrap: wrap;
    max-width: 900px;
    margin: 24px auto;
}

.game-card {
    width: 260px;
    padding: 28px 24px;
    background: #fff;
    text-align: center;
    cursor: pointer;
    border-left: 4px solid #ddd;
}

.game-card:first-child { border-left: none; }

.game-card:hover { background: #f5f5f5; }

.game-card.go { border-top: 4px solid #d00; }
.game-card.shess { border-top: 4px solid #333; }
.game-card.snake { border-top: 4px solid #000; }

.game-card .game-icon { font-size: 3em; display: block; margin-bottom: 12px; }

.game-card h3 {
    font-size: 1em;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.game-desc {
    font-size: 0.75em;
    color: #666;
    margin-bottom: 16px;
    line-height: 1.5;
    min-height: 36px;
}

.game-players {
    font-size: 0.7em;
    color: #999;
    margin-bottom: 16px;
}

.btn-play {
    padding: 10px 28px;
    border: 3px solid #d00;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: 900;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Tahoma', 'Arial', sans-serif;
    background: #fff;
    color: #d00;
    transition: none;
}

.btn-play:hover { background: #d00; color: #fff; }

/* === BOTTOM NAV === */
.bottom-nav {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 8px 20px 32px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 12px 28px;
    border: 2px solid #222;
    border-radius: 3px;
    background: #fff;
    color: #222;
    font-size: 0.85em;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Tahoma', 'Arial', sans-serif;
    transition: none;
}

.nav-btn:hover { background: #d00; border-color: #d00; color: #fff; }

/* === FOOTER === */
.main-footer {
    text-align: center;
    padding: 16px;
    font-size: 0.7em;
    color: #999;
    border-top: 2px solid #eee;
}

.main-footer a { color: #d00; text-decoration: none; font-weight: 700; }

/* === MODALS === */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 200;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active { display: flex; }

.modal {
    background: #fff;
    border: 4px solid #d00;
    border-radius: 3px;
    padding: 32px;
    width: 90%;
    max-width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 1.5em;
    cursor: pointer;
    color: #999;
    background: none;
    border: none;
    font-weight: 700;
}

.modal-close:hover { color: #d00; }

.modal h2 {
    font-size: 1.1em;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    text-align: center;
    color: #d00;
}

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.8em; color: #666; margin-bottom: 4px; text-transform: uppercase; font-weight: 700; letter-spacing: 1px; }

.form-group input {
    width: 100%;
    padding: 10px 12px;
    background: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 3px;
    color: #111;
    font-size: 0.9em;
    font-family: 'Tahoma', 'Arial', sans-serif;
}

.form-group input:focus { outline: none; border-color: #d00; }

.form-submit {
    width: 100%;
    padding: 12px;
    background: #d00;
    border: none;
    border-radius: 3px;
    font-size: 0.9em;
    font-weight: 900;
    color: #fff;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Tahoma', 'Arial', sans-serif;
    margin-top: 4px;
}

.form-submit:hover { background: #b00; }

.form-switch {
    text-align: center;
    margin-top: 14px;
    font-size: 0.8em;
    color: #999;
}

.form-switch a { color: #d00; cursor: pointer; font-weight: 700; text-decoration: underline; }
.form-error { color: #d00; font-size: 0.8em; text-align: center; margin-bottom: 10px; display: none; }

/* === PROFILE SLIDE-IN === */
.profile-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 250;
}

.profile-overlay.active { display: block; }

.profile-panel {
    position: fixed;
    top: 0; right: -400px;
    width: 380px;
    height: 100%;
    background: #fff;
    border-left: 4px solid #d00;
    z-index: 260;
    transition: right 0.25s ease;
    overflow-y: auto;
    padding: 24px;
    max-width: 90vw;
}

.profile-panel.open { right: 0; }

.profile-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #eee;
}

.profile-panel .panel-header h2 { font-size: 1em; font-weight: 900; text-transform: uppercase; color: #d00; }
.panel-close { font-size: 1.5em; cursor: pointer; color: #999; background: none; border: none; font-weight: 700; }
.panel-close:hover { color: #d00; }

.profile-header { text-align: center; margin-bottom: 16px; }
.profile-avatar { font-size: 3em; margin-bottom: 4px; }
.profile-name { font-size: 1.2em; font-weight: 900; }
.profile-level { font-size: 0.75em; color: #999; text-transform: uppercase; letter-spacing: 1px; }

.xp-bar {
    height: 4px;
    background: #eee;
    margin: 12px 0;
    overflow: hidden;
}

.xp-fill {
    height: 100%;
    background: #d00;
}

.profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 16px 0;
}

.stat-box {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 3px;
    text-align: center;
    border: 1px solid #ddd;
}

.stat-box .s-icon { font-size: 1.2em; }
.stat-box .s-value { font-size: 1em; font-weight: 900; margin-top: 2px; color: #d00; }
.stat-box .s-label { font-size: 0.6em; color: #999; text-transform: uppercase; letter-spacing: 1px; }

.section-label {
    font-size: 0.75em;
    font-weight: 900;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 16px 0 10px;
}

/* === ACHIEVEMENTS === */
.ach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
    margin: 10px 0;
}

.ach-item {
    padding: 10px;
    background: #f5f5f5;
    border-radius: 3px;
    text-align: center;
    border: 1px solid #ddd;
}

.ach-item.unlocked { border-color: #d00; background: #fff; }
.ach-item.locked { opacity: 0.3; }
.ach-icon { font-size: 1.5em; margin-bottom: 4px; }
.ach-title { font-size: 0.7em; font-weight: 700; }
.ach-desc { font-size: 0.55em; color: #999; margin-top: 2px; }

/* === LEADERBOARD === */
.lb-table { width: 100%; border-collapse: collapse; font-size: 0.85em; }
.lb-table th { text-align: left; padding: 8px 6px; color: #999; font-size: 0.7em; font-weight: 700; text-transform: uppercase; border-bottom: 2px solid #ddd; }
.lb-table td { padding: 8px 6px; border-bottom: 1px solid #eee; }
.lb-table tr:hover td { background: #f5f5f5; }
.lb-rank { color: #d00; font-weight: 900; width: 30px; }
.lb-player { display: flex; align-items: center; gap: 6px; }
.lb-avatar { font-size: 1.1em; }
.lb-xp { font-weight: 900; color: #d00; }
.lb-rating { color: #333; font-weight: 700; }
.lb-hs { color: #000; font-weight: 700; }

/* === AVATAR PICKER === */
.avatar-picker { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

.avatar-option {
    font-size: 1.5em;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 3px;
    border: 2px solid transparent;
}

.avatar-option:hover { border-color: #d00; }
.avatar-option.selected { border-color: #d00; background: #fee; }

/* === TOAST === */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #000;
    border: 2px solid #d00;
    border-radius: 3px;
    padding: 14px 20px;
    display: none;
    z-index: 300;
    max-width: 320px;
}

.toast.active { display: block; }

.toast-title { font-weight: 900; font-size: 0.9em; color: #d00; margin-bottom: 4px; }
.toast-desc { font-size: 0.75em; color: #ccc; }

/* === RESPONSIVE === */
@media (max-width: 700px) {
    .main-header { padding: 10px 16px; }
    .header-logo h1 { font-size: 1em; }
    .game-card { width: 100%; max-width: 340px; border-left: none; border-bottom: 4px solid #ddd; }
    .game-card:first-child { border-top: 4px solid #d00; }
    .game-card:not(:first-child) { border-top: none; }
    .profile-panel { width: 100%; max-width: 100vw; right: -100vw; }
    .profile-panel.open { right: 0; }
    .modal { padding: 20px; }
    .hero h2 { font-size: 1.3em; }
}

@media (max-width: 500px) {
    .header-auth .btn { padding: 6px 14px; font-size: 0.75em; }
    .nav-btn { padding: 10px 18px; font-size: 0.75em; }
}
