/* =============================================
   TURNIEJE LOKALNE — GLOBAL STYLES
   ============================================= */

:root {
    --bg:            #0f1117;
    --bg-card:       #161b22;
    --bg-card-hover: #1c2333;
    --surface:       #21262d;
    --border:        #30363d;
    --text:          #e6edf3;
    --muted:         #8b949e;
    --primary:       #4f8ef7;
    --primary-dark:  #3462c4;
    --accent:        #f0922b;
    --success:       #3fb950;
    --danger:        #f85149;
    --warning:       #d29922;
    --radius:        14px;
    --shadow:        0 4px 24px rgba(0,0,0,.5);
    --topbar-h:      60px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* =============================================
   FLASH ALERTS — fixed overlay
   ============================================= */
.flash-wrap {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    max-width: 420px;
}

.alert {
    padding: .75rem 1.1rem;
    border-radius: 10px;
    font-weight: 500;
    font-size: .9rem;
    transition: opacity .35s;
}

.alert-success {
    background: rgba(63,185,80,.15);
    color: var(--success);
    border-left: 3px solid var(--success);
}

.alert-error {
    background: rgba(248,81,73,.15);
    color: var(--danger);
    border-left: 3px solid var(--danger);
}

.alert-info {
    background: rgba(79,142,247,.15);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

/* =============================================
   PUBLIC PAGE — no topbar, full width
   ============================================= */
.pub-page {
    width: 100%;
    min-height: 100vh;
}

/* body with admin topbar — add top offset so pub-page starts below topbar */
body.has-topbar .pub-page {
    min-height: calc(100vh - var(--topbar-h));
}

.tournaments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
    padding: 2.5rem 3rem;
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
}

/* Tournament card */
.t-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, transform .2s;
    text-decoration: none;
    color: var(--text);
    overflow: hidden;
}

.t-card:hover {
    border-color: var(--primary);
    box-shadow: 0 12px 40px rgba(79,142,247,.22);
    transform: translateY(-4px);
}

/* Banner image area */
.t-card-banner {
    height: 170px;
    background-size: cover;
    background-position: center;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.t-card-banner--empty {
    background: linear-gradient(135deg, var(--surface) 0%, var(--bg-card-hover) 100%);
}

.t-card-body {
    display: flex;
    flex-direction: column;
    gap: .85rem;
    padding: 1.25rem 1.4rem;
    flex: 1;
}

.t-card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .4rem;
}

.t-card-name {
    font-size: 1.45rem;
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: -.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.t-card-event {
    font-size: .8rem;
    font-weight: 600;
    color: var(--muted);
    margin-top: .1rem;
}

.t-card-date {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -.01em;
}

.t-game-badge {
    background: rgba(79,142,247,.15);
    color: var(--primary);
    border-radius: 999px;
    padding: .2rem .75rem;
    font-size: .8rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
}

.t-meta { display: grid; gap: .4rem; }

.t-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .9rem;
}

.t-meta-label { color: var(--muted); }
.t-meta-value { font-weight: 600; }

.t-spots { margin-top: .1rem; }

.t-spots-label {
    font-size: .82rem;
    color: var(--muted);
    margin-bottom: .4rem;
    display: flex;
    justify-content: space-between;
}

.progress-track {
    height: 7px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), #7bbfff);
    transition: width .4s ease;
}

.progress-fill.full   { background: var(--danger);  }
.progress-fill.almost { background: var(--warning); }

.t-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    padding-top: .5rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.t-status {
    font-size: .78rem;
    font-weight: 700;
    padding: .25rem .75rem;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

.t-status.open   { background: rgba(63,185,80,.15);  color: var(--success); }
.t-status.closed { background: rgba(248,81,73,.15);  color: var(--danger);  }
.t-status.soon   { background: rgba(240,146,43,.15); color: var(--accent);  }

.btn-view {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 9px;
    padding: .5rem 1.1rem;
    font-weight: 700;
    font-size: .88rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: opacity .15s;
}

.btn-view:hover { opacity: .85; }

.no-tournaments {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--muted);
    font-size: 1.1rem;
}

/* =============================================
   PUBLIC INNER PAGES (tournament detail, etc.)
   ============================================= */
.pub-inner {
    padding: 1.5rem 2rem 3rem;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeIn .35s ease;
}

/* Full-width tournament detail page */
.pub-full {
    width: 100%;
    animation: fadeIn .35s ease;
}

.pub-full-inner {
    padding: 1.5rem 2rem 3rem;
    max-width: 100%;
}

/* Two-column tournament layout: left=signup+lists, right=game info+results */
.tournament-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: start;
}

/* Game banner header on tournament detail page */
.tournament-game-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    overflow: hidden;
    padding: 0;
    margin-bottom: 1.25rem;
}

.tgh-banner {
    min-height: 160px;
    overflow: hidden;
    border-radius: var(--radius) 0 0 var(--radius);
    border-right: 1px solid var(--border);
    max-height: 300px;
}

.tgh-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tgh-banner-empty {
    width: 100%;
    height: 100%;
    min-height: 160px;
    background: linear-gradient(135deg, var(--surface) 0%, var(--bg-card-hover) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--muted);
    text-align: center;
    padding: 1rem;
}

.tgh-info {
    padding: 2rem 2rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    position: relative;
}

.tgh-info-content {
    display: flex;
    flex-direction: column;
    gap: .7rem;
    flex: 1;
    min-width: 0;
}

.tgh-qr-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .55rem;
    flex-shrink: 0;
}

.tgh-qr-block > img {
    display: block;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.1);
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.tgh-qr-caption {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    text-align: center;
}

.tgh-qr-brand {
    display: flex;
    align-items: center;
    gap: .3rem;
}

.tgh-qr-brand img {
    display: block;
    border-radius: 2px;
}

.tgh-qr-brand strong {
    color: var(--accent);
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .02em;
}

.tgh-qr-caption > span {
    color: var(--muted);
    font-size: .7rem;
    line-height: 1.35;
    max-width: 130px;
}

.tgh-info h1 {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
}

.tgh-game-label {
    color: var(--primary);
    font-weight: 600;
    font-size: .95rem;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.pub-back {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--muted);
    font-size: .9rem;
    margin-bottom: 1.25rem;
    transition: color .15s;
    text-decoration: none;
}

.pub-back:hover { color: var(--text); }

.tournament-header.card h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: .5rem;
}


/* =============================================
   AUTH PAGE (login)
   ============================================= */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-card h1 {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* =============================================
   ADMIN TOPBAR
   ============================================= */
.admin-topbar {
    height: var(--topbar-h);
    background: #0d1117;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1.5rem;
}

.admin-brand {
    font-size: .95rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: .03em;
    white-space: nowrap;
    text-decoration: none;
    flex-shrink: 0;
}

.admin-brand em {
    color: var(--muted);
    font-style: normal;
    font-weight: 400;
}

.admin-nav {
    display: flex;
    align-items: center;
    gap: .15rem;
    flex: 1;
}

.admin-nav a {
    padding: .4rem .85rem;
    border-radius: 8px;
    font-size: .88rem;
    font-weight: 500;
    color: var(--muted);
    transition: background .15s, color .15s;
    text-decoration: none;
    white-space: nowrap;
}

.admin-nav a:hover {
    background: rgba(255,255,255,.06);
    color: var(--text);
}

.admin-nav a.active {
    background: rgba(79,142,247,.12);
    color: var(--primary);
    font-weight: 600;
}

.admin-topbar-right {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-left: auto;
    flex-shrink: 0;
}

.topbar-user {
    font-size: .82rem;
    color: var(--muted);
}

.topbar-btn {
    padding: .35rem .8rem;
    border-radius: 8px;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s;
    white-space: nowrap;
}

.topbar-btn.preview {
    background: rgba(63,185,80,.12);
    color: var(--success);
}

.topbar-btn.preview:hover { background: rgba(63,185,80,.25); }

.topbar-btn.logout {
    background: rgba(248,81,73,.12);
    color: var(--danger);
}

.topbar-btn.logout:hover { background: rgba(248,81,73,.25); }

/* =============================================
   ADMIN CONTENT AREA
   ============================================= */
.admin-content {
    padding: 1.5rem 2rem 3rem;
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeIn .3s ease;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 1.2rem;
}

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

.section-header h1, .section-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
}

/* =============================================
   DASHBOARD STATS
   ============================================= */
.dash-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
}

.stat-label {
    font-size: .78rem;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: .4rem;
}

.stat-value {
    font-size: 2.4rem;
    font-weight: 900;
    line-height: 1;
    color: var(--text);
}

.stat-card.blue   .stat-value { color: var(--primary); }
.stat-card.green  .stat-value { color: var(--success); }
.stat-card.orange .stat-value { color: var(--accent);  }
.stat-card.red    .stat-value { color: var(--danger);  }

/* =============================================
   CARDS
   ============================================= */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

.card > h2:first-child {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* =============================================
   TABLES
   ============================================= */
table { width: 100%; border-collapse: collapse; }

.clip-table { table-layout: fixed; }
.cell-clip  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 0; }

th, td {
    padding: .65rem .6rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255,255,255,.02); }

/* =============================================
   FORMS
   ============================================= */
.form-grid { display: grid; gap: .8rem; }

.two-col-form {
    grid-template-columns: repeat(2, 1fr);
    gap: .8rem 1.2rem;
}

.two-col-form .form-actions,
.two-col-form button[type="submit"],
.two-col-form .full-width {
    grid-column: 1 / -1;
}

label {
    font-size: .82rem;
    color: var(--muted);
    font-weight: 600;
    display: block;
    margin-bottom: .25rem;
}

input, select, textarea {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .6rem .8rem;
    font: inherit;
    color: var(--text);
    outline: none;
    transition: border-color .15s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,142,247,.1);
}

textarea { resize: vertical; }
select option { background: var(--surface); color: var(--text); }

.form-actions {
    display: flex;
    gap: .6rem;
    align-items: center;
    margin-top: .2rem;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn, .btn-secondary, .btn-danger, .btn-link {
    border: none;
    border-radius: 8px;
    padding: .55rem 1.1rem;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    font-size: .88rem;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    text-decoration: none;
    transition: opacity .15s, background .15s;
}

.btn {
    background: var(--primary);
    color: #fff;
}

.btn:hover { opacity: .85; }

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--border); }

.btn-danger {
    background: rgba(248,81,73,.15);
    color: var(--danger);
}

.btn-danger:hover { background: rgba(248,81,73,.3); }

.btn-link {
    background: rgba(79,142,247,.12);
    color: var(--primary);
}

.btn-link:hover { background: rgba(79,142,247,.25); }

/* ---- Icon-only action buttons ---- */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: 7px;
    border: none;
    cursor: pointer;
    transition: background .15s;
    text-decoration: none;
    flex-shrink: 0;
}
.btn-icon svg {
    width: 15px;
    height: 15px;
    display: block;
    pointer-events: none;
    flex-shrink: 0;
}
.btn-icon-edit   { background: rgba(79,142,247,.12); color: var(--primary); }
.btn-icon-edit:hover   { background: rgba(79,142,247,.25); }
.btn-icon-delete { background: rgba(248,81,73,.15);  color: var(--danger);  }
.btn-icon-delete:hover { background: rgba(248,81,73,.3); }
.btn-icon-save   { background: rgba(63,185,80,.12);  color: var(--success); }
.btn-icon-save:hover   { background: rgba(63,185,80,.25); }
.btn-icon-view   { background: rgba(139,148,158,.12); color: var(--muted); }
.btn-icon-view:hover   { background: rgba(139,148,158,.25); }
.btn-icon-list   { background: rgba(210,153,34,.12); color: var(--warning); }
.btn-icon-list:hover   { background: rgba(210,153,34,.25); }

/* =============================================
   BADGES & STATUS
   ============================================= */
.badge {
    display: inline-block;
    padding: .2rem .7rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
}

.badge-success { background: rgba(63,185,80,.15);  color: var(--success); }
.badge-danger  { background: rgba(248,81,73,.15);  color: var(--danger);  }
.badge-warning { background: rgba(210,153,34,.15); color: var(--warning); }
.badge-info    { background: rgba(79,142,247,.15); color: var(--primary); }

.status-closed {
    display: inline-block;
    background: rgba(248,81,73,.12);
    color: var(--danger);
    border-radius: 999px;
    padding: .25rem .75rem;
    font-weight: 700;
    font-size: .82rem;
}

.status-upcoming {
    display: inline-block;
    background: rgba(210,153,34,.12);
    color: var(--warning);
    border-radius: 999px;
    padding: .25rem .75rem;
    font-weight: 700;
    font-size: .82rem;
}

/* ---- Podium ---- */
.podium-wrapper {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: .5rem;
    margin: .5rem 0 1.4rem;
}
.podium-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 160px;
}
.podium-nick {
    font-size: .82rem;
    font-weight: 700;
    text-align: center;
    color: var(--text);
    margin-bottom: .35rem;
    word-break: break-all;
    line-height: 1.3;
}
.podium-bar {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    border-radius: 6px 6px 0 0;
    padding: .5rem .25rem;
    gap: .2rem;
}
.podium-medal { font-size: 1.5rem; line-height: 1; }
.podium-num {
    font-size: 1.1rem;
    font-weight: 900;
    opacity: .9;
}
.podium-1st .podium-bar {
    background: linear-gradient(160deg, #f5c518 0%, #c9a100 100%);
    color: #1a1200;
    min-height: 100px;
}
.podium-2nd .podium-bar {
    background: linear-gradient(160deg, #b0b8c8 0%, #7c8898 100%);
    color: #12161c;
    min-height: 72px;
}
.podium-3rd .podium-bar {
    background: linear-gradient(160deg, #d4845a 0%, #a0522d 100%);
    color: #1a0e08;
    min-height: 56px;
}
@media (max-width: 480px) {
    .podium-nick { font-size: .75rem; }
    .podium-medal { font-size: 1.2rem; }
}

/* ---- Markdown rendered content ---- */
.md-content h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 1rem 0 .4rem;
}
.md-content h4 {
    font-size: .92rem;
    font-weight: 700;
    color: var(--primary);
    margin: .9rem 0 .35rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.md-content p {
    color: var(--text);
    line-height: 1.65;
    margin-bottom: .6rem;
}
.md-content ul {
    padding-left: 1.3rem;
    display: grid;
    gap: .35rem;
    margin-bottom: .7rem;
}
.md-content li {
    line-height: 1.55;
    color: var(--text);
}
.md-content strong { color: var(--text); }
.md-content em { color: var(--muted); font-style: italic; }
.md-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: .8rem 0;
}
.md-content > *:first-child { margin-top: 0; }
.md-content > *:last-child  { margin-bottom: 0; }

/* =============================================
   LAYOUT HELPERS
   ============================================= */
.two-column {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1rem;
}

/* Narrow left nav for zapisy / wyniki pages */
.two-column.nav-layout {
    grid-template-columns: 400px 1fr;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .8rem;
}

.big-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin: .4rem 0 0;
}

.inline-form, .inline-control {
    display: inline-flex;
    gap: .4rem;
    align-items: center;
}

.table-actions {
    display: flex;
    gap: .4rem;
    flex-wrap: nowrap;
    align-items: center;
}

.participant-list, .match-list {
    margin: 0;
    padding-left: 1.2rem;
    display: grid;
    gap: .35rem;
}

.participant-list li {
    display: flex;
    justify-content: space-between;
    gap: .8rem;
}

/* =============================================
   ANIMATION
   ============================================= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
    .two-column              { grid-template-columns: 1fr; }
    .two-column.nav-layout   { grid-template-columns: 1fr; }
    .two-col-form            { grid-template-columns: 1fr; }
    .tournament-layout       { grid-template-columns: 1fr; }
    .tournament-game-header  { grid-template-columns: 1fr; }
    .tgh-banner              { border-radius: var(--radius) var(--radius) 0 0; border-right: none; border-bottom: 1px solid var(--border); min-height: 150px; }
    .tgh-info                { flex-direction: column; align-items: flex-start; }
    .tgh-qr-block            { flex-direction: row; align-self: stretch; justify-content: center; gap: 1rem; padding: .75rem 0; border-top: 1px solid var(--border); }
    .tgh-qr-block > img      { width: 80px; height: 80px; }
    .tgh-qr-caption          { align-items: flex-start; text-align: left; }
    .tgh-qr-caption > span   { max-width: none; }
}

@media (max-width: 768px) {
    .admin-content     { padding: 1rem; }
    .pub-inner         { padding: 1rem 1rem 2rem; }
    .pub-full-inner    { padding: 1rem 1rem 2rem; }
    .tournaments-grid  { padding: 1rem; gap: 1rem; }
    .admin-topbar      { padding: 0 1rem; gap: .8rem; }
    .admin-nav a       { padding: .4rem .6rem; font-size: .82rem; }
    .topbar-user       { display: none; }
    .pub-hero          { padding: 2.5rem 1rem 1.5rem; }
}

@media (max-width: 540px) {
    .card { padding: .9rem 1rem; }
    th, td { font-size: .85rem; }
}

/* =============================================
   TOURNAMENT NAV LIST (registrations / results)
   ============================================= */
.tournament-nav-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tnav-item {
    display: block;
    padding: .6rem .75rem;
    border-radius: 8px;
    transition: background .15s, color .15s;
    text-decoration: none;
    color: var(--text);
}

.tnav-item:hover { background: rgba(255,255,255,.05); }

.tnav-item.active {
    background: rgba(79,142,247,.12);
    color: var(--primary);
}

.tnav-name {
    font-weight: 600;
    font-size: .9rem;
}

.tnav-meta {
    font-size: .78rem;
    color: var(--muted);
    margin-top: .15rem;
}

/* =============================================
   PARTICIPANT LIST — admin actions
   ============================================= */
.participant-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .4rem 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.participant-row:last-child { border-bottom: none; }

.p-nick { font-weight: 600; flex: 1; min-width: 80px; }
.p-contact { font-size: .82rem; color: var(--muted); }
.muted-text { color: var(--muted); }

.p-admin-actions {
    display: flex;
    align-items: center;
    gap: .3rem;
    margin-left: auto;
}

.btn-sm {
    padding: .25rem .6rem !important;
    font-size: .78rem !important;
    border-radius: 6px !important;
}

.nick-edit-form {
    display: flex;
    align-items: center;
    gap: .4rem;
    width: 100%;
    padding: .35rem 0;
}

.nick-input {
    width: auto !important;
    max-width: 180px;
    padding: .3rem .6rem !important;
    font-size: .88rem !important;
}

/* =============================================
   GAME LIST (admin games page)
   ============================================= */
.game-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.game-list-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .5rem;
    border-radius: 8px;
    transition: background .15s;
    border-bottom: 1px solid var(--border);
}

.game-list-item:last-child { border-bottom: none; }
.game-list-item:hover { background: rgba(255,255,255,.03); }

.game-list-thumb {
    width: 52px;
    height: 36px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: var(--surface);
}

.game-list-thumb--empty {
    border: 1px dashed var(--border);
}

.game-list-info { flex: 1; min-width: 0; }
.game-list-name { font-weight: 600; font-size: .9rem; }
.game-list-desc { font-size: .78rem; color: var(--muted); margin-top: .1rem; }

/* Banner preview in edit form */
.banner-preview-wrap { margin-bottom: .3rem; }
.banner-preview {
    max-width: 100%;
    max-height: 140px;
    border-radius: 8px;
    display: block;
    border: 1px solid var(--border);
}

/* =============================================
   RESPONSIVE ADDITIONS
   ============================================= */
@media (max-width: 768px) {
    .tournaments-grid { padding: 1rem; gap: 1rem; }
    .t-card-banner    { height: 120px; }
}
