/* Competitions — module styles (uses core tokens from app.css). Mobile-first. */

/* Badges & medals */
.cp-badge { display: inline-grid; place-items: center; border-radius: 50%; background: var(--b, #f59e0b); color: #fff; box-shadow: inset 0 -3px 0 rgba(0,0,0,.15), 0 2px 6px rgba(0,0,0,.12); flex-shrink: 0; }
.cp-badge.locked { background: var(--surface-3); color: var(--faint); box-shadow: none; }
.cp-medal { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--ink-2); flex-shrink: 0; }
.cp-medal.m1 { background: #fde68a; color: #92400e; }
.cp-medal.m2 { background: #e5e7eb; color: #374151; }
.cp-medal.m3 { background: #fed7aa; color: #9a3412; }
.cp-mini-board { list-style: none; margin: 6px 0 0; padding: 0; }
.cp-mini-board li { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; }
.cp-w-item + .cp-w-item { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 10px; }
.cp-badges-row { display: flex; flex-wrap: wrap; gap: 10px; }
.cp-badge-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 14px 10px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.cp-badge-card.locked { opacity: .55; }
.cp-badge-card strong { font-size: 13px; }
.cp-badge-card span { font-size: 12px; color: var(--muted); }
.cp-badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }

/* Boards */
.cp-board { list-style: none; margin: 0; padding: 0; }
.cp-board li { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-top: 1px solid var(--border); }
.cp-board li:first-child { border-top: 0; }
.cp-board li.me { background: var(--primary-soft); border-radius: var(--r); padding-left: 8px; padding-right: 8px; }
.cp-board .cp-score { font-weight: 700; font-variant-numeric: tabular-nums; }
.cp-board .cp-sub { font-size: 12px; color: var(--muted); }
.cp-podium { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; align-items: end; margin: 8px 0 14px; text-align: center; }
.cp-podium div { border-radius: var(--r) var(--r) 0 0; padding: 10px 6px; color: #fff; }
.cp-podium .p1 { background: linear-gradient(#f59e0b, #d97706); min-height: 120px; order: 2; }
.cp-podium .p2 { background: linear-gradient(#94a3b8, #64748b); min-height: 95px; order: 1; }
.cp-podium .p3 { background: linear-gradient(#fb923c, #c2410c); min-height: 80px; order: 3; }
.cp-podium strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-podium span { font-size: 12px; opacity: .9; }

/* Member pages */
.cp-wrap { max-width: 720px; margin: 0 auto; }
.cp-wrap > * + * { margin-top: 14px; }
.cp-hero { text-align: center; padding: 6px 0 4px; }
.cp-hero h1 { font-size: 24px; margin-bottom: 4px; }
.cp-hero p { color: var(--muted); margin: 0; }
.cp-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; }
.cp-card h2 { font-size: 17px; margin-bottom: 6px; }
.cp-muted { color: var(--muted); font-size: 13px; }
.cp-quiz { display: flex; gap: 12px; align-items: flex-start; }
.cp-quiz-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, #35496a, #8b5cf6); color: #fff; flex-shrink: 0; }
.cp-quiz-icon.done { background: linear-gradient(135deg, #10b981, #059669); }
.cp-quiz-icon.closed { background: var(--surface-3); color: var(--muted); }
.cp-list > * + * { margin-top: 10px; }
.cp-cta { display: flex; width: 100%; justify-content: center; min-height: 48px; font-size: 16px; }
.cp-live-banner { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--r-lg); color: #fff; background: linear-gradient(135deg, #db2777, #7c3aed); text-decoration: none; }
.cp-live-banner:hover { text-decoration: none; filter: brightness(1.05); }
.cp-live-dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgba(255,255,255,.7); animation: cp-pulse 1.6s infinite; flex-shrink: 0; }
@keyframes cp-pulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.7); } 70% { box-shadow: 0 0 0 10px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }
.cp-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; margin: 12px 0; }
.cp-facts div { background: var(--surface-2); border-radius: var(--r); padding: 10px 4px; }
.cp-facts strong { display: block; font-size: 18px; }
.cp-facts span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cp-seg { display: flex; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: 999px; overflow-x: auto; }
.cp-seg a { flex: 1; text-align: center; padding: 8px 12px; border-radius: 999px; color: var(--ink-2); font-weight: 600; white-space: nowrap; text-decoration: none; min-height: 38px; }
.cp-seg a.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* Play screen */
.cp-play { max-width: 640px; margin: 0 auto; }
.cp-play-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.cp-play-top .grow { flex: 1; }
.cp-timer { position: relative; height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-bottom: 14px; }
.cp-timer span { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #22c55e, #84cc16); border-radius: 999px; width: 100%; transition: width .25s linear; }
.cp-timer.warn span { background: linear-gradient(90deg, #f59e0b, #f97316); }
.cp-timer.danger span { background: linear-gradient(90deg, #ef4444, #dc2626); }
.cp-secs { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); min-width: 38px; text-align: right; }
.cp-q { font-size: 20px; line-height: 1.4; font-weight: 700; margin: 4px 0 16px; color: var(--ink); }
.cp-opts { display: grid; gap: 10px; }
.cp-opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 12px 14px; border-radius: 14px; border: 2px solid transparent; font: inherit; font-size: 16px; font-weight: 600; text-align: left; cursor: pointer; color: #fff; transition: transform .08s, filter .15s; }
.cp-opt:active { transform: scale(.98); }
.cp-opt:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.cp-opt .cp-shape { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.22); font-size: 14px; flex-shrink: 0; }
.cp-opt.a { background: #e11d48; } .cp-opt.b { background: #2563eb; } .cp-opt.c { background: #d97706; } .cp-opt.d { background: #059669; }
.cp-opt[disabled] { cursor: default; }
.cp-opts.answered .cp-opt:not(.chosen):not(.right) { filter: grayscale(.8) opacity(.45); }
.cp-opt.chosen { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(15,23,42,.15); }
.cp-opt.right { border-color: #14532d; box-shadow: 0 0 0 4px #86efac; filter: none !important; }
.cp-opt.wrong { filter: grayscale(.3) opacity(.8); text-decoration: line-through; }
.cp-feedback { margin-top: 16px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.cp-feedback.good { border-color: #86efac; background: #f0fdf4; }
.cp-feedback.bad { border-color: #fecaca; background: #fef2f2; }
.cp-feedback h3 { margin: 0 0 4px; font-size: 18px; }
.cp-points { font-size: 13px; font-weight: 700; color: var(--success); }
.cp-score-big { font-size: 48px; font-weight: 800; line-height: 1; margin: 6px 0; font-variant-numeric: tabular-nums; background: linear-gradient(135deg, #35496a, #db2777); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cp-review li { padding: 10px 0; border-top: 1px solid var(--border); list-style: none; }
.cp-review { margin: 0; padding: 0; }
.cp-review .ok { color: var(--success); } .cp-review .no { color: var(--danger); }
@media (min-width: 560px) { .cp-opts.grid2 { grid-template-columns: 1fr 1fr; } }

/* Live on phones */
.cp-live-phone { max-width: 520px; margin: 0 auto; text-align: center; }
.cp-live-phone .cp-opts { grid-template-columns: 1fr 1fr; }
.cp-live-phone .cp-opt { flex-direction: column; justify-content: center; min-height: 110px; text-align: center; gap: 6px; font-size: 15px; }
.cp-live-status { font-size: 18px; font-weight: 700; margin: 10px 0; }
.cp-code-input { font-size: 28px !important; letter-spacing: .3em; text-align: center; text-transform: uppercase; font-weight: 700; min-height: 56px; }

/* Host / projector */
body.cp-host { margin: 0; background: #0b1224; color: #e2e8f0; font-family: var(--font); min-height: 100vh; }
.cp-host a { color: #9db4d6; }
.cp-host-bar { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: rgba(255,255,255,.04); border-bottom: 1px solid rgba(255,255,255,.08); flex-wrap: wrap; }
.cp-host-bar .grow { flex: 1; }
.cp-host-bar .btn { font-size: 15px; }
.cp-host-title { font-weight: 700; font-size: 18px; color: #fff; }
.cp-stage { padding: 28px clamp(16px, 4vw, 56px); max-width: 1400px; margin: 0 auto; }
.cp-join { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; }
.cp-join-code { font-size: clamp(56px, 10vw, 140px); font-weight: 800; letter-spacing: .12em; color: #fff; line-height: 1; }
.cp-join-url { font-size: clamp(16px, 2vw, 26px); color: #94a3b8; word-break: break-all; }
.cp-qr { background: #fff; padding: 14px; border-radius: 16px; }
.cp-qr svg { display: block; width: clamp(160px, 22vw, 280px); height: auto; }
.cp-players { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.cp-players span { background: rgba(255,255,255,.1); border-radius: 999px; padding: 8px 16px; font-size: 18px; font-weight: 600; animation: cp-pop .3s ease-out; }
@keyframes cp-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.cp-host-q { font-size: clamp(28px, 4vw, 54px); font-weight: 800; color: #fff; line-height: 1.2; margin: 10px 0 26px; }
.cp-host-meta { display: flex; align-items: center; gap: 20px; font-size: 20px; color: #94a3b8; }
.cp-count { font-size: clamp(48px, 7vw, 96px); font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; min-width: 2ch; text-align: center; }
.cp-host-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cp-host-opt { display: flex; align-items: center; gap: 18px; padding: 22px 24px; border-radius: 18px; font-size: clamp(20px, 2.6vw, 36px); font-weight: 700; color: #fff; position: relative; overflow: hidden; min-height: 96px; }
.cp-host-opt .cp-shape { width: 54px; height: 54px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.22); font-size: 24px; flex-shrink: 0; }
.cp-host-opt.a { background: #e11d48; } .cp-host-opt.b { background: #2563eb; } .cp-host-opt.c { background: #d97706; } .cp-host-opt.d { background: #059669; }
.cp-host-opts.revealed .cp-host-opt:not(.right) { opacity: .35; }
.cp-host-opt.right { outline: 6px solid #fff; }
.cp-host-opt .cp-dist { position: absolute; right: 18px; font-size: 22px; opacity: .95; }
.cp-host-ref { margin-top: 20px; font-size: 22px; color: #cbd5e1; }
.cp-host-board { list-style: none; padding: 0; margin: 10px 0 0; max-width: 900px; }
.cp-host-board li { display: flex; align-items: center; gap: 16px; padding: 12px 18px; margin-bottom: 10px; border-radius: 14px; background: rgba(255,255,255,.07); font-size: clamp(18px, 2.2vw, 28px); font-weight: 700; animation: cp-pop .35s ease-out both; }
.cp-host-board li:nth-child(1) { background: linear-gradient(90deg, rgba(245,158,11,.5), rgba(245,158,11,.12)); }
.cp-host-board li .grow { flex: 1; }
.cp-host-board .cp-medal { width: 40px; height: 40px; font-size: 18px; }
.cp-host-empty { text-align: center; padding: 60px 20px; }
.cp-host-empty h1 { color: #fff; font-size: clamp(28px, 4vw, 48px); }
.cp-host .btn-secondary { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.2); }
.cp-host .btn-ghost { color: #cbd5e1; }
.cp-host-err { color: #fca5a5; min-height: 1.4em; }
@media (max-width: 800px) { .cp-join { grid-template-columns: 1fr; } .cp-host-opts { grid-template-columns: 1fr; } }

/* Challenge progress */
.cp-progress-big { height: 14px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.cp-progress-big span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #35496a, #22c55e); }
.cp-log-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.cp-log-form .span-2 { grid-column: 1 / -1; }
.cp-stepper { display: flex; align-items: center; gap: 6px; }
.cp-stepper button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 22px; cursor: pointer; }
.cp-stepper input { text-align: center; font-size: 20px; font-weight: 700; min-height: 44px; }

/* Public inter-church board */
.cp-public { max-width: 900px; margin: 0 auto; }
.cp-public-hero { text-align: center; padding: 24px 0 12px; }
.cp-public-hero h1 { font-size: clamp(26px, 4vw, 40px); }
.cp-rank-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.cp-rank-row:last-child { border-bottom: 0; }
.cp-rank-row .cp-big { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
