/* =========================
   MATECHESS DARK THEME
=========================
*/
:root {
    --bg: #050b1f;
    --bg-alt: #07112b;
    --surface: rgba(12, 28, 72, 0.92);
    --surface-strong: rgba(11, 22, 54, 0.98);
    --surface-soft: rgba(16, 35, 86, 0.74);
    --border: rgba(127, 194, 255, 0.18);
    --text: #f3f7ff;
    --muted: #96a7d6;
    --muted-strong: #7d90b0;
    --primary: #4f8cff;
    --primary-strong: #3d6feb;
    --success: #3cd07a;
    --danger: #ff5c7a;
    --warning: #f0b33b;
    --accent: #7fc2ff;
    --shadow: 0 32px 90px rgba(4, 8, 24, 0.4);
    --radius: 28px;
    --radius-sm: 16px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: radial-gradient(circle at top left, rgba(79, 140, 255, 0.18), transparent 26%),
                radial-gradient(circle at bottom right, rgba(131, 75, 255, 0.14), transparent 24%),
                linear-gradient(180deg, #020618 0%, #05112a 50%, #07162f 100%);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 18% 20%, rgba(79, 140, 255, 0.12), transparent 24%),
                radial-gradient(circle at 86% 10%, rgba(67, 203, 255, 0.08), transparent 18%);
    pointer-events: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

img {
    max-width: 100%;
    display: block;
}

.page-shell {
    min-height: 100vh;
    padding: 28px 0 40px;
}

.container {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
}

.tournament-page .page-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    margin-bottom: 30px;
    padding: 26px 30px;
    border-radius: 32px;
    background: rgba(10, 21, 55, 0.92);
    border: 1px solid rgba(127, 194, 255, 0.14);
    box-shadow: var(--shadow);
}

.section-block {
    margin-top: 26px;
    padding: 26px 30px;
    border-radius: 32px;
    background: rgba(10, 21, 55, 0.92);
    border: 1px solid rgba(127, 194, 255, 0.14);
    box-shadow: var(--shadow);
}

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

.gift-shop-balance-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.gift-shop-balance-card,
.gift-item-card,
.gift-tx-row {
    border-radius: 24px;
    border: 1px solid rgba(127, 194, 255, 0.14);
    background: rgba(10, 21, 55, 0.86);
    box-shadow: 0 18px 48px rgba(2, 6, 18, 0.2);
}

.gift-shop-balance-card {
    padding: 22px;
    display: grid;
    gap: 10px;
}

.gift-shop-balance-label {
    color: var(--muted);
    font-size: 0.92rem;
}

.gift-shop-balance-value {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 800;
    color: #d9ebff;
}

.gift-shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.gift-item-card {
    padding: 22px;
    display: grid;
    gap: 14px;
    cursor: pointer;
}

.gift-item-image-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(127, 194, 255, 0.18);
    background: rgba(5, 12, 34, 0.8);
}

.gift-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gift-item-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: #9ccfff;
}

.gift-item-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.gift-item-price {
    color: #8fd1ff;
    font-weight: 800;
}

.gift-item-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.gift-item-desc-hint {
    color: var(--muted);
    font-size: 0.8rem;
}

/* Gift Item Description Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal[style*="display: none"] {
    pointer-events: none;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    position: relative;
    z-index: 1001;
    background: var(--bg);
    border-radius: 20px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow);
    border: 1px solid rgba(127, 194, 255, 0.2);
    animation: slideUp 0.3s ease-out;
}

.gift-item-modal-content h2 {
    margin: 0 0 16px 0;
    font-size: 24px;
    line-height: 1.3;
    color: var(--text);
}

.gift-item-modal-content p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary, rgba(255, 255, 255, 0.8));
    white-space: pre-wrap;
    word-wrap: break-word;
}

.gift-item-edit-modal-content h2 {
    margin-bottom: 14px;
}

.gift-item-edit-textarea {
    width: 100%;
    border: 1px solid rgba(127, 194, 255, 0.22);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text);
    border-radius: 12px;
    padding: 12px 14px;
    resize: vertical;
    min-height: 140px;
    font: inherit;
    line-height: 1.5;
    margin-bottom: 14px;
}

.gift-item-edit-textarea:focus {
    outline: none;
    border-color: rgba(127, 194, 255, 0.45);
}

.gift-item-edit-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: rgba(127, 194, 255, 0.1);
    color: var(--text);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.gift-item-availability {
    min-height: 22px;
}

.gift-shop-transactions {
    display: grid;
    gap: 14px;
}

.gift-tx-row {
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.gift-tx-source {
    color: var(--text);
    font-weight: 700;
    text-transform: capitalize;
}

.gift-tx-right {
    text-align: right;
    display: grid;
    gap: 6px;
}

.gift-tx-earn {
    color: var(--success);
    font-weight: 800;
}

.gift-tx-spend {
    color: var(--warning);
    font-weight: 800;
}

.tournament-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.tournament-card,
.event-card {
    display: grid;
    gap: 18px;
    padding: 24px;
    border-radius: 28px;
    background: rgba(10, 21, 55, 0.96);
    border: 1px solid rgba(127, 194, 255, 0.12);
    box-shadow: 0 20px 60px rgba(2, 6, 18, 0.24);
    transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.tournament-card:hover,
.event-card:hover {
    transform: translateY(-2px);
    border-color: rgba(79, 140, 255, 0.26);
}

.tournament-card-top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.tournament-card-title,
.event-card-title {
    display: grid;
    gap: 10px;
}

.tournament-card-title h3 {
    font-size: 1.15rem;
    color: var(--text);
}

.tournament-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.tournament-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.tournament-card-summary {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.tournament-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tournament-card-stats span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(79, 140, 255, 0.1);
    color: #c7d8ff;
    font-size: 0.9rem;
    font-weight: 700;
}

.tournament-card button {
    width: auto;
    min-width: 130px;
}

@media (max-width: 1088px) {
    .tournament-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .tournament-page .page-intro,
    .section-block {
        padding: 22px;
        border-radius: 24px;
    }

    .tournament-card,
    .event-card {
        padding: 20px;
    }

    .leaderboard-hero {
        grid-template-columns: 1fr;
    }

    .leaderboard-hero-side {
        justify-content: flex-start;
    }

    .leaderboard-table-head {
        display: none;
    }

    .leaderboard-row {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 10px;
        align-items: center;
        padding: 14px 16px;
    }

    .leaderboard-rank-cell {
        justify-content: flex-start;
        min-width: 58px;
    }

    .leaderboard-player-cell {
        gap: 10px;
        min-width: 0;
    }

    .leaderboard-avatar {
        width: 44px;
        height: 44px;
    }

    .leaderboard-player-meta {
        min-width: 0;
        flex: 1;
    }

    .leaderboard-player-meta strong {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.25;
        word-break: normal;
        overflow-wrap: anywhere;
        font-size: 0.95rem;
    }

    .leaderboard-rating-cell {
        justify-content: flex-end;
        min-width: 78px;
    }

    .leaderboard-rating-cell::before {
        content: none;
    }
}

html[lang="ru"] .leaderboard-rating-cell::before {
    content: "Рейтинг";
}

h1, h2, h3, h4, h5 {
    margin: 0;
    color: var(--text);
}

h1 {
    font-size: clamp(2.4rem, 3vw, 3.4rem);
    line-height: 1.02;
}

h2 {
    font-size: 1.2rem;
}

h3 {
    font-size: 1rem;
}

p,
.muted,
.pill,
.badge {
    color: var(--muted);
}

.muted {
    font-size: 0.95rem;
}

.btn {
    border: none;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0.95rem 1.35rem;
    font-weight: 700;
    transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
    min-height: 52px;
    letter-spacing: 0.01em;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: white;
    box-shadow: 0 16px 36px rgba(79, 140, 255, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5f9dff, #4c7cf0);
}

.btn-secondary {
    background: rgba(17, 36, 84, 0.88);
    color: var(--text);
    border: 1px solid rgba(127, 194, 255, 0.18);
}

.btn-secondary:hover {
    background: rgba(22, 44, 101, 0.96);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 16px 30px rgba(255, 92, 122, 0.28);
}

.btn-success {
    background: var(--success);
    color: white;
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.event-room-page {
    position: relative;
    padding-bottom: 10px;
}

.room-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 22px;
    padding: 28px 32px;
    background: rgba(10, 23, 60, 0.92);
    border: 1px solid rgba(127, 194, 255, 0.16);
    border-radius: 32px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    overflow: hidden;
}

.room-title-block {
    display: grid;
    gap: 14px;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.8rem;
    color: #8ab8ff;
}

.room-heading {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.room-heading h1 {
    letter-spacing: -0.04em;
}

.room-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 14px;
}

.room-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.room-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    margin-top: 24px;
    align-items: start;
}

.panel {
    background: rgba(13, 27, 62, 0.92);
    border: 1px solid rgba(127, 194, 255, 0.14);
    border-radius: 28px;
    box-shadow: var(--shadow);
    padding: 24px;
    min-height: 520px;
}

.sidebar {
    position: sticky;
    top: 24px;
    align-self: start;
    max-height: calc(100vh - 64px);
}

.players-panel,
.matches-panel {
    padding: 24px;
}


.panel-header,
.panel-header-small {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
}

.panel-subtitle {
    margin-top: 8px;
    color: var(--muted-strong);
    font-size: 0.96rem;
    line-height: 1.6;
}

.card {
    background: rgba(14, 31, 74, 0.94);
    border: 1px solid rgba(127, 194, 255, 0.12);
    border-radius: 28px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    padding: 24px;
    margin-bottom: 22px;
}

.card:hover {
    border-color: rgba(79, 140, 255, 0.22);
}

.primary-btn,
.btn.primary-btn {
    border: none;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0.95rem 1.35rem;
    font-weight: 700;
    transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
    min-height: 52px;
    letter-spacing: 0.01em;
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: white;
    box-shadow: 0 16px 36px rgba(79, 140, 255, 0.25);
}

.primary-btn:hover,
.btn.primary-btn:hover {
    background: linear-gradient(135deg, #5f9dff, #4c7cf0);
}

.danger-btn,
.btn.danger-btn {
    border: none;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0.95rem 1.35rem;
    font-weight: 700;
    transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
    min-height: 52px;
    letter-spacing: 0.01em;
    background: var(--danger);
    color: white;
    box-shadow: 0 16px 30px rgba(255, 92, 122, 0.28);
}

.danger-btn:hover,
.btn.danger-btn:hover {
    opacity: 0.95;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 24px;
    margin-bottom: 28px;
    background: rgba(10, 23, 60, 0.94);
    border: 1px solid rgba(127, 194, 255, 0.14);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.top-bar h1 {
    font-size: clamp(1.9rem, 2.6vw, 2.4rem);
}

.section {
    margin-top: 24px;
}

.event-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 920px) {
    .event-grid {
        grid-template-columns: 1fr;
    }
}

.leaderboard-page .container {
    display: grid;
    gap: 24px;
}

.leaderboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 24px;
    align-items: center;
}

.leaderboard-hero-subtitle {
    max-width: 720px;
}

.leaderboard-hero-side {
    display: flex;
    justify-content: flex-end;
}

.leaderboard-badge-card {
    display: grid;
    gap: 10px;
    min-width: 180px;
    text-align: center;
}

.leaderboard-badge-card strong {
    font-size: clamp(2rem, 3vw, 2.8rem);
    color: var(--text);
}

.leaderboard-badge-label {
    color: #9cc2ff;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.leaderboard-section {
    overflow: hidden;
}

.leaderboard-section-header {
    align-items: center;
}

.leaderboard-table-head {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) 120px;
    gap: 16px;
    padding: 0 20px 12px;
    color: var(--muted-strong);
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.leaderboard-list {
    display: grid;
    gap: 12px;
}

.leaderboard-row {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) 120px;
    gap: 16px;
    align-items: center;
    padding: 18px 20px;
    border-radius: 24px;
    background: rgba(10, 20, 48, 0.96);
    border: 1px solid rgba(127, 194, 255, 0.1);
    box-shadow: 0 18px 40px rgba(3, 10, 30, 0.18);
}

.leaderboard-row-top-1 {
    border-color: rgba(255, 215, 96, 0.44);
    background: linear-gradient(135deg, rgba(53, 39, 9, 0.96), rgba(22, 35, 72, 0.96));
}

.leaderboard-row-top-2 {
    border-color: rgba(210, 224, 255, 0.3);
}

.leaderboard-row-top-3 {
    border-color: rgba(255, 173, 119, 0.26);
}

.leaderboard-rank-cell,
.leaderboard-player-cell,
.leaderboard-rating-cell {
    display: flex;
    align-items: center;
}

.leaderboard-rank-cell {
    gap: 10px;
}

.leaderboard-rank-number {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
}

.leaderboard-rank-medal {
    font-size: 1.3rem;
}

.leaderboard-player-cell {
    gap: 14px;
    min-width: 0;
}

.leaderboard-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(79, 140, 255, 0.14);
    border: 1px solid rgba(127, 194, 255, 0.18);
    display: grid;
    place-items: center;
}
.leaderboard-avatar-link {
    text-decoration: none;
}
.leaderboard-avatar-link:hover,
.leaderboard-avatar-link:focus-visible {
    border-color: rgba(79, 140, 255, 0.38);
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.16);
}

.leaderboard-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.leaderboard-avatar-fallback {
    color: var(--text);
    font-weight: 800;
    letter-spacing: 0.03em;
}

.leaderboard-player-meta {
    min-width: 0;
}

.leaderboard-player-meta strong {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-player-link {
    color: inherit;
    text-decoration: none;
    display: block;
}

.leaderboard-player-link:hover strong {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.leaderboard-rating-cell {
    justify-content: flex-end;
}

.leaderboard-rating-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(79, 140, 255, 0.12);
    color: #dbe6ff;
    font-weight: 800;
}

.match-zone-card,
.challenge-panel {
    background: rgba(9, 19, 50, 0.96);
}

.form-grid {
    display: grid;
    gap: 14px;
}

input[type="number"],
input[type="text"],
input[type="url"],
input[type="search"],
input[type="datetime-local"] {
    width: 100%;
    border: 1px solid rgba(127, 194, 255, 0.16);
    border-radius: 18px;
    padding: 16px 18px;
    background: rgba(10, 22, 52, 0.94);
    color: var(--text);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus {
    outline: none;
    border-color: rgba(79, 140, 255, 0.35);
    box-shadow: 0 0 0 4px rgba(79, 140, 255, 0.12);
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 0.95rem;
    color: var(--text);
    background: rgba(72, 112, 207, 0.16);
}

.pill-neutral {
    background: rgba(255, 255, 255, 0.06);
}

.pill-info {
    background: rgba(79, 140, 255, 0.16);
    color: #dfe8ff;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    color: white;
    background: rgba(79, 140, 255, 0.92);
}

.badge-info {
    background: rgba(79, 140, 255, 0.16);
    color: #a9c8ff;
}

.badge-success {
    background: rgba(60, 208, 122, 0.18);
    color: #c7ffe3;
}

.badge-warning {
    background: rgba(240, 179, 59, 0.18);
    color: #fff0c2;
}

.badge-danger {
    background: rgba(255, 92, 122, 0.16);
    color: #ffd3df;
}

.players-list,
.matches-list,
.challenge-list {
    display: grid;
    gap: 14px;
}

.player-item,
.match-card,
.challenge-card {
    display: grid;
    gap: 12px;
    padding: 20px;
    border-radius: 22px;
    background: rgba(10, 20, 48, 0.96);
    border: 1px solid rgba(127, 194, 255, 0.1);
    box-shadow: 0 18px 40px rgba(3, 10, 30, 0.18);
}

.player-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
}

.player-item-actions {
    display: flex;
    justify-content: flex-end;
}

.player-link {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.player-link:hover .player-name > span:first-child {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.player-item:hover,
.match-card:hover,
.challenge-card:hover {
    transform: translateY(-1px);
    border-color: rgba(79, 140, 255, 0.24);
}

.player-item-current {
    background: rgba(47, 96, 199, 0.22);
}

.player-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #4f8cff, #5fb1ff);
    flex-shrink: 0;
}

.player-info {
    min-width: 0;
}

.player-name {
    font-weight: 700;
    font-size: 0.98rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-you {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(60, 208, 122, 0.16);
    color: #b8f7d1;
    font-size: 0.78rem;
    font-weight: 700;
}

.player-rating {
    margin-top: 6px;
    font-size: 0.92rem;
    color: var(--muted-strong);
}

.match-card-header,
.challenge-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.match-card-player {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.96rem;
    font-weight: 700;
}

.match-player-label {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(79, 140, 255, 0.12);
    color: #b7d5ff;
    font-size: 0.78rem;
    font-weight: 700;
}

.match-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.match-status.active {
    background: rgba(60, 208, 122, 0.18);
    color: #c7ffe3;
}

.match-status.finished {
    background: rgba(79, 140, 255, 0.16);
    color: #d9e7ff;
}

.match-status.disputed {
    background: rgba(255, 92, 122, 0.14);
    color: #ffd3df;
}

.match-status.waiting {
    background: rgba(240, 179, 59, 0.16);
    color: #fff3c5;
}

.challenge-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted-strong);
    font-size: 0.94rem;
}

.challenge-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.challenge-card button {
    min-width: 120px;
}

.matchmaking-panel {
    display: grid;
    gap: 18px;
    align-items: center;
    margin-top: 22px;
}

.matchmaking-copy {
    display: grid;
    gap: 6px;
}

.matchmaking-status-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted-strong);
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.matchmaking-status-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(79, 140, 255, 0.16); }
    70% { box-shadow: 0 0 0 18px rgba(79, 140, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(79, 140, 255, 0); }
}

.btn-pulse {
    animation: pulse 1.5s infinite;
}

.fade-in {
    animation: fadeIn 0.28s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Players panel compact ─────────────────────── */
.players-panel-compact {
    position: sticky;
    top: 24px;
    align-self: start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
    min-height: 200px;
}

.players-panel-compact .panel-header {
    margin-bottom: 16px;
}

.players-panel-compact .player-avatar {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
}

.players-panel-compact .player-item {
    padding: 14px 16px;
    gap: 10px;
}

/* ── Main column ───────────────────────────────── */
.room-main-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

/* ── Lobby panel ───────────────────────────────── */
.lobby-panel {
    min-height: 420px;
}

.lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.lobby-title-block h2 {
    margin-bottom: 4px;
}

.lobby-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* ── Matchmaking pill ──────────────────────────── */
.matchmaking-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--muted-strong);
    white-space: nowrap;
}

.matchmaking-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.matchmaking-dot.active {
    background: #3cd07a;
    animation: pulse-dot 1.4s infinite;
}

@keyframes pulse-dot {
    0%   { box-shadow: 0 0 0 0 rgba(60, 208, 122, 0.5); }
    70%  { box-shadow: 0 0 0 8px rgba(60, 208, 122, 0); }
    100% { box-shadow: 0 0 0 0 rgba(60, 208, 122, 0); }
}

/* ── Open challenges list ──────────────────────── */
.open-challenges-list {
    display: grid;
    gap: 12px;
}

.open-challenge-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 18px;
    background: rgba(10, 22, 52, 0.96);
    border: 1px solid rgba(127, 194, 255, 0.1);
    box-shadow: 0 4px 18px rgba(3, 10, 30, 0.14);
    transition: border-color 0.18s ease, transform 0.18s ease;
    flex-wrap: wrap;
}

.open-challenge-card:hover {
    transform: translateY(-1px);
    border-color: rgba(79, 140, 255, 0.26);
}

.oc-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.oc-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.oc-info {
    min-width: 0;
}

.oc-waiting-label {
    font-size: 0.86rem;
    opacity: 0.7;
}

/* ── Matches section (below lobby) ─────────────── */
.matches-section {
    min-height: auto;
}

.current-match-room {
    min-height: auto;
    border-color: rgba(79, 140, 255, 0.28);
    background: rgba(11, 27, 67, 0.96);
}

.match-room-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.match-room-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.match-room-cell {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(127, 194, 255, 0.12);
    border-radius: 14px;
    padding: 10px 12px;
}

.match-room-label {
    font-size: 0.76rem;
    color: var(--muted-strong);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.match-room-value {
    margin-top: 4px;
    font-weight: 700;
}

.match-room-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.match-status.cancelled {
    background: rgba(167, 173, 187, 0.18);
    color: #e3e7f0;
}

.match-created-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(2, 6, 18, 0.65);
    backdrop-filter: blur(8px);
}

.match-created-modal {
    width: min(520px, 100%);
    display: grid;
    gap: 14px;
    justify-items: start;
}

.match-created-actions {
    display: flex;
    gap: 10px;
    width: 100%;
    flex-wrap: wrap;
}

.match-page-shell {
    display: grid;
    gap: 20px;
}

.match-page-main {
    display: grid;
}

.match-room-standalone-panel {
    min-height: 420px;
}

.match-page-header-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.match-room-timer-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(79, 140, 255, 0.1);
}

@media (max-width: 820px) {
    .match-room-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1088px) {
    .room-grid {
        grid-template-columns: 1fr;
    }
    .players-panel-compact {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
}

@media (max-width: 720px) {
    .container {
        width: calc(100% - 20px);
    }

    .room-header,
    .panel,
    .card {
        padding: 20px;
        border-radius: 22px;
    }

    .room-header {
        grid-template-columns: 1fr;
    }

    .room-actions,
    .form-grid,
    .challenge-actions {
        display: grid;
    }

    .btn {
        width: 100%;
    }

    .matchmaking-panel {
        gap: 14px;
    }
}

.auth-pending .auth-gated {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
}

.auth-ready .auth-gated {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.24s ease, transform 0.24s ease;
}

.app-navbar-shell {
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 18px 0 0;
    backdrop-filter: blur(12px);
}

.app-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 20px;
    border-radius: 24px;
    background: rgba(7, 18, 47, 0.72);
    border: 1px solid rgba(127, 194, 255, 0.14);
    box-shadow: 0 24px 50px rgba(2, 6, 18, 0.26);
}

.navbar-left,
.navbar-actions,
.navbar-links,
.page-intro-actions,
.section-actions,
.hero-actions,
.spotlight-actions,
.match-report-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.navbar-left {
    flex: 1;
    min-width: 0;
    flex-wrap: nowrap;
}

.navbar-links {
    min-width: 0;
    flex: 1;
    gap: 10px;
    flex-wrap: nowrap;
}

.navbar-actions {
    margin-left: auto;
    flex-wrap: nowrap;
    gap: 10px;
    flex-shrink: 0;
}

.navbar-actions .btn {
    min-height: 40px;
    padding: 0.65rem 1rem;
    font-size: 0.84rem;
}

.brand-block {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: var(--text);
    text-decoration: none;
}

.brand-block strong,
.brand-block span {
    display: block;
}

.brand-block span:last-child {
    color: var(--muted);
    font-size: 0.82rem;
}

.brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: white;
    font-size: 1.2rem;
    background: linear-gradient(135deg, rgba(79, 140, 255, 1), rgba(98, 224, 255, 0.95));
    box-shadow: 0 16px 32px rgba(79, 140, 255, 0.28);
}

.navbar-links a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.18s ease;
    white-space: nowrap;
}

.navbar-link-button {
    border: none;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    transition: color 0.18s ease;
    white-space: nowrap;
}

.navbar-links a:hover,
.navbar-link-button:hover,
.brand-block:hover {
    color: var(--text);
}

.navbar-user-chip {
    display: grid;
    gap: 2px;
    padding: 7px 10px;
    border-radius: 14px;
    background: rgba(79, 140, 255, 0.08);
    border: 1px solid rgba(127, 194, 255, 0.12);
    min-width: 0;
    max-width: 180px;
}

.navbar-user-name {
    display: inline-block;
    max-width: 135px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
    font-size: 0.86rem;
}

.navbar-user-label {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
}

.navbar-diamond-balance {
    display: block;
    font-size: 0.72rem;
    color: #a78bfa;
    font-weight: 600;
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.language-switcher-btn {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 0.82rem;
    gap: 4px;
}

#current-lang-name {
    font-size: 0.8rem;
}

@media (max-width: 1240px) {
    .app-navbar {
        gap: 12px;
        padding: 14px 16px;
    }

    .navbar-links {
        gap: 8px;
    }

    .navbar-user-chip {
        max-width: 150px;
        padding: 6px 9px;
    }

    .navbar-user-label {
        display: none;
    }

    .language-switcher-btn {
        min-height: 34px;
        padding: 5px 8px;
    }

    #current-lang-name {
        display: none;
    }
}

.navbar-user-label,
.metric-label {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.navbar-loading {
    display: flex;
    gap: 12px;
}

.navbar-skeleton {
    width: 120px;
    height: 44px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(127, 194, 255, 0.18), rgba(255, 255, 255, 0.04));
    background-size: 200% 100%;
    animation: shimmer 1.8s linear infinite;
}

.navbar-skeleton.short {
    width: 86px;
}

.glass-panel,
.glass-panel-soft,
.spotlight-card,
.empty-state {
    position: relative;
    overflow: hidden;
    background: rgba(10, 21, 55, 0.72);
    border: 1px solid rgba(127, 194, 255, 0.12);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.glass-panel-soft {
    background: rgba(10, 21, 55, 0.56);
}

.landing-page {
    padding-top: 20px;
}

.page-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    margin-bottom: 30px;
    padding: 26px 30px;
    border-radius: 32px;
}

.hero-section {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 28px;
    padding: 38px;
    border-radius: 32px;
}

.hero-copy {
    display: grid;
    gap: 18px;
    align-content: center;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.45rem);
    color: #dce7ff;
    margin: 0;
}

.hero-description {
    max-width: 640px;
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.8;
}

.hero-metrics,
.about-grid-3 {
    display: grid;
    gap: 16px;
}

.metric-card,
.about-card,
.spotlight-card,
.empty-state {
    padding: 22px;
    border-radius: 24px;
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.metric-card:hover,
.about-card:hover,
.spotlight-card:hover,
.event-card:hover,
.section-block:hover {
    transform: translateY(-2px);
    border-color: rgba(79, 140, 255, 0.24);
}

.landing-section {
    margin-top: 26px;
}

.spotlight-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.spotlight-copy {
    display: grid;
    gap: 10px;
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    font-size: 1.4rem;
    background: rgba(79, 140, 255, 0.14);
}

.empty-state {
    display: grid;
    gap: 10px;
    text-align: left;
}

.loading-state {
    min-height: 154px;
    display: grid;
    place-items: center;
}

.loading-copy {
    color: var(--muted);
}

.user-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: grid;
    place-items: start center;
    padding: 96px 16px 24px;
    background: rgba(2, 6, 18, 0.62);
    backdrop-filter: blur(8px);
}

.user-search-modal {
    width: min(760px, 100%);
    border-radius: 28px;
    padding: 24px;
}

.user-search-header,
.profile-name-row,
.user-search-result-top,
.user-search-result {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-search-header {
    justify-content: space-between;
}

.user-search-form {
    margin-top: 20px;
}

.user-search-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.user-search-tab {
    border: 1px solid rgba(127, 194, 255, 0.14);
    background: rgba(10, 20, 48, 0.72);
    color: var(--text);
    border-radius: 999px;
    padding: 10px 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.user-search-tab:hover,
.user-search-tab.active {
    border-color: rgba(79, 140, 255, 0.38);
    background: rgba(22, 40, 82, 0.94);
    transform: translateY(-1px);
}

.user-search-input {
    padding-left: 18px;
}

.user-search-results {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    max-height: min(60vh, 520px);
    overflow-y: auto;
}

.user-search-result {
    text-decoration: none;
    justify-content: flex-start;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(10, 20, 48, 0.92);
    border: 1px solid rgba(127, 194, 255, 0.12);
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.user-search-result:hover {
    transform: translateY(-1px);
    border-color: rgba(79, 140, 255, 0.24);
}

.user-directory-card {
    justify-content: space-between;
}

.user-directory-main {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.user-directory-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.user-search-result-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.user-search-result-copy strong {
    color: var(--text);
}

.user-search-result-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: white;
    background: linear-gradient(135deg, rgba(79, 140, 255, 1), rgba(98, 224, 255, 0.95));
    flex-shrink: 0;
}

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

.events-dashboard .section-block {
    background: rgba(10, 21, 55, 0.76);
}


.event-create-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.event-title {
    font-size: 1.12rem;
    font-weight: 700;
}

.event-id {
    color: var(--muted);
    font-size: 0.88rem;
}

.btn-small {
    min-height: 40px;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
}

.match-report-row {
    margin-top: 4px;
}

.rating-popup {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 40;
    min-width: 220px;
    padding: 18px;
    border-radius: 20px;
    background: rgba(7, 18, 47, 0.92);
    border: 1px solid rgba(127, 194, 255, 0.16);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.rating-popup.show {
    opacity: 1;
    transform: translateY(0);
}

.rating-title {
    font-weight: 700;
    margin-bottom: 8px;
}

.rating-row {
    color: var(--muted);
    line-height: 1.7;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (max-width: 1088px) {
    .hero-section,
    .event-create-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .app-navbar {
        padding: 14px;
        border-radius: 20px;
        align-items: flex-start;
    }

    .navbar-left,
    .navbar-actions,
    .navbar-links,
    .page-intro-actions,
    .hero-actions,
    .spotlight-card,
    .match-report-row {
        display: grid;
    }

    .hero-section {
        padding: 24px;
        border-radius: 24px;
    }
}

/* ══════════════════════════════════════════════════════════
   PROFILE PAGE
   ══════════════════════════════════════════════════════════ */

.profile-container {
    max-width: 780px;
    margin: 0 auto;
    padding: 40px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ── Profile Card ── */
.profile-card {
    display: flex;
    align-items: center;
    gap: 32px;
}

.profile-page-header {
    margin-bottom: -4px;
}

.profile-avatar-wrap {
    flex-shrink: 0;
}

.profile-avatar-circle {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(79,140,255,0.25), rgba(98,224,255,0.15));
    border: 2px solid rgba(127,194,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--accent);
    overflow: hidden;
}

.profile-avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-circle.profile-avatar-editable {
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.profile-avatar-circle.profile-avatar-editable:hover {
    transform: translateY(-1px);
    border-color: rgba(127,194,255,0.45);
    box-shadow: 0 0 0 4px rgba(79,140,255,0.14);
}

.profile-identity {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-display-name {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 1.9rem;
    font-weight: 800;
    margin: 0;
}

.profile-diamond-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(167, 139, 250, 0.14);
    border: 1px solid rgba(167, 139, 250, 0.28);
    color: #c4b5fd;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1;
}

.profile-name-row {
    flex-wrap: wrap;
}

.profile-role-controls {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

#profile-friend-btn-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.profile-rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(79,140,255,0.1);
    border: 1px solid rgba(79,140,255,0.22);
    border-radius: 12px;
    width: fit-content;
    margin-top: 4px;
}

.rating-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    font-weight: 700;
}

.rating-value {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
}

/* ── Stats ── */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 16px;
    padding: 20px 16px;
    text-align: center;
    transition: transform 0.18s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-value {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    font-weight: 700;
}

.stat-win  .stat-value { color: #62e0a0; }
.stat-loss .stat-value { color: #ff7070; }
.stat-draw .stat-value { color: #ffcc55; }

/* ── Edit form ── */
.profile-form-grid {
    grid-template-columns: repeat(2, 1fr);
    align-items: end;
}

.avatar-upload-panel {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px dashed rgba(127,194,255,0.3);
    border-radius: 14px;
    background: rgba(79,140,255,0.06);
}

.avatar-upload-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.avatar-upload-hint {
    font-size: 0.82rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    font-weight: 700;
}

.form-field-action {
    justify-content: flex-end;
}

.edit-status {
    font-size: 0.85rem;
    margin-top: 8px;
    min-height: 20px;
    font-weight: 600;
}
.edit-status.success { color: #62e0a0; }
.edit-status.danger  { color: #ff7070; }

/* ── Event history rows ── */
.profile-event-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    margin-bottom: 10px;
    gap: 16px;
}

.profile-event-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.profile-event-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.profile-event-row .btn,
.profile-event-row .btn-sm {
    width: auto;
    min-width: 86px;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   CREATE EVENT FORM — PREMIUM REDESIGN
   ══════════════════════════════════════════════════════════ */

.create-event-section {
    margin-bottom: 32px;
}

.create-event-card {
    background: linear-gradient(135deg, rgba(79,140,255,0.04), rgba(98,224,255,0.02));
    border: 1px solid rgba(127,194,255,0.15);
    border-radius: 20px;
    padding: 32px 28px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.12);
    backdrop-filter: blur(8px);
}

.create-event-header {
    margin-bottom: 28px;
}

.create-event-title {
    font-size: 1.75rem;
    font-weight: 900;
    margin: 0 0 8px 0;
    color: var(--text);
}

.create-event-subtitle {
    font-size: 0.95rem;
    color: var(--muted);
    margin: 0;
    line-height: 1.5;
}

.create-event-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ── Form Groups ── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group-half {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
    display: block;
}

.form-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-icon {
    position: absolute;
    left: 14px;
    font-size: 1.1rem;
    pointer-events: none;
    color: var(--muted);
    z-index: 1;
}

.form-input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1.5px solid rgba(127,194,255,0.2);
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.form-input::placeholder {
    color: rgba(255,255,255,0.3);
}

.form-input:hover {
    border-color: rgba(127,194,255,0.35);
    background: rgba(255,255,255,0.06);
}

.form-input:focus {
    outline: none;
    border-color: rgba(79,140,255,0.6);
    background: rgba(255,255,255,0.08);
    box-shadow: 0 0 0 3px rgba(79,140,255,0.1);
}

.form-helper {
    font-size: 0.78rem;
    color: var(--muted);
    margin: 2px 0 0 0;
    font-weight: 500;
}

/* ── Submit Button ── */
.btn-create-event {
    padding: 14px 24px;
    background: linear-gradient(135deg, #4f8cff 0%, #62e0a0 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    box-shadow: 0 8px 24px rgba(79,140,255,0.3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.btn-create-event-icon {
    font-size: 1.2rem;
    font-weight: 900;
}

.btn-create-event:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(79,140,255,0.4);
}

.btn-create-event:active {
    transform: translateY(0);
    box-shadow: 0 4px 16px rgba(79,140,255,0.3);
}

.btn-create-event:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ── Status Messages ── */
.create-event-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    animation: slideDown 0.3s ease;
}

.create-event-message.hidden {
    display: none;
}

.create-event-message.success {
    background: rgba(98,224,160,0.15);
    border: 1px solid rgba(98,224,160,0.4);
    color: #62e0a0;
}

.create-event-message.error {
    background: rgba(255,112,112,0.15);
    border: 1px solid rgba(255,112,112,0.4);
    color: #ff7070;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Mobile Responsive ── */
@media (max-width: 640px) {
    .create-event-card {
        padding: 24px 18px;
    }

    .create-event-title {
        font-size: 1.5rem;
    }

    .create-event-form {
        gap: 20px;
    }

    .form-input {
        padding: 11px 12px 11px 38px;
    }

    .form-icon {
        left: 11px;
    }

    .form-group-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .btn-create-event {
        width: 100%;
        padding: 12px 20px;
    }
}

/* ── Navbar username link ── */
.navbar-user-name {
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}
.navbar-user-name:hover {
    color: var(--accent);
    text-decoration: underline;
}


/* ── Utility ── */
.hidden { display: none !important; }
.alert-danger {
    background: rgba(255, 80, 80, 0.1);
    border: 1px solid rgba(255, 80, 80, 0.3);
    color: #ff7070;
    padding: 14px 18px;
    border-radius: 14px;
    font-weight: 600;
}

@media (max-width: 640px) {
    .profile-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .profile-rating-badge {
        width: 100%;
        justify-content: center;
    }
    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .profile-form-grid {
        grid-template-columns: 1fr;
    }

    .avatar-upload-actions .btn {
        width: 100%;
    }

    .user-search-overlay {
        padding-top: 76px;
    }

    .user-search-modal {
        padding: 18px;
        border-radius: 22px;
    }

    .user-search-header,
    .user-search-result,
    .profile-name-row {
        display: grid;
        justify-content: stretch;
    }

    .user-directory-card {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .user-directory-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .profile-role-controls {
        display: grid;
    }
}

/* --- FRIENDS SYSTEM --- */

#friend-action-section {
    margin-bottom: 1.5rem;
}

.friend-action-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.friend-status-badge {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    background: rgba(56, 161, 105, 0.15);
    color: #38a169;
    border: 1px solid rgba(56, 161, 105, 0.35);
}

#friend-requests-section,
#friends-list-section {
    margin-bottom: 2rem;
}

.section-block-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.section-block-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
}

.badge-info {
    background: rgba(99, 179, 237, 0.18);
    color: #63b3ed;
    border: 1px solid rgba(99, 179, 237, 0.3);
}

.friends-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    margin-bottom: 0.5rem;
    transition: background 0.2s;
}

.friends-item:hover {
    background: rgba(255,255,255,0.08);
}

.friends-item .player-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    flex: 1;
    min-width: 0;
}

.friends-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .friends-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }
    .friends-item-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE HARDENING (TABLET + MOBILE)
   Targets: <=768px and <=480px
   ───────────────────────────────────────────────────────────── */

html,
body {
    overflow-x: hidden;
}

.container,
.panel,
.card,
.glass-panel,
.glass-panel-soft,
.room-header,
.section-block,
.user-search-modal {
    max-width: 100%;
}

.navbar-links a:focus-visible,
.navbar-link-button:focus-visible,
.btn:focus-visible,
.btn-small:focus-visible,
.player-link:focus-visible,
.user-search-result:focus-visible {
    outline: 2px solid rgba(127, 194, 255, 0.7);
    outline-offset: 2px;
}

.player-item:active,
.match-card:active,
.challenge-card:active,
.open-challenge-card:active,
.user-search-result:active {
    transform: translateY(0);
}

.player-item-online {
    border-color: rgba(60, 208, 122, 0.28);
}

.player-item-searching {
    border-color: rgba(240, 179, 59, 0.34);
    box-shadow: 0 0 0 1px rgba(240, 179, 59, 0.16), 0 16px 30px rgba(3, 10, 30, 0.2);
}

.player-state {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}

.player-state-online {
    background: rgba(60, 208, 122, 0.18);
    color: #c7ffe3;
}

.player-state-searching {
    background: rgba(240, 179, 59, 0.2);
    color: #fff2c9;
}

/* ── Hamburger button ─────────────────────────────────── */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    flex-shrink: 0;
}

.hamburger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease;
    transform-origin: center;
}

.hamburger-btn.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger-btn.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger-btn.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile nav drawer ───────────────────────────────── */
.mobile-nav-drawer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 900;
    background: rgba(7, 15, 40, 0.98);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(127, 194, 255, 0.14);
    padding: 70px 16px 20px;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    pointer-events: none;
}

.mobile-nav-drawer.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-nav-links a,
.mobile-nav-links .navbar-link-button {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
    transition: background 0.15s;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.mobile-nav-links a:hover,
.mobile-nav-links .navbar-link-button:hover {
    background: rgba(127, 194, 255, 0.1);
    border-color: rgba(127, 194, 255, 0.14);
}

.mobile-nav-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-nav-actions .btn,
.mobile-nav-actions .navbar-user-chip {
    width: 100%;
}

.mobile-nav-actions .navbar-user-chip {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    border: 1px solid rgba(127, 194, 255, 0.12);
}

body.mobile-nav-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    html, body {
        font-size: 14px;
    }

    .hamburger-btn {
        display: flex;
    }

    .mobile-nav-drawer {
        display: flex;
    }

    .navbar-links,
    .navbar-actions {
        display: none !important;
    }

    .page-shell {
        padding-top: 10px;
        padding-bottom: 16px;
    }

    .container {
        width: calc(100% - 16px);
    }

    .app-navbar-shell {
        padding-top: 6px;
        position: relative;
        z-index: 950;
    }

    .app-navbar {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 10px 12px;
        border-radius: 16px;
    }

    .navbar-left {
        flex: 1;
        min-width: 0;
    }

    .brand-block {
        width: auto;
    }

    .room-header {
        grid-template-columns: 1fr;
        padding: 14px;
        border-radius: 18px;
    }

    .room-heading {
        gap: 6px;
    }

    .room-actions {
        justify-content: stretch;
        width: 100%;
    }

    .room-actions .btn,
    .match-room-actions .btn,
    .lobby-header-actions .btn,
    .challenge-actions .btn,
    .match-created-actions .btn,
    .page-intro-actions .btn,
    .section-actions .btn,
    .hero-actions .btn,
    .spotlight-actions .btn {
        width: 100%;
        min-height: 40px;
    }

    .room-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 10px;
    }

    .players-panel-compact {
        order: -1;
        position: static;
        max-height: none;
        overflow: visible;
        min-height: 0;
    }

    .players-list,
    .matches-list,
    .open-challenges-list,
    .challenge-list {
        gap: 7px;
    }

    .player-item {
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
        gap: 7px;
        padding: 10px;
    }

    .player-link {
        width: 100%;
    }

    .player-item-actions {
        justify-content: stretch;
        width: 100%;
    }

    .player-item-actions .btn {
        width: 100%;
    }

    .open-challenge-card,
    .match-card,
    .challenge-card,
    .panel,
    .card,
    .section-block,
    .glass-panel,
    .glass-panel-soft,
    .spotlight-card {
        border-radius: 16px;
        padding: 12px;
    }

    .open-challenge-card {
        gap: 8px;
    }

    .oc-left,
    .oc-right {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .match-room-head {
        display: grid;
        gap: 7px;
    }

    .match-room-grid {
        grid-template-columns: 1fr;
        gap: 7px;
    }
    .match-page-header-row {
        display: grid;
        gap: 7px;
    }

    .profile-container {
        padding: 14px 8px;
        gap: 12px;
    }

    .profile-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
        padding: 14px;
    }

    .profile-avatar-circle {
        margin: 0 auto;
        width: 64px !important;
        height: 64px !important;
        font-size: 1.5rem !important;
    }

    .profile-identity {
        width: 100%;
        align-items: center;
    }

    .profile-name-row,
    .profile-role-controls,
    #profile-friend-btn-wrap {
        justify-content: center;
    }

    .profile-rating-badge {
        width: 100%;
        justify-content: center;
    }

    .profile-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .profile-form-grid,
    .form-grid,
    .form-group-row,
    .event-create-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    input[type="number"],
    input[type="text"],
    input[type="url"],
    input[type="search"],
    input[type="datetime-local"],
    input[type="date"],
    input[type="time"],
    input[type="email"],
    input[type="password"],
    textarea,
    select {
        width: 100%;
        min-height: 40px;
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .btn,
    .primary-btn,
    .danger-btn,
    .btn-create-event,
    .btn-small {
        min-height: 40px;
        padding: 8px 14px;
        font-size: 0.88rem;
    }

    .user-search-overlay {
        padding: 52px 8px 8px;
        place-items: start stretch;
    }

    .user-search-modal {
        width: 100%;
        padding: 10px;
        border-radius: 14px;
    }

    .user-search-header,
    .user-search-result,
    .user-directory-card {
        display: grid;
        gap: 8px;
    }

    .user-directory-actions {
        justify-content: stretch;
        width: 100%;
    }

    .user-directory-actions .btn,
    .user-search-tab {
        width: 100%;
        min-height: 38px;
        justify-content: center;
        font-size: 0.82rem;
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    html, body {
        font-size: 13px;
    }

    .container {
        width: calc(100% - 12px);
    }

    h1 {
        font-size: clamp(1.25rem, 6vw, 1.6rem);
    }

    h2 {
        font-size: 0.97rem;
    }

    h3 {
        font-size: 0.92rem;
    }

    .muted,
    .panel-subtitle,
    .player-rating,
    .challenge-meta,
    .room-meta-row,
    .pill,
    .badge {
        font-size: 0.82rem;
    }

    .room-header,
    .panel,
    .card,
    .section-block,
    .glass-panel,
    .glass-panel-soft,
    .spotlight-card {
        padding: 10px;
        border-radius: 14px;
    }

    .player-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.82rem;
    }

    .player-name {
        flex-wrap: wrap;
        gap: 4px;
        font-size: 0.88rem;
    }

    .room-actions,
    .match-room-actions,
    .lobby-header-actions,
    .challenge-actions,
    .match-created-actions,
    .page-intro-actions,
    .section-actions,
    .hero-actions,
    .spotlight-actions,
    .friends-item-actions,
    .friend-action-row {
        display: grid;
        width: 100%;
        gap: 6px;
    }

    .room-actions .btn,
    .match-room-actions .btn,
    .lobby-header-actions .btn,
    .challenge-actions .btn,
    .match-created-actions .btn,
    .page-intro-actions .btn,
    .section-actions .btn,
    .hero-actions .btn,
    .spotlight-actions .btn,
    .friends-item-actions .btn,
    .friend-action-row .btn,
    .btn,
    .btn-small {
        width: 100%;
        min-height: 38px;
        padding: 7px 12px;
        font-size: 0.84rem;
    }

    .event-card,
    .tournament-card {
        padding: 10px;
    }

    .user-search-tabs {
        gap: 5px;
    }

    .user-search-result {
        padding: 9px;
        border-radius: 12px;
    }

    .user-search-modal {
        padding: 9px;
    }

    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .profile-display-name {
        font-size: 1.2rem;
    }

    .rating-value {
        font-size: 1.1rem;
    }

    .app-navbar {
        gap: 6px;
        padding: 8px;
    }

    .navbar-links a,
    .navbar-link-button {
        min-height: 34px;
        padding: 6px 9px;
        font-size: 0.84rem;
    }

    .player-item {
        padding: 8px;
        gap: 6px;
    }

    .players-list,
    .matches-list,
    .open-challenges-list,
    .challenge-list {
        gap: 5px;
    }

    .profile-card {
        padding: 10px;
        gap: 10px;
    }

    .profile-avatar-circle {
        width: 54px !important;
        height: 54px !important;
        font-size: 1.25rem !important;
    }

    .language-switcher {
        gap: 4px;
    }

    .language-switcher-btn {
        min-height: 34px;
        padding: 6px 9px;
        font-size: 0.84rem;
    }

    .language-dropdown {
        min-width: 160px;
    }

    .language-option {
        padding: 8px 12px;
        font-size: 0.84rem;
    }
}

/* ===========================
   LANGUAGE SWITCHER STYLES
=========================== */

.language-switcher {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-switcher-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 14px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.language-switcher-btn:hover {
    background: var(--surface);
    border-color: rgba(79, 140, 255, 0.3);
    transform: translateY(-1px);
}

.language-switcher-btn:active {
    transform: translateY(0);
}

.language-switcher-flag {
    font-size: 1.1em;
    display: inline-block;
}

.language-switcher-chevron {
    display: inline-block;
    font-size: 0.7em;
    transition: transform 0.2s ease;
    margin-left: 2px;
}

.language-switcher-btn.active .language-switcher-chevron {
    transform: scaleY(-1);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    margin-top: 8px;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.32);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    overflow: hidden;
}

.language-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text);
    background: transparent;
    border: none;
    border-left: 3px solid transparent;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 400;
    transition: all 0.15s ease;
    width: 100%;
    text-align: left;
}

.language-option:hover {
    background: rgba(79, 140, 255, 0.1);
    border-left-color: var(--primary);
}

.language-option.active {
    background: rgba(79, 140, 255, 0.16);
    border-left-color: var(--primary);
    color: var(--text);
}

.language-option-flag {
    font-size: 1.2em;
    display: inline-block;
    min-width: 24px;
}

.language-option-name {
    flex: 1;
}

.language-option-check {
    font-size: 1.1em;
    color: var(--primary);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.language-option.active .language-option-check {
    opacity: 1;
}

/* Prevent dropdown from going off-screen */
@media (max-width: 480px) {
    .language-dropdown {
        right: auto;
        left: 0;
    }

    .gift-shop-balance-row {
        grid-template-columns: 1fr;
    }

    .gift-tx-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .gift-tx-right {
        text-align: left;
    }
}
