/* 17-turnamen.css — Halaman standings satu turnamen (/turnamen/<ext_id>) */

.trn-header {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin: 6px 0 16px;
}
.trn-ic {
    font-size: 2rem;
    line-height: 1;
    flex: none;
}
.trn-head-main { min-width: 0; flex: 1; }
.trn-name {
    margin: 0 0 8px;
    font-size: 1.6rem;
    line-height: 1.2;
    color: var(--teks, #eaf2fb);
}
.trn-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}
.trn-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .08);
    font-size: .82rem;
    color: var(--teks-lembut, #b7c6d9);
}
.trn-org { font-weight: 600; }
.trn-fmt {
    background: rgba(88, 166, 255, .14);
    border-color: rgba(88, 166, 255, .3);
    color: #9ecbff;
}

.trn-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 18px;
}
.trn-actions-center { justify-content: center; }
.trn-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    background: rgba(88, 166, 255, .14);
    border: 1px solid rgba(88, 166, 255, .3);
    color: #9ecbff;
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s ease;
}
.trn-btn:hover { background: rgba(88, 166, 255, .24); }
.trn-btn-ext {
    background: rgba(255, 255, 255, .05);
    border-color: rgba(255, 255, 255, .12);
    color: var(--teks-lembut, #b7c6d9);
}

.trn-tablewrap {
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    background: rgba(255, 255, 255, .02);
}
.trn-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
}
.trn-table thead th {
    text-align: left;
    padding: 12px 14px;
    font-size: .74rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--teks-lembut, #8ea3ba);
    background: rgba(255, 255, 255, .04);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    white-space: nowrap;
}
.trn-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
    vertical-align: middle;
    font-size: .9rem;
    color: var(--teks, #eaf2fb);
}
.trn-table tbody tr:last-child td { border-bottom: 0; }
.trn-table tbody tr:hover { background: rgba(255, 255, 255, .03); }

.trn-c-place { width: 54px; text-align: center; }
.trn-place {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .06);
    font-weight: 700;
    font-size: .85rem;
    color: var(--teks-lembut, #b7c6d9);
}
.trn-place-top { background: rgba(88, 166, 255, .18); color: #9ecbff; }
.trn-place-1 {
    background: linear-gradient(135deg, #ffd76a, #f0a500);
    color: #3a2a00;
    box-shadow: 0 0 0 1px rgba(255, 215, 106, .4);
}

.trn-player { display: inline-flex; align-items: center; gap: 8px; }
.trn-player .flag-spr {
    width: 22px;
    height: 16px;
    border-radius: 2px;
    flex: none;
    object-fit: cover;
}
.trn-player-name {
    color: var(--teks, #eaf2fb);
    font-weight: 600;
    text-decoration: none;
}
a.trn-player-name:hover { color: #9ecbff; text-decoration: underline; }

.trn-c-rec { white-space: nowrap; }
.trn-rec {
    font-variant-numeric: tabular-nums;
    color: var(--teks-lembut, #b7c6d9);
}
.trn-c-poin {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: center;
    width: 64px;
}

.trn-team {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.trn-team-mons { display: inline-flex; gap: 2px; flex-wrap: nowrap; }
.trn-team-spr-wrap {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .05);
    border-radius: 6px;
}
.trn-team-spr { width: 28px; height: 28px; object-fit: contain; }
.trn-team-spr.spr-x { opacity: .3; }
.trn-team-link {
    font-size: .82rem;
    font-weight: 600;
    color: #9ecbff;
    white-space: nowrap;
    opacity: .75;
    transition: opacity .15s ease;
}
.trn-team:hover .trn-team-link { opacity: 1; text-decoration: underline; }

@media (max-width: 640px) {
    .trn-name { font-size: 1.3rem; }
    .trn-team-spr-wrap { width: 26px; height: 26px; }
    .trn-team-spr { width: 24px; height: 24px; }
    .trn-team-link { display: none; }
}

/* ============================================================
   Kartu Turnamen — dibaca dari record Turnamen (Fase 4)
   Dipakai di thread.html (kartu atas thread) dan kategori.html
   (penanda di daftar kategori Turnamen).
   ============================================================ */

/* --- Kartu di halaman thread --- */
.kartu-turnamen {
    display: flex;
    gap: 16px;
    align-items: stretch;
    padding: 16px;
    border: 1px solid rgba(88, 166, 255, .22);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(88, 166, 255, .08), rgba(255, 255, 255, .02));
}
.kartu-turnamen.kt-lokal { border-color: rgba(126, 231, 135, .26); }
.kt-poster {
    flex: none;
    width: 128px;
}
.kt-poster img {
    width: 100%;
    border-radius: 10px;
    object-fit: cover;
    display: block;
}
.kt-isi { min-width: 0; flex: 1; }
.kt-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.kt-badge, .kt-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
}
.kt-lokal, .kt-badge.kt-lokal {
    background: rgba(126, 231, 135, .16);
    color: #7ee787;
}
.kt-online, .kt-badge.kt-online {
    background: rgba(88, 166, 255, .16);
    color: #9ecbff;
}
.kt-limitless, .kt-badge.kt-limitless {
    background: rgba(255, 255, 255, .08);
    color: var(--teks-lembut, #b7c6d9);
}
.kt-badge.kt-draf {
    background: rgba(255, 255, 255, .08);
    color: var(--teks-lembut, #b7c6d9);
}
.kt-status-berlangsung { background: rgba(126, 231, 135, .16); color: #7ee787; }
.kt-status-akan { background: rgba(88, 166, 255, .16); color: #9ecbff; }
.kt-status-selesai { background: rgba(255, 255, 255, .07); color: var(--teks-lembut, #b7c6d9); }
.kt-status-dibatalkan { background: rgba(248, 81, 73, .16); color: #ff7b72; }
.kt-nama {
    margin: 0 0 10px;
    font-size: 1.35rem;
    line-height: 1.2;
    color: var(--teks, #eaf2fb);
}
.kt-meta {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
}
.kt-meta th {
    text-align: left;
    padding: 4px 12px 4px 0;
    font-size: .78rem;
    font-weight: 600;
    color: var(--teks-lembut, #8ea3ba);
    white-space: nowrap;
    vertical-align: top;
}
.kt-meta td {
    padding: 4px 0;
    font-size: .9rem;
    color: var(--teks, #eaf2fb);
}
.kt-negara {
    font-size: .78rem;
    color: var(--teks-lembut, #b7c6d9);
}
.kt-aksi {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.kt-aksi .kt-kelola,
.kt-aksi .kt-hasil {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 10px;
    background: rgba(88, 166, 255, .14);
    border: 1px solid rgba(88, 166, 255, .35);
    color: #9ecbff;
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s ease;
}
.kt-aksi .kt-kelola:hover,
.kt-aksi .kt-hasil:hover { background: rgba(88, 166, 255, .26); }

/* --- Penanda di daftar kategori --- */
.tur-baris {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}
.tur-badge, .tur-status {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 600;
}
.tur-lokal { background: rgba(126, 231, 135, .16); color: #7ee787; }
.tur-online { background: rgba(88, 166, 255, .16); color: #9ecbff; }
.tur-status-berlangsung { background: rgba(126, 231, 135, .16); color: #7ee787; }
.tur-status-akan { background: rgba(88, 166, 255, .16); color: #9ecbff; }
.tur-status-selesai { background: rgba(255, 255, 255, .07); color: var(--teks-lembut, #b7c6d9); }
.tur-status-dibatalkan { background: rgba(248, 81, 73, .16); color: #ff7b72; }
.tur-tanggal, .tur-kota {
    font-size: .76rem;
    color: var(--teks-lembut, #8ea3ba);
}
.turnamen-item.tur-dibatalkan .thread-judul { opacity: .6; }

@media (max-width: 640px) {
    .kartu-turnamen { flex-direction: column; }
    .kt-poster { width: 100%; max-height: 200px; }
    .kt-nama { font-size: 1.15rem; }
}

/* ============================================================
   Form pendaftaran peserta (/komunitas/turnamen/<ext_id>/daftar)
   ============================================================ */
.trn-field-nota {
    margin: 4px 0 0;
    font-size: 0.74rem;
    color: var(--teks-lembut, #8ea3ba);
    font-style: italic;
}

.trn-pokepaste { margin-top: 10px; }

/* Kartu slot Pokemon */
.trn-slots { display: flex; flex-direction: column; gap: 10px; }
.trn-slot {
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
    background: rgba(255, 255, 255, .02);
    position: relative;
}
.trn-slot-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    background: rgba(255, 255, 255, .03);
    border-radius: 12px 12px 0 0;
}
.trn-slot.folded .trn-slot-head { border-radius: 12px; }
.trn-slot-title { font-weight: 700; font-size: .85rem; color: var(--teks, #eaf2fb); flex: none; }
.trn-slot-sum { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; font-size: .82rem; color: var(--teks-lembut, #b7c6d9); overflow: hidden; }
.trn-slot-sum img { width: 26px; height: 26px; object-fit: contain; flex: none; }
.trn-slot-sum .sum-poke { font-weight: 600; color: var(--teks, #eaf2fb); white-space: nowrap; }
.trn-fold-ic { flex: none; color: var(--teks-lembut, #8ea3ba); transition: transform .15s ease; }
.trn-slot.folded .trn-fold-ic { transform: rotate(-90deg); }
.trn-slot-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.trn-slot.folded .trn-slot-body { display: none; }

/* Field + sprite di dalam field */
.trn-slot .ac-field { position: relative; }
.trn-slot .ac-box { z-index: 40; }
.trn-slot .ac-field:focus-within { z-index: 50; }
.trn-nature-wrap .ac-box { min-width: 260px; }
.trn-infield .fld-spr {
    position: absolute;
    left: 7px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: none;
    pointer-events: none;
}
.trn-infield .fld-spr.on { display: block; }
.trn-infield input.has-spr { padding-left: 34px; }

.trn-slot .js-poke,
.trn-slot .js-item,
.trn-slot .js-ability,
.trn-slot .js-nature,
.trn-slot .js-move { width: 100%; }

.trn-slot .js-poke,
.trn-slot .js-item,
.trn-slot .js-ability,
.trn-slot .js-nature,
.trn-slot .js-move,
.trn-slot .slot-level,
.trn-slot .trn-ev-toggle {
    height: 42px;
    box-sizing: border-box;
}

.dep:disabled,
input.dep:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(8, 21, 36, 0.35);
}

/* Baris nature / level / EV */
.trn-row2 {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
    justify-content: center;
    margin-bottom: 12px;
}
.trn-nature-wrap { position: relative; width: 150px; flex: none; }
.trn-nature-wrap .js-nature { text-align: center; }
.trn-nat-eff {
    position: absolute;
    top: 100%;
    left: 2px;
    margin-top: 3px;
    font-size: .72rem;
    font-weight: 700;
    color: #9ecbff;
    min-height: 14px;
    white-space: nowrap;
}
.trn-level-wrap { display: flex; flex-direction: column; gap: 3px; width: 76px; flex: none; }
.trn-mini-label { font-size: .62rem; font-weight: 800; text-transform: uppercase; color: var(--teks-lembut, #8ea3ba); }
.trn-level-wrap .slot-level { width: 100%; text-align: center; }
.trn-ev-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid rgba(88, 166, 255, .3);
    background: rgba(88, 166, 255, .12);
    color: #9ecbff;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.trn-ev-toggle:disabled { opacity: .5; cursor: not-allowed; }
.trn-ev-chip { font-variant-numeric: tabular-nums; }

/* Grid EV (tersembunyi sampai tombol EV diklik) */
.trn-ev-wrap { display: none; }
.trn-ev-wrap.open { display: block; margin-top: 2px; }
.trn-ev-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.trn-ev-stat { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.trn-ev-label { font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.3px; color: var(--teks-lembut, #8ea3ba); }
.trn-ev-stat .slot-ev { text-align: center; padding: 8px 4px; width: 100%; }
.trn-ev-info { display: flex; justify-content: flex-end; margin-top: 6px; }
.trn-ev-total { font-size: 0.78rem; font-weight: 700; color: var(--teks-lembut, #b7c6d9); font-variant-numeric: tabular-nums; }
.trn-ev-lebih { color: #ff7b72 !important; border-color: #ff7b72 !important; }

/* Grid move */
.trn-moves-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.trn-moves-grid .ac-box { min-width: 230px; }
.trn-move-row .ac-sprite { width: 20px; height: 20px; object-fit: contain; }

/* Field negara: bendera di dalam field + di dropdown */
.trn-country-in { position: relative; }
.trn-country-field .ac-sprite { width: 22px; height: 16px; object-fit: cover; border-radius: 2px; }
.trn-country-field .fld-spr { width: 22px; height: 16px; object-fit: cover; border-radius: 2px; }

/* Dropdown rekomendasi: dua kolom (nama kiri, persen kanan) */
.ac-box .trn-row { display: flex; align-items: center; gap: 8px; }
.ac-box .trn-row .ac-nama { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trn-extra { flex: none; font-size: .72rem; font-weight: 700; color: #9ecbff; display: inline-flex; align-items: center; }
.trn-pct { flex: none; width: 52px; text-align: right; font-size: .76rem; font-variant-numeric: tabular-nums; color: var(--teks-lembut, #8ea3ba); }
.type-spr { height: 14px; width: auto; vertical-align: middle; border-radius: 3px; }

/* Tombol + Pokemon */
.trn-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px dashed rgba(88, 166, 255, .4);
    background: rgba(88, 166, 255, .08);
    color: #9ecbff;
    font-weight: 700;
    font-size: .88rem;
    cursor: pointer;
}
.trn-add:hover { background: rgba(88, 166, 255, .16); }
.trn-hidden { display: none !important; }

@media (max-width: 640px) {
    .trn-ev-grid { grid-template-columns: repeat(3, 1fr); }
    .trn-moves-grid { grid-template-columns: repeat(2, 1fr); }
    .trn-nature-wrap { width: 100%; flex: 1 1 100%; }
}

/* ============================================================
   Panel admin Vaelyn: kelola & hapus tim turnamen komunitas
   ============================================================ */
.adm-tur { margin-bottom: 22px; }
.adm-tur-judul { font-size: 1.05rem; margin: 0 0 8px; color: var(--teks, #eaf2fb); }
.adm-tur-meta { font-size: .8rem; font-weight: 500; color: var(--teks-lembut, #8ea3ba); }
.adm-tim-tabel { width: 100%; border-collapse: collapse; font-size: .86rem; }
.adm-tim-tabel th, .adm-tim-tabel td { text-align: left; padding: 8px 10px; border-bottom: 1px solid rgba(255, 255, 255, .07); vertical-align: middle; }
.adm-tim-tabel th { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--teks-lembut, #8ea3ba); }
.adm-status { padding: 2px 8px; border-radius: 999px; font-size: .74rem; font-weight: 700; background: rgba(255, 255, 255, .06); }
.adm-status-pending { background: rgba(240, 165, 0, .16); color: #f0a500; }
.adm-status-active { background: rgba(126, 231, 135, .16); color: #7ee787; }
.adm-status-archived { background: rgba(248, 81, 73, .16); color: #ff7b72; }
.btn-hapus { padding: 5px 12px; border-radius: 8px; border: 1px solid rgba(248, 81, 73, .4); background: rgba(248, 81, 73, .14); color: #ff7b72; font-weight: 700; font-size: .8rem; cursor: pointer; }
.btn-hapus:hover { background: rgba(248, 81, 73, .24); }