/* UI refresh (docs/design/refresh): online. Loaded after style.css; see refresh/base.css for the tokens. */

/* === ONLINE SCREEN === */
#screen-online .top {
    height: 44px;
    padding: 0;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}
#screen-online .top b {
    flex: 1;
    margin: 0;
    font: 700 26px/normal var(--rf-font-display);
    color: var(--rf-text);
}
#screen-online .top .back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 22px;
    border: 1px solid var(--rf-line);
    background: var(--rf-surface);
    color: var(--rf-text);
    padding: 0;
}
#screen-online .top .chip {
    display: none;
}

#onl-quick {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    border-radius: 20px;
    background: var(--rf-surface);
    border: 1px solid var(--rf-line);
    margin: 0;
}

#onl-quick > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
#onl-quick > div:first-child b {
    font: 700 18px/normal var(--rf-font-display);
    color: var(--rf-text);
}
#onl-quick > div:first-child p {
    font: 400 13px/normal var(--rf-font-sans);
    letter-spacing: 0;
    text-transform: none;
    color: var(--rf-sub);
    margin: 0;
}

#onl-tcs, #onl-mode, #cl-tcs, #cl-modes {
    display: flex;
    gap: 8px;
}
#onl-tcs button, #onl-mode button, #cl-tcs button, #cl-modes button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 56px;
    border-radius: 12px;
    border: 1px solid var(--rf-line);
    background: var(--rf-surface-2);
    color: var(--rf-text);
    cursor: pointer;
    padding: 1px 6px;
}
/* Five time chips (with "Any") share the sheet's width. */
#cl-tcs button { padding: 1px 4px; }
#onl-tcs button span:first-child, #onl-mode button span:first-child, #cl-tcs button span:first-child, #cl-modes button span:first-child {
    font: 800 15px/normal var(--rf-font-sans);
}
#onl-tcs button .sub, #onl-mode button .sub, #cl-tcs button .sub, #cl-modes button .sub {
    font: 600 11px/normal var(--rf-font-sans);
    color: var(--rf-sub);
}
#onl-tcs button.on, #onl-mode button.on, #cl-tcs button.on, #cl-modes button.on {
    border-color: color-mix(in srgb, var(--rf-accent) 50%, transparent);
    background: color-mix(in srgb, var(--rf-accent) 12%, transparent);
}
#onl-tcs button.on span:first-child, #onl-mode button.on span:first-child, #cl-tcs button.on span:first-child, #cl-modes button.on span:first-child {
    color: var(--rf-accent);
}
#onl-tcs button.on .sub, #onl-mode button.on .sub, #cl-tcs button.on .sub, #cl-modes button.on .sub {
    font-weight: 700;
    color: var(--rf-accent);
}

#onl-find {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 52px;
    border: 0;
    border-radius: 14px;
    background: var(--rf-accent);
    color: var(--rf-accent-text);
    font: 800 15px/normal var(--rf-font-sans);
    letter-spacing: 0.9px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 8px 24px color-mix(in srgb, var(--rf-accent) 22%, transparent);
}
#onl-find * {
    text-transform: uppercase;
}

#screen-online .hdr-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 0;
}
#screen-online .hdr-row h2 {
    margin: 0;
    font: 800 12px/normal var(--rf-font-sans);
    letter-spacing: 1.68px;
    text-transform: uppercase;
    color: var(--rf-text-2);
}
#screen-online .hdr-row .link {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 44px;
    font: 700 14px/normal var(--rf-font-sans);
    color: var(--rf-accent);
    text-decoration: none;
    background: none;
    border: 0;
    padding: 0;
}

#screen-online .filters {
    display: flex;
    gap: 8px;
    margin-top: -8px;
}
#screen-online .filters button {
    flex: 1;
    height: 44px;
    border-radius: 22px;
    border: 1px solid var(--rf-line);
    background: var(--rf-surface);
    color: var(--rf-text-2);
    font: 700 14px/normal var(--rf-font-sans);
    cursor: pointer;
    padding: 1px 6px;
}
#screen-online .filters button.on {
    border-color: var(--rf-accent);
    color: var(--rf-accent-text);
    background: var(--rf-accent);
    font-weight: 800;
}

/* Lobby list items */
.lobby.list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-radius: 18px;
    background: var(--rf-surface);
    border: 1px solid var(--rf-line);
    overflow: hidden;
}
.lobby.list li , .games.list li {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 67px;
    padding: 0 10px 0 14px;
    border: 0;
    background: transparent;
    border-bottom: 0;
}
.lobby.list li:last-child {
    height: 66px;
}
.lobby.list li.muted , .games.list li.muted {
    justify-content: center;
    color: var(--rf-sub);
    height: auto;
    padding: 16px;
}
.lobby.list .tap-area , .games.list .tap-area {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}
.lobby.list .ava-wrap , .games.list .ava-wrap {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 21px;
    position: relative;
    background: #1e2338;
    box-shadow: 0 0 0 2px var(--rf-surface), 0 0 0 4px #f2d27a, 0 0 12px color-mix(in srgb, var(--rf-accent) 55%, transparent);
}
.lobby.list .info , .games.list .info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.lobby.list .info .name , .games.list .info .name {
    font: 700 15px/normal var(--rf-font-sans);
    color: var(--rf-text);
}
.lobby.list .info .elo , .games.list .info .elo {
    font: 400 12px/normal var(--rf-font-sans);
    color: var(--rf-sub);
}
.lobby.list button.challenge , .games.list button.challenge {
    flex: 0 0 auto;
    height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--rf-accent);
    background: transparent;
    color: var(--rf-accent);
    font: 800 14px/normal var(--rf-font-sans);
    cursor: pointer;
}
.lobby.list button.watch , .games.list button.watch {
    flex: 0 0 auto;
    height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--rf-card-line);
    background: var(--rf-surface-2);
    color: var(--rf-text-2);
    font: 700 14px/normal var(--rf-font-sans);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* === FRIENDS SCREEN === */
#screen-friends .top {
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}
#screen-friends .top b {
    flex: 1;
    margin: 0;
    font: 700 26px/normal var(--rf-font-display);
    color: var(--rf-text);
}
#screen-friends .top .back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 22px;
    border: 1px solid var(--rf-line);
    background: var(--rf-surface);
    color: var(--rf-text);
    padding: 0;
}
#screen-friends .top .chip {
    display: flex;
    align-items: center;
    height: 34px;
    padding: 0 12px;
    border-radius: 16px;
    border: 1px solid var(--rf-card-line);
    background: transparent;
    color: var(--rf-accent);
    font: 800 13px/normal var(--rf-font-sans);
}

#screen-friends .match.card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    border-radius: 22px;
    background: linear-gradient(150deg, rgb(58, 46, 18) 0%, rgb(21, 19, 15) 70%);
    border: 1px solid color-mix(in srgb, var(--rf-accent) 50%, transparent);
    margin: 0;
}
#screen-friends .match.card .bg-icon {
    position: absolute;
    right: -14px;
    top: -10px;
    width: 130px;
    height: 130px;
    color: color-mix(in srgb, var(--rf-accent) 16%, transparent) !important;
}
#screen-friends .match.card b {
    position: relative;
    margin: 0;
    font: 700 22px/normal var(--rf-font-display);
    color: var(--rf-text);
}
#screen-friends .match.card p {
    position: relative;
    margin: 0;
    max-width: 260px;
    font: 400 14px/20.3px var(--rf-font-sans);
    color: var(--rf-text-2);
}
#fr-invite {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 50px;
    margin-top: 6px;
    border: 0;
    border-radius: 14px;
    background: var(--rf-accent);
    color: var(--rf-accent-text);
    font: 800 15px/normal var(--rf-font-sans);
    cursor: pointer;
    padding: 1px 6px;
}
#screen-friends h2 {
    margin: 4px 0 0;
    font: 800 12px/normal var(--rf-font-sans);
    letter-spacing: 1.68px;
    text-transform: uppercase;
    color: var(--rf-text-2);
}
#screen-friends h2[data-t="offline"] {
    color: var(--rf-sub);
}
#screen-friends ul.lobby.list {
    margin-top: -4px;
}
#screen-friends ul.lobby.list:last-of-type {
    margin-bottom: 0;
}

#online-chip::before, #fr-chip::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 4px;
    margin-right: 6px;
    background: #34c759;
}
html[data-tier="premium"] #online-chip::before, html[data-tier="premium"] #fr-chip::before {
    background: var(--rf-accent);
    box-shadow: 0 0 8px rgba(217, 181, 86, 0.6);
}

/* === INCOMING CHALLENGE & CHALLENGE LINK ACCEPT === */
#incoming, #cl-accept {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    border-radius: 26px;
    background: var(--rf-surface);
    border: 1px solid color-mix(in srgb, var(--rf-accent) 45%, transparent);
    box-shadow: 0 -10px 60px rgba(0, 0, 0, 0.6), 0 0 40px color-mix(in srgb, var(--rf-accent) 12%, transparent);
    overflow: hidden;
    z-index: 1000;
}
#incoming .timer-bar-wrap {
    position: absolute;
    left: 0;
    top: 0;
    height: 3px;
    width: 100%;
    background: color-mix(in srgb, var(--rf-text) 8%, transparent);
}
#incoming .timer-bar {
    height: 3px;
    background: var(--rf-accent);
    animation: cfo-timer 60s linear forwards;
}
@keyframes cfo-timer {
    from { width: 100%; }
    to { width: 0%; }
}
#incoming .inc-top, #cl-accept .inc-top {
    display: flex;
    align-items: center;
    gap: 14px;
}
#inc-ava, #cl-accept-ava {
    flex: 0 0 auto;
    width: 66px !important;
    height: 66px !important;
    border-radius: 33px !important;
    border: 3px solid var(--rf-accent) !important;
    position: relative;
    box-shadow: 0 0 0 14px transparent;
    background: var(--rf-surface-elevated) !important;
}
#inc-ava .cx-avatar-inner {
    background: transparent !important;
    color: #EADBB0 !important;
    font: 700 24px/normal var(--rf-font-display) !important;
}
#incoming .inc-title, #cl-accept .inc-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
#incoming .inc-sub, #cl-accept .inc-sub {
    font: 800 11px/normal var(--rf-font-sans);
    letter-spacing: 1.76px;
    text-transform: uppercase;
    color: var(--rf-accent);
}
#incoming .inc-main, #cl-accept .inc-main {
    font: 700 22px/25.3px var(--rf-font-display);
    color: var(--rf-text);
}
#incoming .inc-grid, #cl-accept .inc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
#incoming .inc-stat, #cl-accept .inc-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--rf-surface);
    border: 1px solid var(--rf-card-line);
}
#incoming .inc-stat .muted, #cl-accept .inc-stat .muted {
    font: 400 11px/normal var(--rf-font-sans);
    color: var(--rf-sub);
}
#incoming .inc-stat .val, #cl-accept .inc-stat .val {
    font: 800 15px/normal var(--rf-font-sans);
    color: var(--rf-text);
}
#incoming .incoming-actions, #cl-accept .incoming-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
#incoming button, #cl-accept button {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    border-radius: 14px;
    font: 700 15px/normal var(--rf-font-sans);
    cursor: pointer;
}
#incoming-decline, #cl-accept-decline {
    border: 1px solid var(--rf-line-2);
    background: var(--rf-surface);
    color: var(--rf-text);
}
#incoming-accept, #cl-accept-btn {
    border: 0;
    background: var(--rf-accent);
    color: var(--rf-accent-text);
    font: 800 15px/normal var(--rf-font-sans);
    letter-spacing: 0.9px;
    text-transform: uppercase;
}
#incoming-overlay, #cl-accept-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 4, 3, 0.55);
    z-index: 999;
}

/* === CHALLENGE LINK SHEET & BUTTONS === */
#screen-challenge-link .sheet {
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 16px 20px 28px;
}
#screen-challenge-link .title {
    margin: 0 0 16px;
    font: 700 22px/normal var(--rf-font-display);
    color: var(--rf-text);
    text-align: left;
}
#screen-challenge-link .cl-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
#screen-challenge-link .tc-label {
    margin: 0;
    font: 600 12px/normal var(--rf-font-sans);
    color: var(--rf-sub);
}
#screen-challenge-link .cl-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--rf-surface-2);
    border-radius: 12px;
}
#screen-challenge-link .cl-row .muted {
    font: 500 13px/normal var(--rf-font-sans);
    color: var(--rf-sub);
}
#screen-challenge-link .cl-row .val {
    font: 700 15px/normal var(--rf-font-sans);
    color: var(--rf-text);
}
#cl-send-btn {
    margin-top: 8px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 14px;
    background: var(--rf-accent);
    color: var(--rf-accent-text);
    font: 800 15px/normal var(--rf-font-sans);
    letter-spacing: 0.9px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 8px 24px color-mix(in srgb, var(--rf-accent) 22%, transparent);
}
#cl-send-btn * {
    text-transform: uppercase;
}
#fr-challenge-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 50px;
    border-radius: 14px;
    border: 1px solid var(--rf-card-line);
    background: var(--rf-surface);
    color: var(--rf-text);
    font: 800 15px/normal var(--rf-font-sans);
    cursor: pointer;
    padding: 1px 6px;
}

/* === LEADERBOARD SCREEN === */
#screen-leaders .game-top {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 44px;
}
#screen-leaders .game-top .link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 22px;
    border: 1px solid var(--rf-line);
    background: var(--rf-surface);
    color: var(--rf-text);
    padding: 0;
}
#screen-leaders .game-top b {
    flex: 1;
    margin: 0;
    font: 700 26px/normal var(--rf-font-display);
    color: var(--rf-text);
}
#screen-leaders .chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-top: 14px;
}
#screen-leaders .chips button {
    height: 38px;
    padding: 1px 16px;
    border-radius: 19px;
    border: 1px solid var(--rf-line);
    background: var(--rf-surface);
    color: var(--rf-text-2);
    font: 700 14px/normal var(--rf-font-sans);
    white-space: nowrap;
    cursor: pointer;
}
#screen-leaders .chips button.on {
    border-color: var(--rf-accent);
    color: var(--rf-accent-text);
    background: var(--rf-accent);
    font-weight: 800;
}
#screen-leaders .podium {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    align-items: flex-end;
    margin-top: 14px;
}
#screen-leaders .podium-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
#screen-leaders .podium-place .ava-wrap {
    border-radius: 50%;
}
#screen-leaders .podium-place.place-2 .ava-wrap {
    width: 60px; height: 60px;
    box-shadow: 0 0 0 2px var(--rf-bg), 0 0 0 5px #f2d27a, 0 0 16px color-mix(in srgb, var(--rf-accent) 55%, transparent);
}
#screen-leaders .podium-place.place-1 .ava-wrap {
    width: 72px; height: 72px;
    box-shadow: 0 0 0 2px var(--rf-bg), 0 0 0 5px #6d28d9, 0 0 22px 6px rgba(30, 27, 75, 0.9);
}
#screen-leaders .podium-place.place-3 .ava-wrap {
    width: 60px; height: 60px;
    box-shadow: 0 0 0 2px var(--rf-bg), 0 0 0 5px #fb923c, 0 0 16px #ea580c;
}
#screen-leaders .podium-place .crown {
    color: var(--rf-accent);
    margin-bottom: -4px;
}
#screen-leaders .podium-place .name {
    font: 800 14px/normal var(--rf-font-sans);
    color: var(--rf-text);
}
#screen-leaders .podium-place .bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
    width: 100%;
    padding-top: 10px;
    box-sizing: border-box;
    border-radius: 14px 14px 0px 0px;
    border-style: solid solid none;
    border-width: 1px 1px 0px;
    position: relative;
    overflow: hidden;
}
#screen-leaders .podium-place.place-2 .bar {
    height: 74px; background: linear-gradient(var(--rf-surface-2) 0%, var(--rf-surface) 100%); border-color: var(--rf-card-line);
}
#screen-leaders .podium-place.place-1 .bar {
    height: 96px; background: linear-gradient(#5a4618 0%, #1c170c 100%); border-color: var(--rf-accent);
}
#screen-leaders .podium-place.place-3 .bar {
    height: 60px; padding-top: 8px; background: linear-gradient(#33231a 0%, var(--rf-surface) 100%); border-color: #4a3426;
}
#screen-leaders .podium-place .bar .rank {
    font-family: var(--rf-font-display);
    font-weight: 900;
}
#screen-leaders .podium-place.place-2 .bar .rank { font: 900 26px/normal var(--rf-font-display); color: var(--rf-text-2); }
#screen-leaders .podium-place.place-1 .bar .rank { font: 900 30px/normal var(--rf-font-display); color: var(--rf-accent); }
#screen-leaders .podium-place.place-3 .bar .rank { font: 900 24px/normal var(--rf-font-display); color: #e8a27b; }
#screen-leaders .podium-place .bar .val {
    font: 800 13px/normal var(--rf-font-sans);
    color: var(--rf-sub);
}
#screen-leaders .podium-place.place-1 .bar .val { font-size: 14px; color: var(--rf-text); }

#screen-leaders .board-list {
    list-style: none;
    margin: -14px 0 0;
    padding: 0;
    border-radius: 18px;
    background: var(--rf-surface);
    border: 1px solid var(--rf-line);
    overflow: hidden;
}
#screen-leaders .board-list.lb-me {
    display: none;
}
#screen-leaders .board-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 57px;
    padding: 0 16px;
}
#screen-leaders .board-list li.me {
    background: color-mix(in srgb, var(--rf-accent) 12%, transparent);
    box-shadow: inset 3px 0 0 0 var(--rf-accent);
}
#screen-leaders .lb-rank {
    width: 22px;
    font: 700 14px/normal var(--rf-font-sans);
    color: var(--rf-sub);
}
#screen-leaders .board-list li.me .lb-rank {
    font-weight: 800; color: var(--rf-accent);
}
#screen-leaders .ava-wrap {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 17px;
    border: 1px solid var(--rf-card-line);
    position: relative;
    background: var(--rf-surface-elevated);
}
#screen-leaders .board-list li.me .ava-wrap {
    width: 34px; height: 34px; border: 0;
    box-shadow: 0 0 0 2px var(--rf-surface), 0 0 0 3.5px #5ee7f2;
}
#screen-leaders .lb-name {
    flex: 1;
    font: 700 15px/normal var(--rf-font-sans);
    color: var(--rf-text);
}
#screen-leaders .board-list li.me .lb-name {
    font-weight: 800;
}
#screen-leaders .board-list li.me .lb-name::after {
    content: "(you)";
    margin-left: 4px;
    font: 700 12px/normal var(--rf-font-sans);
    color: var(--rf-accent);
}
#screen-leaders .lb-val {
    font: 800 15px/normal var(--rf-font-sans);
    color: var(--rf-text-2);
}
#screen-leaders .board-list li.me .lb-val {
    color: var(--rf-accent);
}

#screen-leaders .sticky-footer {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 66px;
    padding: 0 16px;
    border-radius: 18px;
    background: var(--rf-surface);
    border: 1px solid var(--rf-accent);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
    z-index: 10;
    position: fixed;
    bottom: 90px;
}
#screen-leaders .sticky-footer .your-rank {
    font: 800 12px/normal var(--rf-font-sans);
    letter-spacing: 1.44px;
    text-transform: uppercase;
    color: var(--rf-sub);
}
#screen-leaders .sticky-footer .rank-num {
    font: 900 24px/normal var(--rf-font-display);
    color: var(--rf-accent);
}
#screen-leaders .sticky-footer .spacer {
    flex: 1;
}
#screen-leaders .sticky-footer .gap {
    font: 400 13px/normal var(--rf-font-sans);
    color: var(--rf-text-2);
}

#screen-leaders #lb-list {
    padding-bottom: 96px;
}

/* === OPP PROFILE === */
#screen-opp-profile {
    padding: 0;
    gap: 0;
}


#screen-opp-profile .prof-top {
    padding: 14px 16px;
}
#screen-opp-profile .prof-top .back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 22px;
    border: 1px solid color-mix(in srgb, var(--rf-text) 22%, transparent);
    background: color-mix(in srgb, var(--rf-bg) 55%, transparent);
    color: #fff;
    padding: 0;
}






#screen-opp-profile .hero-row .prof-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font: 800 12px/normal var(--rf-font-sans);
    letter-spacing: 0.96px;
    text-transform: uppercase;
    color: var(--rf-accent);
}













#screen-opp-profile .opp-actions-row {
    margin-top: 2px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}
#opp-challenge-btn {
    height: 52px;
    border-radius: 14px;
    border: 0;
    background: var(--rf-accent);
    color: var(--rf-accent-text);
    font: 800 15px/normal var(--rf-font-sans);
    letter-spacing: 0.9px;
    text-transform: uppercase;
    box-shadow: 0 8px 24px color-mix(in srgb, var(--rf-accent) 22%, transparent);
    cursor: pointer;
    padding: 1px 6px;
}
#opp-add-friend-btn {
    height: 52px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid var(--rf-card-line);
    background: color-mix(in srgb, var(--rf-surface) 88%, transparent);
    color: var(--rf-text);
    font: 700 14px/normal var(--rf-font-sans);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}


/* === ARCHIVE SCREEN === (page and lists in base.css) */
#screen-archive ul.games.list {
    margin: 0; padding: 0; list-style: none; overflow: hidden;
    background: var(--rf-surface); border: 1px solid var(--rf-card-line); border-radius: 18px;
}
#screen-archive ul.games.list li { height: 65px; padding: 0 10px 0 12px; border-bottom: 1px solid var(--rf-line); }
#screen-archive ul.games.list li.done { padding-right: 4px; }
#screen-archive ul.games.list li:last-child { border-bottom: 0; }
#screen-archive .games.list .ava-wrap {
    width: 40px; height: 40px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
    background: radial-gradient(circle at 40% 32%, var(--rf-ava-a) 0%, var(--rf-ava-b) 75%);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--rf-accent) 60%, transparent);
    font: 700 14px var(--rf-font-display); color: var(--rf-text);
}
#screen-archive .games.list .ava-wrap img { width: 100%; height: 100%; object-fit: cover; }
#screen-archive .games.list .res-tile {
    width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center;
    font: 900 15px var(--rf-font-sans); background: color-mix(in srgb, var(--rf-accent) 16%, transparent); color: var(--rf-accent);
}
#screen-archive .games.list .res-tile.res-l { background: color-mix(in srgb, var(--rf-hot) 16%, transparent); color: var(--rf-hot); }
#screen-archive .games.list .res-tile.res-d { background: var(--rf-surface-2); color: var(--rf-sub); }
#screen-archive .games.list .info .name { font: 700 15px var(--rf-font-sans); color: var(--rf-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#screen-archive .games.list .info .elo { font: 400 12px var(--rf-font-sans); color: var(--rf-sub); }
#screen-archive .games.list .info .elo.live { font-weight: 700; color: var(--rf-accent); }
#screen-archive .games.list .right { display: flex; align-items: center; gap: 12px; flex: none; }
#screen-archive .games.list .delta { font: 800 15px var(--rf-font-sans); }
#screen-archive .games.list .delta.res-w { color: var(--rf-accent); }
#screen-archive .games.list .delta.res-l { color: var(--rf-hot); }
#screen-archive .games.list button.review { width: 44px; height: 44px; padding: 0 !important; display: grid; place-items: center; background: none; color: var(--rf-sub); }
#screen-archive .games.list button.challenge {
    height: 44px; padding: 0 14px; border: 0; background: var(--rf-accent); color: var(--rf-accent-text);
    font: 800 14px var(--rf-font-sans); border-radius: 12px !important;
}

#screen-archive .top .chip {
    display: flex; align-items: center; height: 34px; padding: 0 12px; box-sizing: border-box;
    border-radius: 16px; border: 1px solid var(--rf-line-2); background: transparent;
    color: var(--rf-accent); font: 800 13px var(--rf-font-sans); letter-spacing: 0; text-transform: none;
}

/* Empty lists draw nothing (they showed as stray lines and an empty card). */
#screen-friends ul.lobby.list:empty, #screen-friends h2:has(+ ul.lobby.list:empty), #screen-leaders #lb-list:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
  #incoming {
    transition: opacity 0.18s ease !important;
  }
}

/* Quick match, #65: any time control, the search, no one found */
#onl-quick .qm-head { display: flex; flex-direction: column; gap: 2px; }
#onl-tcs button.pref { border-style: dashed; border-color: color-mix(in srgb, var(--rf-accent) 45%, transparent); }
#onl-anytc {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
    min-height: 52px; margin: 0; padding: 8px 8px 8px 14px; box-sizing: border-box; text-align: left;
    border-radius: 12px; border: 1px solid var(--rf-line); background: var(--rf-surface-2); color: var(--rf-text); cursor: pointer;
}
#onl-anytc .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#onl-anytc b { font: 800 14px/normal var(--rf-font-sans); }
#onl-anytc .sub { font: 600 11px/normal var(--rf-font-sans); color: var(--rf-sub); }
#onl-anytc.on { border-color: color-mix(in srgb, var(--rf-accent) 50%, transparent); background: color-mix(in srgb, var(--rf-accent) 12%, transparent); }
#onl-anytc.on b { color: var(--rf-accent); }
#onl-quick.searching :is(#onl-tcs, #onl-anytc, #onl-mode) { opacity: .45; pointer-events: none; }

#onl-search {
    display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px;
    background: rgba(74, 222, 128, 0.07); border: 1px solid rgba(74, 222, 128, 0.25);
}
#onl-search.hidden { display: none; }
#onl-quick.notfound #onl-search { background: var(--rf-surface-2); border-color: var(--rf-line); }
#onl-search .search-row { display: flex; align-items: center; gap: 10px; }
#onl-search .search-row b { flex: 1; font: 800 15px/normal var(--rf-font-sans); color: var(--rf-text); }
#onl-search-time { font: 700 14px/normal var(--rf-font-sans); color: var(--rf-text-2); font-variant-numeric: tabular-nums; }
#onl-search .muted { margin: 0; font: 500 13px/1.4 var(--rf-font-sans); color: var(--rf-text-2); }
#onl-search .spin {
    flex: none; width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid rgba(74, 222, 128, 0.25); border-top-color: #4ADE80; animation: onl-spin .9s linear infinite;
}
#onl-quick.notfound #onl-search .spin { display: none; }
#onl-search .search-bar { height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--rf-text) 10%, transparent); overflow: hidden; }
#onl-search .search-bar i { display: block; height: 100%; width: 0; background: #4ADE80; border-radius: 2px; transition: width 1s linear; }
#onl-quick.notfound .search-bar { display: none; }
#onl-find.cancel { background: var(--rf-surface-elevated) !important; color: var(--rf-text) !important; box-shadow: inset 0 0 0 1px var(--rf-line-2) !important; }
#onl-bot { margin: 0; height: 48px; border-radius: 14px; font: 800 14px/normal var(--rf-font-sans); text-transform: none !important; }
#onl-bot.hidden { display: none; }
.lobby.list .info .elo.looking { color: #6EE7A0; }
@keyframes onl-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    #onl-search .spin { animation: none; border-color: #4ADE80; }
    #onl-search .search-bar i { transition: none; }
}

/* The label over the challenge time controls (lead, 2026-10-10: the row read as a second Quick match row). */
#screen-online .tc-label { margin: -4px 2px 8px; font-size: 12px; }
