/* QueueUp Smart Match - /smart-match questionnaire styles.
   Scoped to .smart-match-main / .sm-* so nothing leaks elsewhere.
   Palette: #8b5cf6 (purple-500), #7c3aed (purple-600 hover/CTA), #a78bfa (purple-400 accent). */

/* ---------- Page shell ---------- */
.smart-match-main {
    position: relative;
    min-height: calc(100vh - 80px);
    overflow: hidden;
    background:
        radial-gradient(900px 500px at 50% 0%, rgba(139, 92, 246, 0.06), transparent 70%),
        linear-gradient(to bottom, #0d0d0f 0%, #08080b 100%);
}

.smart-match-section {
    padding: 40px 0 100px;
    position: relative;
    z-index: 1;
}

.smart-match-shell {
    max-width: 920px;
    margin: 0 auto;
    background: #15151a;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 48px 56px 40px;
    box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.6);
    position: relative;
}

/* ---------- Progress bar ---------- */
.sm-progress {
    margin-bottom: 32px;
}

.sm-progress__meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    color: hsla(0, 0%, 100%, 0.7);
    letter-spacing: 0.02em;
}

.sm-progress__step {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.12em;
    font-weight: 700;
    color: hsla(0, 0%, 100%, 0.55);
}

.sm-progress__step #sm-step-current {
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.sm-progress__sep {
    color: hsla(0, 0%, 100%, 0.3);
    margin: 0 2px;
}

.sm-progress__percent {
    color: #a78bfa;
    font-weight: 800;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.sm-progress__bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
}

.sm-progress__fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
    border-radius: 999px;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Step shell ---------- */
.sm-step {
    display: none;
    animation: smFadeIn 0.25s ease-out;
}

.sm-step.is-active {
    display: block;
}

@keyframes smFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sm-step__header {
    margin-bottom: 28px;
    text-align: center;
}

.sm-step__title {
    font-family: var(--font-display, inherit);
    font-size: clamp(26px, 3vw, 36px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
    color: #fff;
}

.sm-step__subtitle {
    font-size: 15px;
    color: hsla(0, 0%, 100%, 0.6);
    margin: 0 auto;
    max-width: 520px;
    line-height: 1.55;
}

.sm-headline-accent {
    color: #a78bfa;
    background: linear-gradient(135deg, #c4b5fd 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---------- Options (radio / checkbox grids) ---------- */
.sm-options {
    display: grid;
    gap: 12px;
}

.sm-options--grid {
    grid-template-columns: repeat(var(--sm-cols, 3), minmax(0, 1fr));
}

.sm-options--cols-1 { --sm-cols: 1; }
.sm-options--cols-2 { --sm-cols: 2; }
.sm-options--cols-3 { --sm-cols: 3; }

@media (max-width: 640px) {
    .sm-options--cols-3 { --sm-cols: 2; }
}

@media (max-width: 480px) {
    .sm-options--grid { --sm-cols: 1 !important; }
}

/* Visually-hidden input drives the selection state via :checked. */
.sm-option {
    cursor: pointer;
    display: block;
    margin: 0;
}

.sm-option__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.sm-option__card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px 14px;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-height: 108px;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Top-edge highlight - purely decorative. */
.sm-option__card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 12px;
    right: 12px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    transition: opacity 0.2s ease;
    pointer-events: none;
}

/* Wide variant: icon left, label + description right. */
.sm-option__card--wide {
    flex-direction: row;
    text-align: left;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    padding: 16px 18px;
    min-height: 80px;
}

.sm-option__card--wide .sm-option__text {
    flex: 1;
    min-width: 0;
}

.sm-option:hover .sm-option__card {
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
}

.sm-option:has(.sm-option__input:checked) .sm-option__card {
    background: rgba(139, 92, 246, 0.10);
    border-color: #8b5cf6;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.sm-option:has(.sm-option__input:checked) .sm-option__card::before {
    background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.4), transparent);
}

/* Multi-select cards get a small purple checkmark in the top-right when
   selected so it's visually obvious "I picked this AND others." */
.sm-option__card--wide::after {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    transition: all 0.15s ease;
}

.sm-option:has(input[type="checkbox"]:checked) .sm-option__card--wide::after {
    background: #8b5cf6;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.5L6.5 11.5L12.5 5.5' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px;
}

/* ---------- Option icon + labels ---------- */
.sm-option__icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(135deg, rgba(139, 92, 246, 0.18) 0%, rgba(139, 92, 246, 0.06) 100%);
    color: #a78bfa;
    border-radius: 11px;
    font-size: 18px;
    flex-shrink: 0;
    transition: all 0.25s ease;
    border: 1px solid rgba(139, 92, 246, 0.15);
}

.sm-option:has(.sm-option__input:checked) .sm-option__icon {
    background: #8b5cf6;
    color: #fff;
    border-color: #8b5cf6;
}

/* ---------- Role icon variant ----------
   Uses the same st1–st5 role artwork as the coach finder / coach profile.
   Default = greyscale + dimmed, selected = full colour. */
.sm-option__icon--role {
    /* Use individual background-* props (not the shorthand) - shorthand
       resets background-image and would wipe per-role url() declarations. */
    background-color: transparent !important;
    background-image: none;
    border: none !important;
    width: 56px;
    height: 56px;
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    filter: grayscale(1) opacity(0.7);
    transition: filter 0.2s ease, transform 0.2s ease;
}

.sm-option:hover .sm-option__icon--role {
    filter: grayscale(0.3) opacity(0.95);
    transform: scale(1.05);
}

/* !important on the background-* props guards against the parent
   .sm-option__icon selected state's `background:` shorthand resetting
   them - would otherwise crop the role icon to top-left. */
.sm-option:has(.sm-option__input:checked) .sm-option__icon--role {
    background-color: transparent !important;
    background-position: center !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    border: none !important;
    box-shadow: none !important;
    filter: none;
    transform: scale(1.08);
}

/* URLs come from Role.icon_url / Role.icon_url_selected via inline
   --sm-icon / --sm-icon-selected custom properties on each element. */
.sm-option__icon--role {
    background-image: var(--sm-icon, none);
}

.sm-option:has(.sm-option__input:checked) .sm-option__icon--role {
    background-image: var(--sm-icon-selected, var(--sm-icon, none));
}

/* "Fill / Multiple" composite - 5 role icons in a horizontal strip. */
.sm-option__icon--role[data-role="fill"] {
    background-color: transparent !important;
    background-image:
        url('https://queueup-prod.fra1.cdn.digitaloceanspaces.com/assets/images/st1.webp'),
        url('https://queueup-prod.fra1.cdn.digitaloceanspaces.com/assets/images/st2.webp'),
        url('https://queueup-prod.fra1.cdn.digitaloceanspaces.com/assets/images/st3.webp'),
        url('https://queueup-prod.fra1.cdn.digitaloceanspaces.com/assets/images/st4.webp'),
        url('https://queueup-prod.fra1.cdn.digitaloceanspaces.com/assets/images/st5.webp');
    background-position: 0% center, 25% center, 50% center, 75% center, 100% center;
    background-size: 18% auto, 18% auto, 18% auto, 18% auto, 18% auto;
    background-repeat: no-repeat;
    width: 90px;
}

.sm-option:has(.sm-option__input:checked) .sm-option__icon--role[data-role="fill"] {
    background-image:
        url('https://queueup-prod.fra1.cdn.digitaloceanspaces.com/assets/images/st1-selected.webp'),
        url('https://queueup-prod.fra1.cdn.digitaloceanspaces.com/assets/images/st2-selected.webp'),
        url('https://queueup-prod.fra1.cdn.digitaloceanspaces.com/assets/images/st3-selected.webp'),
        url('https://queueup-prod.fra1.cdn.digitaloceanspaces.com/assets/images/st4-selected.webp'),
        url('https://queueup-prod.fra1.cdn.digitaloceanspaces.com/assets/images/st5-selected.webp');
    background-position: 0% center, 25% center, 50% center, 75% center, 100% center !important;
    background-size: 18% auto, 18% auto, 18% auto, 18% auto, 18% auto !important;
    background-repeat: no-repeat !important;
}

.sm-option__label {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.sm-option__desc {
    font-size: 12.5px;
    color: hsla(0, 0%, 100%, 0.55);
    line-height: 1.4;
    margin-top: 3px;
}

/* ---------- Rank tier cards (smaller - 9 per step) ---------- */
.sm-options--ranks .sm-option__card {
    min-height: 92px;
    padding: 14px 10px;
    gap: 6px;
}

.sm-options--ranks .sm-option__icon {
    width: 36px;
    height: 36px;
    font-size: 14px;
}

/* Rank emblem images come straight from Riot's communitydragon CDN. */
.sm-option__rank-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    filter: saturate(0.65) brightness(0.85);
    transition: filter 0.2s ease, transform 0.2s ease;
}

.sm-option:hover .sm-option__rank-img {
    filter: saturate(0.9) brightness(0.95);
    transform: scale(1.05);
}

.sm-option:has(.sm-option__input:checked) .sm-option__rank-img {
    /* Selected: full colour + slight scale. No drop-shadow - the card
       border around the emblem is signal enough. */
    filter: none;
    transform: scale(1.08);
}

/* ---------- Champion + language pickers ----------
   Same UX shape (search -> filtered grid -> chips). Selectors below
   apply to both via selector lists; per-picker overrides follow. */
.sm-champ-search,
.sm-lang-search {
    position: relative;
    margin-bottom: 12px;
}

.sm-champ-search input,
.sm-lang-search input {
    width: 100%;
    padding: 14px 44px 14px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.sm-champ-search input::placeholder,
.sm-lang-search input::placeholder {
    color: hsla(0, 0%, 100%, 0.35);
}

.sm-champ-search input:focus,
.sm-lang-search input:focus {
    outline: none;
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.04);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12);
}

.sm-champ-search > i,
.sm-lang-search > i {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: hsla(0, 0%, 100%, 0.35);
    pointer-events: none;
    font-size: 14px;
}

/* Selected-chips strip above the search box. */
.sm-champ-selected,
.sm-lang-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding: 12px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 12px;
}

.sm-champ-chip,
.sm-lang-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 6px 6px;
    background: #8b5cf6;
    color: #fff;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    animation: smChipIn 0.2s ease-out;
}

.sm-champ-chip img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
}

/* Language chips lead with an FA icon (no portrait). */
.sm-lang-chip {
    padding-left: 10px;
}

.sm-lang-chip > i {
    font-size: 13px;
    opacity: 0.85;
}

.sm-champ-chip__remove,
.sm-lang-chip__remove {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    padding: 0 4px;
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    transition: color 0.15s ease, transform 0.15s ease;
}

.sm-champ-chip__remove:hover,
.sm-lang-chip__remove:hover {
    color: #fff;
    transform: scale(1.2);
}

@keyframes smChipIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

.sm-champ-grid,
.sm-lang-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
    padding: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.4) transparent;
}

.sm-champ-grid::-webkit-scrollbar,
.sm-lang-grid::-webkit-scrollbar {
    width: 6px;
}

.sm-champ-grid::-webkit-scrollbar-thumb,
.sm-lang-grid::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.4);
    border-radius: 3px;
}

.sm-champ-grid.is-hidden,
.sm-lang-grid.is-hidden {
    display: none;
}

@media (min-width: 640px) {
    .sm-champ-grid,
    .sm-lang-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Individual pill - checkbox + icon + name. */
.sm-champ-pill,
.sm-lang-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: hsla(0, 0%, 100%, 0.75);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin: 0;
}

.sm-champ-pill img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

/* Language pills swap the champion image slot for a small FA icon. */
.sm-lang-pill > i {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(139, 92, 246, 0.12);
    color: #a78bfa;
    font-size: 13px;
    flex-shrink: 0;
}

.sm-champ-pill input,
.sm-lang-pill input {
    display: none;
}

.sm-champ-pill:hover,
.sm-lang-pill:hover {
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.06);
    color: #fff;
}

.sm-champ-pill:has(input:checked),
.sm-lang-pill:has(input:checked) {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.12);
    color: #fff;
}

.sm-champ-pill.is-hidden,
.sm-lang-pill.is-hidden {
    display: none;
}

.sm-champ-hint,
.sm-lang-hint {
    margin-top: 14px;
    font-size: 13px;
    color: hsla(0, 0%, 100%, 0.45);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sm-champ-hint i,
.sm-lang-hint i {
    color: hsla(0, 0%, 100%, 0.35);
    font-size: 12px;
}

/* ---------- Free-text note ---------- */
.sm-note {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px 18px;
    color: #fff;
    font-size: 15px;
    line-height: 1.6;
    font-family: inherit;
    resize: vertical;
    min-height: 150px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.sm-note::placeholder {
    color: hsla(0, 0%, 100%, 0.35);
}

.sm-note:focus {
    outline: none;
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.04);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12);
}

.sm-note__counter {
    text-align: right;
    font-size: 12px;
    color: hsla(0, 0%, 100%, 0.4);
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}

.sm-note__hint {
    margin-top: 16px;
    padding: 12px 14px;
    background: rgba(139, 92, 246, 0.06);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 10px;
    font-size: 13px;
    color: hsla(0, 0%, 100%, 0.7);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sm-note__hint i {
    color: #8b5cf6;
}

/* ---------- Nav buttons ---------- */
.sm-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sm-nav__back {
    background: transparent;
    color: hsla(0, 0%, 100%, 0.6);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    padding: 11px 22px;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.sm-nav__back:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
}

.sm-nav__back:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.sm-nav__next,
.sm-nav__submit {
    background: #7c3aed;
    color: #fff;
    border: none;
    padding: 11px 30px;
    font-weight: 600;
    font-size: 15px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.sm-nav__next:hover:not(:disabled),
.sm-nav__submit:hover {
    background: #6d28d9;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px -8px rgba(124, 58, 237, 0.55);
    color: #fff;
}

.sm-nav__next:disabled {
    background: rgba(124, 58, 237, 0.25);
    box-shadow: none;
    cursor: not-allowed;
}

/* ---------- Loading overlay (post-submit) ---------- */
.sm-loading {
    text-align: center;
    padding: 60px 24px;
    animation: smFadeIn 0.4s ease-out;
}

/* Three-ring orbit loader. Size + colours tokenised at the top. */
.sm-loading__spinner {
    --sm-loader-size: 120px;
    --sm-loader-thickness: 3px;
    --sm-loader-primary: #8b5cf6;        /* purple-500 */
    --sm-loader-primary-light: #a78bfa;  /* purple-400 */
    --sm-loader-secondary: #ffffff;

    position: relative;
    width: var(--sm-loader-size);
    height: var(--sm-loader-size);
    margin: 0 auto 28px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sm-loading__ring {
    position: absolute;
    border-radius: 50%;
    border: var(--sm-loader-thickness) solid transparent;
    box-sizing: border-box;
}

.sm-loading__ring--outer {
    width: 100%;
    height: 100%;
    border-left-color: color-mix(in srgb, var(--sm-loader-primary) 20%, transparent);
    border-right-color: color-mix(in srgb, var(--sm-loader-primary) 20%, transparent);
    animation: smSpinCw 3s linear infinite;
}

.sm-loading__ring--middle {
    width: 65%;
    height: 65%;
    border-top-color: var(--sm-loader-primary-light);
    border-bottom-color: var(--sm-loader-primary-light);
    animation: smSpinCcw 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    filter: drop-shadow(0 0 10px color-mix(in srgb, var(--sm-loader-primary) 60%, transparent));
}

.sm-loading__ring--inner {
    width: 30%;
    height: 30%;
    border-left-color: var(--sm-loader-secondary);
    border-right-color: var(--sm-loader-secondary);
    animation: smSpinCw 1s linear infinite;
}

@keyframes smSpinCw {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes smSpinCcw {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
}

/* Deliberately not honouring prefers-reduced-motion - a loader
   without motion can't communicate "working." */

/* ---------- "Match found" lock state ----------
   Triggered by adding .is-arrived to the spinner. Rings stop spinning,
   expand to a locked diamond, inner ring grows + rotates as the focal
   indicator. Per-ring transition-delays sequence the settle. */
.sm-loading__spinner.is-arrived {
    animation: smLockPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes smLockPop {
    0%   { transform: scale(1); filter: drop-shadow(0 0 0 rgba(139, 92, 246, 0)); }
    40%  { transform: scale(0.85); filter: drop-shadow(0 0 24px rgba(139, 92, 246, 0.8)); }
    100% { transform: scale(1.06); filter: drop-shadow(0 0 18px rgba(139, 92, 246, 0.55)); }
}

/* When the form "locks in" the match, flash the heading purple, bump
   the confidence copy, and crossfade the strings in. */
.sm-loading.is-locked h2 {
    color: #ede9fe;
    animation: smLockTextPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.sm-loading.is-locked p {
    animation: smFadeIn 0.5s ease-out 0.15s both;
}

@keyframes smLockTextPop {
    0%   { transform: translateY(6px); opacity: 0; letter-spacing: 0; }
    60%  { transform: translateY(-2px); opacity: 1; letter-spacing: 0.02em; }
    100% { transform: translateY(0); opacity: 1; letter-spacing: 0; }
}

.sm-loading__spinner.is-arrived .sm-loading__ring {
    animation: none;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sm-loading__spinner.is-arrived .sm-loading__ring--outer {
    width: 100%;
    height: 100%;
    transform: rotate(45deg);
}

.sm-loading__spinner.is-arrived .sm-loading__ring--middle {
    width: 100%;
    height: 100%;
    transform: rotate(45deg);
    transition-delay: 0.1s;
    filter: drop-shadow(0 0 12px color-mix(in srgb, var(--sm-loader-primary) 80%, transparent));
}

.sm-loading__spinner.is-arrived .sm-loading__ring--inner {
    width: 55%;
    height: 55%;
    border-color: var(--sm-loader-secondary);
    transform: rotate(135deg);
    transition-delay: 0.15s;
}

.sm-loading h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
}

.sm-loading p {
    color: hsla(0, 0%, 100%, 0.6);
    max-width: 440px;
    margin: 0 auto;
    line-height: 1.55;
}

.sm-loading__countdown {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    margin-top: 16px;
    padding: 8px 14px;
    border: 1px solid rgba(139, 92, 246, 0.28);
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.12);
    color: #c4b5fd;
    font-size: 13px;
    font-weight: 700;
}

/* ---------- Hero ---------- */

.smart-match-main .back-to-home {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: hsl(var(--white) / 0.8);
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 20px;
    padding: 8px 0;
    transition: all 0.3s ease;
}

.smart-match-main .back-to-home:hover {
    color: #a78bfa;
    transform: translateX(-6px);
}

.smart-match-main .back-to-home i {
    font-size: 18px;
}

.smart-match-main .sm-hero {
    padding: 48px 0 28px;
    border-bottom: 1px solid #5c5c5c;
    background:
        radial-gradient(circle at 20% 0%, rgba(139, 92, 246, 0.32), transparent 60%),
        #0d0d0d;
}

.smart-match-main .sm-hero__content {
    max-width: 720px;
}

.smart-match-main .sm-hero__kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #a78bfa;
    margin-bottom: 10px;
}

.smart-match-main .sm-hero h1 {
    font-family: var(--font-display);
    font-size: 38px;
    font-weight: 800;
    color: var(--text-primary, #fff);
    margin-bottom: 8px;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.smart-match-main .sm-hero p {
    color: var(--text-secondary, hsla(0, 0%, 100%, 0.65));
    font-size: 16px;
    line-height: 1.6;
}

.smart-match-main .sm-hero .container {
    max-width: 1680px;
    padding-left: 24px;
    padding-right: 24px;
}

/* ============================================================
   MOBILE LAYOUT (<=720px) - focused-flow redesign
   Edge-to-edge shell, fixed progress band under the site header,
   sticky bottom nav. --sm-header-h / --sm-progress-h drive the
   vertical rhythm so step content always clears the band.
   ============================================================ */
@media (max-width: 720px) {
    .smart-match-main {
        --sm-header-h: 80px;
        --sm-progress-h: 74px;
        background: #0d0d0f;
    }

    .smart-match-main .sm-hero {
        display: none;
    }

    .smart-match-section {
        padding: 0 !important;
    }

    .smart-match-section .container {
        padding: 0 !important;
        max-width: none !important;
        margin: 0;
    }

    /* Zero out every wrapper between body and progress bar so
       parent padding can't push the band downward. */
    .smart-match-main,
    .smart-match-section,
    .smart-match-section > .container,
    .smart-match-shell,
    .smart-match-form {
        margin-top: 0 !important;
        padding-top: 0;
    }

    .smart-match-form > *:first-child {
        margin-top: 0;
    }

    /* Full-bleed flow, not a card. */
    .smart-match-shell {
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        max-width: none;
        min-height: calc(100vh - var(--sm-header-h));
        display: flex;
        flex-direction: column;
    }

    .smart-match-form {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    /* Fixed (not sticky) - sticky inherits parent flow and gets pushed
       down by body padding / offcanvas / toast wrappers. Bar reordered
       above the meta line so the purple fill sits highest. */
    .sm-progress {
        position: fixed;
        top: var(--sm-header-h);
        left: 0;
        right: 0;
        z-index: 10;
        margin: 0;
        padding: 12px 18px 10px;
        background: rgba(13, 13, 15, 0.96);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .sm-loading {
        display: flex;
        flex-direction: column;
    }

    .sm-loading .sm-progress {
        position: fixed;
        top: var(--sm-header-h);
        order: -1;
    }

    /* Compensate for the out-of-flow progress band. */
    .smart-match-form {
        padding-top: var(--sm-progress-h);
    }

    .sm-progress__bar {
        height: 4px;
        order: 1;
    }

    .sm-progress__meta {
        order: 2;
        margin: 0;
    }

    .sm-progress__step {
        font-size: 10.5px;
        letter-spacing: 0.14em;
    }

    .sm-progress__percent {
        font-size: 12px;
    }

    /* scroll-margin-top is a safety net for scrollIntoView calls. */
    .sm-step {
        padding: 28px 18px 32px;
        flex: 1;
        scroll-margin-top: calc(var(--sm-header-h) + var(--sm-progress-h) + 8px);
    }

    .sm-step__header {
        margin-bottom: 24px;
        scroll-margin-top: calc(var(--sm-header-h) + var(--sm-progress-h) + 8px);
    }

    .sm-step__title {
        font-size: clamp(22px, 6vw, 28px);
    }

    .sm-step__subtitle {
        font-size: 14px;
    }

    .sm-option__card {
        padding: 18px 12px;
        min-height: 112px;
        gap: 12px;
    }

    .sm-option__card--wide {
        padding: 16px 18px;
        min-height: 76px;
    }

    .sm-option__icon--role {
        width: 50px;
        height: 50px;
    }

    .sm-options--ranks .sm-option__rank-img {
        width: 40px;
        height: 40px;
    }

    /* font-size: 16px on inputs prevents iOS zoom-on-focus. */
    .sm-note {
        min-height: 180px;
        font-size: 16px;
    }

    .sm-champ-search input,
    .sm-lang-search input {
        font-size: 16px;
        padding: 16px 44px 16px 18px;
    }

    .sm-champ-grid,
    .sm-lang-grid {
        max-height: 240px;
    }

    /* Sticky bottom nav - iOS accessory-bar pattern. */
    .sm-nav {
        position: sticky;
        bottom: 0;
        z-index: 10;
        margin-top: auto;
        padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px));
        background: #0d0d0f;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        gap: 10px;
    }

    .sm-nav__back {
        flex: 0 0 auto;
        padding: 14px 18px;
        font-size: 14px;
    }

    .sm-nav__next,
    .sm-nav__submit {
        flex: 1;
        padding: 16px 20px;
        font-size: 15px;
        font-weight: 700;
    }

}

@media (max-width: 380px) {
    .sm-options--cols-3 { --sm-cols: 2; }
    .sm-options--cols-2 { --sm-cols: 1; }
}
