/* ════════════════════════════════════════════════════════
   Alumni Guess Game v3 — Gontor
   Palet: hijau #1a6b3c · emas #c8962a · biru #1a6bb5
   ════════════════════════════════════════════════════════ */
.agg-wrap {
    --g:    #1a6b3c; --gd:  #134d2c; --gl:  #e8f5ee; --gll: #f4faf7;
    --gold: #c8962a; --goldl:#fdf5e0;
    --blue: #1a6bb5; --bluel:#e8f0fb;
    --red:  #c0392b; --redl: #fdecea;
    --txt:  #1a1a1a; --mut:  #666; --bdr: #dde8e3; --bg: #f7faf8; --wh: #fff;
    --rad:  14px; --shad: 0 6px 28px rgba(26,107,60,.13);
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--wh); border: 1px solid var(--bdr);
    border-radius: var(--rad); box-shadow: var(--shad);
    overflow: hidden; max-width: 360px; margin: 0 auto;
    color: var(--txt); position: relative;
}
.agg-screen { padding: 20px 16px; }

/* ── GUEST ──────────────────────────────────────────────── */
.agg-screen-guest {
    background: linear-gradient(155deg,var(--gd),var(--g));
    text-align:center; padding:30px 18px;
}
.agg-guest-icon { font-size:50px; margin-bottom:10px; filter:drop-shadow(0 3px 8px rgba(0,0,0,.25)); }
.agg-guest-title { font-size:22px; font-weight:900; color:#fff; margin:0 0 8px; }
.agg-guest-desc { color:rgba(255,255,255,.8); font-size:13px; line-height:1.6; margin:0 0 16px; }
.agg-guest-preview { display:flex; justify-content:center; gap:6px; flex-wrap:wrap; margin-bottom:20px; }
.agg-guest-preview span {
    background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.25);
    color:rgba(255,255,255,.9); border-radius:20px; padding:4px 10px; font-size:11px; font-weight:600;
}
.agg-btn-login { text-decoration:none; display:block; text-align:center; }

/* ── BUTTONS ────────────────────────────────────────────── */
.agg-btn {
    display:block; width:100%; padding:12px; border-radius:9px; border:none;
    font-size:14px; font-weight:700; cursor:pointer; transition:all .18s; margin-bottom:8px;
}
.agg-btn-primary { background:var(--gold); color:#1a1a1a; box-shadow:0 3px 10px rgba(200,150,42,.4); }
.agg-btn-primary:hover:not(:disabled) { background:#d9a42e; transform:translateY(-2px); }
.agg-btn-primary:disabled { opacity:.45; cursor:not-allowed; }
.agg-btn-ghost { background:rgba(255,255,255,.1); color:rgba(255,255,255,.85); border:1px solid rgba(255,255,255,.25); }
.agg-btn-ghost:hover { background:rgba(255,255,255,.2); }
.agg-btn-outline { background:var(--gl); color:var(--gd); border:1.5px solid var(--bdr); }
.agg-btn-outline:hover { background:var(--gll); border-color:var(--g); }

/* ── START / LEVEL SELECT ───────────────────────────────── */
.agg-screen[data-screen="start"] {
    background:linear-gradient(155deg,var(--gd),var(--g));
    text-align:center; position:relative;
}
.agg-start-icon {
    font-size:50px; line-height:1; margin-bottom:6px;
    filter:drop-shadow(0 3px 8px rgba(0,0,0,.3));
    animation:agg-float 3s ease-in-out infinite;
}
@keyframes agg-float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }
.agg-start-title { font-size:22px; font-weight:900; color:#fff; margin:0 0 14px; line-height:1.1; }
.agg-start-title em { display:block; font-style:normal; color:var(--gold); font-size:26px; }

/* Player info bar */
.agg-player-info {
    display:flex; align-items:center; gap:8px;
    background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.2);
    border-radius:10px; padding:8px 12px; margin-bottom:14px;
}
.agg-wrap .agg-player-avatar {
    width:32px; height:32px; border-radius:50%; background:var(--gold);
    color:#1a1a1a; font-size:14px; font-weight:900;
    display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.agg-player-greet { color:rgba(255,255,255,.9); font-size:12px; flex:1; text-align:left; }
.agg-player-greet strong { color:#fff; }

/* Tombol mute kecil */
.agg-mute-btn {
    background:rgba(255,255,255,.15); border:1px solid rgba(255,255,255,.25);
    border-radius:50%; width:28px; height:28px; font-size:14px;
    cursor:pointer; flex-shrink:0; display:flex; align-items:center; justify-content:center;
    transition:background .15s;
}
.agg-mute-btn:hover { background:rgba(255,255,255,.25); }

/* Level cards */
.agg-level-label { color:rgba(255,255,255,.8); font-size:12px; font-weight:700;
    text-transform:uppercase; letter-spacing:.5px; margin:0 0 8px; }
.agg-level-cards { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-bottom:14px; }
.agg-level-card {
    background:rgba(255,255,255,.1); border:2px solid rgba(255,255,255,.2);
    border-radius:10px; padding:10px 6px; cursor:pointer; transition:all .18s;
    display:flex; flex-direction:column; align-items:center; gap:3px; color:#fff;
}
.agg-level-card:hover { background:rgba(255,255,255,.2); transform:translateY(-2px); }
.agg-level-card.selected {
    background:rgba(255,255,255,.25); border-color:var(--gold);
    box-shadow:0 0 0 2px var(--gold); transform:translateY(-2px);
}
.agg-lc-icon  { font-size:20px; }
.agg-lc-name  { font-size:13px; font-weight:800; }
.agg-lc-q     { font-size:11px; color:rgba(255,255,255,.85); font-weight:700; }
.agg-lc-timer { font-size:10px; color:rgba(255,255,255,.65); }

/* Loading overlay */
.agg-loading-overlay {
    position:absolute; inset:0; background:rgba(19,77,44,.92);
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    gap:10px; border-radius:var(--rad); z-index:10;
}
.agg-spinner-big { width:48px;height:48px; border:5px solid rgba(255,255,255,.2);
    border-top-color:var(--gold); border-radius:50%; animation:agg-spin .8s linear infinite; }
.agg-loading-text { color:#fff; font-weight:700; font-size:15px; margin:0; }
.agg-loading-sub  { color:rgba(255,255,255,.65); font-size:12px; margin:0; }

/* ── HUD ────────────────────────────────────────────────── */
.agg-screen[data-screen="game"] { background:var(--bg); padding:12px 12px 16px; }
.agg-hud {
    display:grid; grid-template-columns:1fr 56px 1fr; align-items:center;
    background:var(--g); border-radius:10px; padding:8px 12px; margin-bottom:6px;
}
.agg-hud-cell { text-align:center; }
.agg-hud-cell--timer { position:relative; width:56px; height:56px; }
.agg-timer-ring { width:44px;height:44px; position:absolute; top:50%;left:50%; transform:translate(-50%,-50%); }
.agg-js-timer-num {
    position:absolute; top:50%;left:50%; transform:translate(-50%,-50%);
    font-size:16px; font-weight:900; color:#fff; line-height:1;
}
.agg-hud-lbl { display:block; font-size:9px; color:rgba(255,255,255,.65); text-transform:uppercase; letter-spacing:.6px; }
.agg-hud-val { display:block; font-size:17px; font-weight:800; color:#fff; }

/* Level + progress + mute bar */
.agg-hud-level-bar {
    display:flex; align-items:center; gap:6px; margin-bottom:8px;
}
.agg-js-level-badge {
    font-size:11px; font-weight:700; white-space:nowrap;
    background:var(--gl); color:var(--gd); padding:3px 8px; border-radius:20px;
}
.agg-progress-bar { flex:1; height:5px; background:var(--bdr); border-radius:99px; overflow:hidden; }
.agg-progress-fill { height:100%; background:linear-gradient(90deg,var(--g),var(--gold)); border-radius:99px; transition:width .5s ease; }
.agg-hud-level-bar .agg-mute-btn { background:var(--gl); border-color:var(--bdr); color:var(--gd); }

/* Badge jenis soal */
.agg-q-type-badge { display:inline-block; border-radius:20px; padding:3px 10px;
    font-size:11px; font-weight:700; margin-bottom:8px; letter-spacing:.2px; }
.badge-name     { background:var(--gl);    color:var(--gd);  }
.badge-konsulat { background:var(--bluel); color:var(--blue); }

/* ── FOTO ───────────────────────────────────────────────── */
.agg-photo-frame {
    position:relative; width:120px; height:120px; border-radius:50%;
    overflow:hidden; margin:0 auto 10px;
    background:var(--gl); border:4px solid var(--g);
    box-shadow:0 4px 18px rgba(26,107,60,.2);
    display:flex; align-items:center; justify-content:center;
}
.agg-photo-loader { display:flex; align-items:center; justify-content:center; width:100%; height:100%; }
.agg-spinner { width:28px;height:28px; border:3px solid var(--bdr); border-top-color:var(--g);
    border-radius:50%; animation:agg-spin .7s linear infinite; }
@keyframes agg-spin { to{transform:rotate(360deg)} }
.agg-photo { width:100%;height:100%;object-fit:cover; }
.agg-photo-name-overlay {
    position:absolute; bottom:0;left:0;right:0;
    background:rgba(19,77,44,.82); color:#fff;
    font-size:9px; font-weight:700; text-align:center;
    padding:4px 3px; backdrop-filter:blur(2px); line-height:1.2;
}
.agg-question { text-align:center; font-size:12px; font-weight:800;
    color:var(--gd); text-transform:uppercase; letter-spacing:.5px; margin:0 0 10px; }

/* ── PILIHAN ────────────────────────────────────────────── */
.agg-choices { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-bottom:8px; }
.agg-choice {
    background:var(--wh); border:1.5px solid var(--bdr); border-radius:9px;
    padding:8px 7px; cursor:pointer; display:flex; align-items:center; gap:6px;
    text-align:left; font-size:12px; line-height:1.3; transition:all .15s;
    box-shadow:0 1px 3px rgba(0,0,0,.04); min-height:42px;
}
.agg-choice:hover:not(:disabled) { border-color:var(--g); background:var(--gl); transform:translateY(-1px); }
.agg-choice-lbl {
    flex-shrink:0; width:22px;height:22px; border-radius:50%;
    background:var(--gl); color:var(--gd); font-weight:900; font-size:11px;
    display:flex; align-items:center; justify-content:center;
}
.agg-choice-txt { font-weight:600; color:var(--txt); }
.agg-choice.choice-correct { background:var(--gl); border-color:var(--g); }
.agg-choice.choice-correct .agg-choice-lbl { background:var(--g); color:#fff; }
.agg-choice.choice-wrong { background:var(--redl); border-color:var(--red); }
.agg-choice.choice-wrong .agg-choice-lbl { background:var(--red); color:#fff; }
.agg-choice:disabled { cursor:not-allowed; }

/* Feedback */
.agg-feedback { padding:8px 12px; border-radius:8px; font-size:12px; font-weight:700; animation:agg-pop .18s ease; }
@keyframes agg-pop { from{transform:scale(.94);opacity:0} to{transform:scale(1);opacity:1} }
.fb-ok  { background:var(--gl);   color:var(--gd); border:1px solid #b2d8c0; }
.fb-err { background:var(--redl); color:var(--red); border:1px solid #f0b8b3; }

/* ── RESULT ─────────────────────────────────────────────── */
.agg-screen[data-screen="result"] { background:var(--bg); padding:0 0 16px; }
.agg-result-bg { background:linear-gradient(155deg,var(--gd),var(--g)); padding:20px 16px 16px; text-align:center; }
.agg-result-level-tag {
    display:inline-block; background:rgba(255,255,255,.15); border:1px solid rgba(255,255,255,.3);
    color:#fff; font-size:12px; font-weight:700; padding:4px 12px; border-radius:20px; margin-bottom:8px;
}
.agg-result-stars { margin-bottom:4px; }
.agg-star { font-size:24px; }
.agg-star.on  { color:var(--gold); }
.agg-star.off { color:rgba(255,255,255,.2); }
.agg-result-title { color:#fff; font-size:20px; font-weight:900; margin:0 0 12px; }
.agg-result-scorebox {
    display:inline-flex; align-items:baseline; gap:6px;
    background:rgba(255,255,255,.12); border-radius:10px; padding:10px 22px; margin-bottom:4px;
}
.agg-result-pts { font-size:44px; font-weight:900; color:var(--gold); line-height:1; }
.agg-result-pts-lbl { font-size:14px; color:rgba(255,255,255,.8); }
.agg-result-sub  { color:rgba(255,255,255,.75); font-size:13px; margin:0; }
.agg-result-rank { color:rgba(255,255,255,.85); font-size:12px; margin:4px 0 0; font-weight:700; }

/* Breakdown */
.agg-result-breakdown { margin:10px 12px 12px; background:var(--wh);
    border-radius:10px; border:1px solid var(--bdr); overflow:hidden; max-height:180px; overflow-y:auto; }
.agg-breakdown-title { padding:7px 12px; background:var(--g); color:#fff;
    font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; }
.agg-brow { display:flex; align-items:center; gap:8px; padding:6px 10px;
    border-bottom:1px solid var(--bdr); font-size:12px; }
.agg-brow:last-child { border-bottom:none; }
.agg-brow.brow-ok  { background:var(--gll); }
.agg-brow.brow-err { background:#fefaf9; }
.agg-brow-img { width:32px;height:32px; border-radius:50%; object-fit:cover; flex-shrink:0; border:2px solid var(--bdr); }
.agg-brow-info { flex:1; display:flex; flex-direction:column; gap:2px; min-width:0; }
.agg-brow-type    { font-size:10px; color:var(--mut); }
.agg-brow-correct { font-weight:700; color:var(--txt); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.agg-brow-wrong   { font-size:10px; color:var(--red); }
.agg-brow-icon { font-size:16px; }
.agg-result-actions { padding:0 12px; }

/* ── LEADERBOARD ────────────────────────────────────────── */
.agg-screen[data-screen="leaderboard"] { background:var(--bg); }
.agg-lb-header { text-align:center; background:linear-gradient(135deg,var(--gd),var(--g));
    margin:-20px -16px 12px; padding:16px; color:#fff; }
.agg-lb-header h2 { margin:0 0 3px; font-size:18px; color:#fff; }
.agg-lb-header p  { margin:0; font-size:11px; color:rgba(255,255,255,.75); }

/* Tab level */
.agg-lb-tabs { display:grid; grid-template-columns:repeat(3,1fr); gap:5px; margin-bottom:10px; }
.agg-lb-tab {
    padding:7px 4px; border:1.5px solid var(--bdr); border-radius:8px;
    background:var(--wh); color:var(--mut); font-size:12px; font-weight:700;
    cursor:pointer; transition:all .15s;
}
.agg-lb-tab:hover { border-color:var(--g); color:var(--g); }
.agg-lb-tab.active { background:var(--g); color:#fff; border-color:var(--g); }

/* My best */
.agg-lb-mybest {
    background:var(--goldl); border:1.5px solid var(--gold);
    border-radius:9px; padding:9px 12px; margin-bottom:10px; font-size:12px; color:var(--txt);
}
.agg-lb-mybest strong { color:var(--gd); }

/* Rows */
.agg-lb-list { background:var(--wh); border-radius:10px; border:1px solid var(--bdr); overflow:hidden; }
.agg-lb-row {
    display:grid; grid-template-columns:32px 1fr 60px 68px;
    align-items:center; gap:4px; padding:8px 12px;
    border-bottom:1px solid var(--bdr); font-size:12px; transition:background .12s;
}
.agg-lb-row:last-child { border-bottom:none; }
.agg-lb-row.lb-top { background:var(--goldl); }
.agg-lb-row.lb-me  { background:var(--bluel)!important; border-left:3px solid var(--blue); }
.lb-rank  { font-size:16px; text-align:center; }
.lb-name  { font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.lb-score { font-weight:800; color:var(--gd); text-align:right; }
.lb-stars { text-align:right; }
.lb-stars .agg-star { font-size:10px; }
.lb-you   { font-size:10px; color:var(--blue); font-weight:700; }
.agg-lb-loading, .agg-lb-empty { text-align:center; padding:20px; color:var(--mut); font-size:13px; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width:280px) {
    .agg-choices { grid-template-columns:1fr; }
    .agg-photo-frame { width:100px; height:100px; }
    .agg-level-cards { grid-template-columns:1fr; }
}

/* ════ LIVE PLAYERS PANEL ════════════════════════════════ */
.agg-live-wrap {
    border-top: 1px solid var(--bdr);
    padding: 10px 14px 14px;
    background: var(--bg);
}

.agg-live-header {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
}

/* Titik hijau berkedip */
.agg-live-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #2ecc71;
    flex-shrink: 0;
    animation: agg-blink 1.4s ease-in-out infinite;
}
@keyframes agg-blink {
    0%,100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .4; transform: scale(.75); }
}

.agg-live-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--mut);
    text-transform: uppercase;
    letter-spacing: .5px;
    flex: 1;
}

.agg-live-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px; height: 20px;
    background: #2ecc71;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    border-radius: 99px;
    padding: 0 5px;
}

/* List pemain online */
.agg-live-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 180px;
    overflow-y: auto;
}

.agg-live-empty {
    font-size: 12px;
    color: var(--mut);
    text-align: center;
    padding: 8px 0;
    font-style: italic;
}

.agg-live-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--wh);
    border: 1px solid var(--bdr);
    border-radius: 8px;
    padding: 7px 10px;
    animation: agg-slide-in .3s ease;
}
@keyframes agg-slide-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.agg-wrap .agg-live-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--g);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.agg-wrap .agg-live-avatar--photo {
    object-fit: cover; background: transparent;
}

.agg-live-name {
    flex: 1;
    font-size: 12px;
    font-weight: 700;
    color: var(--txt);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agg-live-badge {
    font-size: 10px;
    font-weight: 700;
    background: var(--gl);
    color: var(--gd);
    padding: 2px 7px;
    border-radius: 20px;
    text-transform: capitalize;
    white-space: nowrap;
}

/* Pulsa hijau di kanan */
.agg-live-pulse {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #2ecc71;
    flex-shrink: 0;
    animation: agg-blink 1.4s ease-in-out infinite;
}

/* ════ TOAST NOTIFIKASI ══════════════════════════════════ */
.agg-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #f1c40f;
    color: #1a1a1a;
    border: 1px solid #d4ac0d;
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 220px;
    max-width: 300px;
    box-shadow: 0 6px 24px rgba(0,0,0,.25);
    z-index: 99999;
    opacity: 0;
    transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .3s ease;
    pointer-events: none;
}
.agg-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.agg-toast-icon { font-size: 22px; flex-shrink: 0; }
body > .agg-toast .agg-toast-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #134d2c;
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid rgba(0,0,0,.1);
}
body > .agg-toast .agg-toast-avatar--photo {
    object-fit: cover; background: transparent;
}
.agg-toast-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.agg-toast-body strong { font-size: 13px; color: #1a1a1a; }
.agg-toast-body small  { font-size: 11px; color: #555; }

/* ════════════════════════════════════════════════════════
   BATTLE MODE
   ════════════════════════════════════════════════════════ */

/* Tombol buka battle di layar start */
.agg-wrap .agg-btn-battle {
    background: linear-gradient(135deg, #8e44ad, #c0392b);
    color: #fff;
    box-shadow: 0 3px 10px rgba(142,68,173,.35);
}
.agg-wrap .agg-btn-battle:hover { filter: brightness(1.1); transform: translateY(-2px); }

.agg-battle-wrap {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: #fff;
    border: 1px solid #dde8e3;
    border-radius: 14px;
    box-shadow: 0 6px 28px rgba(26,107,60,.13);
    overflow: hidden;
    max-width: 360px;
    margin: 0 auto;
    color: #1a1a1a;
    position: relative;
}

.agg-battle-screen { padding: 18px 16px 20px; }

/* ── Header ─────────────────────────────────────────────── */
.agg-battle-header {
    text-align: center;
    background: linear-gradient(135deg, #8e44ad, #c0392b);
    margin: -18px -16px 16px;
    padding: 18px 16px;
    color: #fff;
}
.agg-battle-header-icon { font-size: 36px; margin-bottom: 4px; }
.agg-battle-header h2 { margin: 0 0 3px; font-size: 20px; color: #fff; }
.agg-battle-header p  { margin: 0; font-size: 12px; color: rgba(255,255,255,.75); }

/* ── Lobby cards ────────────────────────────────────────── */
.agg-battle-challenge-btn {
    width: 100%; display: flex; align-items: center; gap: 12px;
    background: linear-gradient(135deg, #8e44ad, #c0392b);
    border: none; border-radius: 12px; padding: 14px 16px;
    cursor: pointer; margin-bottom: 12px; transition: all .18s;
    box-shadow: 0 3px 12px rgba(142,68,173,.3); text-align: left;
}
.agg-battle-challenge-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(142,68,173,.4); }
.agg-battle-challenge-btn > span:first-child { font-size: 28px; flex-shrink: 0; }
.agg-battle-challenge-btn strong { display: block; font-size: 15px; color: #fff; font-weight: 800; }
.agg-battle-challenge-btn small  { display: block; font-size: 11px; color: rgba(255,255,255,.75); margin-top: 2px; }

/* Challenger list */
.agg-battle-challengers-box {
    background: #f7faf8; border: 1.5px solid #dde8e3; border-radius: 12px;
    overflow: hidden; margin-bottom: 12px;
}
.agg-battle-challengers-title {
    display: flex; align-items: center; gap: 6px;
    background: linear-gradient(135deg, #8e44ad, #c0392b);
    color: #fff; font-size: 12px; font-weight: 700;
    padding: 8px 12px; text-transform: uppercase; letter-spacing: .4px;
}
.agg-challenger-count {
    margin-left: auto; background: rgba(255,255,255,.25);
    border-radius: 99px; padding: 1px 8px; font-size: 11px;
}
.agg-challenger-list { max-height: 200px; overflow-y: auto; }
.agg-challenger-empty {
    padding: 16px; text-align: center; font-size: 12px; color: #999; font-style: italic;
}
.agg-challenger-row {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; border-bottom: 1px solid #eee; transition: background .15s;
}
.agg-challenger-row:last-child { border-bottom: none; }
.agg-challenger-row:hover { background: #f0e8ff; }
.agg-challenger-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, #8e44ad, #c0392b);
    color: #fff; font-size: 16px; font-weight: 900;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.agg-challenger-name { flex: 1; font-size: 13px; font-weight: 700; color: #1a1a1a; }
.agg-challenger-waiting { font-size: 10px; color: #aaa; white-space: nowrap; }

.agg-battle-rules {
    display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px;
    background: #f7faf8; border-radius: 10px; padding: 10px 14px;
}
.agg-battle-rule { display: flex; gap: 8px; font-size: 12px; color: #555; align-items: center; }

/* ── Waiting screen ─────────────────────────────────────── */
.agg-battle-screen[data-battle-screen="waiting"] { text-align: center; }

/* Waiting card — tampilkan diri sendiri */
.agg-battle-waiting-card {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    background: linear-gradient(135deg, #f9f0ff, #fdf5e0);
    border: 2px solid #d7b3e8; border-radius: 14px;
    padding: 18px; margin-bottom: 14px;
}
.agg-battle-waiting-avatar {
    width: 64px; height: 64px; border-radius: 50%;
    background: rgba(142,68,173,.15);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.agg-battle-waiting-name { font-size: 16px; font-weight: 800; color: #1a1a1a; }
.agg-battle-waiting-label { font-size: 12px; color: #888; text-align: center; line-height: 1.5; }

/* Animasi pulse ring */
.agg-battle-waiting-anim {
    position: relative; width: 60px; height: 60px; margin: 12px auto;
}
.agg-battle-pulse-ring {
    position: absolute; inset: 0;
    border: 3px solid #8e44ad; border-radius: 50%;
    animation: agg-battle-pulse 1.6s ease-out infinite;
}
@keyframes agg-battle-pulse {
    0%   { transform: scale(.5); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

.agg-battle-waiting-status {
    font-size: 13px; color: #555; font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.agg-battle-waiting-status.connected { color: #1a6b3c; }

/* ── Game screen ────────────────────────────────────────── */
.agg-battle-screen[data-battle-screen="game"] {
    padding: 10px 12px 16px; background: #f7faf8;
}

/* Countdown overlay */
.agg-battle-countdown {
    position: absolute; inset: 0; z-index: 20;
    background: rgba(142,68,173,.88); color: #fff;
    font-size: 72px; font-weight: 900; display: flex;
    align-items: center; justify-content: center;
    border-radius: 14px; animation: agg-cd-pulse .6s ease;
}
@keyframes agg-cd-pulse { from{transform:scale(1.5);opacity:0} to{transform:scale(1);opacity:1} }

/* Disconnect overlay */
.agg-battle-disconnect-msg {
    position: absolute; inset: 0; z-index: 25;
    background: rgba(0,0,0,.75); display: flex;
    align-items: center; justify-content: center; border-radius: 14px;
}
.agg-battle-disconnect-inner {
    background: #fff; border-radius: 12px; padding: 24px;
    text-align: center; display: flex; flex-direction: column; gap: 6px;
}
.agg-battle-disconnect-inner span { font-size: 36px; }
.agg-battle-disconnect-inner strong { font-size: 16px; color: #c0392b; }
.agg-battle-disconnect-inner p { font-size: 13px; color: #666; margin: 0; }

/* Scoreboard */
.agg-battle-scoreboard {
    display: grid; grid-template-columns: 1fr 32px 1fr;
    align-items: center; gap: 4px;
    background: linear-gradient(135deg, #8e44ad, #c0392b);
    border-radius: 10px; padding: 8px 10px; margin-bottom: 5px;
}
.agg-battle-player {
    display: flex; align-items: center; gap: 6px;
}
.agg-battle-player--opp { flex-direction: row-reverse; text-align: right; }

.agg-battle-my-avatar,
.agg-battle-opp-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,.25); color: #fff;
    font-size: 16px; font-weight: 900;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; border: 2px solid rgba(255,255,255,.4);
    overflow: hidden;
}

.agg-battle-player-info { display: flex; flex-direction: column; min-width: 0; }
.agg-battle-my-name, .agg-battle-opp-name {
    font-size: 11px; font-weight: 700; color: rgba(255,255,255,.9);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70px;
}
.agg-battle-my-correct, .agg-battle-opp-correct {
    font-size: 9px; color: rgba(255,255,255,.65);
}
.agg-battle-my-score, .agg-battle-opp-score {
    font-size: 18px; font-weight: 900; color: #f1c40f;
    white-space: nowrap;
}
.agg-battle-vs {
    font-size: 11px; font-weight: 900; color: rgba(255,255,255,.6);
    text-align: center;
}

/* Leading bar */
.agg-battle-bar {
    display: flex; height: 5px; border-radius: 99px;
    overflow: hidden; margin-bottom: 8px; background: #eee;
}
.agg-battle-bar-my  { background: #8e44ad; transition: width .4s ease; }
.agg-battle-bar-opp { background: #c0392b; transition: width .4s ease; flex: 1; }

/* HUD bawah scoreboard */
.agg-battle-hud {
    display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
}
.agg-battle-qnum { font-size: 11px; font-weight: 700; color: #666; white-space: nowrap; }
.agg-battle-timer-wrap {
    position: relative; width: 40px; height: 40px; flex-shrink: 0;
}
.agg-battle-timer-num {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 13px; font-weight: 900; color: #1a1a1a;
}
.agg-battle-progress-bar {
    flex: 1; height: 5px; background: #dde8e3; border-radius: 99px; overflow: hidden;
}
.agg-battle-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8e44ad, #c0392b);
    border-radius: 99px; transition: width .5s;
}

.agg-battle-qtype-badge { margin-bottom: 8px; }

/* ── Result screen ──────────────────────────────────────── */
.agg-battle-screen[data-battle-screen="result"] { padding: 0 0 16px; }

.agg-battle-result-banner {
    padding: 18px; text-align: center;
    font-size: 22px; font-weight: 900;
}
.banner-win  { background: linear-gradient(135deg, #f1c40f, #e67e22); color: #1a1a1a; }
.banner-lose { background: linear-gradient(135deg, #95a5a6, #7f8c8d); color: #fff; }
.banner-draw { background: linear-gradient(135deg, #3498db, #2980b9); color: #fff; }

.agg-battle-result-cards {
    display: grid; grid-template-columns: 1fr 28px 1fr;
    gap: 8px; align-items: center; padding: 14px;
}
.agg-battle-result-card {
    background: #f7faf8; border: 2px solid #dde8e3; border-radius: 12px;
    padding: 12px 8px; text-align: center; display: flex;
    flex-direction: column; align-items: center; gap: 4px;
    transition: all .2s;
}
.agg-battle-result-card.card-winner {
    border-color: #f1c40f; background: #fdf5e0;
    box-shadow: 0 0 0 3px #f1c40f55;
}
.agg-battle-result-vs { text-align: center; font-weight: 900; color: #999; font-size: 12px; }

.agg-br-my-avatar, .agg-br-opp-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: #1a6b3c; color: #fff;
    font-size: 18px; font-weight: 900;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 4px; overflow: hidden;
}
.agg-br-my-name, .agg-br-opp-name { font-size: 12px; font-weight: 700; color: #333; }
.agg-br-my-pts, .agg-br-opp-pts {
    font-size: 22px; font-weight: 900; color: #1a6b3c;
}
.agg-br-my-correct, .agg-br-opp-correct { font-size: 11px; color: #666; }

/* Battle badge di live players panel */
.agg-wrap .agg-live-badge--battle {
    background: linear-gradient(135deg, #8e44ad, #c0392b);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agg-wrap .agg-live-row--battle {
    background: #fdf0ff;
    border-color: #d7b3e8;
}

.agg-wrap .agg-live-row--battle .agg-live-avatar {
    background: linear-gradient(135deg, #8e44ad, #c0392b);
}
