.bcth-app,
.bcth-app * {
    box-sizing: border-box;
}

.bcth-app [hidden] {
    display: none !important;
}

.bcth-app {
    --bcth-blue: #2563eb;
    --bcth-blue-dark: #1d4ed8;
    --bcth-purple: #7c3aed;
    --bcth-green: #16a34a;
    --bcth-green-soft: #ecfdf3;
    --bcth-red: #dc2626;
    --bcth-red-soft: #fff1f2;
    --bcth-orange: #f59e0b;
    --bcth-ink: #172033;
    --bcth-muted: #64748b;
    --bcth-border: #d7e2f2;
    --bcth-bg: #f4f8ff;
    width: 100%;
    margin: 24px auto;
    color: var(--bcth-ink);
    font-family: Inter, ui-rounded, "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    text-align: left;
}

.bcth-app--standalone {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
}

.bcth-app button,
.bcth-app input {
    font: inherit;
}

.bcth-app button {
    -webkit-tap-highlight-color: transparent;
}

.bcth-shell {
    position: relative;
    overflow: hidden;
    width: min(100%, 1080px);
    margin: 0 auto;
    padding: clamp(16px, 3vw, 34px);
    border: 1px solid #dce7f7;
    border-radius: 28px;
    background:
        radial-gradient(circle at 8% 4%, rgba(96, 165, 250, .22), transparent 27%),
        radial-gradient(circle at 92% 1%, rgba(196, 181, 253, .3), transparent 24%),
        linear-gradient(180deg, #fff 0%, var(--bcth-bg) 100%);
    box-shadow: 0 22px 55px rgba(30, 64, 175, .13);
}

.bcth-app--standalone .bcth-shell {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
    box-shadow: none;
}

.bcth-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    max-width: 1000px;
    margin: 0 auto 22px;
}

.bcth-brand {
    min-width: 0;
}

.bcth-eyebrow {
    margin: 0 0 4px;
    color: var(--bcth-blue);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.bcth-title {
    margin: 0;
    color: var(--bcth-ink);
    font-size: clamp(27px, 4vw, 43px);
    font-weight: 950;
    letter-spacing: -.035em;
    line-height: 1.12;
}

.bcth-header-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.bcth-icon-button,
.bcth-link-button,
.bcth-level-card,
.bcth-primary-button,
.bcth-secondary-button,
.bcth-answer-button,
.bcth-quit-button,
.bcth-period-tabs button {
    appearance: none;
    border: 0;
    cursor: pointer;
}

.bcth-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    padding: 9px 13px;
    border: 1px solid var(--bcth-border);
    border-radius: 999px;
    background: rgba(255,255,255,.92);
    color: var(--bcth-ink);
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 5px 16px rgba(15, 23, 42, .07);
}

.bcth-exit-button {
    border-color: #fecaca;
    color: #b91c1c;
}

.bcth-button-icon {
    font-size: 17px;
    line-height: 1;
}

.bcth-screen,
.bcth-leaderboard {
    max-width: 1000px;
    margin-right: auto;
    margin-left: auto;
}

.bcth-setup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.bcth-panel {
    margin-bottom: 16px;
    padding: clamp(16px, 2.5vw, 22px);
    border: 1px solid var(--bcth-border);
    border-radius: 20px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 8px 22px rgba(30, 64, 175, .055);
}

.bcth-setup-grid .bcth-panel {
    height: calc(100% - 16px);
}

.bcth-panel h2,
.bcth-leaderboard h2,
.bcth-result-card h2 {
    margin: 0 0 14px;
    color: var(--bcth-ink);
    font-size: 19px;
    font-weight: 950;
    line-height: 1.3;
}

.bcth-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.bcth-link-button {
    padding: 6px 0;
    background: transparent;
    color: var(--bcth-blue);
    font-size: 14px;
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.bcth-choice-grid,
.bcth-level-grid,
.bcth-table-grid,
.bcth-answer-grid,
.bcth-result-grid {
    display: grid;
    gap: 12px;
}

.bcth-choice-grid--operations {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bcth-check-card,
.bcth-save-card,
.bcth-table-chip {
    position: relative;
    display: block;
    cursor: pointer;
    user-select: none;
}

.bcth-check-card input,
.bcth-save-card input,
.bcth-table-chip input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.bcth-check-card__body {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 76px;
    padding: 13px 42px 13px 13px;
    border: 3px solid var(--bcth-border);
    border-radius: 18px;
    background: #fff;
    color: var(--bcth-ink);
    font-size: 17px;
    font-weight: 950;
    transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}

.bcth-check-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #eaf2ff;
    color: var(--bcth-blue);
    font-size: 26px;
    font-weight: 950;
}

.bcth-check-badge,
.bcth-selection-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #cbd5e1;
    color: #fff;
    font-size: 15px;
    font-style: normal;
    font-weight: 950;
    line-height: 1;
}

.bcth-check-card .bcth-check-badge {
    position: absolute;
    top: 9px;
    right: 9px;
}

.bcth-check-card input:checked + .bcth-check-card__body {
    border-color: var(--bcth-blue);
    background: linear-gradient(145deg, var(--bcth-blue), #4f46e5);
    color: #fff;
    box-shadow: 0 12px 25px rgba(37, 99, 235, .25);
    transform: translateY(-2px);
}

.bcth-check-card input:checked + .bcth-check-card__body .bcth-check-icon {
    background: rgba(255,255,255,.2);
    color: #fff;
}

.bcth-check-card input:checked + .bcth-check-card__body .bcth-check-badge {
    background: #fff;
    color: var(--bcth-blue);
}

.bcth-save-card__body {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 3px solid var(--bcth-border);
    border-radius: 17px;
    background: #fff;
    transition: .16s ease;
}

.bcth-save-card__body .bcth-check-badge {
    flex: 0 0 25px;
    margin-top: 1px;
}

.bcth-save-card__body strong,
.bcth-save-card__body small {
    display: block;
}

.bcth-save-card__body strong {
    color: var(--bcth-ink);
    font-size: 15px;
    font-weight: 950;
}

.bcth-save-card__body small {
    margin-top: 3px;
    color: var(--bcth-muted);
    font-size: 12px;
    line-height: 1.45;
}

.bcth-save-card input:checked + .bcth-save-card__body {
    border-color: var(--bcth-green);
    background: var(--bcth-green-soft);
    box-shadow: 0 8px 20px rgba(22, 163, 74, .12);
}

.bcth-save-card input:checked + .bcth-save-card__body .bcth-check-badge {
    background: var(--bcth-green);
}

.bcth-player-fields {
    margin-top: 13px;
}

.bcth-player-fields label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 900;
}

.bcth-player-fields input {
    width: 100%;
    min-height: 50px;
    padding: 10px 13px;
    border: 2px solid #b9c9dd;
    border-radius: 13px;
    background: #fff;
    color: var(--bcth-ink);
    font-size: 16px;
    font-weight: 800;
    outline: none;
}

.bcth-player-fields input:focus {
    border-color: var(--bcth-blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .13);
}

.bcth-player-fields p {
    margin: 6px 0 0;
    color: var(--bcth-muted);
    font-size: 12px;
}

.bcth-table-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.bcth-table-chip span {
    position: relative;
    display: block;
    width: 100%;
    padding: 12px 30px 12px 8px;
    border: 3px solid var(--bcth-border);
    border-radius: 14px;
    background: #fff;
    color: var(--bcth-ink);
    text-align: center;
    font-size: 14px;
    font-weight: 950;
    transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}

.bcth-table-chip i {
    position: absolute;
    top: 50%;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #cbd5e1;
    color: #fff;
    font-size: 12px;
    font-style: normal;
    transform: translateY(-50%);
}

.bcth-table-chip input:checked + span {
    border-color: var(--bcth-purple);
    background: linear-gradient(145deg, #7c3aed, #6d28d9);
    color: #fff;
    box-shadow: 0 8px 18px rgba(124, 58, 237, .2);
    transform: translateY(-1px);
}

.bcth-table-chip input:checked + span i {
    background: #fff;
    color: var(--bcth-purple);
}

.bcth-level-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bcth-level-card {
    position: relative;
    min-height: 118px;
    padding: 16px 12px;
    border: 3px solid var(--bcth-border);
    border-radius: 18px;
    background: #fff;
    color: var(--bcth-ink);
    text-align: center;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
}

.bcth-level-card > span,
.bcth-level-card > strong {
    display: block;
}

.bcth-level-card .bcth-selection-mark {
    position: absolute;
    top: 9px;
    right: 9px;
}

.bcth-level-card .bcth-level-number {
    margin-bottom: 4px;
    color: var(--bcth-blue);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

.bcth-level-card strong {
    font-size: 16px;
    font-weight: 950;
}

.bcth-level-card strong + span {
    margin-top: 5px;
    color: var(--bcth-muted);
    font-size: 13px;
    font-weight: 800;
}

.bcth-level-card.is-selected {
    border-color: var(--bcth-blue);
    background: linear-gradient(145deg, var(--bcth-blue), #4f46e5);
    color: #fff;
    box-shadow: 0 12px 25px rgba(37, 99, 235, .24);
    transform: translateY(-3px);
}

.bcth-level-card.is-selected .bcth-level-number,
.bcth-level-card.is-selected strong + span {
    color: #fff;
}

.bcth-level-card.is-selected .bcth-selection-mark {
    background: #fff;
    color: var(--bcth-blue);
}

.bcth-check-card input:focus-visible + .bcth-check-card__body,
.bcth-save-card input:focus-visible + .bcth-save-card__body,
.bcth-table-chip input:focus-visible + span,
.bcth-level-card:focus-visible,
.bcth-primary-button:focus-visible,
.bcth-secondary-button:focus-visible,
.bcth-icon-button:focus-visible,
.bcth-link-button:focus-visible,
.bcth-answer-button:focus-visible,
.bcth-quit-button:focus-visible,
.bcth-period-tabs button:focus-visible {
    outline: 4px solid rgba(37, 99, 235, .25);
    outline-offset: 3px;
}

.bcth-primary-button,
.bcth-secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 54px;
    padding: 12px 23px;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 950;
    transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.bcth-primary-button {
    background: linear-gradient(135deg, var(--bcth-blue), var(--bcth-purple));
    color: #fff;
    box-shadow: 0 12px 24px rgba(79, 70, 229, .24);
}

.bcth-secondary-button {
    border: 2px solid var(--bcth-border);
    background: #fff;
    color: var(--bcth-ink);
}

.bcth-start-button {
    width: 100%;
    min-height: 60px;
    font-size: 18px;
}

.bcth-primary-button:hover,
.bcth-secondary-button:hover,
.bcth-answer-button:hover,
.bcth-icon-button:hover,
.bcth-quit-button:hover {
    transform: translateY(-2px);
}

.bcth-primary-button:disabled,
.bcth-secondary-button:disabled,
.bcth-answer-button:disabled {
    cursor: not-allowed;
    opacity: .68;
}

.bcth-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bcth-spin .7s linear infinite;
}

@keyframes bcth-spin {
    to { transform: rotate(360deg); }
}

.bcth-form-error {
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 2px solid #fecdd3;
    border-radius: 13px;
    background: #fff1f2;
    color: #be123c;
    font-size: 14px;
    font-weight: 900;
}

.bcth-game-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 12px;
}

.bcth-game-topbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
}

.bcth-stat {
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--bcth-border);
    border-radius: 14px;
    background: rgba(255,255,255,.92);
    text-align: center;
}

.bcth-stat > span {
    display: block;
    color: var(--bcth-muted);
    font-size: 11px;
    font-weight: 900;
}

.bcth-stat strong,
.bcth-stat strong span {
    display: inline;
    color: var(--bcth-ink);
    font-size: 18px;
    font-weight: 950;
}

.bcth-stat--correct strong {
    color: var(--bcth-green);
}

.bcth-stat--wrong strong {
    color: var(--bcth-red);
}

.bcth-quit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 150px;
    min-height: 52px;
    padding: 10px 14px;
    border: 2px solid #fecaca;
    border-radius: 14px;
    background: #fff;
    color: #b91c1c;
    font-size: 14px;
    font-weight: 950;
}

.bcth-progress {
    overflow: hidden;
    height: 10px;
    margin-bottom: 16px;
    border-radius: 999px;
    background: #dfe9f8;
}

.bcth-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--bcth-blue), var(--bcth-purple));
    transition: width .25s ease;
}

.bcth-question-card {
    position: relative;
    overflow: hidden;
    min-height: 570px;
    padding: clamp(20px, 3vw, 32px);
    border: 1px solid var(--bcth-border);
    border-radius: 25px;
    background: rgba(255,255,255,.96);
    text-align: center;
    box-shadow: 0 16px 35px rgba(30, 64, 175, .1);
}

.bcth-question-head {
    display: flex;
    justify-content: center;
    gap: 9px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.bcth-score-pill,
.bcth-streak-pill {
    padding: 7px 11px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 13px;
    font-weight: 900;
}

.bcth-streak-pill {
    background: #fff7ed;
    color: #9a3412;
}

.bcth-timer-wrap {
    position: relative;
    width: 118px;
    height: 118px;
    margin: 0 auto 10px;
}

.bcth-timer-ring {
    display: block;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.bcth-timer-ring circle {
    fill: none;
    stroke-width: 10;
}

.bcth-timer-bg {
    stroke: #e6edf8;
}

.bcth-timer-value {
    stroke: var(--bcth-blue);
    stroke-linecap: round;
    transition: stroke-dashoffset .25s linear, stroke .2s ease;
}

.bcth-timer-number {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.bcth-timer-number span {
    font-size: 37px;
    font-weight: 950;
    line-height: 1;
}

.bcth-timer-number small {
    margin-top: 2px;
    color: var(--bcth-muted);
    font-size: 11px;
    font-weight: 900;
}

.bcth-app.is-time-low .bcth-timer-value {
    stroke: var(--bcth-red);
}

.bcth-app.is-time-low .bcth-timer-number span {
    color: var(--bcth-red);
    animation: bcth-pulse .7s ease-in-out infinite alternate;
}

@keyframes bcth-pulse {
    to { transform: scale(1.08); }
}

.bcth-question-label {
    margin: 0 0 2px;
    color: var(--bcth-muted);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.bcth-question {
    margin: 0 0 18px;
    color: var(--bcth-ink);
    font-size: clamp(45px, 8vw, 78px);
    font-weight: 950;
    letter-spacing: -.035em;
    line-height: 1.2;
}

.bcth-answer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 700px;
    margin: 0 auto;
}

.bcth-answer-button {
    position: relative;
    min-height: 88px;
    padding: 14px 16px;
    border: 3px solid #cbd8eb;
    border-radius: 18px;
    background: #fff;
    color: var(--bcth-ink);
    box-shadow: 0 8px 16px rgba(30, 64, 175, .06);
    transition: transform .14s ease, border-color .14s ease, background .14s ease, color .14s ease;
}

.bcth-answer-button strong {
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 950;
}

.bcth-answer-key {
    position: absolute;
    top: 8px;
    left: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: #e9eff8;
    color: var(--bcth-muted);
    font-size: 12px;
    font-weight: 900;
}

.bcth-answer-button.is-correct {
    border-color: var(--bcth-green);
    background: var(--bcth-green-soft);
    color: #166534;
}

.bcth-answer-button.is-wrong {
    border-color: var(--bcth-red);
    background: var(--bcth-red-soft);
    color: #b91c1c;
}

.bcth-feedback {
    min-height: 35px;
    margin-top: 13px;
    font-size: 17px;
    font-weight: 950;
}

.bcth-feedback.is-correct {
    color: var(--bcth-green);
}

.bcth-feedback.is-wrong {
    color: var(--bcth-red);
}

.bcth-result-card {
    padding: clamp(22px, 4vw, 38px);
    border: 1px solid var(--bcth-border);
    border-radius: 25px;
    background: rgba(255,255,255,.96);
    text-align: center;
    box-shadow: 0 16px 35px rgba(30, 64, 175, .1);
}

.bcth-result-icon {
    margin-bottom: 4px;
    font-size: 62px;
    line-height: 1.1;
}

.bcth-result-card > p {
    margin: -4px 0 20px;
    color: var(--bcth-muted);
}

.bcth-result-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 16px;
}

.bcth-result-grid > div {
    padding: 15px 10px;
    border: 1px solid var(--bcth-border);
    border-radius: 16px;
    background: #f8fbff;
}

.bcth-result-grid span,
.bcth-result-grid strong {
    display: block;
}

.bcth-result-grid span {
    color: var(--bcth-muted);
    font-size: 12px;
    font-weight: 900;
}

.bcth-result-grid strong {
    margin-top: 4px;
    font-size: 21px;
    font-weight: 950;
}

.bcth-result-grid .is-correct strong {
    color: var(--bcth-green);
}

.bcth-result-grid .is-wrong strong {
    color: var(--bcth-red);
}

.bcth-save-status {
    margin: 16px 0 0 !important;
    padding: 11px 13px;
    border-radius: 12px;
    background: #f1f5f9;
    color: var(--bcth-muted) !important;
    font-size: 13px;
    font-weight: 900;
}

.bcth-save-status.is-saving {
    background: #eff6ff;
    color: #1d4ed8 !important;
}

.bcth-save-status.is-success {
    background: var(--bcth-green-soft);
    color: #166534 !important;
}

.bcth-save-status.is-error {
    background: var(--bcth-red-soft);
    color: #b91c1c !important;
}

.bcth-result-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: 620px;
    margin: 18px auto 0;
}

.bcth-leaderboard {
    margin-top: 22px;
    padding: clamp(17px, 3vw, 24px);
    border: 1px solid var(--bcth-border);
    border-radius: 22px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 10px 26px rgba(30, 64, 175, .07);
}

.bcth-leaderboard-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
}

.bcth-leaderboard-head h2 {
    margin-bottom: 0;
}

.bcth-period-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 5px;
    border-radius: 13px;
    background: #eaf0f8;
}

.bcth-period-tabs button {
    min-height: 38px;
    padding: 7px 12px;
    border-radius: 9px;
    background: transparent;
    color: var(--bcth-muted);
    font-size: 13px;
    font-weight: 950;
}

.bcth-period-tabs button.is-active {
    background: #fff;
    color: var(--bcth-blue);
    box-shadow: 0 4px 12px rgba(15, 23, 42, .1);
}

.bcth-leaderboard-note {
    margin: 12px 0;
    color: var(--bcth-muted);
    font-size: 12px;
}

.bcth-leaderboard-status {
    padding: 20px;
    border-radius: 14px;
    background: #f8fafc;
    color: var(--bcth-muted);
    text-align: center;
    font-size: 14px;
    font-weight: 850;
}

.bcth-leaderboard-list {
    display: grid;
    gap: 8px;
}

.bcth-rank-item {
    display: grid;
    grid-template-columns: 52px minmax(160px, 1fr) minmax(130px, .7fr) minmax(110px, .55fr);
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid var(--bcth-border);
    border-radius: 14px;
    background: #fff;
}

.bcth-rank-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #eef4ff;
    color: var(--bcth-blue);
    font-size: 19px;
    font-weight: 950;
}

.bcth-rank-player,
.bcth-rank-accuracy,
.bcth-rank-time {
    min-width: 0;
}

.bcth-rank-player strong,
.bcth-rank-player span,
.bcth-rank-accuracy span,
.bcth-rank-accuracy strong,
.bcth-rank-time span,
.bcth-rank-time strong {
    display: block;
}

.bcth-rank-player strong {
    overflow: hidden;
    color: var(--bcth-ink);
    font-size: 15px;
    font-weight: 950;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bcth-rank-player span,
.bcth-rank-accuracy span,
.bcth-rank-time span {
    color: var(--bcth-muted);
    font-size: 11px;
    font-weight: 800;
}

.bcth-rank-accuracy strong,
.bcth-rank-time strong {
    margin-top: 2px;
    color: var(--bcth-ink);
    font-size: 14px;
    font-weight: 950;
}

.bcth-rank-time strong {
    color: var(--bcth-blue);
    font-variant-numeric: tabular-nums;
}

body.bcth-standalone-page {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 !important;
    padding: 0 !important;
    background: #f4f8ff !important;
    overflow-x: hidden;
}

body.bcth-standalone-page > *:not(.bcth-standalone-main):not(script):not(style):not(link) {
    display: none !important;
}

body.bcth-standalone-page #wpadminbar {
    display: none !important;
}

html:has(body.bcth-standalone-page) {
    margin-top: 0 !important;
    background: #f4f8ff;
}

.bcth-standalone-main {
    min-height: 100vh;
    min-height: 100dvh;
}

:fullscreen .bcth-app--standalone,
:fullscreen .bcth-shell {
    min-height: 100vh;
    min-height: 100dvh;
}

@media (max-width: 820px) {
    .bcth-setup-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .bcth-level-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bcth-table-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 8px;
    }

    .bcth-game-toolbar {
        grid-template-columns: 1fr;
    }

    .bcth-quit-button {
        width: 100%;
        min-height: 48px;
    }

    .bcth-question-card {
        min-height: 530px;
    }

    .bcth-result-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bcth-leaderboard-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .bcth-period-tabs {
        width: 100%;
    }

    .bcth-period-tabs button {
        flex: 1 1 auto;
    }

    .bcth-rank-item {
        grid-template-columns: 44px minmax(0, 1fr) auto;
    }

    .bcth-rank-accuracy {
        grid-column: 2 / 4;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding-top: 7px;
        border-top: 1px dashed var(--bcth-border);
    }
}

@media (max-width: 600px) {
    .bcth-app {
        margin: 10px auto;
        font-size: 15px;
    }

    .bcth-app--standalone {
        margin: 0;
    }

    .bcth-shell {
        padding: 14px;
        border-radius: 18px;
    }

    .bcth-app--standalone .bcth-shell {
        padding-top: max(12px, env(safe-area-inset-top));
        padding-right: max(10px, env(safe-area-inset-right));
        padding-bottom: max(14px, env(safe-area-inset-bottom));
        padding-left: max(10px, env(safe-area-inset-left));
    }

    .bcth-header {
        align-items: center;
        gap: 9px;
        margin-bottom: 14px;
    }

    .bcth-eyebrow {
        font-size: 9px;
        letter-spacing: .035em;
    }

    .bcth-title {
        font-size: clamp(23px, 7vw, 31px);
    }

    .bcth-header-actions {
        gap: 5px;
    }

    .bcth-icon-button {
        min-width: 44px;
        min-height: 44px;
        padding: 9px;
    }

    .bcth-icon-button > span:last-child:not(.bcth-button-icon) {
        display: none;
    }

    .bcth-panel {
        margin-bottom: 11px;
        padding: 14px;
        border-radius: 16px;
    }

    .bcth-panel h2,
    .bcth-leaderboard h2,
    .bcth-result-card h2 {
        font-size: 17px;
    }

    .bcth-choice-grid--operations {
        gap: 8px;
    }

    .bcth-check-card__body {
        min-height: 69px;
        padding: 10px 35px 10px 8px;
        border-width: 2px;
        font-size: 14px;
    }

    .bcth-check-icon {
        width: 34px;
        height: 34px;
        font-size: 22px;
    }

    .bcth-table-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bcth-table-chip span {
        min-height: 48px;
        padding: 11px 31px 11px 8px;
        border-width: 2px;
        font-size: 14px;
    }

    .bcth-level-grid {
        gap: 8px;
    }

    .bcth-level-card {
        min-height: 102px;
        padding: 13px 8px;
        border-width: 2px;
    }

    .bcth-level-card strong {
        font-size: 14px;
    }

    .bcth-start-button {
        position: sticky;
        bottom: max(8px, env(safe-area-inset-bottom));
        z-index: 5;
        min-height: 57px;
        box-shadow: 0 13px 28px rgba(79, 70, 229, .35);
    }

    .bcth-game-topbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .bcth-stat {
        padding: 7px;
    }

    .bcth-stat strong,
    .bcth-stat strong span {
        font-size: 16px;
    }

    .bcth-progress {
        margin-bottom: 10px;
    }

    .bcth-question-card {
        min-height: 0;
        padding: 14px 10px 18px;
        border-radius: 19px;
    }

    .bcth-question-head {
        margin-bottom: 5px;
    }

    .bcth-timer-wrap {
        width: 92px;
        height: 92px;
        margin-bottom: 4px;
    }

    .bcth-timer-ring circle {
        stroke-width: 11;
    }

    .bcth-timer-number span {
        font-size: 29px;
    }

    .bcth-question-label {
        font-size: 11px;
    }

    .bcth-question {
        margin-bottom: 12px;
        font-size: clamp(42px, 14vw, 62px);
    }

    .bcth-answer-grid {
        gap: 8px;
    }

    .bcth-answer-button {
        min-height: 76px;
        padding: 10px;
        border-width: 2px;
        border-radius: 15px;
    }

    .bcth-answer-button strong {
        font-size: clamp(28px, 9vw, 38px);
    }

    .bcth-feedback {
        min-height: 28px;
        margin-top: 8px;
        font-size: 14px;
    }

    .bcth-result-card {
        padding: 19px 12px;
        border-radius: 19px;
    }

    .bcth-result-icon {
        font-size: 49px;
    }

    .bcth-result-grid {
        gap: 8px;
    }

    .bcth-result-grid > div {
        padding: 11px 7px;
    }

    .bcth-result-grid strong {
        font-size: 17px;
    }

    .bcth-result-actions {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .bcth-leaderboard {
        margin-top: 14px;
        padding: 14px 10px;
        border-radius: 17px;
    }

    .bcth-period-tabs {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .bcth-rank-item {
        grid-template-columns: 40px minmax(0, 1fr) auto;
        gap: 7px;
        padding: 10px 8px;
    }

    .bcth-rank-number {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }

    .bcth-rank-player strong {
        font-size: 14px;
    }

    .bcth-rank-time strong,
    .bcth-rank-accuracy strong {
        font-size: 13px;
    }
}

@media (max-width: 380px) {
    .bcth-title {
        font-size: 21px;
    }

    .bcth-choice-grid--operations {
        grid-template-columns: 1fr;
    }

    .bcth-level-grid {
        grid-template-columns: 1fr 1fr;
    }

    .bcth-level-card {
        min-height: 96px;
    }

    .bcth-question {
        font-size: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bcth-app *,
    .bcth-app *::before,
    .bcth-app *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* ===== BCTH 2.1: shortcode fullscreen + answer input mode ===== */
html.bcth-page-locked,
body.bcth-page-locked {
    overflow: hidden !important;
}

.bcth-app:fullscreen,
.bcth-app.is-native-fullscreen,
.bcth-app.is-pseudo-fullscreen {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background: #f4f8ff;
}

.bcth-app.is-pseudo-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
}

.bcth-app:fullscreen .bcth-shell,
.bcth-app.is-native-fullscreen .bcth-shell,
.bcth-app.is-pseudo-fullscreen .bcth-shell {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding-top: max(14px, env(safe-area-inset-top));
    padding-right: max(14px, env(safe-area-inset-right));
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    padding-left: max(14px, env(safe-area-inset-left));
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.bcth-choice-grid--modes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bcth-mode-card .bcth-check-card__body {
    justify-content: flex-start;
    min-height: 92px;
    text-align: left;
}

.bcth-mode-card .bcth-check-card__body > span:nth-child(2) {
    min-width: 0;
}

.bcth-mode-card strong,
.bcth-mode-card small {
    display: block;
}

.bcth-mode-card small {
    margin-top: 3px;
    color: var(--bcth-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.bcth-mode-card input:checked + .bcth-check-card__body small {
    color: rgba(255,255,255,.86);
}

.bcth-game-toolbar-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.bcth-minimize-button {
    border-color: #bfdbfe !important;
    background: #eff6ff !important;
    color: #1d4ed8 !important;
}

.bcth-input-answer {
    width: min(100%, 390px);
    margin: 18px auto 0;
}

.bcth-number-display-wrap {
    position: relative;
    margin-bottom: 12px;
}

.bcth-number-display {
    display: block;
    width: 100%;
    height: 76px;
    padding: 8px 18px;
    border: 4px solid #93c5fd;
    border-radius: 20px;
    outline: 0;
    background: #fff;
    color: var(--bcth-ink);
    font-size: clamp(34px, 8vw, 52px);
    font-weight: 950;
    line-height: 1;
    text-align: center;
    box-shadow: inset 0 2px 0 rgba(255,255,255,.8), 0 10px 25px rgba(37,99,235,.12);
    caret-color: transparent;
    transition: border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}

.bcth-number-display:focus {
    border-color: var(--bcth-blue);
    box-shadow: 0 0 0 5px rgba(37,99,235,.13), 0 12px 28px rgba(37,99,235,.16);
}

.bcth-number-display.is-empty {
    border-color: var(--bcth-orange);
    animation: bcth-input-shake .25s ease;
}

.bcth-number-display.is-correct {
    border-color: var(--bcth-green);
    background: var(--bcth-green-soft);
    color: #166534;
}

.bcth-number-display.is-wrong {
    border-color: var(--bcth-red);
    background: var(--bcth-red-soft);
    color: #991b1b;
}

@keyframes bcth-input-shake {
    0%, 100% { transform: translateX(0); }
    30% { transform: translateX(-6px); }
    70% { transform: translateX(6px); }
}

.bcth-keypad {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.bcth-keypad button {
    appearance: none;
    min-height: 58px;
    padding: 8px;
    border: 2px solid #cbdcf4;
    border-radius: 16px;
    background: #fff;
    color: var(--bcth-ink);
    font-size: 24px;
    font-weight: 950;
    cursor: pointer;
    box-shadow: 0 5px 0 #dbe7f7;
    touch-action: manipulation;
    transition: transform .08s ease, box-shadow .08s ease, border-color .12s ease, background .12s ease;
}

.bcth-keypad button:hover,
.bcth-keypad button:focus-visible {
    border-color: var(--bcth-blue);
    background: #eff6ff;
    outline: 0;
}

.bcth-keypad button:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #dbe7f7;
}

.bcth-keypad button:disabled,
.bcth-input-next:disabled {
    cursor: default;
    opacity: .58;
    transform: none;
}

.bcth-keypad .bcth-keypad-action {
    color: #475569;
    font-size: 16px;
}

.bcth-input-next {
    width: 100%;
    margin-top: 13px;
    min-height: 54px;
}

.bcth-keyboard-hint {
    margin: 9px 0 0;
    color: var(--bcth-muted);
    font-size: 12px;
    text-align: center;
}

@media (max-width: 700px) {
    .bcth-choice-grid--modes {
        grid-template-columns: 1fr;
    }

    .bcth-mode-card .bcth-check-card__body {
        min-height: 78px;
    }

    .bcth-game-toolbar-actions {
        width: 100%;
    }

    .bcth-game-toolbar-actions .bcth-quit-button {
        flex: 1 1 0;
        justify-content: center;
    }

    .bcth-input-answer {
        width: min(100%, 340px);
        margin-top: 12px;
    }

    .bcth-number-display {
        height: 64px;
        border-radius: 16px;
    }

    .bcth-keypad {
        gap: 8px;
    }

    .bcth-keypad button {
        min-height: 52px;
        border-radius: 14px;
        font-size: 22px;
    }
}

@media (max-width: 420px) {
    .bcth-app:fullscreen .bcth-question-card,
    .bcth-app.is-native-fullscreen .bcth-question-card,
    .bcth-app.is-pseudo-fullscreen .bcth-question-card {
        padding-right: 12px;
        padding-left: 12px;
    }

    .bcth-keypad button {
        min-height: 48px;
    }

    .bcth-keyboard-hint {
        display: none;
    }
}

@media (max-height: 700px) and (orientation: landscape) {
    .bcth-app:fullscreen .bcth-header,
    .bcth-app.is-native-fullscreen .bcth-header,
    .bcth-app.is-pseudo-fullscreen .bcth-header {
        margin-bottom: 10px;
    }

    .bcth-app:fullscreen .bcth-question-card,
    .bcth-app.is-native-fullscreen .bcth-question-card,
    .bcth-app.is-pseudo-fullscreen .bcth-question-card {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .bcth-number-display {
        height: 54px;
        font-size: 34px;
    }

    .bcth-keypad button {
        min-height: 42px;
    }
}

/* ===== BCTH 2.1.2: lưu kết quả ổn định, nút chọn tất cả và chế độ tập trung ===== */
.bcth-select-all-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 9px 15px;
    border: 2px solid #bfdbfe;
    border-radius: 12px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 14px;
    font-weight: 950;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 5px 13px rgba(37, 99, 235, .11);
    transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.bcth-select-all-button > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    font-size: 14px;
    line-height: 1;
}

.bcth-select-all-button:hover,
.bcth-select-all-button:focus-visible {
    transform: translateY(-1px);
    border-color: #60a5fa;
    background: #dbeafe;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .18);
    outline: none;
}

.bcth-select-all-button.is-all-selected {
    border-color: #ddd6fe;
    background: #f5f3ff;
    color: #6d28d9;
}

.bcth-select-all-button.is-all-selected > span {
    background: #7c3aed;
}

.bcth-focus-toggle[aria-pressed="true"] {
    border-color: #93c5fd;
    background: #dbeafe;
    color: #1d4ed8;
}

.bcth-app.is-pseudo-fullscreen {
    z-index: 2147483647 !important;
    isolation: isolate;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

body.bcth-page-locked > .bcth-app.is-pseudo-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    margin: 0 !important;
}

.bcth-retry-save {
    width: 100%;
    min-height: 46px;
    margin: 10px 0 0;
    border-color: #fecaca;
    color: #b91c1c;
}

.bcth-latest-saved {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    padding: 13px 15px;
    border: 2px solid #86efac;
    border-radius: 15px;
    background: #f0fdf4;
    color: #166534;
}

.bcth-latest-saved__icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    font-size: 20px;
    font-weight: 950;
}

.bcth-latest-saved strong,
.bcth-latest-saved span {
    display: block;
}

.bcth-latest-saved strong {
    font-size: 14px;
}

.bcth-latest-saved div > span {
    margin-top: 2px;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.4;
}

.bcth-rank-item.is-latest {
    border-color: #86efac;
    background: #f0fdf4;
    box-shadow: inset 4px 0 0 #22c55e;
}

@media (max-width: 600px) {
    .bcth-panel-heading {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .bcth-panel-heading h2 {
        flex: 1 1 190px;
        margin-bottom: 0;
    }

    .bcth-select-all-button {
        flex: 0 0 auto;
        min-height: 40px;
        padding: 8px 12px;
        font-size: 13px;
    }

    .bcth-latest-saved {
        align-items: flex-start;
        padding: 11px;
    }
}

@media (max-width: 390px) {
    .bcth-panel-heading {
        display: grid;
        grid-template-columns: 1fr;
    }

    .bcth-select-all-button {
        width: 100%;
    }
}
