/* Semaphore Arena — Shared Styles */
:root {
    --sem-primary: #1abc9c;
    --sem-primary-dark: #16a085;
    --sem-gold: #f1c40f;
    --sem-danger: #e74c3c;
    --sem-success: #2ecc71;
    --sem-dark: #1e272e;
    --sem-card: #2c3a47;
    --sem-text: #d2dae2;
    --sem-muted: #95a5a6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.sem-body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--sem-dark);
    color: var(--sem-text);
    min-height: 100vh;
}

.sem-container { max-width: 1200px; margin: 0 auto; padding: 20px; }

.sem-title {
    font-family: 'Bungee', cursive;
    color: #fff;
}

.sem-card {
    background: linear-gradient(145deg, #2c3a47, #243039);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.sem-btn {
    display: inline-block;
    background: var(--sem-primary);
    color: #fff;
    padding: 12px 28px;
    border-radius: 50px;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.sem-btn:hover { background: var(--sem-primary-dark); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(26,188,156,0.4); }
.sem-btn:disabled { background: #555; cursor: not-allowed; transform: none; box-shadow: none; }
.sem-btn-danger { background: var(--sem-danger); }
.sem-btn-danger:hover { background: #c0392b; }
.sem-btn-gold { background: var(--sem-gold); color: #1e272e; }
.sem-btn-gold:hover { background: #d4ac0d; }
.sem-btn-outline { background: transparent; border: 2px solid var(--sem-primary); color: var(--sem-primary); }
.sem-btn-sm { padding: 8px 18px; font-size: 0.85rem; }

.sem-back {
    position: fixed; top: 16px; left: 16px; z-index: 100;
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255,255,255,0.1); color: #fff;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; font-size: 1.4rem;
    transition: background 0.2s, transform 0.2s;
}
.sem-back:hover { background: rgba(255,255,255,0.2); transform: scale(1.1); }

/* Admin layout */
.sem-admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sem-sidebar {
    background: #1a2229;
    padding: 24px 16px;
    border-right: 1px solid #34495e;
}
.sem-sidebar .sem-logo {
    font-family: 'Bungee', cursive;
    font-size: 1.1rem;
    color: var(--sem-primary);
    margin-bottom: 32px;
    text-align: center;
}
.sem-nav a {
    display: block;
    padding: 12px 16px;
    color: var(--sem-muted);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 4px;
    transition: background 0.2s, color 0.2s;
    font-size: 0.95rem;
}
.sem-nav a:hover, .sem-nav a.active {
    background: rgba(26,188,156,0.15);
    color: var(--sem-primary);
}
.sem-main { padding: 28px; overflow-y: auto; }
.sem-page-title { font-size: 1.6rem; margin-bottom: 24px; color: #fff; }

.sem-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.sem-stat-card { text-align: center; padding: 20px; }
.sem-stat-card .num { font-family: 'Bungee', cursive; font-size: 2.2rem; color: var(--sem-primary); }
.sem-stat-card .lbl { font-size: 0.85rem; color: var(--sem-muted); margin-top: 4px; }

/* Forms */
/* Panduan tipe soal (admin) */
.sem-type-guide {
    margin-bottom: 0;
    padding: 18px 20px;
    border-radius: 12px;
}
.sem-type-guide-head {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 14px;
}
.sem-type-guide-icon {
    font-size: 1.75rem;
    line-height: 1;
    flex-shrink: 0;
}
.sem-type-guide-title {
    display: block;
    font-size: 1.05rem;
    color: #fff;
    margin-bottom: 4px;
}
.sem-type-guide-summary {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    opacity: 0.95;
}
.sem-type-guide-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}
@media (max-width: 640px) {
    .sem-type-guide-grid { grid-template-columns: 1fr; }
}
.sem-type-guide-col {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 10px 12px;
}
.sem-type-guide-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
    opacity: 0.85;
}
.sem-type-guide-col p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.45;
}
.sem-type-guide-fill {
    margin: 0 0 12px;
    padding-left: 18px;
    font-size: 0.88rem;
    line-height: 1.55;
}
.sem-type-guide-fill li { margin-bottom: 4px; }
.sem-type-guide-fill li > span:first-child {
    font-weight: 600;
    color: rgba(255,255,255,0.9);
}
.sem-type-guide-example {
    margin: 0;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.15);
    font-size: 0.85rem;
    line-height: 1.5;
    opacity: 0.95;
}

.sem-form-group { margin-bottom: 18px; }
.sem-form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
.sem-form-group input, .sem-form-group select, .sem-form-group textarea {
    width: 100%; padding: 12px 14px;
    border: 2px solid #485460; border-radius: 10px;
    background: #1e272e; color: #fff; font-family: inherit; font-size: 1rem;
}
.sem-form-group input:focus, .sem-form-group select:focus, .sem-form-group textarea:focus {
    outline: none; border-color: var(--sem-primary);
}
.sem-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.sem-table { width: 100%; border-collapse: collapse; }
.sem-table th, .sem-table td { padding: 12px; text-align: left; border-bottom: 1px solid #485460; }
.sem-table th { font-size: 0.8rem; text-transform: uppercase; color: var(--sem-muted); }
.sem-badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 600;
}
.sem-badge-teal { background: rgba(26,188,156,0.2); color: var(--sem-primary); }
.sem-badge-gold { background: rgba(241,196,15,0.2); color: var(--sem-gold); }

.sem-alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 16px; }
.sem-alert-error { background: rgba(231,76,60,0.15); border: 1px solid var(--sem-danger); color: #e74c3c; }
.sem-alert-success { background: rgba(46,204,113,0.15); border: 1px solid var(--sem-success); color: var(--sem-success); }
.sem-alert-info { background: rgba(26,188,156,0.15); border: 1px solid var(--sem-primary); color: var(--sem-primary); }
.sem-alert-warning { background: rgba(241,196,15,0.15); border: 1px solid var(--sem-gold); color: var(--sem-gold); }

/* Notifikasi JS (toast + modal) */
#sem-notify-root { position: relative; z-index: 99999; pointer-events: none; }
.sem-notify-toasts {
    position: fixed; top: 16px; right: 16px; left: 16px;
    display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
    pointer-events: none;
}
@media (min-width: 520px) { .sem-notify-toasts { left: auto; max-width: 420px; } }
.sem-notify-toast {
    display: flex; align-items: flex-start; gap: 10px;
    width: 100%; padding: 14px 16px; border-radius: 12px;
    font-family: Poppins, sans-serif; font-size: 0.92rem; line-height: 1.45;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35);
    pointer-events: auto;
    opacity: 0; transform: translateX(24px);
    transition: opacity 0.28s ease, transform 0.28s ease;
}
.sem-notify-toast-in { opacity: 1; transform: translateX(0); }
.sem-notify-toast-out { opacity: 0; transform: translateX(24px); }
.sem-notify-toast-error { background: #2d1f21; border: 1px solid var(--sem-danger); color: #ff8a80; }
.sem-notify-toast-success { background: #1a2d24; border: 1px solid var(--sem-success); color: #7bed9f; }
.sem-notify-toast-info { background: #1a2a2d; border: 1px solid var(--sem-primary); color: #7fdbda; }
.sem-notify-toast-warning { background: #2d2a1a; border: 1px solid var(--sem-gold); color: #ffe066; }
.sem-notify-toast-icon {
    flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700;
}
.sem-notify-toast-error .sem-notify-toast-icon { background: rgba(231,76,60,0.25); color: var(--sem-danger); }
.sem-notify-toast-success .sem-notify-toast-icon { background: rgba(46,204,113,0.25); color: var(--sem-success); }
.sem-notify-toast-info .sem-notify-toast-icon { background: rgba(26,188,156,0.25); color: var(--sem-primary); }
.sem-notify-toast-warning .sem-notify-toast-icon { background: rgba(241,196,15,0.25); color: var(--sem-gold); }
.sem-notify-toast-text { flex: 1; }
.sem-notify-toast-close {
    flex-shrink: 0; background: none; border: none; color: inherit; opacity: 0.65;
    font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 0 2px;
}
.sem-notify-toast-close:hover { opacity: 1; }

.sem-notify-modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.65);
    display: flex; align-items: center; justify-content: center;
    padding: 20px; pointer-events: auto;
    opacity: 0; transition: opacity 0.22s ease;
}
.sem-notify-modal[hidden] { display: none !important; }
.sem-notify-modal-open { opacity: 1; }
.sem-notify-dialog {
    width: 100%; max-width: 400px; padding: 28px 24px 22px;
    background: var(--sem-card, #2f3542); border-radius: 16px;
    border: 1px solid #485460; text-align: center;
    box-shadow: 0 16px 48px rgba(0,0,0,0.45);
    transform: scale(0.92); transition: transform 0.22s ease;
}
.sem-notify-modal-open .sem-notify-dialog { transform: scale(1); }
.sem-notify-dialog-icon {
    width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; font-weight: 700;
}
.sem-notify-dialog-icon-error { background: rgba(231,76,60,0.2); color: var(--sem-danger); }
.sem-notify-dialog-icon-success { background: rgba(46,204,113,0.2); color: var(--sem-success); }
.sem-notify-dialog-icon-info { background: rgba(26,188,156,0.2); color: var(--sem-primary); }
.sem-notify-dialog-icon-warning { background: rgba(241,196,15,0.2); color: var(--sem-gold); }
.sem-notify-dialog-msg {
    margin: 0 0 22px; font-size: 1rem; line-height: 1.5; color: var(--sem-text, #dfe6e9);
}
.sem-notify-dialog-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.sem-notify-dialog-actions .sem-btn { min-width: 100px; }

/* Animations */
@keyframes semFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes semFadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes semFadeInDown { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes semPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes semBounceIn { 0% { opacity:0; transform:scale(0.3); } 50% { opacity:1; transform:scale(1.05); } 70% { transform:scale(0.95); } 100% { transform:scale(1); } }
@keyframes semSlideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes semCountdownPop { 0% { transform: scale(2); opacity: 0; } 60% { transform: scale(1); opacity: 1; } 100% { transform: scale(0.8); opacity: 0; } }
@keyframes semWave { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes semFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.sem-animate-fade { animation: semFadeIn 0.6s ease-out forwards; }
.sem-animate-up { animation: semFadeInUp 0.6s ease-out forwards; }
.sem-animate-bounce { animation: semBounceIn 0.6s ease-out forwards; }

/* Host display — tipografi game (bukan default browser/serif) */
.sem-host-body {
    font-family: 'Poppins', sans-serif;
    color: var(--sem-text);
    margin: 0;
}
.sem-host-screen {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    background-size: 400% 400%;
    animation: semWave 12s ease infinite;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 40px 20px; overflow: hidden;
    position: relative;
    font-family: 'Poppins', sans-serif;
    color: #fff;
}
.sem-host-screen h1,
.sem-host-screen h2,
.sem-host-screen h3,
.sem-host-screen .host-title,
.sem-host-screen .host-q-text,
.sem-host-screen .host-answer-big,
.sem-host-screen .sem-ketik-target,
.sem-host-screen .countdown-big,
.sem-host-screen .sem-host-pin {
    font-family: 'Bungee', cursive;
    font-weight: 400;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.35);
}
.host-logo {
    position: absolute; top: 20px; left: 30px;
    font-family: 'Bungee', cursive;
    color: rgba(255,255,255,0.55);
    font-size: 1.15rem;
    letter-spacing: 0.04em;
}
.host-pin-small {
    position: absolute; top: 20px; right: 30px;
    font-family: 'Bungee', cursive;
    color: var(--sem-gold);
    font-size: 1.35rem;
    text-shadow: 0 0 20px rgba(241,196,15,0.4);
}
.host-badges {
    position: absolute; top: 58px; right: 30px;
    display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end;
}
.host-sub {
    font-family: 'Poppins', sans-serif;
    color: var(--sem-muted);
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    font-weight: 500;
}
.host-q-text {
    font-size: clamp(1.5rem, 4.5vw, 2.6rem);
    line-height: 1.25;
    margin-bottom: 20px;
    animation: semFadeInDown 0.5s ease-out;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}
.host-q-progress {
    font-family: 'Bungee', cursive;
    color: var(--sem-primary);
    font-size: 1rem;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
    text-transform: uppercase;
}
.host-hint {
    font-family: 'Poppins', sans-serif;
    color: var(--sem-muted);
    font-size: 1rem;
    margin-top: 14px;
}
.host-answer-big {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    color: var(--sem-gold);
    letter-spacing: 0.12em;
    margin: 16px 0;
    animation: semBounceIn 0.6s ease-out;
    text-shadow: 0 0 30px rgba(241,196,15,0.45);
}
.host-reveal-title {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    color: var(--sem-success);
    margin-bottom: 8px;
}
.countdown-big {
    font-family: 'Bungee', cursive;
    font-size: clamp(6rem, 20vw, 12rem);
    color: var(--sem-gold);
    animation: semCountdownPop 1s ease-out;
    text-shadow: 0 0 50px rgba(241,196,15,0.5);
}
.survival-hud {
    font-family: 'Bungee', cursive;
    font-size: 1rem;
    color: var(--sem-danger);
    margin-top: 8px;
}
.sem-ketik-target {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    color: var(--sem-gold);
    letter-spacing: 0.2em;
    margin: 20px 0;
    animation: semBounceIn 0.6s ease-out;
}

/* Layar akhir — kartu game */
.host-finished-wrap {
    animation: semFadeInUp 0.8s ease-out;
    padding: 20px;
}
.host-finished-card {
    background: linear-gradient(160deg, rgba(44,58,71,0.95), rgba(20,28,35,0.98));
    border: 3px solid rgba(26,188,156,0.45);
    border-radius: 28px;
    padding: 48px 40px;
    box-shadow: 0 0 60px rgba(26,188,156,0.2), 0 24px 80px rgba(0,0,0,0.45);
    max-width: 640px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}
.host-finished-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(241,196,15,0.12), transparent 55%);
    pointer-events: none;
}
.host-finished-emoji {
    font-size: 4rem;
    line-height: 1;
    margin-bottom: 12px;
    animation: semFloat 3s ease-in-out infinite;
}
.host-finished-title {
    font-family: 'Bungee', cursive;
    font-size: clamp(2rem, 6vw, 3.2rem);
    color: var(--sem-gold);
    margin-bottom: 12px;
    text-shadow: 0 0 28px rgba(241,196,15,0.4);
    position: relative;
}
.host-finished-sub {
    font-family: 'Poppins', sans-serif;
    color: var(--sem-muted);
    font-size: 1.1rem;
    position: relative;
}
.host-podium-title {
    font-family: 'Bungee', cursive;
    font-size: clamp(1.8rem, 5vw, 2.6rem);
    color: var(--sem-gold);
    margin-bottom: 20px;
    text-shadow: 0 0 24px rgba(241,196,15,0.35);
}
.host-podium-name {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 8px;
}
.host-team-win-name {
    font-family: 'Bungee', cursive;
    font-size: clamp(2rem, 6vw, 2.8rem);
    color: var(--sem-gold);
    margin: 16px 0;
}
.sem-host-pin {
    font-family: 'Bungee', cursive;
    font-size: clamp(3rem, 12vw, 7rem);
    color: var(--sem-gold);
    letter-spacing: 0.15em;
    text-shadow: 0 0 40px rgba(241,196,15,0.5);
    animation: semPulse 2s ease-in-out infinite;
}
.sem-timer-ring {
    width: 80px; height: 80px; border-radius: 50%;
    border: 4px solid var(--sem-primary);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Bungee', cursive; font-size: 2rem; color: #fff;
    margin: 20px auto;
    transition: border-color 0.3s;
}
.sem-timer-ring.urgent { border-color: var(--sem-danger); color: var(--sem-danger); animation: semPulse 0.5s ease infinite; }

.sem-ketik-words {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
}
.sem-ketik-word-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}
.sem-ketik-char { flex-shrink: 0; }

.sem-host-hp-lb .sem-lb-item {
    transition: transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.35s ease;
}
.sem-host-hp-lb .sem-lb-item.rank-up {
    animation: semLbPop 0.55s ease;
}
@keyframes semLbPop {
    0% { transform: scale(1); }
    40% { transform: scale(1.04) translateY(-4px); }
    100% { transform: scale(1); }
}

.host-untimed-badge {
    font-family: 'Bungee', cursive;
    font-size: clamp(1.3rem, 3.5vw, 2rem);
    color: var(--sem-gold);
    margin: 20px 0 8px;
    text-shadow: 0 2px 12px rgba(241, 196, 15, 0.35);
}

.sem-question-display { text-align: center; max-width: 900px; width: 100%; }
.sem-question-display h2 { font-family: 'Bungee', cursive; font-size: clamp(1.4rem, 4vw, 2.4rem); margin-bottom: 24px; animation: semFadeInDown 0.5s ease-out; color: #fff; }
.sem-semaphore-img {
    max-width: 280px; max-height: 320px;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
    animation: semBounceIn 0.7s ease-out;
    background: #fff; padding: 12px;
}
.sem-semaphore-placeholder {
    width: 200px; height: 240px;
    background: rgba(255,255,255,0.1);
    border: 3px dashed var(--sem-muted);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 4rem; font-family: 'Bungee', cursive;
    color: var(--sem-gold); margin: 0 auto;
}

/* Leaderboard — panel game */
.sem-lb-panel {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(145deg, rgba(44,58,71,0.95), rgba(30,39,46,0.92));
    border: 2px solid rgba(26,188,156,0.35);
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.06);
}
.sem-lb-panel-title {
    font-family: 'Bungee', cursive;
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--sem-gold);
    text-shadow: 0 0 20px rgba(241,196,15,0.35);
}
.sem-lb-list { list-style: none; width: 100%; }
.sem-lb-item {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 16px; margin-bottom: 10px;
    background: rgba(0,0,0,0.22);
    border: 2px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    animation: semSlideUp 0.5s ease-out backwards;
    transition: transform 0.2s, box-shadow 0.2s;
}
.sem-lb-item.lb-top-1 { border-color: rgba(241,196,15,0.55); background: linear-gradient(90deg, rgba(241,196,15,0.12), rgba(0,0,0,0.2)); box-shadow: 0 0 20px rgba(241,196,15,0.15); }
.sem-lb-item.lb-top-2 { border-color: rgba(189,195,199,0.45); background: linear-gradient(90deg, rgba(189,195,199,0.1), rgba(0,0,0,0.2)); }
.sem-lb-item.lb-top-3 { border-color: rgba(230,126,34,0.45); background: linear-gradient(90deg, rgba(230,126,34,0.1), rgba(0,0,0,0.2)); }
.sem-lb-item .rank {
    font-family: 'Bungee', cursive; font-size: 1.4rem; min-width: 36px;
    text-align: center; color: var(--sem-gold);
}
.sem-lb-item.lb-top-1 .rank { color: #f1c40f; font-size: 1.6rem; }
.sem-lb-item.lb-top-2 .rank { color: #bdc3c7; }
.sem-lb-item.lb-top-3 .rank { color: #e67e22; }
.sem-lb-item .name { flex: 1; font-weight: 600; font-size: 1.05rem; }
.sem-lb-item .score { font-family: 'Bungee', cursive; font-size: 1.2rem; color: var(--sem-primary); min-width: 56px; text-align: right; }
.sem-lb-av-gold { filter: drop-shadow(0 0 10px rgba(241,196,15,0.55)); }
.sem-lb-av-silver { filter: drop-shadow(0 0 8px rgba(189,195,199,0.45)); }
.sem-lb-av-bronze { filter: drop-shadow(0 0 8px rgba(230,126,34,0.45)); }

/* Podium juara */
.sem-podium { display: flex; align-items: flex-end; justify-content: center; gap: 20px; margin-top: 32px; flex-wrap: wrap; }
.sem-podium-place { text-align: center; animation: semFadeInUp 0.8s ease-out backwards; }
.sem-podium-place .avatar-big { margin-bottom: 12px; display: flex; justify-content: center; }
.sem-podium-av-1 { filter: drop-shadow(0 0 18px rgba(241,196,15,0.65)); animation: semCelebrate 1.2s ease-out, semFrameGlow 2s ease-in-out infinite 1s !important; }
.sem-podium-av-2 { filter: drop-shadow(0 0 12px rgba(189,195,199,0.5)); }
.sem-podium-av-3 { filter: drop-shadow(0 0 12px rgba(230,126,34,0.5)); }
.sem-podium-place .bar {
    width: 120px; border-radius: 14px 14px 0 0;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Bungee', cursive; font-size: 2rem; color: #fff;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}
.sem-podium-1 .bar { height: 160px; background: linear-gradient(180deg, var(--sem-gold), #d4ac0d); animation-delay: 0.3s; }
.sem-podium-2 .bar { height: 120px; background: linear-gradient(180deg, #bdc3c7, #95a5a6); animation-delay: 0.1s; }
.sem-podium-3 .bar { height: 90px; background: linear-gradient(180deg, #e67e22, #d35400); animation-delay: 0.5s; }
.sem-podium-crown { font-size: 1.8rem; margin-bottom: 4px; animation: semFloat 2s ease-in-out infinite; }

/* Peserta mobile */
.sem-peserta-screen { min-height: 100vh; padding: 20px; display: flex; flex-direction: column; }
.sem-answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.sem-answer-btn {
    padding: 20px 16px; border-radius: 14px;
    border: 3px solid #485460; background: rgba(255,255,255,0.05);
    color: #fff; font-size: 1.1rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
    font-family: inherit; text-align: center;
}
.sem-answer-btn:hover { border-color: var(--sem-primary); background: rgba(26,188,156,0.15); transform: scale(1.03); }
.sem-answer-btn.correct { border-color: var(--sem-success); background: rgba(46,204,113,0.3); }
.sem-answer-btn.wrong { border-color: var(--sem-danger); background: rgba(231,76,60,0.3); }
.sem-answer-btn img { max-width: 100%; max-height: 80px; border-radius: 8px; }

/* Semaphore keyboard */
.sem-kb-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-top: 16px;
}
.sem-kb-key {
    aspect-ratio: 1;
    border: 2px solid #485460;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    transition: all 0.15s;
    padding: 4px;
}
.sem-kb-key:hover { border-color: var(--sem-primary); transform: scale(1.08); }
.sem-kb-key img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sem-kb-key .kb-fallback { font-family: 'Bungee', cursive; font-size: 1.2rem; color: var(--sem-gold); }
.sem-kb-display {
    background: #1a2229; border: 2px solid var(--sem-primary);
    border-radius: 12px; padding: 16px; text-align: center;
    font-family: 'Bungee', cursive; font-size: 2rem;
    letter-spacing: 0.2em; min-height: 60px; margin-bottom: 12px;
    color: var(--sem-gold);
}

/* === Bingkai avatar imajinatif (gambar Labirin) === */
.sem-avatar-frame {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0.02));
}
.sem-avatar-frame-inner {
    border-radius: 50%;
    overflow: hidden;
    background: #1a2229;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sem-avatar-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

.sem-avatar-xs { width: 40px; height: 40px; flex-shrink: 0; }
.sem-avatar-sm { width: 48px; height: 48px; }
.sem-avatar-md { width: 56px; height: 56px; }
.sem-avatar-lg { width: 72px; height: 72px; }
.sem-avatar-xl { width: 96px; height: 96px; }
.sem-avatar-xxl { width: 120px; height: 120px; }
.sem-avatar-hero { width: 140px; height: 140px; }

/* Bingkai: Perisai Pramuka */
.frame-shield {
    clip-path: polygon(50% 0%, 95% 18%, 82% 90%, 50% 100%, 18% 90%, 5% 18%);
    padding: 5px;
    background: linear-gradient(160deg, #1abc9c, #16a085, #0e6655);
    box-shadow: 0 0 16px rgba(26,188,156,0.45);
}
.frame-shield .sem-avatar-frame-inner { clip-path: polygon(50% 2%, 92% 20%, 80% 88%, 50% 96%, 20% 88%, 8% 20%); border-radius: 0; }

/* Bingkai: Kristal Hex */
.frame-hex {
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    padding: 4px;
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    box-shadow: 0 0 14px rgba(155,89,182,0.5);
}
.frame-hex .sem-avatar-frame-inner { clip-path: polygon(25% 2%, 75% 2%, 98% 50%, 75% 98%, 25% 98%, 2% 50%); border-radius: 0; }

/* Bingkai: Bintang Emas */
.frame-star {
    padding: 5px;
    background: conic-gradient(from 0deg, #f1c40f, #f39c12, #f1c40f, #fff8dc, #f1c40f);
    box-shadow: 0 0 18px rgba(241,196,15,0.55);
    animation: semFrameGlow 3s ease-in-out infinite;
}
@keyframes semFrameGlow { 0%,100% { box-shadow: 0 0 12px rgba(241,196,15,0.4); } 50% { box-shadow: 0 0 22px rgba(241,196,15,0.7); } }

/* Bingkai: Orbit Galaksi */
.frame-orbit {
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, #3498db, #2980b9, #1abc9c);
    box-shadow: 0 0 0 3px rgba(52,152,219,0.2), 0 0 20px rgba(52,152,219,0.35);
}
.frame-orbit::before {
    content: '';
    position: absolute;
    inset: -6px;
    border: 2px dashed rgba(52,152,219,0.35);
    border-radius: 50%;
    animation: semOrbitSpin 8s linear infinite;
}
@keyframes semOrbitSpin { to { transform: rotate(360deg); } }

/* Bingkai: Api Semangat */
.frame-flame {
    border-radius: 50% 50% 45% 45%;
    padding: 4px;
    background: linear-gradient(180deg, #e74c3c, #e67e22, #f1c40f);
    box-shadow: 0 4px 20px rgba(230,126,34,0.5);
}

/* Bingkai: Daun Alam */
.frame-leaf {
    border-radius: 50% 0 50% 50%;
    padding: 4px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    box-shadow: 0 0 14px rgba(39,174,96,0.4);
    transform: rotate(-5deg);
}
.frame-leaf .sem-avatar-frame-inner { transform: rotate(5deg); }

/* Avatar picker — bingkai kecil, grid rapat */
.sem-avatar-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.sem-avatar-picker { max-height: 220px; overflow-y: auto; padding: 6px 4px; }
.sem-avatar-pick {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 5px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
    min-width: 0;
}
.sem-avatar-pick:hover { border-color: var(--sem-primary); transform: scale(1.05); }
.sem-avatar-pick.selected {
    border-color: var(--sem-gold);
    background: rgba(241,196,15,0.1);
    box-shadow: 0 0 10px rgba(241,196,15,0.2);
}
/* Bingkai ringkas khusus picker */
.sem-avatar-picker .sem-avatar-pick-frame {
    padding: 2px;
    box-shadow: none;
}
.sem-avatar-picker .frame-shield,
.sem-avatar-picker .frame-hex,
.sem-avatar-picker .frame-flame,
.sem-avatar-picker .frame-leaf {
    box-shadow: none;
}
.sem-avatar-picker .frame-star { animation: none; box-shadow: none; }
.sem-avatar-picker .frame-orbit::before { display: none; }
.sem-avatar-picker .frame-orbit { box-shadow: none; }
.sem-avatar-picker .frame-leaf { transform: rotate(-3deg); }
.sem-avatar-picker .frame-leaf .sem-avatar-frame-inner { transform: rotate(3deg); }

@media (min-width: 420px) {
    .sem-avatar-grid { grid-template-columns: repeat(6, 1fr); }
}
.sem-lb-item .sem-avatar-frame { flex-shrink: 0; }
.sem-podium-place .sem-avatar-frame { margin: 0 auto 8px; }

/* Upload grid pengaturan */
.sem-upload-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 12px; }
.sem-upload-slot {
    background: linear-gradient(145deg, #2c3a47, #243039);
    border: 2px solid #3d4f5f;
    border-radius: 14px;
    padding: 12px 10px;
    text-align: center;
    position: relative;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.sem-upload-slot.has-pending {
    border-color: var(--sem-gold);
    box-shadow: 0 0 14px rgba(241,196,15,0.2);
}
.sem-upload-slot img { max-width: 100%; max-height: 70px; border-radius: 6px; }
.sem-upload-slot .char-label {
    font-family: 'Bungee', cursive;
    font-size: 1.15rem;
    color: var(--sem-gold);
    margin-bottom: 6px;
    text-shadow: 0 2px 8px rgba(241,196,15,0.3);
}
.sem-upload-slot .upload-empty {
    color: var(--sem-muted);
    font-size: 0.72rem;
}

/* Custom file picker — tema game, bukan default browser */
.sem-file-wrap { margin-top: 8px; }
.sem-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.sem-file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 52px;
    padding: 8px 6px;
    border: 2px dashed rgba(26,188,156,0.45);
    border-radius: 10px;
    background: rgba(26,188,156,0.07);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
    user-select: none;
}
.sem-file-label:hover {
    border-color: var(--sem-primary);
    background: rgba(26,188,156,0.14);
    transform: translateY(-1px);
}
.sem-file-label:active { transform: scale(0.98); }
.sem-file-label.has-file {
    border-style: solid;
    border-color: var(--sem-gold);
    background: rgba(241,196,15,0.1);
}
.sem-file-label.has-file .sem-file-action { color: var(--sem-gold); }
.sem-file-icon { font-size: 1.15rem; line-height: 1; }
.sem-file-action {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--sem-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.sem-file-name {
    font-size: 0.62rem;
    color: var(--sem-muted);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-height: 0.9em;
}
.sem-file-label.has-file .sem-file-name { color: var(--sem-success); font-weight: 600; }

/* === FASE 2: Avatar animasi === */
.sem-avatar-live { display: inline-block; font-size: 2rem; line-height: 1; transition: transform 0.2s; }
.sem-avatar-live.anim-float { animation: semFloat 3s ease-in-out infinite; }
.sem-avatar-live.anim-bounce { animation: semAvatarBounce 1.2s ease-in-out infinite; }
.sem-avatar-live.anim-wiggle { animation: semWiggle 0.8s ease-in-out infinite; }
.sem-avatar-live.anim-roar { animation: semRoar 1.5s ease-in-out infinite; }
.sem-avatar-live.anim-glitch { animation: semGlitch 2s steps(2) infinite; }
.sem-avatar-live.anim-pop { animation: semPop 1s ease-in-out infinite; }
.sem-avatar-live.anim-sparkle { animation: semSparkle 2s ease-in-out infinite; filter: drop-shadow(0 0 6px rgba(241,196,15,0.5)); }
.sem-avatar-live.anim-celebrate { animation: semCelebrate 0.8s ease-out; }
.sem-avatar-live.anim-shake { animation: semShake 0.5s ease-in-out; }
.sem-avatar-streak { filter: drop-shadow(0 0 8px #e67e22); animation: semStreakFire 0.6s ease-in-out infinite alternate !important; }
.sem-avatar-eliminated { filter: grayscale(1); opacity: 0.45; }

@keyframes semAvatarBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes semWiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
@keyframes semRoar { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }
@keyframes semGlitch { 0% { transform: translate(0); } 50% { transform: translate(-2px, 1px); } }
@keyframes semPop { 0%,100% { transform: scale(1); } 50% { transform: scale(1.2); } }
@keyframes semSparkle { 0%,100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.1) rotate(5deg); } }
@keyframes semCelebrate { 0% { transform: scale(0.5) rotate(-20deg); } 50% { transform: scale(1.3) rotate(10deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes semShake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
@keyframes semStreakFire { from { filter: drop-shadow(0 0 4px #e67e22); } to { filter: drop-shadow(0 0 12px #f39c12); } }

.sem-avatar-option.anim-float, .sem-avatar-option.anim-bounce { animation: semFloat 2s ease-in-out infinite; }

/* Player header */
.sem-player-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; }
.sem-player-info { display: flex; align-items: center; gap: 12px; }
.sem-player-stats { display: flex; align-items: center; gap: 8px; }
.sem-score-pill { font-family: 'Bungee', cursive; color: var(--sem-gold); background: rgba(241,196,15,0.12); padding: 6px 14px; border-radius: 20px; font-size: 0.95rem; }
.sem-lives { display: flex; gap: 4px; }
.sem-life { font-size: 1.1rem; transition: transform 0.3s, opacity 0.3s; }
.sem-life.dead { opacity: 0.3; transform: scale(0.8); }

/* Power-up bar */
.sem-powerup-bar { display: flex; justify-content: center; gap: 12px; margin: 16px 0; }
.sem-powerup-btn {
    width: 64px; height: 64px; border-radius: 16px;
    border: 2px solid #485460; background: rgba(255,255,255,0.06);
    cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: all 0.2s; font-family: inherit; color: #fff;
}
.sem-powerup-btn:not(.disabled):hover { border-color: var(--sem-gold); transform: scale(1.1); box-shadow: 0 0 20px rgba(241,196,15,0.3); }
.sem-powerup-btn.disabled { opacity: 0.35; cursor: not-allowed; }
.sem-powerup-btn .pu-icon { font-size: 1.5rem; }
.sem-powerup-btn .pu-count { font-size: 0.7rem; font-weight: 700; color: var(--sem-gold); }

/* Team battle */
.sem-team-bars { background: rgba(0,0,0,0.2); border-radius: 12px; padding: 14px; }
.sem-team-bar-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 10px; align-items: center; margin-bottom: 10px; font-size: 0.9rem; }
.sem-team-bar-row .team-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sem-team-bar-track { height: 12px; background: rgba(255,255,255,0.1); border-radius: 6px; overflow: hidden; }
.sem-team-bar-fill { height: 100%; background: linear-gradient(90deg, var(--sem-primary), var(--sem-gold)); border-radius: 6px; transition: width 0.8s ease-out; animation: semBarGrow 0.8s ease-out; }
@keyframes semBarGrow { from { width: 0 !important; } }
.sem-team-bar-row .team-score { font-family: 'Bungee', cursive; color: var(--sem-gold); min-width: 50px; text-align: right; }

.sem-team-battle-host { width: 100%; max-width: 700px; margin: 0 auto 24px; }
.sem-team-battle-row {
    display: grid; grid-template-columns: 36px 1fr 3fr auto auto; gap: 12px; align-items: center;
    padding: 10px 14px; margin-bottom: 8px; background: rgba(255,255,255,0.06); border-radius: 10px;
    animation: semSlideUp 0.5s ease-out backwards;
}
.team-rank { font-family: 'Bungee', cursive; color: var(--sem-gold); }
.team-name-host { font-weight: 600; font-size: 1.1rem; }
.team-score-host { font-family: 'Bungee', cursive; font-size: 1.2rem; color: var(--sem-primary); }
.team-alive { font-size: 0.85rem; color: var(--sem-muted); }
.sem-team-bar-track.host { height: 16px; }

.sem-lb-item.eliminated { opacity: 0.45; }
.sem-lb-item.eliminated .name { text-decoration: line-through; }
.sem-lb-item.rank-up { box-shadow: 0 0 20px rgba(26,188,156,0.4); border: 1px solid var(--sem-primary); }

.sem-mystery-banner {
    background: linear-gradient(90deg, #9b59b6, #e74c3c, #f1c40f);
    background-size: 200% 100%;
    animation: semMysteryShift 2s linear infinite;
    color: #fff; font-family: 'Bungee', cursive;
    text-align: center; padding: 10px; border-radius: 12px;
    margin-bottom: 12px; font-size: 0.95rem;
}
.sem-mystery-banner.host { font-size: 1.2rem; padding: 14px; margin-bottom: 20px; }
@keyframes semMysteryShift { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }

/* === Bingkai semaphore game (tidak flat) === */
.sem-sem-card {
    position: relative;
    border-radius: 14px;
    padding: 3px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}
.sem-sem-card-body {
    background: linear-gradient(160deg, #1a2229 0%, #0f1419 100%);
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 100%;
    height: 100%;
}
.sem-sem-card-body img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.sem-sem-card-fallback {
    font-family: 'Bungee', cursive;
    color: var(--sem-gold);
    font-size: 1.4rem;
}
.sem-sem-card-quiz .sem-sem-card-label,
.sem-host-screen .sem-sem-card-label,
.sem-sem-quiz-img .sem-sem-card-label { display: none !important; }

.sem-sem-card-fallback-quiz {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-family: 'Bungee', cursive;
    font-size: 1.1rem;
    color: var(--sem-gold);
    opacity: 0.85;
}
.kb-fallback-quiz,
.kb-typed-char-quiz {
    display: block;
    width: 100%;
    height: 100%;
    visibility: hidden;
    font-size: 0;
}

.sem-semaphore-placeholder-quiz {
    font-size: 0;
    color: transparent;
    user-select: none;
}

.sem-sem-card-label {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-family: 'Bungee', cursive;
    font-size: 0.55rem;
    color: rgba(255,255,255,0.7);
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    pointer-events: none;
}
.sem-sem-card-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, transparent 40%, transparent 60%, rgba(255,255,255,0.08) 100%);
    pointer-events: none;
    border-radius: inherit;
}
.sem-sem-card-teal { background: linear-gradient(135deg, #1abc9c, #0e6655); }
.sem-sem-card-gold { background: linear-gradient(135deg, #f1c40f, #d68910); }
.sem-sem-card-purple { background: linear-gradient(135deg, #9b59b6, #6c3483); }
.sem-sem-card-blue { background: linear-gradient(135deg, #3498db, #1a5276); }
.sem-sem-card-flame { background: linear-gradient(135deg, #e74c3c, #f39c12); }

.sem-sem-card-xs { width: 44px; height: 52px; }
.sem-sem-card-sm { width: 72px; height: 86px; }
.sem-sem-card-md { width: 110px; height: 130px; }
.sem-sem-card-lg { width: 160px; height: 190px; }

.sem-sem-showcase { display: flex; justify-content: center; margin: 0 auto 16px; }
.sem-sem-card-btn { pointer-events: none; margin: 0 auto; }
.sem-sem-card-kb { width: 100%; height: 100%; }

.sem-kb-key .sem-sem-card { width: 100%; height: 100%; }
.sem-kb-key:hover .sem-sem-card { transform: scale(1.06); box-shadow: 0 8px 24px rgba(26,188,156,0.35); }
.sem-answer-btn.sem-answer-img { padding: 8px; }
.sem-answer-btn.sem-answer-img:hover .sem-sem-card { transform: scale(1.05); }

.sem-kb-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--sem-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 12px 0 6px;
}
.sem-kb-actions { display: flex; gap: 8px; margin-bottom: 8px; }
.sem-kb-grid.sem-kb-letters { grid-template-columns: repeat(7, 1fr); }
.sem-kb-grid.sem-kb-digits { grid-template-columns: repeat(5, 1fr); max-width: 280px; }
.kb-typed-char { font-family: 'Bungee', cursive; color: var(--sem-gold); margin: 0 2px; }

/* Turnamen bracket */
.sem-bracket-wrap { display: flex; gap: 24px; overflow-x: auto; padding-bottom: 12px; }
.sem-bracket-round { min-width: 200px; flex-shrink: 0; }
.sem-bracket-round h3 {
    font-size: 0.85rem;
    color: var(--sem-muted);
    text-transform: uppercase;
    margin-bottom: 12px;
    text-align: center;
}
.sem-bracket-match {
    background: rgba(0,0,0,0.25);
    border: 2px solid #485460;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    text-align: center;
    transition: border-color 0.3s;
}
.sem-bracket-match.siap { border-color: var(--sem-primary); }
.sem-bracket-match.berlangsung { border-color: var(--sem-gold); box-shadow: 0 0 16px rgba(241,196,15,0.25); }
.sem-bracket-match.selesai { border-color: var(--sem-success); opacity: 0.85; }
.sem-bracket-player { font-weight: 600; padding: 6px; }
.sem-bracket-vs { font-size: 0.75rem; color: var(--sem-muted); margin: 4px 0; }
.sem-bracket-winner { margin-top: 8px; color: var(--sem-gold); font-weight: 700; font-size: 0.9rem; }

/* === Host lobby — toolbar atas + 2 kolom === */
.sem-host-lobby-page {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
    box-sizing: border-box;
    background: linear-gradient(180deg, #1a252f 0%, var(--sem-bg) 120px);
}
.sem-host-lobby-header {
    flex-shrink: 0;
    padding: 14px 20px 12px;
    border-bottom: 1px solid rgba(72, 84, 96, 0.55);
    background: rgba(0, 0, 0, 0.22);
}
.sem-host-lobby-headrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.sem-host-lobby-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.sem-host-lobby-brand h1 {
    font-family: 'Bungee', cursive;
    font-size: 1.25rem;
    margin: 0;
    white-space: nowrap;
}
.sem-host-lobby-brand-meta {
    min-width: 0;
    border-left: 1px solid #485460;
    padding-left: 12px;
}
.sem-host-lobby-quiz {
    margin: 0 0 4px;
    color: var(--sem-text);
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}
.sem-host-lobby-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.sem-host-lobby-badges .sem-badge { font-size: 0.68rem; padding: 2px 7px; }
.sem-host-lobby-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.sem-host-lobby-toolbar .sem-btn {
    padding: 8px 14px;
    font-size: 0.82rem;
    white-space: nowrap;
}
.sem-host-lobby-toolbar .sem-btn-gold { padding: 8px 18px; font-size: 0.88rem; }
.sem-host-lobby-toolbar .sem-btn-ghost {
    background: transparent;
    border: 1px solid #485460;
    color: var(--sem-text);
}
.sem-host-lobby-toolbar .sem-btn-ghost:hover:not(:disabled) {
    border-color: var(--sem-primary);
    color: var(--sem-primary);
}
.sem-host-lobby-toolbar .sem-btn-ghost.danger:hover:not(:disabled) {
    border-color: var(--sem-danger);
    color: var(--sem-danger);
}
.sem-host-lobby-toolbar .sem-btn-ghost:disabled,
.sem-host-lobby-toolbar .sem-btn-gold:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.sem-host-lobby-toolbar .sem-btn-ghost[hidden] { display: none; }
.sem-fs-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #485460;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--sem-muted);
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
}
.sem-fs-btn:hover { border-color: var(--sem-primary); color: var(--sem-primary); }
.sem-host-lobby-status {
    margin-top: 10px;
    font-size: 0.82rem;
    color: var(--sem-muted);
    min-height: 1.2em;
}
.sem-host-lobby-status:empty { display: none; }
.sem-host-lobby-body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(240px, 34%) 1fr;
    gap: 14px;
    padding: 14px 18px 18px;
}
.sem-host-lobby-card {
    margin: 0;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.sem-host-lobby-card-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--sem-muted);
    margin: 0 0 12px;
    font-weight: 600;
    flex-shrink: 0;
}
/* Daftar peserta — kolom kiri */
.sem-host-lobby-players ul {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.sem-host-lobby-players li {
    padding: 9px 6px;
    border-bottom: 1px solid rgba(72, 84, 96, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}
.sem-host-lobby-players li.empty-msg {
    color: var(--sem-muted);
    justify-content: center;
    text-align: center;
    border: none;
    padding: 24px 8px;
    font-size: 0.85rem;
    line-height: 1.45;
}

/* Lobby peserta — daftar pemain di ruang tunggu */
.sem-peserta-lobby { padding: 20px 18px 24px; }
.sem-peserta-lobby-section {
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 14px 12px;
    margin-bottom: 12px;
}
.sem-peserta-lobby-subtitle {
    margin: 0 0 12px;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sem-muted);
}
.sem-peserta-lobby-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: min(52vh, 360px);
    overflow-y: auto;
}
.sem-peserta-lobby-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    border-bottom: 1px solid rgba(72, 84, 96, 0.35);
    font-size: 0.92rem;
}
.sem-peserta-lobby-item:last-child { border-bottom: none; }
.sem-peserta-lobby-item.is-me {
    background: rgba(26, 188, 156, 0.12);
    border-radius: 8px;
    border-bottom-color: transparent;
}
.sem-peserta-lobby-name {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    line-height: 1.3;
    min-width: 0;
    word-break: break-word;
}
.sem-peserta-lobby-you {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sem-primary);
    background: rgba(26, 188, 156, 0.2);
    padding: 1px 6px;
    border-radius: 4px;
}
.sem-peserta-lobby-team {
    color: var(--sem-muted);
    font-size: 0.78rem;
}
.sem-peserta-lobby-empty {
    text-align: center;
    color: var(--sem-muted);
    font-size: 0.88rem;
    padding: 20px 8px;
    line-height: 1.45;
}
.sem-peserta-lobby-hint {
    text-align: center;
    margin: 0;
    font-size: 0.78rem;
    color: var(--sem-muted);
}
.sem-peserta-lobby-wait {
    text-align: center;
    font-size: 2.5rem;
    margin-top: 16px;
    animation: semFloat 2s ease-in-out infinite;
}
/* Gabung — kolom kanan */
.sem-host-lobby-join {
    display: flex;
    align-items: center;
    justify-content: center;
}
.sem-host-lobby-join-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    max-width: 360px;
    gap: 12px;
}
.sem-host-lobby-pin-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.sem-host-lobby-pin-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--sem-muted);
}
.sem-host-lobby-pin-code {
    font-family: 'Poppins', system-ui, sans-serif;
    font-weight: 700;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    letter-spacing: 0.28em;
    color: var(--sem-gold);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    padding-left: 0.28em;
}
.sem-host-lobby-count {
    font-size: 0.85rem;
    color: var(--sem-muted);
    margin: 0;
}
.sem-host-lobby-join .sem-qr-box {
    padding: 0;
    margin-top: 4px;
}
.sem-host-lobby-join .sem-qr-img-lobby {
    width: min(240px, 52vw);
    height: min(240px, 52vw);
    max-width: 100%;
    padding: 12px;
    display: block;
    border-radius: 16px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35), 0 0 0 4px rgba(26, 188, 156, 0.25);
}
.sem-host-lobby-qr-hint {
    margin: 0;
    font-size: 0.8rem;
    color: var(--sem-muted);
}

/* Tombol fullscreen layar proyektor */
.sem-layar-fs {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 100;
    opacity: 0.35;
    transition: opacity 0.2s;
}
.sem-host-screen:hover .sem-layar-fs,
.sem-layar-fs:hover,
.sem-layar-fs:focus { opacity: 1; }

@media (max-width: 640px) {
    .sem-host-lobby-page { height: auto; max-height: none; overflow: auto; }
    .sem-host-lobby-body {
        grid-template-columns: minmax(130px, 38%) 1fr;
        gap: 10px;
        padding: 10px 12px 14px;
    }
    .sem-host-lobby-card { padding: 12px; }
    .sem-host-lobby-join .sem-qr-img-lobby {
        width: min(180px, 42vw);
        height: min(180px, 42vw);
        padding: 8px;
    }
    .sem-host-lobby-pin-code { font-size: 1.35rem; letter-spacing: 0.2em; }
    .sem-host-lobby-toolbar .sem-btn { padding: 7px 10px; font-size: 0.75rem; }
}
@media (max-width: 400px) {
    .sem-host-lobby-headrow { flex-direction: column; align-items: stretch; }
    .sem-host-lobby-toolbar { justify-content: flex-start; }
}

/* QR join lobby */
.sem-qr-box { text-align: center; padding: 12px; }
.sem-qr-img {
    display: inline-block;
    border-radius: 14px;
    background: #fff;
    padding: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.35), 0 0 0 3px rgba(26,188,156,0.35);
}
.sem-qr-img-host { padding: 14px; box-shadow: 0 12px 40px rgba(0,0,0,0.45), 0 0 0 4px rgba(241,196,15,0.4); }
.sem-qr-hint { font-size: 0.8rem; color: var(--sem-muted); margin-top: 10px; word-break: break-all; }

/* === Sertifikat & hasil (latar game) === */
.sem-cert-page {
    min-height: 100vh;
    padding: 28px 16px 48px;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    background-size: 400% 400%;
    animation: semWave 14s ease infinite;
    position: relative;
    overflow-x: hidden;
    color: var(--sem-text);
}
.sem-cert-page::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(2px 2px at 10% 20%, rgba(255,255,255,0.35), transparent),
        radial-gradient(2px 2px at 80% 40%, rgba(241,196,15,0.25), transparent),
        radial-gradient(1px 1px at 50% 70%, rgba(26,188,156,0.3), transparent);
    background-size: 200% 200%;
    animation: semStarsDrift 40s linear infinite;
    opacity: 0.6;
}
@keyframes semStarsDrift {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}
.sem-cert-float {
    position: fixed;
    font-size: 1.5rem;
    opacity: 0.15;
    pointer-events: none;
    animation: semFloat 6s ease-in-out infinite;
}
.sem-cert-card {
    position: relative;
    max-width: 820px;
    margin: 0 auto 28px;
    padding: 40px 32px;
    background: linear-gradient(160deg, rgba(44,58,71,0.97), rgba(26,35,44,0.98));
    border-radius: 24px;
    border: 2px solid rgba(26,188,156,0.4);
    box-shadow: 0 0 0 1px rgba(241,196,15,0.15), 0 24px 60px rgba(0,0,0,0.45);
    text-align: center;
    animation: semFadeInUp 0.8s ease-out;
    z-index: 1;
}
.sem-cert-card::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 2px dashed rgba(241,196,15,0.25);
    border-radius: 18px;
    pointer-events: none;
}
.sem-cert-card.hero { border-color: rgba(241,196,15,0.5); box-shadow: 0 0 40px rgba(241,196,15,0.12), 0 24px 60px rgba(0,0,0,0.5); }
.sem-cert-title {
    font-family: 'Bungee', cursive;
    font-size: clamp(1.4rem, 4vw, 2rem);
    color: var(--sem-gold);
    text-shadow: 0 0 24px rgba(241,196,15,0.35);
    margin-bottom: 8px;
    position: relative;
}
.sem-cert-sub { color: var(--sem-muted); font-size: 0.9rem; margin-bottom: 24px; position: relative; }
.sem-cert-avatar-wrap { display: flex; justify-content: center; margin: 20px 0 12px; position: relative; }
.sem-cert-name {
    font-family: 'Bungee', cursive;
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    color: #fff;
    margin: 12px 0;
    position: relative;
}
.sem-cert-score {
    font-family: 'Bungee', cursive;
    font-size: 1.5rem;
    color: var(--sem-primary);
    margin: 8px 0;
    position: relative;
}
.sem-cert-rank-badge {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-top: 8px;
    position: relative;
}
.sem-cert-rank-1 { background: linear-gradient(90deg, #f1c40f, #f39c12); color: #1e272e; }
.sem-cert-rank-2 { background: linear-gradient(90deg, #bdc3c7, #95a5a6); color: #1e272e; }
.sem-cert-rank-3 { background: linear-gradient(90deg, #e67e22, #d35400); color: #fff; }
.sem-cert-rank-n { background: rgba(26,188,156,0.2); color: var(--sem-primary); border: 1px solid var(--sem-primary); }
.sem-cert-podium { display: flex; justify-content: center; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 28px 0; position: relative; }
.sem-cert-podium-slot { text-align: center; animation: semFadeInUp 0.7s ease-out backwards; }
.sem-cert-podium-slot:nth-child(1) { animation-delay: 0.15s; }
.sem-cert-podium-slot:nth-child(2) { animation-delay: 0.05s; }
.sem-cert-podium-slot:nth-child(3) { animation-delay: 0.25s; }
.sem-cert-lb { text-align: left; position: relative; }
.sem-cert-lb .sem-lb-item { background: rgba(0,0,0,0.3); }
.sem-cert-footer { color: var(--sem-muted); font-size: 0.8rem; margin-top: 20px; position: relative; }
.sem-cert-print-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--sem-primary), var(--sem-primary-dark));
    color: #fff;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(26,188,156,0.35);
    transition: transform 0.2s;
}
.sem-cert-print-btn:hover { transform: translateY(-2px); }
@media print {
    .sem-cert-page { background: #fff; padding: 0; animation: none; }
    .sem-cert-page::before, .sem-cert-float, .no-print { display: none !important; }
    .sem-cert-card { box-shadow: none; border: 2px solid #ccc; color: #222; break-inside: avoid; }
    .sem-cert-name { color: #222; }
}

@media (max-width: 768px) {
    .sem-admin-layout { grid-template-columns: 1fr; }
    .sem-sidebar { display: none; }
    .sem-form-row { grid-template-columns: 1fr; }
    .sem-kb-grid.sem-kb-letters { grid-template-columns: repeat(5, 1fr); }
    .sem-kb-grid.sem-kb-digits { grid-template-columns: repeat(5, 1fr); max-width: none; }
    .sem-podium { gap: 8px; }
    .sem-podium-place .bar { width: 90px; }
    .sem-team-battle-row { grid-template-columns: 28px 1fr; gap: 6px; }
    .sem-team-battle-row .sem-team-bar-track.host { grid-column: 1 / -1; }
    .sem-powerup-btn { width: 56px; height: 56px; }
}
