/*
 * LiveQuiz — Jain theme. Baloo 2 covers both Hindi (Devanagari) and English.
 * Colours of the Jain flag (पंच परमेष्ठी): white = अरिहंत, red = सिद्ध, yellow = आचार्य,
 * green = उपाध्याय, dark blue = साधु. The four answer options use red, yellow, green, blue;
 * white is used for the cards. Backgrounds are kesariya (saffron) with gold.
 */
:root {
    --font: 'Baloo 2', 'Noto Sans Devanagari', 'Nirmala UI', 'Mangal', system-ui, sans-serif;
    --ink: #3b1d0e;
    --ink-soft: #7c5a3c;
    --paper: #ffffff;
    --line: #f1dfc6;
    --violet: #9a3412;   /* primary: deep kesariya */
    --violet-2: #ea7a1e; /* focus / accents: saffron */
    --pink: #d97706;     /* gradient partner: gold */
    --orange: #ea580c;
    --gold: #f5b301;
    --jain-red: #d62828;
    --jain-yellow: #f4b400;
    --jain-white: #ffffff;
    --jain-green: #2e8b3e;
    --jain-blue: #1e3a8a;
    --opt-0: var(--jain-red);    /* A ▲ सिद्ध */
    --opt-1: var(--jain-yellow); /* B ◆ आचार्य */
    --opt-2: var(--jain-green);  /* C ● उपाध्याय */
    --opt-3: var(--jain-blue);   /* D ■ साधु */
    --ok: #2e8b3e;
    --bad: #c81e1e;
    --radius: 18px;
    --shadow: 0 10px 30px rgba(59, 29, 14, .22);
}

/* Five-colour Jain flag stripe along the top of every screen */
.jain-bar {
    position: fixed; top: 0; left: 0; right: 0; height: 6px; z-index: 60; pointer-events: none;
    background: linear-gradient(90deg,
        var(--jain-red) 0 20%, var(--jain-yellow) 20% 40%, var(--jain-white) 40% 60%,
        var(--jain-green) 60% 80%, var(--jain-blue) 80% 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: var(--font);
    color: var(--ink);
    background: #f5f3ff;
    -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Animated party background ---------- */
.bg-party {
    background: linear-gradient(135deg, #7c2d12, #c2410c, #ea7a1e, #d97706, #9a3412);
    background-size: 400% 400%;
    animation: bgmove 22s ease infinite;
    color: #fff;
    min-height: 100vh;
}
@keyframes bgmove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
body.bg-ok { background: linear-gradient(160deg, #1f6f2e, #2e8b3e 60%, #4caf50); animation: none; }
body.bg-bad { background: linear-gradient(160deg, #7f1d1d, #c81e1e); animation: none; }
body.bg-wait { background: linear-gradient(160deg, #7c2d12, #b45309); animation: none; }

/* ---------- Common widgets ---------- */
.card {
    background: var(--paper);
    color: var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 0; border-radius: 14px; padding: 12px 20px;
    font-weight: 700; font-size: 1.05rem; cursor: pointer; text-decoration: none;
    transition: transform .08s ease, filter .15s ease, box-shadow .15s ease;
    box-shadow: 0 4px 0 rgba(0, 0, 0, .18);
}
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, .18); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--violet), var(--pink)); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-green { background: var(--ok); color: #fff; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-white { background: #fff; color: var(--violet); }
.btn-ghost { background: transparent; color: inherit; box-shadow: none; border: 2px solid currentColor; }
.btn-danger { background: #fee2e2; color: var(--bad); box-shadow: none; }
.btn-sm { padding: 6px 12px; font-size: .9rem; border-radius: 10px; }
.btn-lg { padding: 16px 30px; font-size: 1.35rem; border-radius: 18px; }
.btn-block { width: 100%; }

label { display: block; font-weight: 700; margin: 12px 0 6px; }
input[type=text], input[type=tel], input[type=password], input[type=number], select, textarea {
    width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px;
    background: #fff; font-size: 1.05rem; outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--violet-2); }
textarea { resize: vertical; min-height: 84px; }

.alert { padding: 12px 14px; border-radius: 12px; margin: 12px 0; font-weight: 600; }
.alert-err { background: #fee2e2; color: #991b1b; }
.alert-ok { background: #dcfce7; color: #166534; }
.muted { color: var(--ink-soft); font-weight: 500; }
.center-card { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.center-card .card { width: 100%; max-width: 440px; }

/* Option colours + shapes (shared by phone and projector) */
.opt-0 { --c: var(--opt-0); --fg: #fff; }
.opt-1 { --c: var(--opt-1); --fg: #3b1d0e; } /* dark text on yellow for readability */
.opt-2 { --c: var(--opt-2); --fg: #fff; }
.opt-3 { --c: var(--opt-3); --fg: #fff; }
.shape { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; background: rgba(255, 255, 255, .22); font-size: 1.1em; flex: none; }

/* ======================= Student phone ======================= */
.play-app { max-width: 560px; margin: 0 auto; min-height: 100vh; padding: 16px; display: flex; flex-direction: column; }
.logo { text-align: center; font-weight: 800; font-size: 2.4rem; margin: 18px 0 4px; text-shadow: 0 3px 0 rgba(0, 0, 0, .15); }
.tagline { text-align: center; margin: 0 0 18px; opacity: .9; }
.join-card { margin-top: 8px; }
.join-card .pin-input { text-align: center; font-size: 1.8rem; letter-spacing: .3em; font-weight: 800; }
.join-card .btn { margin-top: 18px; }

.center-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; }
.big-emoji { font-size: 5rem; line-height: 1; animation: pop .5s ease; }
.stage-title { font-size: 2rem; font-weight: 800; margin: 0; line-height: 1.2; }
.stage-sub { font-size: 1.15rem; margin: 0; opacity: .92; }
.name-pill { background: rgba(255, 255, 255, .2); padding: 6px 18px; border-radius: 999px; font-weight: 700; font-size: 1.2rem; }
.dots span { display: inline-block; width: 12px; height: 12px; margin: 0 4px; border-radius: 50%; background: #fff; animation: bounce 1.2s infinite ease-in-out; }
.dots span:nth-child(2) { animation-delay: .15s; }
.dots span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(.5); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }

.q-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 1.15rem; margin-bottom: 8px; }
.q-hint { text-align: center; margin: 4px 0 12px; font-weight: 600; opacity: .95; }
.timebar { height: 12px; background: rgba(255, 255, 255, .25); border-radius: 999px; overflow: hidden; margin-bottom: 10px; }
.timebar > div { height: 100%; background: #fff; border-radius: 999px; transition: width .25s linear; }
.answer-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.answer-grid.two { grid-template-rows: 1fr; }
.answer-btn {
    background: var(--c); color: var(--fg, #fff); border: 0; border-radius: var(--radius);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 10px; font-size: 1.3rem; font-weight: 700; line-height: 1.25; text-align: center;
    min-height: 140px; cursor: pointer; box-shadow: 0 6px 0 rgba(0, 0, 0, .22);
    transition: transform .08s, filter .15s; word-break: break-word;
}
.answer-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, .22); }
.answer-btn .shape { font-size: 1.6rem; }
.answer-btn:disabled { filter: grayscale(.6) brightness(.85); }
.answer-btn.chosen { outline: 5px solid #fff; filter: none; }

.result-card { background: rgba(255, 255, 255, .16); border-radius: var(--radius); padding: 16px 22px; min-width: 240px; }
.result-points { font-size: 2.6rem; font-weight: 800; line-height: 1.1; }
.stat-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.stat { background: rgba(255, 255, 255, .18); border-radius: 14px; padding: 8px 16px; min-width: 110px; }
.stat b { display: block; font-size: 1.7rem; line-height: 1.1; }
.chip-answer { display: inline-flex; align-items: center; gap: 8px; background: var(--c); color: var(--fg, #fff); padding: 6px 14px; border-radius: 12px; font-weight: 700; }
.net-badge { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 6px 14px; border-radius: 999px; font-size: .9rem; z-index: 50; }
.play-footer { text-align: center; opacity: .85; font-size: .9rem; margin-top: 12px; }
.link-btn { background: none; border: 0; color: #fff; text-decoration: underline; cursor: pointer; opacity: .85; }

/* ======================= Projector / host ======================= */
.host-app { min-height: 100vh; padding: 24px 32px; display: flex; flex-direction: column; }
.host-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-weight: 800; font-size: 1.4rem; }
.host-top .actions { display: flex; gap: 10px; }
.pill { background: rgba(255, 255, 255, .2); padding: 6px 16px; border-radius: 999px; }

.lobby { flex: 1; display: grid; grid-template-columns: minmax(320px, 1fr) 1.2fr; gap: 28px; margin-top: 20px; }
.join-panel { background: #fff; color: var(--ink); border-radius: 24px; padding: 28px; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.join-panel .url { font-size: 1.3rem; font-weight: 700; color: var(--violet); word-break: break-all; }
.join-panel .pin-label { margin-top: 12px; font-weight: 700; color: var(--ink-soft); }
.join-panel .pin { font-size: 5.5rem; font-weight: 800; letter-spacing: .08em; line-height: 1; background: linear-gradient(135deg, var(--violet), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.qr { margin-top: 16px; padding: 10px; background: #fff; border-radius: 12px; }
.qr img, .qr canvas { display: block; }
.players-panel { display: flex; flex-direction: column; }
.players-count { font-size: 3rem; font-weight: 800; line-height: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; align-content: flex-start; overflow: auto; max-height: 52vh; }
.chip { background: #fff; color: var(--ink); padding: 6px 16px; border-radius: 999px; font-weight: 700; font-size: 1.1rem; border: 0; cursor: pointer; animation: pop .4s ease; box-shadow: 0 3px 0 rgba(0, 0, 0, .12); }
.chip:hover { background: #fee2e2; color: var(--bad); text-decoration: line-through; }
.lobby-start { margin-top: auto; padding-top: 20px; }

.q-stage { flex: 1; display: flex; flex-direction: column; gap: 20px; margin-top: 16px; }
.q-card { background: #fff; color: var(--ink); border-radius: 24px; padding: 28px 36px; text-align: center; font-size: clamp(1.8rem, 3.6vw, 3.2rem); font-weight: 800; line-height: 1.3; box-shadow: var(--shadow); white-space: pre-wrap; }
.q-middle { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.timer-ring { --p: 1; width: 130px; height: 130px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#fff calc(var(--p) * 360deg), rgba(255, 255, 255, .25) 0); flex: none; }
.timer-ring > div { width: 104px; height: 104px; border-radius: 50%; background: var(--violet); display: grid; place-items: center; font-size: 3rem; font-weight: 800; }
.timer-ring.low > div { background: var(--bad); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.answered-box { text-align: center; font-weight: 800; }
.answered-box b { display: block; font-size: 3.4rem; line-height: 1; }
.host-options { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.host-opt { position: relative; overflow: hidden; background: var(--c); color: var(--fg, #fff); border-radius: 20px; padding: 20px 24px; display: flex; align-items: center; gap: 16px; font-size: clamp(1.4rem, 2.6vw, 2.3rem); font-weight: 700; min-height: 110px; box-shadow: 0 6px 0 rgba(0, 0, 0, .2); transition: opacity .3s, transform .3s; }
.host-opt .shape { font-size: 1.3em; }
.host-opt .opt-text { flex: 1; position: relative; z-index: 1; }
.host-opt .count { font-size: 1.1em; font-weight: 800; position: relative; z-index: 1; }
.host-opt .bar { position: absolute; left: 0; bottom: 0; top: 0; background: rgba(255, 255, 255, .18); width: 0; transition: width 1s ease; }
.host-opt.dim { opacity: .55; filter: grayscale(.85) brightness(.85); }
.host-opt.correct { transform: scale(1.02); outline: 6px solid #fff; }
.host-opt .tick { font-size: 1.3em; position: relative; z-index: 1; }
.host-bottom { display: flex; justify-content: flex-end; gap: 12px; margin-top: auto; padding-top: 12px; }

.board { max-width: 900px; width: 100%; margin: 20px auto 0; display: flex; flex-direction: column; gap: 10px; }
.board h2 { text-align: center; font-size: 2.6rem; margin: 0 0 8px; }
.board-row { display: flex; align-items: center; gap: 16px; background: #fff; color: var(--ink); border-radius: 16px; padding: 10px 20px; font-size: 1.5rem; font-weight: 700; animation: slidein .4s ease both; box-shadow: 0 4px 0 rgba(0, 0, 0, .12); }
.board-row .rank { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--line); font-weight: 800; flex: none; }
.board-row:nth-child(2) .rank { background: #fde047; }
.board-row:nth-child(3) .rank { background: #e5e7eb; }
.board-row:nth-child(4) .rank { background: #fdba74; }
.board-row .who { flex: 1; }
.board-row .pts { color: var(--violet); font-weight: 800; }
@keyframes slidein { from { transform: translateX(-40px); opacity: 0; } to { transform: none; opacity: 1; } }

.podium { display: flex; justify-content: center; align-items: flex-end; gap: 18px; margin-top: 30px; }
.podium-col { text-align: center; width: 220px; animation: pop .6s ease both; }
.podium-col .pname { font-size: 1.6rem; font-weight: 800; margin-bottom: 6px; word-break: break-word; }
.podium-col .pscore { font-weight: 700; opacity: .9; margin-bottom: 8px; }
.podium-block { border-radius: 18px 18px 0 0; display: grid; place-items: center; font-size: 4rem; font-weight: 800; color: #fff; box-shadow: var(--shadow); }
.p1 .podium-block { height: 240px; background: linear-gradient(#facc15, #d97706); }
.p2 .podium-block { height: 180px; background: linear-gradient(#cbd5e1, #64748b); }
.p3 .podium-block { height: 140px; background: linear-gradient(#fdba74, #c2410c); }
.p1 { animation-delay: .6s; } .p2 { animation-delay: .3s; } .p3 { animation-delay: 0s; }
.rest-list { max-width: 700px; margin: 24px auto 0; width: 100%; display: flex; flex-direction: column; gap: 8px; }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; width: 100%; height: 100%; }

/* ======================= Admin ======================= */
.page-admin { background: linear-gradient(180deg, #f5f3ff, #fdf2f8); min-height: 100vh; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 22px; background: linear-gradient(135deg, var(--violet), var(--pink)); color: #fff; }
.topbar .brand { font-size: 1.5rem; font-weight: 800; }
.topbar .brand .muted { color: rgba(255, 255, 255, .85); }
.brand { font-weight: 800; }
.admin-app { max-width: 1200px; margin: 0 auto; padding: 22px 16px 60px; display: grid; grid-template-columns: 300px 1fr; gap: 22px; }
.admin-app.single { display: block; }
.side h2, .main h2 { margin: 0 0 12px; }
.quiz-item { display: block; width: 100%; text-align: left; background: #fff; border: 2px solid transparent; border-radius: 14px; padding: 10px 14px; margin-bottom: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(31, 18, 53, .06); }
.quiz-item:hover { border-color: var(--violet-2); }
.quiz-item.active { border-color: var(--violet); background: #f5f3ff; }
.quiz-item small { color: var(--ink-soft); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 160px; }
.section { margin-top: 22px; }
.q-item { background: #fff; border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; box-shadow: 0 2px 10px rgba(31, 18, 53, .07); border-left: 6px solid var(--violet-2); }
.q-item .q-text { font-weight: 700; font-size: 1.1rem; white-space: pre-wrap; }
.q-item .opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0; }
.q-item .opt { padding: 6px 10px; border-radius: 10px; background: #f3f4f6; display: flex; gap: 8px; align-items: center; }
.q-item .opt.right { background: #dcfce7; font-weight: 700; }
.q-item .opt .dot { width: 14px; height: 14px; border-radius: 4px; background: var(--c); flex: none; }
.q-item .tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.q-form { background: #fff; border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.opt-edit { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.opt-edit .swatch { width: 44px; height: 44px; border-radius: 12px; background: var(--c); color: var(--fg, #fff); display: grid; place-items: center; font-weight: 800; flex: none; }
.opt-edit input[type=text] { flex: 1; }
.opt-edit .correct-pick { display: flex; align-items: center; gap: 4px; font-weight: 700; margin: 0; white-space: nowrap; cursor: pointer; }
.opt-edit .correct-pick input { width: 22px; height: 22px; accent-color: var(--ok); }
.tip { background: #fef3c7; color: #92400e; border-radius: 12px; padding: 10px 14px; margin-top: 12px; font-size: .95rem; }
.games-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden; }
.games-table th, .games-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.status { padding: 2px 10px; border-radius: 999px; font-weight: 700; font-size: .85rem; background: #ede9fe; color: var(--violet); }
.status.ended { background: #e5e7eb; color: #374151; }
.empty { text-align: center; padding: 30px; color: var(--ink-soft); background: #fff; border-radius: 16px; }

/* ======================= Phone-perfect layout ======================= */
/* Real visible height on phones (the address bar no longer hides the buttons). */
.page-play, .page-play .play-app { min-height: 100vh; min-height: 100dvh; }
.page-play {
    overscroll-behavior-y: contain;      /* no accidental pull-to-refresh on Android */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
.page-play .play-app {
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
             max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}
button, .btn, .answer-btn, .chip { touch-action: manipulation; user-select: none; -webkit-user-select: none; }
input, select, textarea { font-size: max(16px, 1rem); } /* stops iPhone zooming into inputs */

.answer-grid { grid-auto-rows: 1fr; min-height: 0; }
.answer-btn {
    min-height: clamp(96px, 22vh, 220px);
    font-size: clamp(1.05rem, 4.6vw, 1.5rem);
    overflow-wrap: anywhere;
}
.answer-btn > span:last-child { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.q-head { gap: 10px; }
.q-head .name-pill, .center-stage .name-pill { max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center-stage { padding: 8px 0; }
.stage-title { font-size: clamp(1.5rem, 7vw, 2.2rem); }
.big-emoji { font-size: clamp(3.5rem, 18vw, 5.5rem); }
.result-card { max-width: 100%; }
.chip-answer { max-width: 100%; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Small phones (iPhone SE, 320–360 px) */
@media (max-width: 360px) {
    .logo { font-size: 1.9rem; margin-top: 8px; }
    .card { padding: 16px; }
    .join-card .pin-input { font-size: 1.5rem; letter-spacing: .2em; }
    .answer-grid { gap: 8px; }
    .answer-btn { padding: 10px 6px; border-radius: 14px; }
    .answer-btn .shape { font-size: 1.3rem; }
    .stat { min-width: 0; flex: 1; padding: 8px 10px; }
    .stat b { font-size: 1.4rem; }
    .btn-lg { font-size: 1.15rem; padding: 14px 18px; }
}

/* Phones held sideways: everything must fit without scrolling */
@media (orientation: landscape) and (max-height: 520px) {
    .logo { font-size: 1.6rem; margin: 4px 0 0; }
    .tagline { margin-bottom: 8px; }
    .q-head { margin-bottom: 4px; font-size: 1rem; }
    .q-hint { margin: 2px 0 6px; font-size: .9rem; }
    .timebar { height: 8px; margin-bottom: 6px; }
    .answer-grid { gap: 8px; }
    .answer-btn { min-height: 0; padding: 6px; flex-direction: row; font-size: clamp(1rem, 2.6vw, 1.3rem); }
    .answer-btn .shape { font-size: 1.2rem; }
    .big-emoji { font-size: 3rem; }
    .stage-title { font-size: 1.5rem; }
    .center-stage { gap: 6px; }
    .result-points { font-size: 1.8rem; }
    .play-app { max-width: 900px; }
}

/* ---------- Tablets / teacher on a phone ---------- */
@media (max-width: 900px) {
    .admin-app { grid-template-columns: 1fr; }
    .lobby { grid-template-columns: 1fr; }
    .host-app { padding: 16px; }
    .join-panel .pin { font-size: 4rem; }
}
@media (max-width: 700px) {
    .host-top { flex-wrap: wrap; font-size: 1.1rem; }
    .host-options { grid-template-columns: 1fr; gap: 10px; }
    .host-opt { min-height: 70px; padding: 12px 16px; }
    .q-card { padding: 18px; }
    .timer-ring { width: 90px; height: 90px; }
    .timer-ring > div { width: 72px; height: 72px; font-size: 2rem; }
    .answered-box b { font-size: 2.2rem; }
    .podium { gap: 8px; }
    .podium-col { width: 32%; }
    .podium-col .pname { font-size: 1.1rem; }
    .p1 .podium-block { height: 160px; } .p2 .podium-block { height: 120px; } .p3 .podium-block { height: 90px; }
    .podium-block { font-size: 2.5rem; }
    .board-row { font-size: 1.1rem; padding: 8px 12px; }
    .host-bottom { flex-wrap: wrap; }
    .topbar .brand { font-size: 1.2rem; }
}
@media (max-width: 420px) {
    .q-item .opts { grid-template-columns: 1fr; }
    .opt-edit { flex-wrap: wrap; }
    .join-panel .pin { font-size: 3rem; }
}

/* ======================= Jain event branding ======================= */
.shape { background: rgba(255, 255, 255, .25); }
.opt-1 .shape { background: rgba(59, 29, 14, .12); }
.host-opt.opt-1 .bar { background: rgba(59, 29, 14, .12); }
.btn-primary { background: linear-gradient(135deg, #9a3412, #ea7a1e); }
.btn-white { color: #9a3412; }
.jain-greet { font-weight: 800; letter-spacing: .02em; }

/* Round framed photo of Pujya Mataji (gold ring like a garland) */
.guru-photo {
    border-radius: 50%; object-fit: cover; background: #fff7ed;
    border: 5px solid #fff; box-shadow: 0 0 0 4px var(--gold), 0 10px 28px rgba(0, 0, 0, .3);
}
.guru-sm { width: 76px; height: 76px; border-width: 3px; box-shadow: 0 0 0 3px var(--gold), 0 6px 16px rgba(0, 0, 0, .25); }
.guru-md { width: 128px; height: 128px; }
.guru-caption { font-weight: 700; text-align: center; margin-top: 10px; line-height: 1.25; }

.event-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; margin: 14px 0 12px; }
.event-title { font-size: clamp(1.7rem, 7vw, 2.4rem); font-weight: 800; line-height: 1.15; margin: 0; text-shadow: 0 2px 0 rgba(0, 0, 0, .18); }
.event-sub { margin: 0; font-weight: 600; opacity: .95; font-size: 1.05rem; }

/* Projector: photo slideshow panel in the lobby */
.lobby.with-photo { grid-template-columns: minmax(240px, .8fr) minmax(300px, 1fr) 1.1fr; }
.photo-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.photo-frame { position: relative; width: min(100%, 360px); aspect-ratio: 3 / 4; border-radius: 26px; overflow: hidden; background: #fff7ed;
    border: 6px solid #fff; box-shadow: 0 0 0 5px var(--gold), var(--shadow); }
.photo-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s ease; }
.photo-frame img.show { opacity: 1; }
.photo-panel .guru-caption { font-size: 1.35rem; }
.lobby-head { text-align: center; margin-top: 14px; }
.lobby-head .event-title { font-size: clamp(2rem, 3.4vw, 3rem); }
.host-top .guru-sm { width: 44px; height: 44px; margin-right: 10px; vertical-align: middle; }
.host-top .title-wrap { display: flex; align-items: center; }
.final-photo { display: flex; flex-direction: column; align-items: center; margin-top: 6px; }

/* Admin: event & photo settings */
.brand-card { margin-top: 22px; }
.brand-card h2 { font-size: 1.25rem; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.photo-item { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 1; background: #fff7ed; border: 2px solid var(--line); }
.photo-item.main { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-item .tools { position: absolute; left: 4px; right: 4px; bottom: 4px; display: flex; gap: 4px; justify-content: space-between; }
.photo-item .tools button { border: 0; border-radius: 8px; padding: 2px 6px; font-size: .8rem; font-weight: 700; cursor: pointer; background: rgba(255, 255, 255, .92); }
.upload-btn { position: relative; overflow: hidden; }
.upload-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.page-admin { background: linear-gradient(180deg, #fff8ee, #fdf1e3); }
.topbar { background: linear-gradient(135deg, #7c2d12, #c2410c 55%, #ea7a1e); padding-top: 20px; }
.quiz-item.active { background: #fff7ed; }

@media (max-width: 1100px) {
    .lobby.with-photo { grid-template-columns: 1fr 1fr; }
    .lobby.with-photo .photo-panel { grid-column: 1 / -1; flex-direction: row; gap: 20px; }
    .lobby.with-photo .photo-frame { width: 200px; }
}
@media (max-width: 900px) {
    .lobby.with-photo { grid-template-columns: 1fr; }
}
@media (orientation: landscape) and (max-height: 520px) {
    .event-head { flex-direction: row; margin: 6px 0; gap: 12px; }
    .event-head .guru-md { width: 64px; height: 64px; }
}
