/* ── Live Poll — Shared ─────────────────────────────────────────────────── */

.uic-lp-spinner {
    width: 40px; height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #1e3a5f;
    border-radius: 50%;
    animation: uic-spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}
@keyframes uic-spin { to { transform: rotate(360deg); } }

/* ── Admin card ─────────────────────────────────────────────────────────── */
.uic-lp-admin-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.125rem 1.25rem;
}
.uic-lp-resp-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .25rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: .875rem;
}
.uic-lp-resp-row:last-child { border-bottom: none; }
.uic-lp-resp-rank { width: 22px; color: #9ca3af; font-size: .8rem; flex-shrink: 0; }
.uic-lp-resp-name { flex: 1; font-weight: 600; color: #111827; }
.uic-lp-resp-score { color: #1e3a5f; font-weight: 700; font-size: .8rem; }
.uic-lp-resp-reset {
    background: none; border: 1px solid #e5e7eb; border-radius: 4px;
    cursor: pointer; color: #9ca3af; font-size: .9rem; padding: 1px 5px;
    line-height: 1;
}
.uic-lp-resp-reset:hover { color: #cd202c; border-color: #cd202c; }

/* ── Delegate page ──────────────────────────────────────────────────────── */

.uic-lp-delegate {
    max-width: 480px;
    margin: 0 auto;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.uic-lp-dl-header {
    background: #fff;
    border-bottom: 4px solid #1e3a5f;
    padding: .75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.uic-lp-dl-logo {
    height: 36px;
    object-fit: contain;
}

#uic-lp-dl-content {
    padding: 1.5rem 1rem;
    min-height: 300px;
}

/* Waiting / connecting */
.uic-lp-waiting {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}
.uic-lp-waiting p { margin: 0; font-size: 1rem; }

/* Name picker */
.uic-lp-dl-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e3a5f;
    margin: 0 0 .25rem;
}
.uic-lp-dl-sub {
    font-size: .875rem;
    color: #6b7280;
    margin: 0 0 1.25rem;
}
.uic-lp-name-grid {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-bottom: 1.25rem;
}
.uic-lp-name-btn {
    display: block;
    width: 100%;
    padding: .875rem 1rem;
    text-align: left;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    touch-action: manipulation;
}
.uic-lp-name-btn:hover, .uic-lp-name-btn:active {
    background: #eff6ff;
    border-color: #1e3a5f;
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
}
.uic-lp-name-btn.uic-lp-taken { opacity: .4; cursor: not-allowed; }
.uic-lp-name-btn.uic-lp-taken::after { content: ' — joined'; font-size: .8rem; font-weight: 400; color: #9ca3af; }
.uic-lp-name-btn.uic-lp-name-selected,
.uic-lp-name-btn.uic-lp-name-selected:hover,
.uic-lp-name-btn.uic-lp-name-selected:active {
    background: #1e3a5f;
    border-color: #1e3a5f;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}
.uic-lp-name-btn.uic-lp-name-dimmed { opacity: .3; }

/* Confirm bar */
.uic-lp-confirm-bar {
    background: #f0fdf4;
    border: 2px solid #22c55e;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.uic-lp-confirm-msg {
    font-size: .95rem;
    color: #15803d;
    margin-bottom: .75rem;
    text-align: center;
}
.uic-lp-confirm-actions {
    display: flex;
    gap: .625rem;
}
.uic-lp-confirm-yes {
    flex: 1;
    padding: .75rem;
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
}
.uic-lp-confirm-cancel {
    padding: .75rem 1rem;
    background: #fff;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: .9rem;
    cursor: pointer;
    touch-action: manipulation;
}

.uic-lp-walkin-row {
    display: flex;
    gap: .5rem;
    margin-top: .75rem;
}
.uic-lp-walkin-input {
    flex: 1;
    padding: .7rem .875rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: .95rem;
}
.uic-lp-walkin-btn {
    padding: .7rem 1rem;
    background: #1e3a5f;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
}

/* In-session lobby waiting */
.uic-lp-joined-screen {
    text-align: center;
    padding: 2rem 1rem;
}
.uic-lp-joined-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e3a5f;
    margin: 0 0 .35rem;
}
.uic-lp-score-pill {
    display: inline-block;
    background: #1e3a5f;
    color: #fff;
    border-radius: 20px;
    padding: .3rem .9rem;
    font-size: .85rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}
.uic-lp-rank-pill {
    display: inline-block;
    background: #cd202c;
    color: #fff;
    border-radius: 20px;
    padding: .3rem .9rem;
    font-size: .85rem;
    font-weight: 700;
    margin-left: .4rem;
    margin-bottom: 1.5rem;
}
.uic-lp-waiting-msg {
    color: #6b7280;
    font-size: .95rem;
    margin-bottom: 1.75rem;
}
.uic-lp-notme-btn {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: .8rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

/* Question screen */
.uic-lp-q-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .75rem;
}
.uic-lp-q-num {
    font-size: .8rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.uic-lp-q-timer {
    font-size: .8rem;
    font-weight: 700;
    color: #cd202c;
}
.uic-lp-q-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.45;
    margin: 0 0 1.25rem;
}
.uic-lp-options {
    display: flex;
    flex-direction: column;
    gap: .625rem;
}
.uic-lp-opt-btn {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .9rem 1rem;
    border: none;
    border-radius: 10px;
    font-size: .975rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    text-align: left;
    width: 100%;
    touch-action: manipulation;
    transition: opacity .15s, transform .1s;
}
.uic-lp-opt-btn:active { transform: scale(.97); }
.uic-lp-opt-btn:disabled { cursor: default; }
.uic-lp-opt-btn .uic-lp-opt-lbl {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.2);
    border-radius: 50%;
    font-size: .9rem;
    flex-shrink: 0;
}
.uic-lp-opt-0 { background: #e74c3c; }
.uic-lp-opt-1 { background: #2980b9; }
.uic-lp-opt-2 { background: #e67e22; }
.uic-lp-opt-3 { background: #27ae60; }
.uic-lp-opt-btn.uic-lp-selected { filter: brightness(.85); }
.uic-lp-speed-tip {
    text-align: center;
    font-size: .78rem;
    color: #9ca3af;
    margin-top: 1rem;
}

/* Answered / results */
.uic-lp-answered-screen {
    text-align: center;
    padding: 2.5rem 1rem;
}
.uic-lp-tick {
    font-size: 4rem;
    margin-bottom: .5rem;
}
.uic-lp-answered-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 .5rem;
}
.uic-lp-result-screen {
    padding: 1.5rem 0;
}
.uic-lp-result-banner {
    text-align: center;
    padding: 1.25rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
}
.uic-lp-result-banner.correct { background: #d1fae5; }
.uic-lp-result-banner.wrong   { background: #fee2e2; }
.uic-lp-result-icon  { font-size: 2.5rem; }
.uic-lp-result-label { font-size: 1.1rem; font-weight: 700; margin: .25rem 0 0; }
.uic-lp-result-pts   { font-size: .9rem; color: #374151; margin-top: .25rem; }
.uic-lp-result-answer { font-size: .9rem; color: #374151; margin: 0; }

/* Leaderboard (delegate) */
.uic-lp-dl-leaderboard { padding: .5rem 0; }
.uic-lp-lb-title {
    font-size: 1.1rem; font-weight: 700; color: #1e3a5f;
    text-align: center; margin: 0 0 1rem;
}
.uic-lp-lb-row {
    display: flex; align-items: center; gap: .6rem;
    padding: .55rem .5rem;
    border-radius: 8px;
    margin-bottom: .35rem;
    background: #f9fafb;
}
.uic-lp-lb-row.me { background: #eff6ff; border: 2px solid #1e3a5f; }
.uic-lp-lb-pos  { width: 28px; text-align: center; font-size: 1.1rem; flex-shrink: 0; }
.uic-lp-lb-name { flex: 1; font-weight: 600; font-size: .9rem; color: #111827; }
.uic-lp-lb-pts  { font-weight: 700; color: #1e3a5f; font-size: .9rem; }

/* Closed state */
.uic-lp-closed { text-align: center; padding: 3rem 1rem; }

/* ── Display / projector page ───────────────────────────────────────────── */

.uic-lp-display {
    background: #0d1b2a;
    color: #f1f5f9;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    box-sizing: border-box;
}
.uic-lp-ds-panel {
    width: 100%;
    max-width: 900px;
    text-align: center;
}
.uic-lp-ds-logo {
    height: 48px;
    object-fit: contain;
    margin-bottom: 1.5rem;
    background: #fff;
    border-radius: 6px;
    padding: 6px 12px;
}
.uic-lp-ds-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: .5px;
    color: #fff;
    margin-bottom: .5rem;
}
.uic-lp-ds-sub {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: #94a3b8;
    margin-bottom: 2rem;
}
.uic-lp-ds-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center;
    margin-top: 1.5rem;
}
.uic-lp-ds-chip {
    background: #1e3a5f;
    color: #93c5fd;
    padding: .35rem .9rem;
    border-radius: 20px;
    font-size: .85rem;
    font-weight: 600;
}

/* Display: question active */
.uic-lp-ds-question { width: 100%; max-width: 900px; }
.uic-lp-ds-q-label {
    font-size: 1rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: .75rem;
}
.uic-lp-ds-q-text {
    font-size: clamp(1.3rem, 3vw, 2.25rem);
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.35;
    margin-bottom: 2rem;
}
.uic-lp-ds-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.uic-lp-ds-opt {
    display: flex;
    align-items: center;
    gap: .875rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-size: clamp(.95rem, 2vw, 1.35rem);
    font-weight: 600;
    color: #fff;
    text-align: left;
}
.uic-lp-ds-opt-lbl {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,.25);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.uic-lp-ds-opt-0 { background: #c0392b; }
.uic-lp-ds-opt-1 { background: #1f618d; }
.uic-lp-ds-opt-2 { background: #b7770d; }
.uic-lp-ds-opt-3 { background: #1e8449; }
.uic-lp-ds-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: .75rem;
    flex-wrap: wrap;
}
.uic-lp-ds-counter {
    font-size: 1.1rem;
    color: #94a3b8;
}
.uic-lp-ds-counter strong { color: #f1f5f9; font-size: 1.4rem; }
.uic-lp-ds-cd-wrap { text-align: center; flex-shrink: 0; }

/* Display: results / bar chart */
.uic-lp-ds-results { width: 100%; max-width: 900px; }
.uic-lp-ds-results-title {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: .5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.uic-lp-ds-results-q {
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: #f1f5f9;
    font-weight: 600;
    margin-bottom: 1.75rem;
    line-height: 1.35;
}
.uic-lp-ds-bar-row {
    display: flex;
    align-items: center;
    gap: .875rem;
    margin-bottom: .875rem;
}
.uic-lp-ds-bar-lbl {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: .9rem;
    color: #fff;
    flex-shrink: 0;
}
.uic-lp-ds-bar-text {
    width: 220px;
    font-size: clamp(.85rem, 1.8vw, 1.1rem);
    color: #e2e8f0;
    flex-shrink: 0;
    text-align: left;
}
.uic-lp-ds-bar-track {
    flex: 1;
    background: #1e3a5f;
    border-radius: 6px;
    height: 28px;
    overflow: hidden;
    position: relative;
}
.uic-lp-ds-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width .6s ease;
    display: flex;
    align-items: center;
    padding: 0 .5rem;
    box-sizing: border-box;
}
.uic-lp-ds-bar-count {
    width: 45px;
    text-align: right;
    font-weight: 700;
    color: #f1f5f9;
    font-size: 1rem;
    flex-shrink: 0;
}
.uic-lp-ds-bar-row.correct .uic-lp-ds-bar-text::after {
    content: ' ✓';
    color: #4ade80;
    font-weight: 700;
}

/* Display: leaderboard */
.uic-lp-ds-leaderboard { width: 100%; max-width: 700px; margin: 0 auto; }
.uic-lp-ds-lb-title {
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-weight: 800;
    color: #fbbf24;
    margin-bottom: 1.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.uic-lp-ds-lb-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .9rem 1.25rem;
    border-radius: 12px;
    margin-bottom: .75rem;
    background: #1e2d3d;
}
.uic-lp-ds-lb-row:nth-child(1) { background: linear-gradient(90deg,#78350f,#92400e); }
.uic-lp-ds-lb-row:nth-child(2) { background: linear-gradient(90deg,#1e3a5f,#1e4a7f); }
.uic-lp-ds-lb-row:nth-child(3) { background: linear-gradient(90deg,#1a3d1f,#1e4d24); }
.uic-lp-ds-lb-pos  { font-size: clamp(1.4rem, 3vw, 2.2rem); width: 50px; text-align: center; flex-shrink: 0; }
.uic-lp-ds-lb-name { flex: 1; font-size: clamp(1rem, 2.5vw, 1.6rem); font-weight: 700; color: #f1f5f9; }
.uic-lp-ds-lb-pts  { font-size: clamp(1rem, 2.5vw, 1.6rem); font-weight: 800; color: #fbbf24; }

/* ── WordPress body override for display page (full screen) ─────────────── */
body:has(.uic-lp-display) {
    background: #0d1b2a;
    margin: 0;
    padding: 0;
}
body:has(.uic-lp-display) .site-header,
body:has(.uic-lp-display) .site-footer,
body:has(.uic-lp-display) #wpadminbar {
    display: none !important;
}
body:has(.uic-lp-display) #page,
body:has(.uic-lp-display) #content,
body:has(.uic-lp-display) .entry-content {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
}
