:root {
    --ink: #071326;
    --muted: #526174;
    --line: #d7e1ee;
    --panel: rgba(255, 255, 255, .94);
    --blue: #0b51c5;
    --blue-dark: #001844;
    --gold: #d9b327;
    --green: #2fa65a;
    --green-soft: #eefaf2;
    --red: #ef4444;
    --red-soft: #fff0f0;
    --shadow: 0 22px 60px rgba(15, 37, 74, .14);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: linear-gradient(145deg, #f8fbff 0%, #eef4fb 52%, #ffffff 100%);
    font-family: "Source Sans Pro", "Open Sans", "Segoe UI", Arial, sans-serif;
}

[dir="rtl"] {
    font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
}

button {
    font: inherit;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.projector-shell {
    min-height: 100vh;
    display: grid;
    grid-template-rows: 88px minmax(0, 1fr) 84px;
}

.projector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 14px 48px;
    background: rgba(255, 255, 255, .82);
    border-bottom: 1px solid var(--line);
}

.brand-logo {
    width: 250px;
    max-width: 34vw;
}

.event-title {
    display: grid;
    gap: 4px;
    text-align: right;
    font-size: 16px;
}

.event-title span {
    font-family: "Cairo", sans-serif;
    font-weight: 700;
}

.stage-grid {
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    padding: 28px 48px 24px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 34px;
    align-items: stretch;
}

.qr-panel,
.question-card,
.results-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.qr-panel {
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 24px;
    text-align: center;
}

.panel-title {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
}

.panel-title.ar {
    font-family: "Cairo", sans-serif;
    margin-bottom: 16px;
}

.qr-code {
    width: 210px;
    height: 210px;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(90deg, #111 10px, transparent 10px 26px, #111 26px 38px, transparent 38px 52px, #111 52px 64px, transparent 64px 78px, #111 78px 90px, transparent 90px 108px, #111 108px 122px, transparent 122px 138px, #111 138px 150px, transparent 150px 168px, #111 168px 180px, transparent 180px),
        linear-gradient(#111 10px, transparent 10px 24px, #111 24px 36px, transparent 36px 54px, #111 54px 66px, transparent 66px 80px, #111 80px 94px, transparent 94px 112px, #111 112px 124px, transparent 124px 140px, #111 140px 152px, transparent 152px 172px, #111 172px 184px, transparent 184px),
        #fff;
    background-blend-mode: multiply;
    border: 10px solid #fff;
    box-shadow: 0 8px 20px rgba(18, 43, 84, .14);
}

.qr-code::before,
.qr-code::after,
.qr-fallback::before {
    content: "";
    position: absolute;
    width: 48px;
    height: 48px;
    background: #fff;
    border: 14px solid #111;
    box-shadow: inset 0 0 0 8px #fff, inset 0 0 0 16px #111;
}

.qr-code::before {
    left: 8px;
    top: 8px;
}

.qr-code::after {
    right: 8px;
    top: 8px;
}

.qr-fallback::before {
    left: 8px;
    bottom: 8px;
}

.qr-code img {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.link-label {
    margin-top: 18px;
    color: var(--muted);
}

.qr-panel strong {
    color: var(--blue);
    overflow-wrap: anywhere;
}

.session-box {
    width: 100%;
    margin-top: 22px;
    padding-top: 18px;
    display: grid;
    gap: 4px;
    border-top: 1px solid var(--line);
}

.session-box span {
    color: var(--muted);
}

.question-card,
.results-card {
    min-height: 0;
    padding: 34px 46px;
}

.question-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 28px;
    align-items: center;
    margin-bottom: 15px;
}

#questionCounter,
#resultQuestionCounter {
    color: var(--blue);
    font-weight: 800;
}

.progress-dots {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
}

.progress-dots span {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    color: #64748b;
    background: #dbe2ea;
    border-radius: 50%;
    font-weight: 800;
}

.progress-dots span.active {
    color: #fff;
    background: linear-gradient(180deg, #1567d7, #063d9e);
}

.question-copy {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
}

.question-copy h1,
.results-card h2 {
    margin: 0 0 10px;
    font-family: "Cairo", sans-serif;
    font-size: clamp(23px, 1.75vw, 30px);
    line-height: 1.24;
    color: var(--ink);
    visibility: visible;
}

.question-copy h1 p,
.results-card h2 p {
    margin: 0 0 10px;
}

.question-copy h1 ul,
.results-card h2 ul {
    width: min(100%, 880px);
    margin: 12px auto 0;
    padding: 0 44px 0 0;
    text-align: right;
    transform: translateX(28px);
}

.question-copy h1 li,
.results-card h2 li {
    margin: 2px 0;
    font-size: clamp(16px, 1.12vw, 20px);
    line-height: 1.36;
}

.question-points {
    max-width: 880px;
    margin: 16px auto 0;
    padding: 0 28px 0 0;
    text-align: right;
    font-size: clamp(16px, 1.25vw, 23px);
    line-height: 1.75;
}

.question-copy p,
.results-card>p {
    margin: 0;
    font-size: clamp(21px, 2vw, 28px);
    color: var(--ink);
    visibility: visible;
}

li {
    font-size: 17px;
    text-align: right;
}

.answer-preview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    width: min(100%, 900px);
    margin: 0 auto;
}

.answer-box {
    min-height: 88px;
    display: grid;
    grid-template-columns: 48px auto auto;
    gap: 18px;
    align-items: center;
    justify-content: center;
    border: 2px solid;
    border-radius: 8px;
    font-size: 19px;
    font-weight: 800;
}

.answer-box strong,
.result-row strong,
.timer-panel span[dir="rtl"],
.panel-title.ar {
    font-family: "Cairo", sans-serif;
}

.answer-box.yes {
    color: var(--green);
    background: var(--green-soft);
}

.answer-box.no {
    color: var(--red);
    background: var(--red-soft);
}

.answer-icon,
.result-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #fff;
    border-radius: 50%;
    font-size: 30px;
    line-height: 1;
}

.yes .answer-icon,
.yes .result-icon {
    background: var(--green);
}

.no .answer-icon,
.no .result-icon {
    background: var(--red);
}

.result-heading {
    display: grid;
    gap: 4px;
    justify-items: center;
    margin-bottom: 6px;
}

.result-heading h1 {
    margin: 0;
    font-size: 29px;
}

.result-heading span {
    font-size: 22px;
}

.results-card {
    text-align: center;
}

.result-status {
    min-height: 22px;
    margin: 4px 0 8px;
    color: var(--muted);
    font-size: 15px;
    font-weight: 700;
}

.result-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: center;
}

.pie-wrap {
    display: grid;
    justify-items: center;
    gap: 16px;
}

.pie-chart {
    width: min(27vw, 255px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--green) 0 72%, var(--red) 72% 100%);
    border-radius: 50%;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .75), 0 18px 34px rgba(21, 78, 45, .18);
}

.pie-chart span {
    color: #fff;
    font-size: 44px;
    font-weight: 900;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}

.result-list {
    display: grid;
    gap: 14px;
}

.result-row {
    min-height: 78px;
    display: grid;
    grid-template-columns: 42px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    text-align: left;
    background: linear-gradient(180deg, #ffffff, #f9fbfe);
    box-shadow: 0 10px 24px rgba(15, 37, 74, .08);
}

.result-row b {
    font-size: 28px;
}

.result-row small {
    grid-column: 3;
    margin-top: -18px;
    color: var(--muted);
    font-weight: 700;
}

.control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 12px 48px;
    color: #fff;
    background: linear-gradient(90deg, #001238, #041d4f 50%, #001238);
}

.timer-panel {
    min-width: 390px;
    min-height: 58px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 20px;
    padding: 10px 22px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .07);
}

.timer-panel span {
    font-size: 15px;
    font-weight: 700;
}

.timer-panel strong {
    grid-column: 2;
    grid-row: 1 / span 2;
    color: #ffd84d;
    font-size: 36px;
    letter-spacing: 0;
}

.control-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.control-btn {
    min-height: 48px;
    min-width: 124px;
    padding: 0 20px;
    position: relative;
    overflow: hidden;
    color: #fff;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 6px;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .08);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, filter .18s ease;
}

.control-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 45%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .36), transparent);
    transform: translateX(-140%) skewX(-18deg);
    transition: transform .55s ease;
}

.control-btn:hover {
    transform: translateY(-1px);
    filter: saturate(1.06);
    border-color: var(--gold);
    box-shadow: 0 14px 24px rgba(0, 0, 0, .16);
}

.control-btn:hover::after {
    transform: translateX(260%) skewX(-18deg);
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn.primary {
    background: linear-gradient(180deg, #1767e3, #0642ad);
    border-color: #2e7fff;
}

.control-btn.outline {
    color: #d9e7ff;
}


@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

@media (max-width: 980px) {
    .projector-shell {
        grid-template-rows: auto 1fr auto;
    }

    .projector-header,
    .control-bar {
        padding-inline: 22px;
    }

    .stage-grid {
        grid-template-columns: 1fr;
        padding: 22px;
    }

    .qr-panel {
        min-height: auto;
    }

    .control-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .timer-panel {
        min-width: 0;
    }
}