* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Source Sans Pro', Arial, sans-serif; }

body {
    background: #eef0f3;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #333;
}

/* ---------- Навбар ---------- */
.navbar {
    background-color: #0074bd;
    height: 46px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    color: #fff;
    font-weight: 900;
    font-size: 22px;
    text-decoration: none;
    letter-spacing: 1px;
}

.navbar-nav { display: flex; align-items: center; }

.navbar-nav a {
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: bold;
    margin-left: 22px;
    white-space: nowrap;
}
.navbar-nav a:hover { text-decoration: underline; }

.tix-pill {
    background: rgba(255,255,255,0.15);
    padding: 5px 12px;
    border-radius: 14px;
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    margin-left: 22px;
}

.badge-check {
    width: 15px;
    height: 15px;
    vertical-align: middle;
    margin-left: 3px;
}

/* ---------- Аватарки в навбаре + друзья ---------- */
.nav-identity { display: flex; align-items: center; gap: 8px; margin-left: 18px; }
.nav-username {
    color: #fff; text-decoration: none; font-size: 13px; font-weight: bold;
    display: flex; align-items: center; white-space: nowrap;
}
.request-dot {
    position: absolute; top: -2px; right: -2px; width: 10px; height: 10px;
    background: #e2231a; border: 2px solid #0074bd; border-radius: 50%;
}
.nav-avatars { display: flex; align-items: center; gap: 6px; margin-left: 6px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,0.25); position: relative; }
.nav-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: rgba(255,255,255,0.25); color: #fff; font-weight: bold; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; text-decoration: none; cursor: pointer; position: relative;
    border: 2px solid rgba(255,255,255,0.5); flex-shrink: 0;
}
.nav-avatar img { width: 100%; height: 100%; object-fit: cover; }
.nav-avatar.me-avatar { border-color: #fff; }
.online-dot {
    position: absolute; bottom: -1px; right: -1px; width: 9px; height: 9px;
    background: #00d26a; border: 2px solid #0074bd; border-radius: 50%;
}
.friend-popup {
    display: none; position: absolute; top: 40px; left: 50%; transform: translateX(-50%);
    background: white; color: #333; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,0.35);
    padding: 12px; width: 160px; z-index: 300; text-align: center;
}
.friend-popup.open { display: block; }
.friend-popup-name { font-weight: bold; font-size: 13px; margin-bottom: 8px; }
.friend-popup .btn { display: block; width: 100%; margin-bottom: 6px; font-size: 12px; padding: 7px; }
.friend-popup .btn:last-child { margin-bottom: 0; }

.avatar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.btn-gray { background-color: #777; }
.btn-gray:hover { background-color: #666; }

/* ---------- Контент ---------- */
.page {
    flex: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px 60px;
}

.card {
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    padding: 25px;
}

.page-title {
    font-size: 24px;
    font-weight: 900;
    color: #004276;
    margin-bottom: 20px;
}

/* ---------- Формы ---------- */
.form-narrow { max-width: 380px; margin: 40px auto; }

.form-group { margin-bottom: 14px; }

.form-group label {
    display: block;
    font-size: 12px;
    color: #777;
    font-weight: bold;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.form-control {
    width: 100%;
    height: 38px;
    padding: 8px 12px;
    border: 1px solid #c3c3c3;
    border-radius: 3px;
    font-size: 14px;
    outline: none;
}
.form-control:focus { border-color: #0074bd; }

textarea.form-control { height: 90px; resize: vertical; padding-top: 10px; }

.btn {
    display: inline-block;
    background-color: #0074bd;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 3px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}
.btn:hover { background-color: #005c96; }

.btn-green { background-color: #00a200; }
.btn-green:hover { background-color: #008800; }

.btn-red { background-color: #da291c; }
.btn-red:hover { background-color: #b52216; }

.btn-block { width: 100%; text-align: center; }
.btn:disabled { background-color: #ccc; cursor: default; color: #888; }

.alert {
    padding: 10px 14px;
    border-radius: 3px;
    font-size: 13px;
    margin-bottom: 14px;
}
.alert.error { background-color: #f2dede; color: #a94442; border: 1px solid #ebccd1; }
.alert.success { background-color: #dff0d8; color: #3c763d; border: 1px solid #d6e9c6; }

/* ---------- Каталог игр ---------- */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.game-card {
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    text-decoration: none;
    color: #333;
    display: block;
    transition: transform 0.15s;
}
.game-card:hover { transform: translateY(-3px); }

.game-thumb {
    width: 100%;
    height: 124px;
    background: linear-gradient(135deg, #3c4257, #5a6178);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.5);
    font-size: 12px;
}

.game-info { padding: 10px 12px; }
.game-info .title { font-weight: bold; font-size: 14px; margin-bottom: 4px; }
.game-info .owner { font-size: 12px; color: #888; }
.game-info .plays { font-size: 11px; color: #aaa; margin-top: 4px; }

/* ---------- Профиль ---------- */
.profile-head { display: flex; align-items: center; gap: 20px; margin-bottom: 25px; }
.avatar-circle {
    width: 84px; height: 84px; border-radius: 50%;
    background: #0074bd; color: white; font-size: 34px; font-weight: 900;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.profile-name { font-size: 22px; font-weight: 900; color: #222; }
.profile-tix { color: #777; font-size: 14px; margin-top: 4px; }

.option-box {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 16px;
}
.option-box h3 { color: #004276; margin-bottom: 8px; }
.option-box p { color: #666; font-size: 14px; margin-bottom: 14px; line-height: 1.5; }

footer {
    text-align: center;
    color: #999;
    font-size: 12px;
    padding: 20px;
}
