.lq [hidden] { display: none !important; }
.lq .panel { max-width: 900px; margin-inline: auto; }
.lq label, .lq details, .lq fieldset { margin-block: .7rem; }
.lq label { display: block; }
.lq input:not([type=checkbox]):not([type=radio]), .lq select, .lq button { min-height: 44px; max-width: 100%; }
.lq button { margin: .2rem .35rem .2rem 0; padding-inline: .65rem; }
.lq button:not(:disabled) { cursor: pointer; }
.lq :focus-visible { outline: 3px solid #65129d; outline-offset: 3px; }
.lq summary { cursor: pointer; color: #511087; padding-block: .5rem; }
.lq .lq-choices { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,205px),1fr)); gap: .1rem .75rem; }
.lq #timer { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.lq #error { color: #8a2020; }
.lq #options label { padding: .55rem; border: 1px solid #dbc7eb; border-radius: .5rem; }
.lq-screen .panel { max-width: 1200px; font-size: clamp(1.2rem,3vw,2.3rem); }
.lq-screen #options label { border: 0; }
.lq-screen #options input { display: none; }
.lq-screen #speech { display: none; }
.lq td, .lq th { padding: .45rem; text-align: left; }
.lq .lq-scroll { overflow-x: auto; }

/* Refinement 01: scoped, responsive live quiz styling */
.lq .panel{max-width:1160px;color:#28143e;overflow-wrap:anywhere}
.lq .panel h1{font-size:clamp(1.65rem,3vw,2.3rem);margin-top:0}.lq .panel h2{margin-top:1.5rem}
.lq button,.lq .lq-link{display:inline-flex;align-items:center;justify-content:center;background:#65159c;color:#fff;border:1px solid #65159c;border-radius:10px;padding:10px 16px;font:inherit;font-weight:700;text-decoration:none;min-height:44px;box-sizing:border-box}
.lq button:disabled{background:#e7e0ec;color:#5d5366;border-color:#d4c8df;cursor:not-allowed}.lq button.lq-danger{background:#a51e35;border-color:#a51e35}.lq button.lq-start{background:#166534;border-color:#166534}
.lq input:not([type=checkbox]):not([type=radio]),.lq select{border:1px solid #9d83b5;border-radius:8px;padding:8px 12px;background:#fff;color:#28143e;box-sizing:border-box;font:inherit}.lq input[type=checkbox],.lq input[type=radio]{accent-color:#65159c;width:18px;height:18px;vertical-align:middle}
.lq fieldset,.lq details,.lq-summary,.lq #eligible,.lq #host,.lq #results{border:1px solid #d9c8e9;border-radius:12px;padding:14px;background:#faf6fd;min-width:0}.lq #eligible,.lq-code{font-weight:700;background:#eee2fa;padding:14px;border-radius:12px;color:#42116c}.lq-code strong{font-size:1.4em;letter-spacing:.08em}.lq .lq-choices label{padding:8px;border:1px solid #dfd0eb;border-radius:8px;margin:0}.lq .lq-choices span{font-size:.85em;color:#54346f}
.lq-review-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,290px),1fr));gap:12px;padding-left:0;list-style-position:inside}.lq-review-grid>li,.lq-room-list>li{border:1px solid #d9c8e9;background:#fff;border-radius:12px;padding:14px;min-width:0}.lq-review-grid details{padding:8px}.lq-tools{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.lq-room-list{display:grid;gap:8px;list-style:none;padding:0}.lq-good{color:#166534;font-weight:700}.lq-bad{color:#991b1b;font-weight:700}.lq-admin .panel>form,.lq-admin .lq-scroll{background:#faf6fd;border:1px solid #d9c8e9;border-radius:12px;padding:16px}.lq #timer{background:#eee2fa;color:#42116c;border-radius:10px;padding:10px}.lq #timer:empty,.lq #error:empty,.lq #score:empty{display:none}.lq #board li{padding:10px;border-bottom:1px solid #d9c8e9}.lq #board li:first-child{font-weight:800;color:#166534}.lq-screen .panel{max-width:1200px}.lq a:not(.lq-link):not(.button){color:#511087}.lq :focus-visible{outline:3px solid #511087;outline-offset:3px}
@media(max-width:600px){.lq .panel{padding:16px}.lq button{white-space:normal}.lq-review-grid{grid-template-columns:1fr}.lq .lq-scroll{padding:6px}.lq .lq-choices{grid-template-columns:1fr}}


/* Development 03: player, results and quizmaster refinements. */
.lq .lq-meta, .lq .lq-personal {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
}
.lq .lq-badge {
    display: inline-block;
    padding: .3rem .65rem;
    border-radius: .55rem;
    color: #451372;
    background: #eee2fa;
    font-size: .9rem;
    font-weight: 700;
}
.lq .lq-badge-difficulty { color: #14532d; background: #dcfce7; }
.lq .lq-personal > div {
    flex: 1 1 8rem;
    border: 1px solid #d9c8e9;
    border-radius: .75rem;
    padding: .6rem .85rem;
    background: #faf6fd;
}
.lq .lq-personal strong { display: block; font-size: 1.55rem; }
.lq #clock { margin-block: 1rem; }
.lq #timer { margin-block: 0 .45rem; }
.lq #time-bar {
    --bar-colour: #16703d;
    appearance: none;
    display: block;
    width: 100%;
    height: .7rem;
    overflow: hidden;
    border: 0;
    border-radius: 1rem;
    background: #e7dcef;
}
.lq #time-bar[data-level="medium"] { --bar-colour: #a65100; }
.lq #time-bar[data-level="low"] { --bar-colour: #b42318; }
.lq #time-bar::-webkit-progress-bar { background: #e7dcef; }
.lq #time-bar::-webkit-progress-value { background: var(--bar-colour); }
.lq #time-bar::-moz-progress-bar { background: var(--bar-colour); }
.lq #options label:has(input:enabled) { cursor: pointer; }
.lq #options label:where(:has(input:checked)) { background: #eee2fa; border: 2px solid #65159c; }
.lq #options label.lq-correct { color: #14532d; background: #dcfce7; border: 2px solid #16703d; }
.lq #options label.lq-wrong { color: #821c1c; background: #fee2e2; border: 2px solid #b42318; }
.lq #options small { display: block; margin-inline-start: .4rem; font-weight: 750; }
.lq #options small:empty, .lq #board-progress:empty, .lq #feedback:empty { display: none; }
.lq #feedback { font-weight: 750; }
.lq #explanation { padding: .75rem 1rem; border-radius: .65rem; background: #eef7f0; color: #16442a; }
.lq #explanation h3 { margin: 0; }
.lq #explanation p { margin-bottom: 0; }
.lq .lq-host-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.lq .lq-host-grid > div { border: 1px solid #d9c8e9; border-radius: .75rem; padding: .75rem; background: #fff; }
.lq .lq-host-grid h3 { margin-top: 0; }
.lq #moderation { list-style: none; margin: 0; padding: 0; }
.lq #moderation li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.lq #commands { margin-top: .75rem; }
.lq .lq-board, .lq .lq-podium { list-style: none; padding: 0; display: grid; gap: .4rem; }
.lq .lq-board li, .lq .lq-podium li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .55rem;
    padding: .65rem;
    border: 1px solid #d9c8e9;
    border-radius: .6rem;
    background: #fff;
}
.lq .lq-rank { color: #451372; font-weight: 800; }
.lq #board li:first-child { color: inherit; }
.lq .lq-board li.lq-own, .lq .lq-podium li.lq-own { border: 2px solid #65159c; background: #eee2fa; }
.lq .lq-podium { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lq .lq-podium li { grid-template-columns: 1fr; text-align: center; }
.lq .lq-podium li[value="1"] { border-color: #a27218; background: #fff4d4; }
.lq #export, .lq .lq-link.lq-positive { background: #166534; border-color: #166534; }
.lq .lq-admin-nav { display: flex; flex-wrap: wrap; gap: .5rem; margin-block: .65rem; }
@media (max-width: 600px) {
    .lq .lq-host-grid, .lq .lq-podium { grid-template-columns: 1fr; }
    .lq #submit-answer { width: 100%; margin-inline: 0; }
}
@media (max-width: 360px) {
    .lq .lq-board strong { grid-column: 2; }
}