/* refresh/home-play.css */




/* Base styles for the package */
button { font-family: inherit; }

/* Home — measured from the design (UI refresh 1, "Home"). */
#screen-home.active {
  display: flex; flex-direction: column; gap: 16px;
  padding: 16px 20px 108px; min-height: 100vh; box-sizing: border-box;
  background: var(--rf-gradient-bg); color: var(--rf-text);
  font-family: var(--rf-font-sans);
}
#screen-home header.top {
  position: static; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 0; margin: 0; height: 44px; background: none;
}
#screen-home .me { display: flex; align-items: center; gap: 12px; min-width: 0; cursor: pointer; }
#screen-home .ava-wrap {
  width: 44px; height: 44px; border-radius: 50%; border: 0; flex: none;
  display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--rf-bg), 0 0 0 3px var(--rf-accent);
}
#screen-home .ava { width: 44px; height: 44px; border-radius: 50%; background: var(--rf-surface-elevated); }
#screen-home .me-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#screen-home .me-text b { font: 800 16px var(--rf-font-sans); letter-spacing: .02em; color: var(--rf-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#screen-home .me-text .muted { font-size: 12px; color: var(--rf-sub); }
#screen-home .elo-btn {
  display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; box-sizing: border-box;
  background: var(--rf-surface); border: 1px solid var(--rf-line-2); border-radius: 18px;
  color: var(--rf-accent); font: 800 15px var(--rf-font-sans); letter-spacing: 0; text-transform: none; cursor: pointer;
}
#screen-home .elo-btn::before { content: none; }
#screen-home .elo-btn svg { width: 16px; height: 16px; }

/* Wearing a wardrobe: a pill with its name in the wardrobe's font (design "Wearing it"). */
#screen-home #home-wearing:not(.hidden) {
  display: flex; align-items: center; gap: 10px; align-self: center; height: 46px; padding: 0 8px 0 14px; box-sizing: border-box;
  background: color-mix(in srgb, var(--card, #171010) 95%, transparent); border: 1px solid var(--rf-accent); border-radius: 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .6), 0 0 20px color-mix(in srgb, var(--rf-accent) 30%, transparent);
  font: 700 13px var(--rf-font-sans); color: var(--rf-text);
}
#screen-home #home-wearing .dot { color: var(--rf-accent); font-size: 10px; }
#screen-home #home-wearing #home-wearing-name { font: 700 15px var(--rf-font-display); color: var(--rf-accent-2, var(--rf-accent)); }
#screen-home #home-wearing .divider { display: none; }
#screen-home #home-wearing button {
  height: 30px; padding: 0 10px !important; border-radius: 15px !important; background: color-mix(in srgb, var(--rf-text) 8%, transparent);
  color: var(--rf-text-2); font: 700 12px var(--rf-font-sans);
}
[data-tier="premium"] #screen-home .card.bots {
  background: radial-gradient(60% 80% at 50% 120%, color-mix(in srgb, var(--rf-accent) 60%, transparent) 0%, transparent 70%), var(--card, #171010);
  border-color: color-mix(in srgb, var(--rf-accent) 25%, transparent);
}
[data-tier="premium"] #screen-home .bots .label { color: rgba(255, 255, 255, .8); }
[data-tier="premium"] #screen-home .bots-right { background: rgba(255, 255, 255, .1); box-shadow: 0 0 0 3px var(--rf-accent-2, var(--rf-accent)), 0 0 0 10px rgba(255, 255, 255, .06); }

/* Chess or checkers: one tap, beside the Elo it changes (owner, 2026-10-11). */
#screen-home .top-right { display: flex; align-items: center; gap: 8px; flex: none; }
#screen-home .segmented.kinds {
  display: flex; gap: 2px; margin: 0; padding: 3px; height: 38px; box-sizing: border-box;
  background: var(--rf-surface); border: 1px solid var(--rf-line-2); border-radius: 19px;
}
#screen-home .segmented.kinds button {
  display: grid; place-items: center; width: 34px; height: 30px; padding: 0;
  background: transparent; color: var(--rf-text-2); border-radius: 15px !important; box-shadow: none;
}
#screen-home .segmented.kinds button svg { width: 18px; height: 18px; }
#screen-home .segmented.kinds button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#screen-home .segmented.kinds button.on { background: var(--rf-accent); color: var(--rf-accent-text); }

#screen-home .hub.body { display: flex; flex-direction: column; gap: 16px; margin: 0; }
#screen-home .hub .card { margin: 0; box-shadow: none; cursor: pointer; }

/* Resume row */
#screen-home .resume.card:not(.hidden) {
  display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px;
  background: var(--rf-surface); border: 1px solid color-mix(in srgb, var(--rf-accent) 35%, transparent); border-radius: 18px;
}
#screen-home .ava-letter {
  width: 46px; height: 46px; flex: none; border-radius: 50%; overflow: hidden; box-sizing: border-box;
  display: grid; place-items: center; background: var(--rf-surface-elevated); border: 1px solid var(--rf-line-2);
  font: 700 16px var(--rf-font-display); color: var(--rf-accent);
}
#screen-home .ava-letter img, #screen-home .bots-letter img { width: 100%; height: 100%; object-fit: cover; display: block; }
#screen-home .resume .text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
#screen-home .resume .label { font: 800 11px var(--rf-font-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--rf-accent); margin: 0; }
#screen-home .resume b { font: 700 16px var(--rf-font-sans); color: var(--rf-text); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#screen-home .resume .muted { font-size: 12px; color: var(--rf-sub); }
#screen-home .resume .muted:empty { display: none; }
#screen-home .resume button.primary.small {
  flex: none; width: auto; height: 44px; padding: 0 18px !important; font: 800 14px var(--rf-font-sans) !important; white-space: nowrap;
}

/* Online hero: first and biggest (owner, #65: "make the online game the
   first thing in the menu and the bots second"). */
#screen-home #go-online.card.online {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 8px; box-sizing: border-box; padding: 20px;
  background: radial-gradient(90% 70% at 100% 0%, rgba(74, 222, 128, .13) 0%, transparent 60%), linear-gradient(160deg, #15251C 0%, #0F1511 100%);
  border: 1px solid #24402F; border-radius: 22px;
}
#screen-home .online-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 34px; }
#screen-home .card.online .label {
  display: flex; align-items: center; gap: 6px; margin: 0; min-width: 0; white-space: nowrap; overflow: hidden;
  font: 800 11px var(--rf-font-sans); letter-spacing: .14em; text-transform: uppercase; color: #6EE7A0;
  isolation: isolate; /* the dot's ring sits behind the dot, above the card */
}
#screen-home .card.online .looking { color: var(--rf-accent); }
#screen-home .card.online .looking::before { content: "·"; margin: 0 6px 0 2px; color: var(--rf-sub); }
#screen-home .card.online .live-dot {
  flex: none; width: 8px; height: 8px; border-radius: 50%; background: #4ADE80; margin: 0;
  position: relative; box-shadow: none; animation: none;
}
/* The ping as a growing, fading ring (transform + opacity) instead of an
   animated box-shadow: the GPU moves it, nothing repaints. The box-shadow made
   Chrome repaint the whole screen every frame, ~0.9 core on a phone (2026-10-12). */
#screen-home .card.online .live-dot::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 50%;
  background: rgba(74, 222, 128, .6); animation: ping-ring 1.6s infinite;
}
@keyframes ping-ring { 0% { transform: scale(1); opacity: 1; } 70% { transform: scale(3); opacity: 0; } 100% { transform: scale(1); opacity: 0; } }
#screen-home .online-faces { display: flex; flex: none; padding-left: 8px; }
#screen-home .online-faces > * { width: 34px; height: 34px; margin-left: -8px; border-radius: 50%; box-shadow: 0 0 0 2px #132019; flex: none; }
#screen-home .online-faces .more {
  display: grid; place-items: center; background: #1E3327; color: #CFEFDC; font: 800 11px var(--rf-font-sans);
}
#screen-home .card.online h2.serif { font: 700 32px/1.05 var(--rf-font-display); color: var(--rf-text); margin: 2px 0 0; text-transform: none; }
#screen-home .card.online p.muted { font-size: 13px; line-height: 1.35; color: var(--rf-text-2); margin: 0; }
#screen-home :is(#home-quick, #home-challenge-btn) {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 52px; margin: 8px 0 0; padding: 0 16px !important;
  font: 800 15px var(--rf-font-sans) !important; letter-spacing: .06em; text-transform: uppercase !important;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--rf-accent) 25%, transparent) !important;
}
#screen-home .home-secondary-link {
  display: inline-block;
  align-self: center;
  margin-top: 6px;
  background: none;
  border: none;
  padding: 4px 8px;
  font: 700 13px var(--rf-font-sans);
  color: var(--rf-accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: .9;
}
#screen-home .home-secondary-link:hover {
  opacity: 1;
}

/* Play vs bots: second, one row */
#screen-home .card.bots {
  position: relative; overflow: hidden; display: flex; flex-direction: row; align-items: center; gap: 14px; min-height: 0; box-sizing: border-box; padding: 14px 16px;
  background: linear-gradient(160deg, #1D1933 0%, #110F1B 100%); border: 1px solid #2D2943; border-radius: 20px;
}
#screen-home .bots-left { position: relative; z-index: 2; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 0; }
#screen-home .bots .label { font: 800 11px var(--rf-font-sans); letter-spacing: .18em; text-transform: uppercase; color: var(--rf-accent); margin: 0; }
#screen-home .bots .title.serif { font: 700 21px/1.1 var(--rf-font-display); color: var(--rf-text); margin: 0; max-width: none; text-transform: none; }
#screen-home .bots-progress { display: flex; flex-direction: column; gap: 5px; width: auto; max-width: 170px; margin: 2px 0 0; }
#screen-home .bots-progress span { font-size: 12px; color: var(--rf-text-2); margin: 0; }
#screen-home .progress-bar { width: 100%; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--rf-text) 12%, transparent); }
#screen-home .progress-fill { height: 100%; border-radius: 3px; background: var(--rf-accent); }
#screen-home .bots-right {
  position: relative; flex: none; width: 76px; height: 76px; z-index: 1;
  border-radius: 50%; border: 0;
  box-shadow: 0 0 0 2px var(--rf-accent), 0 0 0 7px color-mix(in srgb, var(--rf-accent) 10%, transparent);
  background: radial-gradient(circle at 40% 35%, var(--rf-ava-a) 0%, var(--rf-ava-b) 72%);
  display: grid; place-items: center;
}
#screen-home .bots-circle { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; display: grid; place-items: center; }
#screen-home .bots-letter { width: 100%; height: 100%; display: grid; place-items: center; font: 700 30px var(--rf-font-display); color: color-mix(in srgb, var(--rf-text) 85%, transparent); }
#screen-home .bots-letter img { object-position: center 20%; }
#screen-home .card.bots .arrow-icon { margin: 0; align-self: center; flex: none; }

/* Puzzles / Friends pair */
#screen-home .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; }
#screen-home .pair .card {
  position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 124px; box-sizing: border-box; padding: 16px;
  background: var(--rf-surface); border: 1px solid var(--rf-card-line); border-radius: 20px; overflow: visible;
}
#screen-home .pair .label {
  display: flex; align-items: center; gap: 6px; margin: 0; height: 15px;
  font: 800 11px var(--rf-font-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--rf-accent);
}
#screen-home .card.puz .label { color: var(--rf-hot); }
#screen-home .pair h2.serif { font: 700 22px var(--rf-font-display); color: var(--rf-text); margin: 0; text-transform: none; }
#screen-home .pair p.muted { font-size: 13px; line-height: 1.35; color: var(--rf-sub); margin: 0; max-width: none; }
#screen-home .arrow-icon { margin-top: auto; align-self: flex-end; position: static; color: var(--rf-accent); font-size: 20px; line-height: 20px; }
#screen-home .card.online .bg-text, #screen-home .card.puz .mini { display: none; }
#screen-home .chev { color: var(--rf-sub); font-size: 22px; }

@media (max-width: 370px) {
  #screen-home .card.online h2.serif { font-size: 28px; }
  #screen-home .online-faces > * { width: 28px; height: 28px; margin-left: -9px; }
  #screen-home .bots-right { width: 64px; height: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  #screen-home .card.online .live-dot { box-shadow: 0 0 0 4px rgba(74, 222, 128, .18); }
  #screen-home .card.online .live-dot::before { display: none; }
}

/* Play vs bots — measured from the design (UI refresh (1), "Play vs bots"). */
#screen-play.active { display: flex; flex-direction: column; gap: 0; height: auto; min-height: 100dvh; padding: 16px 20px 28px;
  background: radial-gradient(120% 60% at 50% 20%, var(--rf-bg) 0%, var(--rf-bg) 62%); }
#screen-play .play-body { flex: 1; display: flex; flex-direction: column; gap: 16px; min-height: 0; height: auto; padding: 0; }
#screen-play .hero {
  flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0;
  padding: 18px 16px 16px; box-sizing: border-box; text-align: center;
  background: linear-gradient(170deg, #1D1933 0%, #110F1B 100%); border: 1px solid #2D2943; border-radius: 24px;
}
#screen-play .type-badge {
  align-self: flex-start; display: inline-flex; align-items: center; height: 28px; padding: 0 12px; margin: 0; border-radius: 14px;
  background: color-mix(in srgb, var(--rf-accent) 14%, transparent); color: var(--rf-accent);
  font: 800 11px var(--rf-font-sans); letter-spacing: .14em; text-transform: uppercase;
}
#screen-play .portrait-wrap { position: relative; display: flex; align-items: center; justify-content: space-between; width: 100%; height: 210px; margin: 0; gap: 0; }
#screen-play .portrait-wrap::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 292px; height: 292px; transform: translate(-50%, -50%);
  border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--rf-accent) 50%, transparent); pointer-events: none;
}
#screen-play .ava-circle-lg {
  width: 184px; height: 184px; margin: 0; 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 6px #17142A, 0 0 0 9px var(--rf-accent), 0 0 40px color-mix(in srgb, var(--rf-accent) 25%, transparent);
  font: 700 68px var(--rf-font-display); color: color-mix(in srgb, var(--rf-text) 90%, transparent);
}
#screen-play .ava-circle-lg img { width: 100%; height: 100%; object-fit: cover; display: block; }
#screen-play .arrow {
  position: relative; top: auto; left: auto; right: auto; transform: none; z-index: 1; width: 44px; height: 44px; padding: 0 !important; display: grid; place-items: center;
  border-radius: 50% !important; background: color-mix(in srgb, var(--rf-bg) 40%, transparent); border: 1px solid #3A3550; color: var(--rf-text);
  font-size: 22px; line-height: 1; box-shadow: none;
}
#screen-play h2#play-name { margin: 4px 0 0; font: 700 30px/1.05 var(--rf-font-display); color: var(--rf-text); text-transform: none; }
:is(#screen-play, #screen-universe, #screen-group) .elo { margin: 0; font: 800 14px var(--rf-font-sans); letter-spacing: .1em; color: var(--rf-accent); }
:is(#screen-play, #screen-universe, #screen-group) .beaten:not(.hidden), :is(#screen-play, #screen-universe, #screen-group) .play-wardrobe:not(.hidden) {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 12px; margin: 0;
  font: 700 12px var(--rf-font-sans);
}
:is(#screen-play, #screen-universe, #screen-group) .beaten { background: color-mix(in srgb, var(--rf-accent) 16%, transparent); color: var(--rf-accent); }
:is(#screen-play, #screen-universe, #screen-group) .play-wardrobe { background: color-mix(in srgb, var(--rf-text) 8%, transparent); color: var(--rf-text-2); }
:is(#screen-play, #screen-universe, #screen-group) #play-style { margin: 0; padding: 0 !important; background: none; color: var(--rf-accent); font: 700 13px var(--rf-font-sans); }
:is(#screen-play, #screen-universe, #screen-group) .quote { margin: 2px 0 0; max-width: 280px; font: italic 400 16px/22.4px var(--rf-font-display); color: var(--rf-text-2); }
#screen-play .dots { display: flex; gap: 6px; justify-content: center; margin: auto 0 0; padding-top: 12px; }
#screen-play .dot { width: 6px; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--rf-text) 25%, transparent); cursor: pointer; transition: width .2s; }
#screen-play .dot.active { width: 18px; background: var(--rf-accent); }
#screen-play #play-all { height: 40px; margin: 0; padding: 0 !important; background: none; color: var(--rf-accent); font: 700 14px var(--rf-font-sans); }
:is(#screen-play, #screen-universe, #screen-group) .dock { position: static; display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; background: none; border: 0; box-shadow: none; }
:is(#screen-play, #screen-universe, #screen-group) .dock-row { display: flex; gap: 10px; margin: 0; }
:is(#screen-play, #screen-universe, #screen-group) .segmented#colors {
  flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; height: 50px; padding: 4px; box-sizing: border-box; margin: 0;
  background: var(--rf-surface); border: 1px solid var(--rf-surface-2); border-radius: 14px;
}
:is(#screen-play, #screen-universe, #screen-group) .segmented#colors button { height: 40px; padding: 1px 6px !important; border-radius: 10px !important; background: transparent; color: var(--rf-text-2); font: 700 14px var(--rf-font-sans); }
:is(#screen-play, #screen-universe, #screen-group) .segmented#colors button.on { background: var(--rf-accent); color: var(--rf-accent-text); font-weight: 800; }
:is(#screen-play, #screen-universe, #screen-group) .odds-btn {
  flex: none; width: 84px; height: 50px; padding: 0 12px !important; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: var(--rf-surface); border: 1px solid var(--rf-card-line); border-radius: 14px !important; color: var(--rf-text);
}
:is(#screen-play, #screen-universe, #screen-group) .odds-btn br { display: none; }
:is(#screen-play, #screen-universe, #screen-group) .odds-btn span { font: 800 10px var(--rf-font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--rf-sub); }
:is(#screen-play, #screen-universe, #screen-group) .odds-btn b { margin: 0; font: 800 14px var(--rf-font-sans); color: var(--rf-text); }
/* The Tension mode switch beside Odds (owner, 2026-10-11): lit when on. */
/* The Tension mode switch (owner, 2026-10-11): its own row above the colours
   and Odds, like Online's "Any time control". */
:is(#screen-play, #screen-universe, #screen-group) .tension-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  min-height: 52px; margin: 0 0 10px; padding: 8px 8px 8px 14px; box-sizing: border-box; text-align: left;
  border-radius: 14px; border: 1px solid var(--rf-card-line); background: var(--rf-surface); color: var(--rf-text); cursor: pointer;
}
:is(#screen-play, #screen-universe, #screen-group) .tension-row .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
:is(#screen-play, #screen-universe, #screen-group) .tension-row b { font: 800 14px/normal var(--rf-font-sans); }
:is(#screen-play, #screen-universe, #screen-group) .tension-row .sub { font: 600 11px/normal var(--rf-font-sans); color: var(--rf-sub); }
:is(#screen-play, #screen-universe, #screen-group) .tension-row.on { border-color: color-mix(in srgb, var(--rf-accent) 50%, transparent); background: color-mix(in srgb, var(--rf-accent) 12%, transparent); }
:is(#screen-play, #screen-universe, #screen-group) .tension-row.on b { color: var(--rf-accent); }
:is(#screen-play, #screen-universe, #screen-group) button.primary.play {
  height: 56px; padding: 0 !important; border-radius: 16px !important; font: 800 16px var(--rf-font-sans) !important;
  letter-spacing: .12em; text-transform: uppercase !important; box-shadow: 0 10px 30px color-mix(in srgb, var(--rf-accent) 28%, transparent) !important;
}


/* Choose your opponent — measured from the design (bottom sheet). */
#screen-picker .sheet {
  display: flex; flex-direction: column; gap: 16px; max-height: 76dvh; overflow-y: auto; box-sizing: border-box;
  padding: 10px 20px 28px; background: var(--rf-surface); border: 1px solid var(--rf-line-2); border-bottom: 0;
  border-radius: 28px 28px 0 0; box-shadow: 0 -20px 60px rgba(0, 0, 0, .5);
}
#screen-picker .overlay { background: rgba(5, 4, 3, .62); }
#screen-picker .handle { width: 40px; height: 4px; margin: 0 auto; border-radius: 2px; background: var(--rf-line-2); opacity: 1; }
#screen-picker .title { margin: 0; font: 700 24px var(--rf-font-display); color: var(--rf-text); text-align: left; }
#screen-picker .segmented#casts {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; height: 50px; padding: 4px; margin: 0; box-sizing: border-box;
  background: var(--rf-surface); border: 1px solid var(--rf-surface-2); border-radius: 14px;
}
#screen-picker .segmented#casts button { height: 40px; padding: 1px 6px !important; border-radius: 10px !important; background: transparent; color: var(--rf-text-2); font: 700 14px var(--rf-font-sans); }
#screen-picker .segmented#casts button.on { background: var(--rf-accent); color: var(--rf-accent-text); font-weight: 800; }
#screen-picker .bots.list { display: flex; flex-direction: column; gap: 10px; padding: 0; margin: 0; }
#screen-picker .bots.list .pick {
  position: relative; display: flex; flex-direction: row; align-items: center; gap: 14px; width: 100%; min-height: 88px; padding: 12px 14px !important; box-sizing: border-box;
  background: var(--rf-surface); border: 1px solid var(--rf-card-line); border-radius: 18px !important; text-align: left; color: var(--rf-text); box-shadow: none;
}
#screen-picker .bots.list .pick.on { border: 2px solid var(--rf-accent); padding: 11px 13px !important; box-shadow: 0 0 20px color-mix(in srgb, var(--rf-accent) 18%, transparent); }
#screen-picker .ava-circle {
  position: relative; width: 54px; height: 54px; flex: none; border-radius: 50%; 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 var(--rf-line-2);
  font: 700 20px var(--rf-font-display); color: var(--rf-text);
}
#screen-picker .ava-circle img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
#screen-picker .beat-tick {
  position: absolute; right: -3px; bottom: -3px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%;
  background: var(--rf-accent); color: var(--rf-accent-text); border: 2px solid var(--rf-surface); font: 900 11px var(--rf-font-sans);
}
#screen-picker .text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
#screen-picker .text .top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
#screen-picker .text b { font: 800 16px var(--rf-font-sans); color: var(--rf-text); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#screen-picker .elo-num { flex: none; font: 800 13px var(--rf-font-sans); color: var(--rf-accent); }
#screen-picker .text .bio {
  font: 400 13px/18.2px var(--rf-font-sans); color: var(--rf-sub);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Versus */
#versus { position: fixed; inset: 0; z-index: 9999; background: #0C0B09; color: #F3ECDD; font-family: -apple-system, sans-serif; opacity: 0; pointer-events: none; transition: opacity 0.2s; overflow: hidden; display: none; }
#versus.show { opacity: 1; display: flex; flex-direction: column; padding: max(30px, env(safe-area-inset-top)) 28px max(16px, env(safe-area-inset-bottom)); box-sizing: border-box; }
#versus .vs-bg-top { position: absolute; left: calc(-50vw + 50% - 40px); right: calc(-50vw + 50% - 40px); bottom: calc(50% - 10px); top: -100vh; background: linear-gradient(160deg, #2A2148 0%, #141022 70%); transform: skewY(-9deg); transform-origin: left bottom; z-index: -2; }
#versus .vs-divider { position: absolute; left: calc(-50vw + 50% - 40px); right: calc(-50vw + 50% - 40px); top: calc(50% + 10px); height: 6px; background: var(--rf-accent, #d9b456); transform: skewY(-9deg); transform-origin: left top; box-shadow: color-mix(in srgb, var(--rf-accent, #d9b456) 70%, transparent) 0px 0px 30px; z-index: -1; }
#versus .vs-right { align-self: flex-end; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; text-align: right; }
#versus .vs-emoji { overflow: hidden; }
#versus .vs-name {  font-family: var(--rf-serif, 'Playfair Display', serif);  font-size: clamp(20px, 4dvh, 34px);  font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1;  }
#versus .vs-mark-wrap { display: flex; justify-content: center; z-index: 10; position: relative; margin: auto 0; }
#versus .vs-side { position: relative; z-index: 11; } /* above .vs-mark-wrap (z 10), which holds the diagonal background */
#versus .vs-mark {  font-family: var(--rf-serif, 'Playfair Display', serif);  font-size: clamp(60px, 12dvh, 112px);  font-weight: 900; font-style: italic; line-height: 1; color: var(--rf-accent, #d9b456); text-shadow: color-mix(in srgb, var(--rf-accent, #d9b456) 55%, transparent) 0px 0px 40px, #6b521a 0px 6px 0px;  }
#versus .vs-left { align-self: flex-start; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
#versus .vs-you-wrap { position: relative; width: clamp(80px, 18dvh, 150px); height: clamp(80px, 18dvh, 150px); }
#versus .cfo-glow { position: absolute; inset: -8px; border-radius: 50%; box-shadow: rgba(94, 231, 242, 0.5) 0px 0px 30px 6px; }
#versus .cfo-ring { position: absolute; inset: 0px; border-radius: 50%; background: conic-gradient(#5ee7f2, #3b6cf6, #b05ef2, #5ee7f2, #3b6cf6, #5ee7f2); }
#versus .vs-you { font: 700 clamp(34px, 8dvh, 64px) var(--rf-font-display); }
#versus .vs-you-label {  font-family: var(--rf-serif, 'Playfair Display', serif);  font-size: clamp(20px, 4dvh, 34px);  font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1;  }

@keyframes cfoInRight{from{transform:translateX(420px)}to{transform:none}}
@keyframes cfoInLeft{from{transform:translateX(-420px)}to{transform:none}}
@keyframes cfoPop{0%{transform:scale(.3) rotate(-14deg);opacity:0}60%{transform:scale(1.15) rotate(3deg);opacity:1}100%{transform:scale(1) rotate(-6deg);opacity:1}}
@keyframes cfoSpin{to{transform:rotate(360deg)}}
@keyframes cfoPulse{0%,100%{opacity:.55}50%{opacity:1}}
#versus.show .cfo-r{animation:cfoInRight .5s cubic-bezier(.2,.9,.3,1.2) both}
#versus.show .cfo-l{animation:cfoInLeft .5s .1s cubic-bezier(.2,.9,.3,1.2) both}
#versus.show .cfo-vs{animation:cfoPop .6s .35s cubic-bezier(.3,1.6,.5,1) both}
#versus.show .cfo-ring{animation:cfoSpin 5s linear infinite}
#versus.show .cfo-glow{animation:cfoPulse 2.4s ease-in-out infinite}

#versus .vs-subtitle {   font-size: clamp(10px, 1.6dvh, 14px);  color: var(--rf-accent, #eab308); font-weight: bold;  margin-top: clamp(4px, 1dvh, 10px);  letter-spacing: 0.1em; text-transform: uppercase; text-align: center;  }
#versus .vs-quote-card { position: relative; margin-top: auto; margin-bottom: 16px; width: 100%; box-sizing: border-box; background: rgba(20, 19, 17, 0.9); padding: 12px; border-radius: 12px; border: 1px solid var(--rf-line, rgba(255,255,255,0.1)); font-family: var(--rf-serif, 'Playfair Display', serif); font-style: italic; color: var(--rf-text, #f3ecdd); text-align: center; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; font-size: clamp(12px, 2dvh, 16px); }
#versus .vs-footer { position: relative; width: 100%; text-align: center; font-size: 11px; font-weight: bold; letter-spacing: 0.1em; color: var(--rf-muted, rgba(243, 236, 221, 0.5)); }

/* Premium Tier Overrides */
html[data-tier="premium"] {
  --rf-bg: #140b05;
  --rf-card-home: #1f1108;
  --rf-line: color-mix(in srgb, var(--rf-accent) 20%, transparent);
  --rf-card2: #2b160a;
  --rf-muted: rgba(255, 230, 213, 0.6);
  --rf-text: #ffe6d5;
}

html[data-tier="premium"] #screen-home .bots-right {
  background: radial-gradient(circle at 40% 35%, color-mix(in srgb, var(--rf-accent) 25%, #1f1108) 0%, #1f1108 72%);
}

html[data-tier="premium"] #screen-play .ava-circle-lg {
  background: radial-gradient(circle at 40% 32%, color-mix(in srgb, var(--rf-accent) 25%, #1f1108) 0%, #1f1108 75%);
}

html[data-tier="premium"] #versus .vs-bg-top { background: linear-gradient(160deg, color-mix(in srgb, var(--rf-accent) 25%, #1a0b05) 0%, #1a0b05 70%); }

html[data-tier="premium"] #versus .vs-emoji {
  background: radial-gradient(circle at 40% 32%, color-mix(in srgb, var(--rf-accent) 25%, #1a0b05) 0%, #1a0b05 75%);
}
#versus .vs-you::before { content: none !important; }

#home-wearing {
  background: var(--rf-surface-elevated, var(--rf-surface-elevated));
  border: 1px solid var(--rf-accent, var(--rf-accent));
  border-radius: 100px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  margin: 0 16px 16px;
  color: var(--rf-text, var(--rf-text));
}
#home-wearing.hidden { display: none !important; }
#home-wearing .dot { color: var(--rf-accent, var(--rf-accent)); font-size: 12px; }
#home-wearing .divider { width: 1px; height: 12px; background: var(--rf-line, var(--rf-surface-2)); }
#home-wearing button { background: transparent !important; color: var(--rf-muted, var(--rf-muted)); padding: 0 !important; font-size: 13px !important; font-weight: 600; border: none; }

#versus .vs-emoji { overflow: hidden; }
#versus .vs-emoji img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
#versus .vs-you { font: 700 clamp(34px, 8dvh, 64px) var(--rf-font-display); }
#versus .vs-you img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
#versus .vs-you { font: 700 clamp(34px, 8dvh, 64px) var(--rf-font-display); }
/* Longer titles (ru, uz) stay on two lines beside the portrait. */
html:not([lang="en"]) #screen-home .bots .title.serif { font-size: 26px; max-width: 56%; }

/* Play vs bots: links under the hero, and a universe's ladder sheet. */
#screen-play .play-links { display: flex; gap: 18px; justify-content: center; }
#screen-play #play-universe { height: 40px; margin: 0; padding: 0 !important; background: none; color: var(--rf-text-2); font: 700 14px var(--rf-font-sans); }
:is(#screen-universe, #screen-group) .uv-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; height: auto !important; max-height: 82dvh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px; padding: 10px 20px calc(24px + env(safe-area-inset-bottom)) !important; box-sizing: border-box;
  background: var(--rf-surface); border: 1px solid var(--rf-line-2); border-bottom: 0; border-radius: 28px 28px 0 0;
}
#screen-universe .handle { width: 40px; height: 4px; border-radius: 2px; background: var(--rf-line-2); margin: 0 auto 4px; }
:is(#screen-universe, #screen-group) h2 { margin: 0; font: 700 24px var(--rf-font-display); color: var(--rf-text); text-align: left; }
:is(#screen-universe #uv-blurb, #screen-group #grp-blurb) { margin: 0 0 4px; font: 400 13px/1.4 var(--rf-font-sans); color: var(--rf-sub); }
:is(#screen-universe, #screen-group) .uv-list { display: flex; flex-direction: column; gap: 8px; }
:is(#screen-universe, #screen-group) .uv-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 8px 12px !important; box-sizing: border-box; text-align: left;
  background: var(--rf-surface); border: 1px solid var(--rf-card-line); border-radius: 16px !important; color: var(--rf-text);
}
:is(#screen-universe, #screen-group) .uv-row.boss { border-color: color-mix(in srgb, var(--rf-accent) 45%, transparent); background: linear-gradient(100deg, color-mix(in srgb, var(--rf-accent) 12%, var(--rf-surface)), var(--rf-surface) 70%); }
:is(#screen-universe, #screen-group) .uv-row.on { border: 2px solid var(--rf-accent); padding: 7px 11px !important; }
:is(#screen-universe, #screen-group) .uv-rung { flex: none; width: 22px; text-align: center; font: 800 15px var(--rf-font-display); color: var(--rf-sub); }
:is(#screen-universe, #screen-group) .uv-row.boss .uv-rung { color: var(--rf-accent); }
:is(#screen-universe, #screen-group) .uv-ava {
  position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; overflow: visible;
  background: radial-gradient(circle at 40% 32%, var(--rf-ava-a) 0%, var(--rf-ava-b) 75%); box-shadow: 0 0 0 2px var(--rf-line-2); font-size: 22px;
}
:is(#screen-universe, #screen-group) .uv-ava img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
:is(#screen-universe, #screen-group) .uv-tick { position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--rf-accent); color: var(--rf-accent-text); font: 900 10px var(--rf-font-sans); font-style: normal; }
:is(#screen-universe, #screen-group) .uv-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
:is(#screen-universe, #screen-group) .uv-text b { font: 800 15px var(--rf-font-sans); }
:is(#screen-universe, #screen-group) .uv-text span, #screen-group .uv-text span { font: 400 12px/1.3 var(--rf-font-sans); color: var(--rf-sub); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
:is(#screen-universe, #screen-group) .uv-elo { flex: none; font: 800 13px var(--rf-font-sans); color: var(--rf-accent); }

@media (prefers-reduced-motion: reduce) {
  #versus.show .cfo-r,
  #versus.show .cfo-l,
  #versus.show .cfo-vs,
  #versus.show .cfo-ring,
  #versus.show .cfo-glow {
    animation: none !important;
    transform: none !important;
  }
  #screen-play .dot {
    transition: none !important;
  }
}

/* Entry animations (fx.versus): over both sides; a tap skips them. */
#versus .vs-entry { z-index: 12; border-radius: 0; }
#versus.show.has-entry { pointer-events: auto; }
