/*
 * Playora front site styles.
 * Colours live in CSS variables: the light theme is the default, the dark
 * theme ("Neon Night") applies when <html data-theme="dark">. Brand colours
 * chosen in admin > Settings > Appearance override --brand, --brand-2, --grad.
 */

/* ---------------------------------------------------------------- fonts (SIL Open Font License, see assets/fonts) */
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url('../fonts/baloo2-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url('../fonts/baloo2-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Cyrillic letters have their own family name: it is only in the font list on pages in a Cyrillic
   language (see "tokens"). On other pages the few Cyrillic words, like "Русский" in the language
   menu, use the system font, so those pages don't download this font. */
@font-face {
  font-family: 'Nunito Cyrillic';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/nunito-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: 'Nunito Cyrillic';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/nunito-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/nunito-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/nunito-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------------------------------------------------------------- tokens */
:root {
  --font: 'Nunito', ui-rounded, system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
  --font-display: 'Baloo 2', 'Nunito', ui-rounded, system-ui, sans-serif;
}

:root:is(:lang(ru), :lang(uk), :lang(be), :lang(bg), :lang(sr), :lang(mk), :lang(kk), :lang(ky), :lang(tg), :lang(mn)) {
  --font: 'Nunito', 'Nunito Cyrillic', ui-rounded, system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
  --font-display: 'Baloo 2', 'Nunito', 'Nunito Cyrillic', ui-rounded, system-ui, sans-serif;
}

:root {
  --bg: #f5f3ff;
  --bg-a: #e9e0ff;
  --bg-b: #ddefff;
  --bg-c: #ffe6f3;
  --dots: rgba(91, 63, 224, .07);
  --surface: #ffffff;
  --surface-2: #f2effc;
  --surface-3: #e9e4f8;
  --glass: rgba(255, 255, 255, .8);
  --line: #e8e3f6;
  --line-2: #d9d2ee;
  --text: #1b1436;
  --muted: #6c6790;
  --faint: #77719a;
  --brand: #7c4dff;
  --brand-2: #ff4fa0;
  --brand-ink: #5b2ee0;
  --grad: linear-gradient(135deg, #8b5cff 0%, #ff4fa0 100%);
  --ok: #17a86b;
  --warn: #e8890c;
  --danger: #e5384f;
  --shadow-sm: 0 1px 2px rgba(27, 20, 54, .06);
  --shadow: 0 1px 2px rgba(27, 20, 54, .05), 0 10px 22px -12px rgba(27, 20, 54, .28);
  --shadow-lg: 0 2px 6px rgba(27, 20, 54, .06), 0 22px 40px -18px rgba(76, 38, 190, .45);
  --radius: 16px;
  --radius-lg: 22px;
  --tile-bg: #e6e1f5;
  --header-h: 72px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0b0820;
  --bg-a: rgba(139, 92, 255, .22);
  --bg-b: rgba(46, 230, 246, .10);
  --bg-c: rgba(255, 46, 147, .12);
  --dots: rgba(255, 255, 255, .035);
  --surface: #16112e;
  --surface-2: #1f1842;
  --surface-3: #2a2257;
  --glass: rgba(14, 10, 36, .8);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #f4f1ff;
  --muted: #a39cc8;
  --faint: #6f6896;
  --brand: #9b6bff;
  --brand-2: #ff2e93;
  --brand-ink: #c7b0ff;
  --grad: linear-gradient(135deg, #8b5cff 0%, #ff2e93 100%);
  --ok: #2bd48c;
  --warn: #ffb25c;
  --danger: #ff5a6e;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 26px -14px rgba(0, 0, 0, .7);
  --shadow-lg: 0 0 0 1px rgba(255, 46, 147, .35), 0 18px 40px -14px rgba(255, 46, 147, .45);
  --tile-bg: #221a47;
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 64px);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 700 15px/1.5 var(--font);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* The page background on its own fixed layer (a fixed background on body repaints while scrolling). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 520px at 0% -5%, var(--bg-a), transparent 60%),
    radial-gradient(900px 520px at 100% 0%, var(--bg-b), transparent 58%),
    radial-gradient(900px 700px at 50% 120%, var(--bg-c), transparent 60%),
    radial-gradient(circle, var(--dots) 1.2px, transparent 1.6px) 0 0 / 22px 22px,
    var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.2px;
  margin: 0;
}

p {
  margin: 0 0 12px;
}

::selection {
  background: color-mix(in srgb, var(--brand) 30%, transparent);
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 70%, transparent);
  outline-offset: 2px;
  border-radius: 10px;
}

.skip {
  position: absolute;
  inset-inline-start: 12px;
  top: -60px;
  z-index: 100;
  background: var(--surface);
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.skip:focus {
  top: 12px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.wrap {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 28px;
}

.muted {
  color: var(--muted);
}

.grow {
  flex: 1;
}

.m-only {
  display: none !important;
}

.hidden {
  display: none !important;
}

main {
  display: block;
  padding-bottom: 40px;
}

/* ---------------------------------------------------------------- header */
.topline {
  height: 3px;
  background: linear-gradient(90deg, #8b5cff, #ff4fa0, #ff8a3d, #ffc233, #2bc48a, #22c7e6, #8b5cff);
}

.hdr {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border-bottom: 1px solid var(--line);
}

.hdr-in {
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--header-h);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.logo-mark {
  width: 42px;
  height: 42px;
  flex: none;
  filter: drop-shadow(0 6px 10px rgba(124, 77, 255, .35));
}

.logo-img {
  height: 42px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
}

.logo-word {
  font: 800 30px/1 var(--font-display);
  letter-spacing: -.5px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-top: 4px;
  white-space: nowrap;
}

.seg {
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin-inline-start: 10px;
}

.seg a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 15px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14.5px;
  color: var(--muted);
  white-space: nowrap;
  transition: color .2s, background .2s;
}

.seg a:hover {
  color: var(--text);
}

.seg a.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--line);
}

.seg img {
  width: 22px;
  height: 22px;
}

.seg .cup-link {
  color: #c2410c;
}

[data-theme="dark"] .seg .cup-link {
  color: #ffb25c;
}

.search {
  position: relative;
  flex: 1;
  max-width: 440px;
  margin-inline-start: auto;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding-block: 0;
  padding-inline: 16px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: border-color .2s, box-shadow .2s;
}

.search-box:hover,
.search-box:focus-within {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
}

.search-box:focus-within {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent);
}

.search-box:has(input:focus-visible) {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 40%, transparent);
}

.search-box svg {
  width: 19px;
  height: 19px;
  color: var(--brand);
  flex: none;
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-weight: 700;
  color: var(--text);
}

.search-box input::placeholder {
  color: var(--faint);
}

.search-box kbd {
  font: 800 12px var(--font);
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 3px 9px;
  border-radius: 8px;
}

.suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 50;
}

.suggest a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 12px;
}

.suggest a:hover,
.suggest a.on {
  background: var(--surface-2);
}

.suggest img {
  width: 64px;
  height: 40px;
  object-fit: cover;
  border-radius: 9px;
  background: var(--tile-bg);
}

.suggest b {
  display: block;
  font-size: 14px;
  font-weight: 900;
}

.suggest small {
  color: var(--muted);
  font-size: 12px;
}

.suggest .all-results {
  justify-content: center;
  color: var(--brand-ink);
  font-weight: 900;
  font-size: 13.5px;
  padding: 10px;
}

.suggest .none {
  padding: 14px;
  text-align: center;
  color: var(--muted);
}

.btn-surprise {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding-block: 0;
  padding-inline: 16px 20px;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 10px 22px -8px rgba(124, 77, 255, .6);
  white-space: nowrap;
  flex: none;
  transition: transform .2s, box-shadow .2s;
}

.btn-surprise:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -8px rgba(124, 77, 255, .7);
}

.btn-surprise svg {
  width: 22px;
  height: 22px;
}

.btn-surprise:hover svg {
  animation: dice .5s ease;
}

@keyframes dice {
  50% {
    transform: rotate(-90deg) scale(1.1);
  }
}

.icon-btn {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  flex: none;
  padding: 0;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.theme-light,
[data-theme="dark"] .theme-dark {
  display: none;
}

[data-theme="dark"] .theme-light {
  display: block;
}

.me {
  position: relative;
  flex: none;
}

.me-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-block: 4px;
  padding-inline: 4px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.ring {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  padding: 2.5px;
  background: conic-gradient(var(--brand) 0 var(--p, 0%), var(--surface-3) var(--p, 0%) 100%);
  flex: none;
}

.ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--surface);
  object-fit: cover;
}

.me-txt {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: start;
}

.me-txt small {
  font-size: 11px;
  font-weight: 900;
  color: var(--brand-ink);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.me-txt b {
  font-size: 14px;
  font-weight: 900;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  width: 260px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 60;
}

.menu-head {
  padding: 8px 10px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.menu-head b {
  display: block;
}

.xpbar {
  height: 8px;
  border-radius: 8px;
  background: var(--surface-3);
  overflow: hidden;
  margin-top: 6px;
}

.xpbar i {
  display: block;
  height: 100%;
  width: var(--p, 0%);
  border-radius: 8px;
  background: var(--grad);
}

.menu a,
.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 12px;
  border: 0;
  background: none;
  text-align: start;
  font-weight: 800;
  font-size: 14px;
}

.menu a:hover,
.menu button:hover {
  background: var(--surface-2);
}

.menu img {
  width: 24px;
  height: 24px;
}

.btn-signin {
  display: inline-flex;
  align-items: center;
  height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-weight: 900;
  color: var(--brand-ink);
  white-space: nowrap;
  flex: none;
}

/* category chips */
.chips {
  display: flex;
  gap: 10px;
  padding-top: 2px;
  padding-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask: linear-gradient(90deg, #000 94%, transparent);
  mask: linear-gradient(90deg, #000 94%, transparent);
}

[dir="rtl"] .chips {
  -webkit-mask: linear-gradient(270deg, #000 94%, transparent);
  mask: linear-gradient(270deg, #000 94%, transparent);
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding-block: 0;
  padding-inline: 5px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-weight: 800;
  font-size: 14.5px;
  white-space: nowrap;
  flex: none;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}

.chip img {
  width: 32px;
  height: 32px;
  padding: 3px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--c) 16%, transparent);
}

.chip:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--c) 45%, var(--line));
  box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--c) 70%, transparent);
}

.chip.on {
  background: var(--c);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 20px -10px var(--c);
}

.chip.on img {
  background: rgba(255, 255, 255, .28);
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-weight: 900;
  font-size: 15px;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .2s, background .2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn.primary {
  background: var(--grad);
  border: 0;
  color: #fff;
  box-shadow: 0 10px 22px -10px rgba(124, 77, 255, .7);
}

.btn.soft {
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--brand) 25%, var(--line));
  color: var(--brand-ink);
}

.btn.danger {
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 30%, var(--line));
  color: var(--danger);
}

.btn.small {
  height: 36px;
  padding: 0 14px;
  font-size: 13.5px;
}

.btn.block {
  width: 100%;
}

.btn[disabled] {
  opacity: .6;
  pointer-events: none;
}

/* ---------------------------------------------------------------- page intro */
.intro {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0 14px;
}

.intro h1 {
  font-size: 30px;
}

.intro h1 span {
  color: var(--muted);
  font-weight: 700;
}

.intro p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* ---------------------------------------------------------------- game tiles */
.mosaic {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 14px;
}

.t {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--tc, var(--tile-bg));
  box-shadow: var(--shadow);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s;
  isolation: isolate;
  min-width: 0;
}

.t.xl {
  grid-column: span 2;
  grid-row: span 2;
  aspect-ratio: auto;
}

.t > img,
.t > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s cubic-bezier(.2, .8, .2, 1), opacity .3s;
}

.t > video {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.t.playing > video {
  opacity: 1;
}

.t:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.t:hover > img {
  transform: scale(1.06);
}

.cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 26px 10px 8px;
  background: linear-gradient(180deg, transparent, rgba(10, 6, 30, .86));
  color: #fff;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  transform: translateY(101%);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}

.cap b {
  font-size: 13.5px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cap small {
  font-size: 11.5px;
  opacity: .82;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.t:hover .cap,
.t:focus-visible .cap,
.t.xl .cap {
  transform: none;
}

.t.xl .cap {
  padding: 40px 16px 14px;
}

.t.xl .cap b {
  font: 800 24px/1.1 var(--font-display);
}

.t.xl .cap small {
  font-size: 13px;
}

.badge {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 25px;
  padding: 0 10px;
  border-radius: 999px;
  font: 900 11px/1 var(--font);
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #fff;
  box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .45);
}

.badge svg {
  width: 13px;
  height: 13px;
}

.badge.hot {
  background: linear-gradient(135deg, #d9480f, #c2255c);
}

.badge.new {
  background: linear-gradient(135deg, #0f8a56, #0b6e44);
}

.badge.liked {
  background: linear-gradient(135deg, #7a4cf0, #5a2fd8);
}

.badge.top {
  background: linear-gradient(135deg, #ffd24d, #ffb020);
  color: #4a2f00;
}

.badge.inline {
  position: static;
  height: 21px;
  font-size: 10px;
  padding: 0 8px;
  box-shadow: none;
}

/* Hero mosaic: four big tiles (one can be the weekly cup) and sixteen small ones. */
@media (max-width: 1280px) {
  .mosaic {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .mosaic.hero > .t:nth-last-child(-n+2) {
    display: none;
  }

  .mosaic.sec > .t:nth-child(n+10) {
    display: none;
  }
}

@media (max-width: 1024px) {
  .mosaic {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mosaic.hero > .t:nth-last-child(-n+2) {
    display: block;
  }
}

/* weekly cup tile */
.t.cup {
  background:
    radial-gradient(circle at 85% 10%, rgba(255, 255, 255, .25), transparent 40%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .05) 0 12px, transparent 12px 24px),
    linear-gradient(140deg, #6a3df0 0%, #a040e8 45%, #ff4fa0 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  gap: 10px;
}

.cup-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cup-top img {
  width: 50px;
  height: 50px;
  flex: none;
  filter: drop-shadow(0 6px 10px rgba(40, 0, 80, .4));
}

.cup-top span {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.cup-top small {
  font-size: 11.5px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .85;
}

.cup-top b {
  font: 800 26px/1 var(--font-display);
  letter-spacing: .5px;
  padding-top: 3px;
  font-variant-numeric: tabular-nums;
}

.cup-game {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 12px;
  padding: 6px;
}

.cup-game img {
  width: 58px;
  height: 38px;
  object-fit: cover;
  border-radius: 8px;
  flex: none;
}

.cup-game span {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.cup-game b {
  font-size: 14.5px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cup-game small {
  font-size: 11.5px;
  opacity: .85;
}

.cup-podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: auto;
}

.pp {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
  min-width: 0;
}

.pp img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #fff;
  background: #fff;
}

.pp.p1 img {
  box-shadow: 0 0 0 2.5px #ffd23f;
}

.pp b {
  font-size: 12px;
  font-weight: 900;
  margin-top: 3px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pp small {
  font-size: 11px;
  opacity: .85;
}

.pp-empty {
  grid-column: span 3;
  align-self: end;
  padding: 10px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, .45);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  opacity: .9;
}

.cup-live {
  position: absolute;
  top: 16px;
  inset-inline-end: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: #fff;
  color: #e0245e;
  padding: 5px 10px;
  border-radius: 999px;
  box-shadow: 0 6px 14px -6px rgba(40, 0, 80, .6);
}

.cup-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff2d55;
  box-shadow: 0 0 0 3px rgba(255, 45, 85, .25);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 0 6px rgba(255, 45, 85, 0);
  }
}

.t.cup.cup-banner {
  display: none;
}

/* ---------------------------------------------------------------- rows */
.row {
  margin-top: 34px;
}

.row-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.row-head .ico {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  flex: none;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 30%, #fff), color-mix(in srgb, var(--c) 60%, #fff));
  box-shadow: 0 8px 16px -10px var(--c);
}

[data-theme="dark"] .row-head .ico {
  background: color-mix(in srgb, var(--c) 28%, var(--surface));
}

.row-head .ico img {
  width: 30px;
  height: 30px;
}

.row-head h2 {
  font-size: 25px;
  padding-top: 4px;
}

.row-head .sp {
  flex: 1;
}

.all {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--brand-ink);
  font-weight: 900;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.all:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
}

.arrow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--brand-ink);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
  padding: 0;
}

.arrow svg {
  width: 18px;
  height: 18px;
}

.arrow:disabled {
  opacity: .4;
  cursor: default;
}

/* one line of tiles that scrolls sideways */
.strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 7 * 14px) / 8);
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  scroll-behavior: smooth;
  padding: 6px 2px 10px;
  margin: -6px -2px -10px;
}

.strip::-webkit-scrollbar {
  display: none;
}

.strip > * {
  scroll-snap-align: start;
}

/* uniform grid of tiles (lists, search, favorites) */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 14px;
}

/* continue playing (filled by site.js from the visitor's history) */
.recent {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 5 * 14px) / 6);
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.recent::-webkit-scrollbar {
  display: none;
}

.rc {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  transition: transform .2s, box-shadow .2s;
}

.rc:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.rc img {
  width: 76px;
  height: 50px;
  object-fit: cover;
  border-radius: 11px;
  flex: none;
  background: var(--tile-bg);
}

.rc span {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.2;
}

.rc b {
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rc small {
  font-size: 12px;
  color: var(--muted);
}

/* ---------------------------------------------------------------- categories */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.cat {
  position: relative;
  display: flex;
  align-items: center;
  height: 92px;
  padding: 0 18px;
  border-radius: 20px;
  color: #fff;
  /* Bright card colour, with a soft shade under the text so white text stays readable on light colours. */
  --cat-shade: linear-gradient(90deg, rgba(20, 10, 50, .36), rgba(20, 10, 50, 0) 65%);
  background:
    radial-gradient(circle at 80% 30%, rgba(255, 255, 255, .28), transparent 45%),
    var(--cat-shade),
    linear-gradient(135deg, color-mix(in srgb, var(--c) 94%, #000), color-mix(in srgb, var(--c) 78%, #000));
  box-shadow: 0 12px 24px -14px var(--c);
  overflow: hidden;
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s;
}

[dir="rtl"] .cat {
  --cat-shade: linear-gradient(270deg, rgba(20, 10, 50, .36), rgba(20, 10, 50, 0) 65%);
}

.cat::before {
  content: "";
  position: absolute;
  inset-inline-end: -30px;
  bottom: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
}

.cat:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 30px -14px var(--c);
}

.cat span {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  position: relative;
  min-width: 0;
  padding-inline-end: 72px;
}

.cat b {
  font: 800 23px/1 var(--font-display);
  padding-top: 3px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .18);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat small {
  font-size: 13px;
  font-weight: 800;
  margin-top: 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}

.cat img {
  position: absolute;
  inset-inline-end: 12px;
  top: 50%;
  width: 74px;
  height: 74px;
  margin-top: -37px;
  transform: rotate(8deg);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .18));
}

.cat:hover img {
  transform: rotate(-4deg) scale(1.08);
}

/* ---------------------------------------------------------------- ads */
/* "Computers only" and "Phones only" places. Hidden places don't request an ad with
   responsive codes such as AdSense (no width, no request). */
@media (max-width: 767px) {
  [data-devices="desktop"] { display: none !important; }
}

@media (min-width: 768px) {
  [data-devices="mobile"] { display: none !important; }
}

.ad-slot {
  margin: 34px auto 0;
  max-width: 980px;
  min-height: 110px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 10px 12px;
  overflow: hidden;
}

.ad-slot > small {
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 6px;
}

.ad-slot > div {
  width: 100%;
  display: flex;
  justify-content: center;
}

.ad-slot.side {
  margin: 0;
  min-height: 250px;
}

.ad-sticky {
  display: none;
}

/* ---------------------------------------------------------------- FAQ */
.faq {
  display: grid;
  gap: 10px;
}

.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.faq summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 3px solid var(--brand);
  border-bottom: 3px solid var(--brand);
  transform: rotate(45deg);
  transition: transform .2s;
  flex: none;
  margin-top: -4px;
}

.faq details[open] summary::after {
  transform: rotate(225deg);
  margin-top: 4px;
}

.faq .answer {
  padding: 0 18px 16px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.65;
}

/* ---------------------------------------------------------------- footer */
.ftr {
  margin-top: 60px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 40px 0 28px;
}

.ftr-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 30px;
}

.ftr-brand p {
  color: var(--muted);
  font-weight: 600;
  margin: 12px 0;
  max-width: 340px;
}

.ftr h3 {
  font: 900 12px var(--font);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 12px;
}

.ftr ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.ftr li a {
  color: var(--muted);
  font-weight: 700;
}

.ftr li a:hover {
  color: var(--brand-ink);
}

.ftr-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  border-top: 1px solid var(--line);
  margin-top: 30px;
  padding-top: 20px;
  color: var(--muted);
  font-size: 13.5px;
}

.ftr-tools {
  display: flex;
  gap: 10px;
  align-items: center;
}

.select {
  height: 40px;
  padding: 0 34px 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237c4dff' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") right 14px center no-repeat;
  -webkit-appearance: none;
  appearance: none;
  font-weight: 800;
  font-size: 14px;
}

.socials {
  display: flex;
  gap: 8px;
}

.socials a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--muted);
}

.socials a:hover {
  color: var(--brand-ink);
}

.socials svg {
  width: 18px;
  height: 18px;
}

.tabbar {
  display: none;
}

/* ---------------------------------------------------------------- list pages */
.page-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 22px 0 18px;
  flex-wrap: wrap;
}

.page-head .ico {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  flex: none;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 30%, #fff), color-mix(in srgb, var(--c) 62%, #fff));
  box-shadow: 0 10px 20px -12px var(--c);
}

[data-theme="dark"] .page-head .ico {
  background: color-mix(in srgb, var(--c) 28%, var(--surface));
}

.page-head .ico img {
  width: 42px;
  height: 42px;
}

.page-head h1 {
  font-size: 32px;
}

.page-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-weight: 600;
}

.page-head .grow {
  min-width: 200px;
}

.tabs {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
}

.tabs a {
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  border: 0;
  background: none;
}

.tabs a.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--line);
}

.preview-note {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--gold-soft, #fff4d6);
  color: #6b4b00;
  font-weight: 700;
  font-size: 14px;
}

.crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13.5px;
  color: var(--muted);
  margin: 16px 0 12px;
}

.crumbs a:hover {
  color: var(--brand-ink);
}

.crumbs i {
  font-style: normal;
  color: var(--faint);
}

.crumbs span {
  color: var(--text);
}

.empty {
  text-align: center;
  padding: 50px 20px;
  background: var(--surface);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-lg);
  color: var(--muted);
}

.empty img {
  width: 90px;
  height: 90px;
  margin: 0 auto 12px;
}

.empty h1,
.empty h2 {
  color: var(--text);
  font-size: 22px;
  margin-bottom: 6px;
}

.pager {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 28px;
}

.pager a,
.pager span {
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 900;
  box-shadow: var(--shadow-sm);
}

.pager .on {
  background: var(--grad);
  color: #fff;
  border: 0;
}

.pager .off {
  opacity: .45;
}

/* category page hero */
.cat-hero {
  position: relative;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 24px 26px;
  margin: 6px 0 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, color-mix(in srgb, var(--c) 14%, var(--surface)), var(--surface) 70%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.cat-hero::after {
  content: "";
  position: absolute;
  inset-inline-end: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--c) 16%, transparent);
}

.cat-hero .ico {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--c);
  box-shadow: 0 12px 22px -12px var(--c);
}

.cat-hero .ico img {
  width: 48px;
  height: 48px;
}

.cat-hero h1 {
  font-size: 34px;
  margin-bottom: 6px;
}

.cat-hero p {
  color: var(--muted);
  font-weight: 600;
  max-width: 860px;
  line-height: 1.65;
}

.cat-hero .picks {
  font-size: 14px;
  color: var(--muted);
}

.cat-hero .picks b {
  color: var(--text);
}

.cat-hero .picks a {
  color: var(--brand-ink);
}

.list-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.list-bar .count {
  color: var(--muted);
  font-weight: 800;
}

/* ---------------------------------------------------------------- game page */
.stage {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 150px;
  gap: 14px;
  align-items: start;
}

.stage.no-rails {
  grid-template-columns: minmax(0, 1fr);
}

.rail {
  display: grid;
  gap: 14px;
}

.rail .t .cap {
  padding: 18px 8px 6px;
}

.rail .t .cap b {
  font-size: 12.5px;
}

.player-card {
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 0;
}

.player {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - var(--header-h) - 130px);
  min-height: 300px;
  width: 100%;
  overflow: hidden;
  background: #120c2a;
  color: #fff;
}

.player.portrait {
  aspect-ratio: 4 / 3;
}

.player-bg {
  position: absolute;
  inset: -40px;
  width: calc(100% + 80px);
  height: calc(100% + 80px);
  object-fit: cover;
  filter: blur(28px) saturate(1.3) brightness(.6);
}

.poster {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px;
  text-align: center;
}

.poster-art {
  width: min(320px, 46%);
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .9), 0 30px 60px -20px rgba(0, 0, 0, .7);
}

.play-big {
  width: 84px;
  height: 84px;
  margin-top: -58px;
  border-radius: 50%;
  border: 5px solid #fff;
  background: var(--grad);
  display: grid;
  place-items: center;
  box-shadow: 0 16px 34px -10px rgba(124, 77, 255, .8);
  transition: transform .2s;
  padding: 0;
}

.play-big:hover {
  transform: scale(1.07);
}

.play-big svg {
  width: 38px;
  height: 38px;
  margin-inline-start: 4px;
  color: #fff;
}

.play-label {
  font: 800 22px/1 var(--font-display);
  background: #fff;
  color: #5b2ee0;
  padding: 9px 22px 6px;
  border-radius: 999px;
  border: 0;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .6);
}

.play-hint {
  font-size: 13px;
  opacity: .85;
  max-width: 420px;
}

.player iframe,
.player .embed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.player .layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: rgba(14, 9, 34, .88);
  backdrop-filter: blur(6px);
}

.player .layer h3 {
  font-size: 24px;
}

.player .layer p {
  color: rgba(255, 255, 255, .8);
  font-weight: 600;
  max-width: 420px;
}

.spinner {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 5px solid rgba(255, 255, 255, .18);
  border-top-color: #fff;
  animation: spin .8s linear infinite;
}

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

.loadbar {
  width: 220px;
  height: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .15);
  overflow: hidden;
}

.loadbar i {
  display: block;
  height: 100%;
  width: 30%;
  border-radius: 8px;
  background: var(--grad);
  animation: loading 1.2s ease-in-out infinite;
}

@keyframes loading {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(340%);
  }
}

.preroll .ad-box {
  width: min(640px, 92%);
  min-height: 200px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .06);
  border-radius: 14px;
  overflow: hidden;
}

.preroll .skip-ad {
  position: absolute;
  inset-inline-end: 16px;
  bottom: 16px;
}

.rotate-hint svg {
  width: 64px;
  height: 64px;
  animation: rotate-phone 2s ease-in-out infinite;
}

@keyframes rotate-phone {
  40%,
  60% {
    transform: rotate(-90deg);
  }
}

.player-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.pb-thumb {
  width: 64px;
  height: 40px;
  object-fit: cover;
  border-radius: 10px;
  flex: none;
  background: var(--tile-bg);
}

.pb-title {
  min-width: 0;
}

.pb-title h1 {
  font-size: 23px;
  margin: 0 0 3px;
  padding-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pb-title div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pb-meta {
  font-size: 13px;
  color: var(--muted);
}

.pb-actions {
  display: flex;
  gap: 8px;
  margin-inline-start: auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-weight: 900;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  transition: background .2s, transform .2s, color .2s;
}

.pill:hover {
  transform: translateY(-1px);
}

.pill svg {
  width: 18px;
  height: 18px;
}

.pill.on {
  color: var(--brand-ink);
  background: color-mix(in srgb, var(--brand) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
}

.pill.fav.on {
  color: #e8336e;
  background: color-mix(in srgb, #ff4f8b 14%, var(--surface));
  border-color: color-mix(in srgb, #ff4f8b 30%, var(--line));
}

.pill.fav.on svg path {
  fill: currentColor;
}

.pill.brand {
  background: var(--grad);
  border: 0;
  color: #fff;
}

.pill.icon {
  width: 40px;
  padding: 0;
  justify-content: center;
}

/* Fullscreen: the browser's own fullscreen, or a full-window mode where it is
   missing (iPhone Safari). */
.player-card.is-full,
.player-card:fullscreen {
  position: fixed;
  inset: 0;
  z-index: 200;
  border-radius: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  background: #000;
}

.player-card.is-full {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.player-card.is-full .player,
.player-card:fullscreen .player {
  flex: 1;
  aspect-ratio: auto;
  max-height: none;
  height: 100%;
}

.player-card.is-full .player-bar,
.player-card:fullscreen .player-bar {
  display: none;
}

.exit-full {
  display: none;
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  inset-inline-end: max(10px, env(safe-area-inset-right), env(safe-area-inset-left));
  z-index: 10;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  place-items: center;
  padding: 0;
}

.exit-full svg {
  width: 20px;
  height: 20px;
}

.player-card.is-full .exit-full,
.player-card:fullscreen .exit-full {
  display: grid;
}

body.no-scroll {
  overflow: hidden;
}

.related {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 14px;
}

.gp-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 20px;
  margin-top: 30px;
  align-items: start;
}

.gp-main,
.gp-side {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
  min-width: 0;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.card-head h2,
.card-head h3 {
  font-size: 20px;
}

.card-head small {
  color: var(--muted);
  font-size: 13px;
}

.tagline {
  font-size: 22px;
  margin: 0 0 12px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding-block: 0;
  padding-inline: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  background: color-mix(in srgb, var(--c, var(--brand)) 14%, var(--surface));
  color: color-mix(in srgb, var(--c, var(--brand)) 70%, var(--text));
}

.tag img {
  width: 22px;
  height: 22px;
}

.tag.plain {
  background: var(--surface-2);
  color: var(--muted);
  padding-inline-start: 12px;
}

.prose {
  font-weight: 600;
  font-size: 16px;
  line-height: 1.7;
}

.prose h2,
.prose h3 {
  font-size: 21px;
  margin: 22px 0 10px;
}

.prose ul,
.prose ol {
  padding-inline-start: 22px;
}

.prose li {
  margin: 4px 0;
}

.prose a {
  color: var(--brand-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.about h2,
.about h3 {
  font-size: 20px;
  margin: 22px 0 10px;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 15px;
  font-weight: 600;
}

.steps b {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--grad);
  color: #fff;
  font-size: 13px;
}

.controls {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr;
  gap: 10px 16px;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
}

.key {
  justify-self: start;
  font-size: 13px;
  font-weight: 900;
  padding: 5px 11px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 3px 0 var(--line);
}

.tips {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.tips li {
  position: relative;
  padding-inline-start: 22px;
  font-weight: 600;
}

.tips li::before {
  content: "";
  position: absolute;
  inset-inline-start: 2px;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--grad);
  transform: rotate(45deg);
}

.details dl {
  display: grid;
  grid-template-columns: auto 1fr;
  margin: 0;
  font-size: 14px;
}

.details dt,
.details dd {
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  margin: 0;
}

.details dt {
  color: var(--muted);
}

.details dd {
  text-align: end;
}

.details dd a {
  color: var(--brand-ink);
}

.details dl > :nth-last-child(-n+2) {
  border-bottom: 0;
}

.tabs-mini {
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 12.5px;
}

.tabs-mini button {
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--muted);
  border: 0;
  background: none;
  font-weight: 800;
}

.tabs-mini button.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.board {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.board li,
[data-board-me] {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 12px;
  font-size: 14px;
  min-width: 0;
}

.board li:nth-child(odd) {
  background: var(--surface-2);
}

.board img,
[data-board-me] img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex: none;
  background: var(--surface-2);
}

.board .who {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board small {
  color: var(--muted);
  font-size: 12px;
  flex: none;
}

.board .sc,
[data-board-me] .sc {
  margin-inline-start: auto;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.board .empty-row {
  justify-content: center;
  color: var(--muted);
  background: none !important;
  padding: 16px;
}

.rk {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
  background: var(--surface-3);
  color: var(--muted);
  flex: none;
}

.rk.r1 {
  background: linear-gradient(135deg, #ffd95a, #f0a000);
  color: #5a3a00;
}

.rk.r2 {
  background: linear-gradient(135deg, #eef1f8, #bfc6d8);
  color: #39415a;
}

.rk.r3 {
  background: linear-gradient(135deg, #ffc79a, #e07b39);
  color: #5a2600;
}

[data-board-me] {
  margin-top: 8px;
  border: 1px dashed color-mix(in srgb, var(--brand) 45%, var(--line));
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
}

.badges {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 12px;
}

.ab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.medal {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #fff6c8, #ffc233 55%, #e89400);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12), 0 8px 16px -8px rgba(232, 148, 0, .8);
  border: 3px solid #fff;
}

.medal img {
  width: 40px;
  height: 40px;
}

.ab b {
  font-size: 12.5px;
  line-height: 1.2;
}

.ab small {
  font-size: 11.5px;
  line-height: 1.2;
  color: var(--muted);
}

.ab.locked .medal {
  background: var(--surface-2);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .06);
  filter: grayscale(1);
  opacity: .55;
}

.cup-card {
  background:
    radial-gradient(circle at 90% 0%, rgba(255, 255, 255, .25), transparent 45%),
    linear-gradient(140deg, #6a3df0, #a040e8 50%, #ff4fa0);
  color: #fff;
  border: 0;
}

.cup-card .card-head small {
  color: rgba(255, 255, 255, .85);
}

.cup-card p {
  color: rgba(255, 255, 255, .9);
  font-weight: 600;
}

/* comments */
.comments-form {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.comments-form img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex: none;
}

.comments-form .field {
  flex: 1;
}

.comments-form textarea {
  min-height: 82px;
}

.comment {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.comment img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: none;
  background: var(--surface-2);
}

.comment .body {
  flex: 1;
  min-width: 0;
}

.comment .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

.comment .meta b {
  color: var(--text);
  font-size: 14px;
}

.lvl {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.comment p {
  margin: 4px 0 6px;
  font-weight: 600;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.comment .acts {
  display: flex;
  gap: 14px;
  font-size: 13px;
}

.comment .acts button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font-weight: 800;
}

.comment .acts button:hover {
  color: var(--brand-ink);
}

.comment .replies {
  margin-top: 6px;
  padding-inline-start: 14px;
  border-inline-start: 3px solid var(--surface-3);
}

.comment .replies .comment {
  border-top: 0;
  padding: 8px 0;
}

/* ---------------------------------------------------------------- forms */
.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.field > label {
  font-weight: 900;
  font-size: 14px;
}

.field small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.field select,
.field textarea {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-weight: 700;
  transition: border-color .2s, box-shadow .2s;
}

.field textarea {
  height: auto;
  min-height: 120px;
  padding: 12px 16px;
  resize: vertical;
  line-height: 1.5;
}

.field select {
  -webkit-appearance: none;
  appearance: none;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237c4dff' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") right 16px center no-repeat;
  padding-inline-end: 40px;
}

[dir="rtl"] .field select {
  background-position: left 16px center;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 0;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent);
}

.field.has-error input,
.field.has-error textarea,
.field.has-error select {
  border-color: var(--danger);
}

.error {
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.check input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--brand);
  flex: none;
}

.check a {
  color: var(--brand-ink);
  text-decoration: underline;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 800;
  margin: 16px 0;
  border: 1px solid;
}

.alert.success {
  background: color-mix(in srgb, var(--ok) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--ok) 35%, transparent);
  color: color-mix(in srgb, var(--ok) 75%, var(--text));
}

.alert.error {
  background: color-mix(in srgb, var(--danger) 9%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
  color: color-mix(in srgb, var(--danger) 80%, var(--text));
}

.alert.info {
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--brand) 25%, transparent);
  color: var(--brand-ink);
}

/* ---------------------------------------------------------------- modal, toasts, notice */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(14, 9, 34, .55);
  backdrop-filter: blur(4px);
  animation: fade .2s ease;
}

.modal-box {
  width: min(460px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--surface);
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  padding: 22px 24px;
  animation: pop .25s cubic-bezier(.2, .9, .3, 1.2);
}

.modal-box h3 {
  font-size: 22px;
  margin-bottom: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.choice {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.choice label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-weight: 800;
  cursor: pointer;
}

.choice input {
  accent-color: var(--brand);
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes pop {
  from {
    transform: scale(.92) translateY(8px);
    opacity: 0;
  }
}

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 400;
  display: grid;
  gap: 10px;
  transform: translateX(-50%);
  pointer-events: none;
  width: min(420px, calc(100% - 28px));
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 18px;
  background: #1b1436;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .6);
  animation: toast-in .35s cubic-bezier(.2, .9, .3, 1.2);
  pointer-events: auto;
}

[data-theme="dark"] .toast {
  background: #2a2257;
  border: 1px solid var(--line-2);
}

.toast img {
  width: 40px;
  height: 40px;
  flex: none;
}

.toast .xp {
  margin-inline-start: auto;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--grad);
  font-size: 13px;
}

.toast.out {
  animation: toast-out .3s ease forwards;
}

@keyframes toast-in {
  from {
    transform: translateY(20px) scale(.95);
    opacity: 0;
  }
}

@keyframes toast-out {
  to {
    transform: translateY(12px);
    opacity: 0;
  }
}

.notice {
  position: fixed;
  inset-inline-start: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 250;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 520px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  font-weight: 700;
  font-size: 14px;
}

.notice a {
  color: var(--brand-ink);
  text-decoration: underline;
}

/* ---------------------------------------------------------------- profile */
.profile-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 26px;
  margin-top: 22px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 92% 0%, color-mix(in srgb, var(--brand-2) 20%, transparent), transparent 45%),
    linear-gradient(120deg, color-mix(in srgb, var(--brand) 14%, var(--surface)), var(--surface) 70%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.profile-hero .ring {
  width: 112px;
  height: 112px;
  padding: 5px;
}

.profile-hero h1 {
  font-size: 32px;
}

.profile-hero .who {
  flex: 1;
  min-width: 220px;
}

.profile-hero p {
  color: var(--muted);
  font-weight: 600;
  margin: 4px 0 10px;
}

.level-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 14px;
}

.level-line .xpbar {
  flex: 1;
  max-width: 340px;
  height: 10px;
  margin: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 10px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  text-align: center;
}

.stat b {
  display: block;
  font: 800 24px/1.1 var(--font-display);
}

.stat small {
  color: var(--muted);
  font-size: 12.5px;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}

.list-plain {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.list-plain li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 14px;
  min-width: 0;
}

.list-plain li img {
  width: 54px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  flex: none;
}

.list-plain li .grow {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- rankings and cups */
.rank-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
}

.rank-table td {
  padding: 8px 10px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}

.rank-table td:first-child {
  border-inline-start: 1px solid var(--line);
  border-start-start-radius: 14px;
  border-end-start-radius: 14px;
  width: 46px;
}

.rank-table td:last-child {
  border-inline-end: 1px solid var(--line);
  border-start-end-radius: 14px;
  border-end-end-radius: 14px;
  text-align: end;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.rank-table .player-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rank-table img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.prize {
  display: inline-block;
  margin-inline-start: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, #ffc233 22%, var(--surface));
  color: color-mix(in srgb, #b26b00 80%, var(--text));
  font-size: 12px;
  font-weight: 900;
}

.cup-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  align-items: center;
  padding: 26px;
  margin-top: 22px;
  border-radius: 26px;
  color: #fff;
  background:
    radial-gradient(circle at 85% 10%, rgba(255, 255, 255, .25), transparent 40%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .05) 0 14px, transparent 14px 28px),
    linear-gradient(140deg, #6a3df0 0%, #a040e8 45%, #ff4fa0 100%);
  box-shadow: 0 24px 50px -24px rgba(106, 61, 240, .7);
}

.cup-hero h1 {
  font-size: 36px;
  margin: 6px 0 8px;
}

.cup-hero p {
  color: rgba(255, 255, 255, .9);
  font-weight: 600;
}

.cup-hero .timer {
  display: flex;
  gap: 10px;
  margin: 14px 0 18px;
}

.cup-hero .timer div {
  min-width: 74px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .25);
  text-align: center;
}

.cup-hero .timer b {
  display: block;
  font: 800 30px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
}

.cup-hero .timer small {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .85;
}

.cup-hero .art {
  border-radius: 22px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .85), 0 30px 50px -24px rgba(0, 0, 0, .6);
}

.cup-hero .art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cup-hero .btn {
  background: #fff;
  color: #5b2ee0;
  border: 0;
}

.prizes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prizes span {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  font-size: 13px;
  font-weight: 900;
}

.past-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.past {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.past .top {
  display: flex;
  gap: 10px;
  align-items: center;
}

.past .top img {
  width: 72px;
  height: 45px;
  border-radius: 10px;
  object-fit: cover;
}

/* ---------------------------------------------------------------- account and auth */
.account-grid {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 20px;
  margin-top: 22px;
  align-items: start;
}

.side-nav {
  position: sticky;
  top: calc(var(--header-h) + 72px);
  display: grid;
  gap: 4px;
  padding: 10px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 800;
  color: var(--muted);
}

.side-nav a:hover,
.side-nav a.on {
  background: var(--surface-2);
  color: var(--text);
}

.side-nav img {
  width: 26px;
  height: 26px;
}

.avatars {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 10px;
}

.avatars button {
  padding: 4px;
  border-radius: 50%;
  border: 3px solid transparent;
  background: var(--surface-2);
}

.avatars button.on {
  border-color: var(--brand);
}

.avatars img {
  width: 100%;
  border-radius: 50%;
}

.social-btns {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-weight: 900;
}

.social-btn i {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-style: normal;
  font-size: 14px;
  font-weight: 900;
  background: var(--c);
}

.or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--faint);
  font-size: 13px;
  font-weight: 800;
  margin: 6px 0 16px;
}

.or::before,
.or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 980px;
  margin: 40px auto 0;
  border-radius: 28px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}

.auth-art {
  position: relative;
  padding: 34px;
  color: #fff;
  background:
    radial-gradient(circle at 85% 10%, rgba(255, 255, 255, .25), transparent 40%),
    linear-gradient(150deg, #6a3df0, #a040e8 55%, #ff4fa0);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-art .auth-art-title {
  font-size: 30px;
}

.auth-art ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
  font-weight: 800;
}

.auth-art li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-art li img {
  width: 40px;
  height: 40px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .18);
}

.auth-art .collage {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.auth-art .collage img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .5);
}

.auth-form {
  padding: 34px 36px;
}

.auth-form h1 {
  font-size: 30px;
  margin-bottom: 4px;
}

.auth-form > p {
  color: var(--muted);
  font-weight: 600;
}

.auth-form .switch {
  text-align: center;
  margin-top: 16px;
  color: var(--muted);
  font-weight: 700;
}

.auth-form .switch a,
.link {
  color: var(--brand-ink);
  font-weight: 900;
}

.narrow {
  max-width: 760px;
  margin: 0 auto;
}

.notif {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.notif img {
  width: 40px;
  height: 40px;
}

.notif.unread b {
  color: var(--brand-ink);
}

.notif small {
  color: var(--muted);
}

/* error and offline pages */
.oops {
  text-align: center;
  padding: 70px 20px 40px;
}

.oops .code {
  font: 800 110px/1 var(--font-display);
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.oops h1 {
  font-size: 30px;
  margin: 6px 0 10px;
}

.oops p {
  color: var(--muted);
  font-weight: 600;
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1280px) {
  .related {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .related > :nth-child(n+7) {
    display: none;
  }

  .strip {
    grid-auto-columns: calc((100% - 5 * 14px) / 6);
  }

  .recent {
    grid-auto-columns: calc((100% - 3 * 14px) / 4);
  }
}

@media (max-width: 1100px) {
  .stage {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    display: none;
  }

  .gp-body,
  .profile-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ftr-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1024px) {
  .seg {
    display: none;
  }

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

  .strip {
    grid-auto-columns: calc((100% - 3 * 14px) / 4);
  }

  .cup-hero {
    grid-template-columns: 1fr;
  }

  .auth {
    grid-template-columns: 1fr;
  }

  .auth-art {
    display: none;
  }

  .account-grid {
    grid-template-columns: 1fr;
  }

  .side-nav {
    position: static;
    display: flex;
    overflow-x: auto;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 62px;
  }

  body {
    font-size: 14.5px;
  }

  .wrap {
    padding: 0 14px;
  }

  .d-only {
    display: none !important;
  }

  .m-only {
    display: flex !important;
  }

  .hdr-in {
    gap: 8px;
  }

  .logo-mark {
    width: 38px;
    height: 38px;
  }

  .logo-word {
    font-size: 27px;
  }

  .search {
    display: none;
    position: absolute;
    left: 10px;
    right: 10px;
    top: 8px;
    max-width: none;
    z-index: 5;
  }

  .search.open {
    display: block;
  }

  .btn-surprise {
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
    border-radius: 14px;
  }

  .icon-btn {
    width: 44px;
    height: 44px;
  }

  .me-btn {
    padding: 3px;
  }

  .btn-signin {
    height: 44px;
    padding: 0 14px;
    font-size: 14px;
  }

  .chips {
    gap: 8px;
    padding-bottom: 12px;
  }

  .chip {
    height: 40px;
    font-size: 14px;
  }

  .intro {
    flex-direction: column;
    gap: 2px;
    padding: 16px 0 12px;
  }

  .intro h1 {
    font-size: 25px;
  }

  .intro h1 span {
    display: none;
  }

  .mosaic {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .mosaic.hero > .t.cup {
    display: none;
  }

  .mosaic.hero > .t:nth-last-child(-n+2) {
    display: block;
  }

  .mosaic.hero > .t:last-child {
    display: none;
  }

  .mosaic.sec > .t:nth-child(n+10) {
    display: none;
  }

  .t {
    border-radius: 13px;
  }

  .t .cap {
    display: none;
  }

  .t.xl .cap {
    display: flex;
    padding: 30px 10px 8px;
  }

  .t.xl .cap b {
    font-size: 19px;
  }

  .badge {
    top: 7px;
    inset-inline-start: 7px;
    height: 21px;
    padding: 0 8px;
    font-size: 9.5px;
  }

  .t.cup.cup-banner {
    display: flex;
    margin-top: 14px;
    border-radius: 18px;
    aspect-ratio: auto;
    min-height: 0;
  }

  .row {
    margin-top: 26px;
  }

  .row-head h2 {
    font-size: 21px;
  }

  .row-head .ico {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .row-head .ico img {
    width: 26px;
    height: 26px;
  }

  .row-head .arrow {
    display: none;
  }

  .all {
    height: 34px;
    padding: 0 12px;
    font-size: 13px;
  }

  .strip {
    grid-auto-columns: 42%;
    margin: -6px -14px -10px;
    padding: 6px 14px 10px;
    scroll-padding: 0 14px;
  }

  .recent {
    grid-auto-columns: 74%;
    margin: 0 -14px;
    padding: 0 14px;
  }

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

  .grid .t .cap {
    display: none;
  }

  .cat {
    height: 78px;
    padding: 0 14px;
  }

  .cat b {
    font-size: 19px;
  }

  .cat img {
    width: 58px;
    height: 58px;
    margin-top: -29px;
    inset-inline-end: 6px;
  }

  .cat span {
    padding-inline-end: 56px;
  }

  .ad-slot {
    min-height: 90px;
  }

  .ad-sticky {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + 66px);
    z-index: 35;
    justify-content: center;
    background: var(--surface);
    border-top: 1px solid var(--line);
    min-height: 50px;
  }

  .ad-sticky .ad-close {
    position: absolute;
    top: -28px;
    inset-inline-end: 8px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
  }

  main {
    padding-bottom: 100px;
  }

  .tabbar {
    display: flex;
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 30;
    justify-content: space-around;
    padding: 6px;
    border-radius: 22px;
    background: var(--glass);
    backdrop-filter: blur(10px) saturate(1.4);
    -webkit-backdrop-filter: blur(10px) saturate(1.4);
    border: 1px solid var(--line);
    box-shadow: 0 16px 34px -14px rgba(27, 20, 54, .45);
  }

  .tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 5px 9px 3px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 900;
    color: var(--muted);
  }

  .tabbar a.on {
    color: var(--brand-ink);
    background: color-mix(in srgb, var(--brand) 12%, transparent);
  }

  .tabbar img {
    width: 27px;
    height: 27px;
  }

  .ftr {
    margin-top: 40px;
    padding-bottom: 110px;
  }

  .ftr-grid {
    grid-template-columns: 1fr 1fr;
    gap: 22px;
  }

  .ftr-brand {
    grid-column: 1 / -1;
  }

  .page-head h1 {
    font-size: 25px;
  }

  .page-head .ico {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .page-head .ico img {
    width: 34px;
    height: 34px;
  }

  .cat-hero {
    padding: 18px;
    flex-direction: column;
  }

  .cat-hero h1 {
    font-size: 26px;
  }

  .crumbs {
    display: none;
  }

  .gp > .stage {
    margin: 8px -14px 0;
  }

  .player-card {
    border-radius: 0;
    border-inline-start: 0;
    border-inline-end: 0;
  }

  .player {
    aspect-ratio: 4 / 3;
    min-height: 0;
    max-height: none;
  }

  .poster-art {
    width: 56%;
  }

  .play-big {
    width: 70px;
    height: 70px;
    margin-top: -46px;
  }

  .play-hint {
    display: none;
  }

  .player-bar {
    flex-wrap: wrap;
  }

  .pb-title {
    flex: 1;
  }

  .pb-title h1 {
    font-size: 21px;
  }

  .pb-actions {
    width: 100%;
    margin-inline-start: 0;
    flex-wrap: wrap;
  }

  .pill {
    flex: none;
  }

  /* Phones: the small buttons on one line, a full-width Fullscreen button under them. */
  .pb-actions .pill.brand {
    flex: 1 0 100%;
    justify-content: center;
  }

  .related {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .related > :nth-child(n+7) {
    display: none;
  }

  .related .t .cap {
    display: none;
  }

  .card {
    padding: 18px 16px;
  }

  .controls {
    grid-template-columns: 130px 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .auth {
    margin-top: 18px;
    border-radius: 22px;
  }

  .auth-form {
    padding: 24px 18px;
  }

  .notice {
    left: 10px;
    right: 10px;
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + 80px);
    flex-direction: column;
    align-items: stretch;
  }

  .toasts {
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + 86px);
  }
}

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

/* ---------------------------------------------------------------- right-to-left languages */
[dir="rtl"] .flip-rtl {
  transform: scaleX(-1);
}

/* Letter spacing pulls joined Arabic letters apart. */
[dir="rtl"] * {
  letter-spacing: normal !important;
}
