/* Tap Trivia — online quiz editor */
:root {
	color-scheme: light;
	--bg: #f6f6f4; --card: #fff; --ink: #0c0d10; --mute: #5d616b; --line: #e4e4e0; --soft: #f1f1ee;
	--red: #f2462e; --red-soft: #fde9e5; --ok: #15965a; --ok-soft: #e3f5eb; --warn: #b5541c; --warn-soft: #fff1e6;
	--violet: #5b4bff; --r: 12px; --font: "Inter", "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; min-width: 0; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.15; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.ra-muted { color: var(--mute); }
.ra-loading { padding: 48px; text-align: center; color: var(--mute); }
code, kbd { font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--soft); padding: 1px 5px; border-radius: 5px; }

/* ---------- brand / bars ---------- */
.ra-brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; text-decoration: none; letter-spacing: -.01em; }
.ra-brand i { width: 24px; height: 24px; border-radius: 7px; background: var(--red); display: grid; place-items: center; }
.ra-brand i::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.35); }
.ra-bar { display: flex; align-items: center; gap: 14px; height: 60px; padding: 0 max(3vw, 16px); background: var(--card); border-bottom: 1px solid var(--line); }
.ra-bar-sep { color: var(--mute); padding-left: 14px; border-left: 1px solid var(--line); }
.ra-user { margin-left: auto; }
.ra-avatar { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--soft); display: grid; place-items: center; font-weight: 700; overflow: hidden; padding: 0; }
.ra-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- buttons ---------- */
.ra-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.ra-btn:hover { border-color: #cfcfca; background: #fafaf8; }
.ra-btn svg { width: 16px; height: 16px; fill: currentColor; }
.ra-btn.is-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.ra-btn.is-primary:hover { background: #262830; }
.ra-btn.is-danger { color: #b3261e; }
.ra-btn.is-red { background: var(--red); border-color: var(--red); color: #fff; }
.ra-btn.is-red:hover { background: #d93a24; border-color: #d93a24; }
.ra-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.3); }
.ra-modal .ra-btn.is-danger { background: #c62f1f; border-color: #c62f1f; color: #fff; }
.ra-icon { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--mute); padding: 0; flex: none; }
.ra-icon svg { width: 18px; height: 18px; fill: currentColor; }
.ra-icon:hover:not(:disabled) { background: var(--soft); color: var(--ink); }
.ra-icon:disabled { opacity: .3; cursor: default; }
.ra-icon.is-sm { width: 30px; height: 30px; }
.ra-icon.is-sm svg { width: 15px; height: 15px; }
.ra-icon.is-danger:hover { color: #b3261e; background: var(--red-soft); }
.ra-link { background: none; border: 0; padding: 4px 2px; color: var(--violet); font-weight: 600; font-size: 14px; }
.ra-link:hover { text-decoration: underline; }
.ra-link.is-danger { color: #b3261e; }

/* ---------- menus ---------- */
.ra-menu { position: relative; }
.ra-pop { display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; min-width: 220px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px -16px rgba(12,13,16,.3); }
.ra-pop.is-right, .ra-user .ra-pop, .ra-qrow .ra-pop { left: auto; right: 0; }
.ra-menu.is-open .ra-pop { display: grid; }
.ra-pop > button, .ra-pop > a { text-align: left; border: 0; background: none; padding: 9px 11px; border-radius: 7px; font-size: 14px; text-decoration: none; white-space: nowrap; }
.ra-pop > button:hover, .ra-pop > a:hover { background: var(--soft); }
.ra-pop .is-danger { color: #b3261e; }
.ra-pop-head { margin: 0; padding: 8px 11px 10px; font-weight: 600; border-bottom: 1px solid var(--line); margin-bottom: 4px; }

/* ---------- inputs ---------- */
.ra-input { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); font-size: 15px; transition: border-color .15s, box-shadow .15s; }
textarea.ra-input { resize: vertical; line-height: 1.45; }
.ra-input:focus, .ra-qtext:focus, .ra-opt-input:focus, .ra-title:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(12,13,16,.08); }
.ra-input.ra-big { font-size: 18px; font-weight: 600; }
.ra-code { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.ra-field { display: grid; gap: 6px; margin-bottom: 16px; }
.ra-field label, .ra-flabel, .ra-lbl { font-size: 13px; font-weight: 600; color: #34363d; }
.ra-field small, .ra-hint { font-size: 12.5px; color: var(--mute); font-weight: 400; }
.ra-hint { margin: 6px 0 10px; }
.ra-check { display: flex; align-items: center; gap: 9px; min-height: 40px; font-size: 14px; cursor: pointer; }
.ra-check input, .ra-radio input { width: 18px; height: 18px; accent-color: var(--ink); }
.ra-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ra-row3 { align-items: start; display: grid; grid-template-columns: 110px 1.4fr 1fr; gap: 16px; padding-top: 18px; margin-top: 6px; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .ra-row2, .ra-row3 { grid-template-columns: 1fr; } }

/* ---------- list view ---------- */
.ra-list-wrap { max-width: 980px; margin: 0 auto; padding: 40px max(3vw, 16px) 80px; }
.ra-list-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 22px; }
.ra-list-head h1 { font-size: 30px; }
.ra-list-head p { margin: 4px 0 0; }
.ra-list-actions { display: flex; gap: 10px; align-items: center; }
.ra-list-actions .ra-input { width: 240px; }
.ra-qlist { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.ra-qrow { display: grid; grid-template-columns: minmax(0, 1fr) auto 110px 40px; align-items: center; gap: 14px; padding: 6px 10px 6px 6px; border-bottom: 1px solid var(--line); }
.ra-qrow:last-child { border-bottom: 0; }
.ra-qrow-main { display: grid; gap: 2px; text-align: left; border: 0; background: none; padding: 12px 14px; border-radius: 9px; }
.ra-qrow-main:hover { background: var(--soft); }
.ra-qrow-title { font-weight: 600; font-size: 16px; }
.ra-qrow-meta { font-size: 13px; color: var(--mute); }
.ra-qrow-time { font-size: 13px; color: var(--mute); text-align: right; white-space: nowrap; }
@media (max-width: 640px) { .ra-qrow { grid-template-columns: minmax(0, 1fr) auto 40px; } .ra-qrow-time { display: none; } .ra-list-actions { width: 100%; } .ra-list-actions .ra-input { width: auto; flex: 1; } }
.ra-pill, .ra-pill-btn { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: var(--soft); color: var(--mute); border: 0; white-space: nowrap; }
.ra-pill::before, .ra-pill-btn::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ra-pill.is-publish, .ra-pill-btn.is-publish { background: var(--ok-soft); color: var(--ok); }
.ra-pill.is-private, .ra-pill-btn.is-private { background: #eceaff; color: var(--violet); }
.ra-pill-btn { min-height: 34px; padding: 0 12px; }
.ra-empty { text-align: center; padding: 56px 20px; background: var(--card); border: 1px dashed #d3d3ce; border-radius: 14px; }
.ra-empty h2 { font-size: 22px; margin-bottom: 6px; }
.ra-demo-note { font-size: 13px; color: var(--mute); text-align: center; margin-top: 18px; }

/* ---------- editor layout ---------- */
.ra-editor { min-height: 100vh; display: flex; flex-direction: column; }
.ra-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; height: 60px; padding: 0 12px; background: var(--card); border-bottom: 1px solid var(--line); }
.ra-title { flex: 1 1 120px; max-width: 460px; min-height: 40px; border: 1px solid transparent; border-radius: 8px; padding: 6px 10px; font-size: 17px; font-weight: 700; background: transparent; letter-spacing: -.01em; }
.ra-title:hover { border-color: var(--line); }
.ra-save { font-size: 13px; color: var(--mute); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.ra-save::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.ra-save.is-ok { color: var(--ok); }
.ra-save.is-busy { color: var(--mute); }
.ra-save.is-busy::before { animation: ra-blink 1s infinite; }
.ra-save.is-warn { color: var(--warn); }
@keyframes ra-blink { 50% { opacity: .25; } }
.ra-top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.ra-outline-toggle { display: none; }
.ra-banner { margin: 0; padding: 10px 18px; background: var(--warn-soft); color: #7a3a10; font-size: 14px; border-bottom: 1px solid #f3d6bf; }
.ra-cols { flex: 1; display: grid; grid-template-columns: 280px minmax(0, 1fr) 280px; align-items: start; }

/* outline */
.ra-outline { position: sticky; top: 60px; height: calc(100vh - 60px); overflow: auto; padding: 14px 10px 40px; border-right: 1px solid var(--line); background: var(--card); }
.ra-outline-head { display: flex; justify-content: space-between; align-items: center; padding: 0 8px 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); }
.ra-outline-head .ra-link { text-transform: none; letter-spacing: 0; font-size: 13px; }
.ra-oround { margin-bottom: 10px; border-radius: 10px; }
.ra-oround.is-over { outline: 2px dashed var(--violet); }
.ra-oround-head { display: flex; align-items: center; gap: 2px; border-radius: 8px; }
.ra-oround-head > button { flex: 1; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; border: 0; background: none; padding: 8px 8px 8px 2px; text-align: left; border-radius: 8px; }
.ra-oround-head b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ra-oround-head small { color: var(--mute); font-size: 12px; white-space: nowrap; }
.ra-oround-head.is-sel { background: var(--soft); }
.ra-oround-head:hover { background: var(--soft); }
.ra-oround-head.is-over, .ra-addq.is-over { box-shadow: inset 0 -2px 0 var(--violet); }
.ra-grip { width: 18px; height: 28px; display: grid; place-items: center; color: #b2b4ba; cursor: grab; flex: none; }
.ra-grip svg { width: 14px; height: 14px; fill: currentColor; }
.ra-oqs { list-style: none; margin: 2px 0 0; padding: 0; }
.ra-oq { border-radius: 8px; cursor: grab; }
.ra-oq.is-over { box-shadow: inset 0 2px 0 var(--violet); }
.ra-oq.is-dragging, .ra-oround-head.is-dragging { opacity: .4; }
.ra-oq > button { width: 100%; display: grid; grid-template-columns: 26px minmax(0, 1fr) 10px; gap: 6px; align-items: center; border: 0; background: none; padding: 7px 8px 7px 12px; text-align: left; border-radius: 8px; font-size: 13.5px; color: #34363d; }
.ra-oq > button:hover { background: var(--soft); }
.ra-oq.is-sel > button { background: var(--ink); color: #fff; }
.ra-oq.is-sel .ra-oq-n { color: rgba(255,255,255,.6); }
.ra-oq-n { font-size: 12px; color: var(--mute); font-variant-numeric: tabular-nums; }
.ra-oq-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ra-dot { width: 7px; height: 7px; border-radius: 50%; }
.ra-dot.is-ok { background: #9ed8b8; }
.ra-dot.is-warn { background: #f0913c; }
.ra-addq { border: 0; background: none; color: var(--mute); font-size: 13px; padding: 6px 12px 6px 40px; border-radius: 8px; width: 100%; text-align: left; }
.ra-addq:hover { color: var(--ink); background: var(--soft); }
.ra-addround { width: 100%; margin-top: 6px; }

/* main */
.ra-main { padding: 24px clamp(14px, 3vw, 40px) 120px; }
.ra-card { max-width: 780px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: clamp(18px, 3vw, 30px); box-shadow: 0 1px 2px rgba(12,13,16,.04); }
.ra-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: -6px 0 16px; }
.ra-crumb { margin: 0; font-size: 13px; color: var(--mute); }
.ra-crumb .ra-link { font-size: 13px; padding: 0; }
.ra-tools { display: flex; gap: 2px; }
.ra-types { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.ra-types button { min-height: 34px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); font-size: 13px; font-weight: 600; color: #34363d; }
.ra-types button:hover { border-color: #c9c9c4; }
.ra-types button[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.ra-qtext { width: 100%; margin: 6px 0 20px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 21px; font-weight: 600; line-height: 1.35; letter-spacing: -.01em; resize: none; min-height: 64px; background: var(--card); }
.ra-answer { margin-bottom: 8px; }
.ra-answer > .ra-lbl { margin: 0 0 8px; }
.ra-opts { display: grid; gap: 8px; margin-bottom: 6px; }
.ra-opt { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); transition: border-color .15s, background .15s; }
.ra-opt:focus-within { border-color: var(--ink); }
.ra-opt.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.ra-letter { flex: none; width: 32px; height: 32px; border-radius: 8px; border: 0; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--soft); color: #34363d; }
button.ra-letter:hover { background: #e3e3df; }
.ra-opt.is-correct .ra-letter { background: var(--ok); color: #fff; }
.ra-opt-input { flex: 1; min-height: 38px; border: 0; background: transparent; padding: 6px 8px; font-size: 15px; border-radius: 6px; }
.ra-opt-input:focus { box-shadow: none !important; }
.ra-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--soft); gap: 3px; }
.ra-seg button { min-height: 34px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; font-weight: 600; font-size: 13px; color: var(--mute); }
.ra-seg button[aria-checked="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(12,13,16,.15); }
.ra-seg .d-easy[aria-checked="true"] { color: var(--ok); }
.ra-seg .d-hard[aria-checked="true"] { color: #c62f1f; }
.ra-tf button { min-width: 120px; min-height: 44px; font-size: 15px; }
.ra-tf button[aria-checked="true"] { background: var(--ok); color: #fff; }
.ra-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.ra-chips button { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 2px 9px; font-size: 12px; color: var(--mute); }
.ra-chips button.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.ra-media { display: grid; gap: 10px; margin-bottom: 16px; }
.ra-media img { max-height: 280px; max-width: 100%; width: auto; border-radius: 10px; border: 1px solid var(--line); justify-self: start; }
.ra-media audio { width: 100%; }
.ra-media-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ra-upload-state { font-size: 13px; color: var(--mute); }
.ra-drop { display: grid; place-items: center; min-height: 120px; border: 2px dashed #d3d3ce; border-radius: 12px; color: var(--mute); font-size: 14px; }
.ra-drop.is-over { border-color: var(--violet); background: #f3f2ff; }
.ra-more { margin-top: 4px; border-top: 1px solid var(--line); padding-top: 12px; }
.ra-more summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 6px 0 12px; color: #34363d; }
.ra-qissues { font-size: 13.5px; margin-top: 6px; }
.ra-qissues ul { margin: 0; padding: 10px 14px 10px 30px; background: var(--warn-soft); color: #7a3a10; border-radius: 10px; }
.ra-ok { color: var(--ok); font-weight: 600; }
.ra-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.ra-kbd { font-size: 12px; color: var(--mute); }
.ra-nav { margin-left: auto; display: flex; gap: 10px; }
.ra-fieldset { border: 0; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.ra-fieldset legend { font-size: 13px; font-weight: 600; margin-bottom: 8px; color: #34363d; }
.ra-radio { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.ra-radio:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.ra-radio span { display: grid; }
.ra-radio small { color: var(--mute); font-size: 13px; }
.ra-radio.is-disabled { opacity: .55; cursor: not-allowed; }

/* health */
.ra-health { position: sticky; top: 60px; max-height: calc(100vh - 60px); overflow: auto; padding: 20px 18px 40px; }
.ra-h3 { font-size: 15px; margin-bottom: 12px; }
.ra-h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); margin: 18px 0 8px; }
.ra-h4.is-warn { color: var(--warn); }
.ra-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ra-stats div { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; }
.ra-stats b { font-size: 20px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ra-stats span { font-size: 12px; color: var(--mute); }
.ra-diffbar { display: flex; height: 8px; border-radius: 9px; overflow: hidden; background: var(--line); gap: 2px; }
.ra-diffbar .e { background: var(--ok); } .ra-diffbar .m { background: var(--ink); } .ra-diffbar .h { background: var(--red); }
.ra-legend { display: flex; gap: 12px; font-size: 12px; color: var(--mute); margin: 8px 0 0; flex-wrap: wrap; }
.ra-legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.ra-legend .e::before { background: var(--ok); } .ra-legend .m::before { background: var(--ink); } .ra-legend .h::before { background: var(--red); }
.ra-issues { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ra-issues button { width: 100%; text-align: left; border: 0; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.ra-issues button:hover { border-color: #f0b98c; background: var(--warn-soft); }
.ra-allgood { color: var(--ok); font-weight: 600; font-size: 14px; margin-top: 18px; }

/* responsive editor */
@media (max-width: 1180px) {
	.ra-cols { grid-template-columns: 260px minmax(0, 1fr); }
	.ra-health { grid-column: 2; position: static; max-height: none; padding: 0 clamp(14px, 3vw, 40px) 60px; }
	.ra-health > * { max-width: 780px; margin-left: auto; margin-right: auto; }
	.ra-main { padding-bottom: 24px; }
}
@media (max-width: 860px) {
	.ra-cols { grid-template-columns: minmax(0, 1fr); }
	.ra-health { grid-column: 1; }
	.ra-outline { position: fixed; top: 60px; left: 0; bottom: 0; width: min(320px, 88vw); height: auto; z-index: 40; transform: translateX(-102%); transition: transform .2s; box-shadow: 20px 0 40px -20px rgba(0,0,0,.25); }
	.show-outline .ra-outline { transform: none; }
	.ra-outline-toggle { display: inline-grid; }
	.ra-save { display: none; }
	.ra-top .ra-icon[data-act="undo"], .ra-top .ra-icon[data-act="redo"] { display: none; }
	.ra-top-actions .ra-btn.is-primary { padding: 0 12px; }
}
@media (max-width: 860px) { .ra-hide-sm { display: none; } }
@media (max-width: 520px) { .ra-pill-btn, .ra-hide-sm { display: none; } .ra-nav { margin-left: 0; } .ra-top { gap: 4px; padding: 0 6px; } .ra-title { font-size: 15px; } }

/* ---------- modal + toast ---------- */
.ra-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(12,13,16,.45); }
.ra-modal-box { width: min(480px, 100%); max-height: 90vh; overflow: auto; background: var(--card); border-radius: 16px; padding: 24px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.4); }
.ra-modal-box.is-wide { width: min(760px, 100%); }
.ra-modal-box h2 { font-size: 20px; margin-bottom: 12px; }
.ra-modal-body p { margin: 0 0 12px; }
.ra-modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.ra-toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 120; display: grid; gap: 8px; width: max-content; max-width: 92vw; }
.ra-toast { display: flex; align-items: center; gap: 14px; padding: 11px 14px 11px 16px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: 0 12px 30px -10px rgba(0,0,0,.4); animation: ra-in .2s ease-out; }
.ra-toast button { border: 0; background: none; color: #ffb4a6; font-weight: 700; padding: 2px 4px; }
@keyframes ra-in { from { transform: translateY(8px); opacity: 0; } }
.ra-keys { width: 100%; border-collapse: collapse; font-size: 14px; }
.ra-keys td { padding: 8px 4px; border-bottom: 1px solid var(--line); }
.ra-keys td:first-child { width: 48%; }
.ra-alert { padding: 12px 14px; border-radius: 10px; background: var(--red-soft); color: #8a1f12; font-size: 14px; }

/* answer sheet */
.ra-print h1 { font-size: 22px; margin-bottom: 4px; }
.ra-print h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; border-bottom: 2px solid var(--ink); padding: 16px 0 6px; }
.ra-print table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ra-print td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ra-print td.n { width: 36px; font-weight: 700; color: var(--mute); }
.ra-print td.a { font-weight: 700; width: 34%; }
.ra-print td.p { width: 40px; text-align: right; color: var(--mute); }
.ra-print small { display: block; font-weight: 400; color: var(--mute); font-size: 12px; }
@media print {
	body.ra-printing > *:not(.ra-modal) { display: none !important; }
	body.ra-printing .ra-modal { position: static; background: none; padding: 0; display: block; }
	body.ra-printing .ra-modal-box { box-shadow: none; max-height: none; width: 100%; padding: 0; }
	body.ra-printing .ra-modal-box > h2, body.ra-printing .ra-modal-actions { display: none; }
}

/* ---------- sign-in ---------- */
.ra-auth { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; background: radial-gradient(80% 60% at 50% 0%, #ffffff 0%, var(--bg) 70%); }
.ra-auth-card { width: min(420px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: 0 30px 60px -40px rgba(12,13,16,.35); }
.ra-auth-card h1 { font-size: 24px; margin: 26px 0 6px; }
.ra-auth-card > p { margin: 0 0 20px; }
.ra-auth-card form p { margin: 0 0 14px; display: grid; gap: 6px; }
.ra-auth-card label { font-size: 13px; font-weight: 600; }
.ra-auth-card input[type="text"], .ra-auth-card input[type="password"], .ra-auth-card input[type="email"] { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 16px; }
.ra-auth-card input[type="text"]:focus, .ra-auth-card input[type="password"]:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(12,13,16,.08); }
.ra-auth-card .login-remember label { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.ra-auth-card input[type="submit"] { width: 100%; min-height: 46px; border: 0; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 600; font-size: 15px; cursor: pointer; }
.ra-auth-card input[type="submit"]:hover { background: #262830; }
.ra-auth-links { display: flex; gap: 8px; justify-content: center; font-size: 14px; margin: 18px 0 0 !important; color: var(--mute); }
.ra-auth-links a { color: var(--violet); text-decoration: none; font-weight: 600; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Picture reveal effects (shared) ---------- */
.rr-rv { position: relative; overflow: hidden; border-radius: 14px; background: #0c0d10; }
.rr-rv-img { display: block; width: 100%; height: 100%; object-fit: contain; transition: opacity .3s; will-change: transform, filter; }
.rr-rv-canvas { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity .3s; }
.rr-rv-tiles { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(4, 1fr); }
.rr-rv-tiles i { background: #1a1d23; border: 1px solid #0c0d10; transition: opacity .5s, transform .5s; }
.rr-rv-tiles i.is-off { opacity: 0; transform: scale(.85); }
.rr-rv-veil { position: absolute; inset: 0; background: #0c0d10; transition: opacity .4s; }
.rr-rv.is-done .rr-rv-img { filter: none !important; transform: none !important; opacity: 1 !important; visibility: visible !important; transition: filter .4s, transform .6s; }
.rr-rv.is-done .rr-rv-tiles i { opacity: 0; }

/* ---------- Pin it, reveal effects, survival ---------- */
.ra-pinpick, .ra-focuspick { position: relative; width: 100%; max-width: 640px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); cursor: crosshair; background: var(--soft); }
.ra-pinpick img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.ra-focuspick { margin-top: 10px; max-width: 360px; }
.ra-focuspick img { display: block; width: 100%; height: auto; pointer-events: none; }
.ra-pin-target { position: absolute; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 2px dashed var(--ok); background: rgba(21,150,90,.18); pointer-events: none; }
.ra-pin-flag { position: absolute; width: 16px; height: 16px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px #fff, 0 2px 8px rgba(0,0,0,.35); pointer-events: none; }
.ra-pin-flag.is-focus { background: var(--red); }
.ra-chips--lg button { font-size: 13px; padding: 5px 12px; }
.ra-reveal { margin-top: 6px; }
.ra-rvprev { width: 100%; height: 360px; }
.ra-survival { margin: 4px 0 14px; padding: 14px 16px; border-radius: 12px; background: var(--soft); font-size: 14px; }
.ra-survival p { margin: 0 0 8px; }
.ra-survival .ra-check { min-height: 34px; }
.ra-pinpick img, .ra-focuspick img { max-height: none; max-width: none; border: 0; border-radius: 0; justify-self: auto; }

/* Tap Trivia mark */
.ra-brand i { background: url(../images/taptrivia-mark.svg) center / contain no-repeat !important; border-radius: 0 !important; }
.ra-brand i::after { display: none !important; }

/* Twists */
.ra-twistfield { margin-top: 14px; }
.ra-twistfield .ra-flabel small { font-weight: 400; color: var(--mute); }
.ra-twists { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.ra-twist { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 3px 11px 3px 3px; font-size: 13px; font-weight: 600; color: var(--ink); }
.ra-twist span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--mist, #f5f5f3); font-size: 11px; font-weight: 800; }
.ra-twist:hover { border-color: var(--ink); }
.ra-twist.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.ra-twist.is-on span { background: #F2462E; color: #fff; }
.ra-twist[disabled] { opacity: .75; cursor: default; }
.ra-twist small { font-weight: 500; opacity: .7; }

/* Music bingo */
.ra-bingo { margin-top: 14px; padding: 16px 18px; border-radius: 14px; background: var(--soft); border: 1px solid var(--line); }
.ra-bingo > p:first-child { margin-top: 0; }
.ra-bingo textarea { font-size: 14px; line-height: 1.5; }
.ra-warn { color: #c2410c; }
.ra-short { max-width: 140px; }
.ra-songtitle { font-size: 17px; font-weight: 600; }
.ra-songdrop { margin: 6px 0 4px; padding: 16px; border: 2px dashed var(--line); border-radius: 12px; background: var(--card); }
.ra-songdrop.is-over { border-color: #F2462E; background: #fff5f3; }
.ra-songdrop > p { margin: 0 0 10px; }
.ra-songdrop small { display: block; margin-top: 8px; color: var(--mute); }
.ra-songjob { margin-top: 12px; }
.ra-songjob p { margin: 6px 0 0; font-size: 13px; font-weight: 600; }
.ra-songbar { height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.ra-songbar i { display: block; height: 100%; background: #F2462E; transition: width .3s; }
.ra-or { display: flex; align-items: center; gap: 10px; color: var(--mute); font-size: 13px; margin: 14px 0 8px; }
.ra-or::before, .ra-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
