/* Kings Chess Club website. Mobile-first and right-to-left aware (logical CSS
   properties). High-contrast KCC palette: deep black background, vivid gold
   for primary actions and accents, pure white for text, borders and secondary
   actions. The header, footer and KCC title badge live in chrome.css (shared
   with the Arena Portal). */

:root {
  color-scheme: dark;
  /* Brand */
  --black: #090909;
  --gold: #ffd000;
  --gold-hover: #ffdc3d;
  --white: #ffffff;
  /* Page */
  --bg: var(--black);
  --surface: #121212;
  --surface-2: #1a1a1a;
  --text: var(--white);
  --text-2: #d9d9d9;
  --muted: #a3a3a3;
  --line: #2a2a2a;
  --line-strong: #4a4a4a;
  --ink: var(--black);
  --ink-2: #121212;
  --on-ink: var(--white);
  --on-ink-2: #c7c7c7;
  --strong: var(--white);
  --on-strong: #000000;
  --accent: var(--gold);
  --accent-2: var(--gold-hover);
  --accent-deep: var(--gold);
  --accent-soft: rgba(255, 208, 0, 0.12);
  --on-accent: #000000;
  --silver: var(--white);
  /* Status colours (functional, tuned for the black background) */
  --green: #4fd38c;
  --green-soft: rgba(79, 211, 140, 0.14);
  --red: #ff7b72;
  --red-soft: rgba(255, 123, 114, 0.12);
  --blue: #7fb0ff;
  --blue-soft: rgba(127, 176, 255, 0.14);
  --amber: #ffb547;
  --amber-soft: rgba(255, 181, 71, 0.14);
  --pink: #ff8fc0;
  --pink-soft: rgba(255, 143, 192, 0.14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.45), 0 12px 32px rgba(0, 0, 0, 0.4);
  --radius: 18px;
  --radius-sm: 12px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --arabic: "Segoe UI", "Noto Naskh Arabic", "Noto Sans Arabic", "Geeza Pro", "Arabic Typesetting", Tahoma, sans-serif;
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  line-height: 1.15;
  letter-spacing: -0.005em;
  margin: 0 0 0.6rem;
}

h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
}

h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.25rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--accent-deep);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

img {
  max-width: 100%;
  height: auto;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

main:focus {
  outline: none;
}

.skip-link {
  position: absolute;
  inset-inline-start: -9999px;
  top: 8px;
  z-index: 100;
  background: var(--surface);
  color: var(--text);
  padding: 0.6rem 1rem;
  border-radius: 10px;
}

.skip-link:focus {
  inset-inline-start: 8px;
}

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

.wrap {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 700px) {
  .wrap {
    padding: 0 24px;
  }
}

.narrow {
  max-width: 800px;
}

.narrow-wide {
  max-width: 980px;
}

.center {
  text-align: center;
}

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

.small {
  font-size: 0.88rem;
}

.grow {
  flex: 1;
  min-width: 0;
}

.stack > * + * {
  margin-top: 1.2rem;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

.icon-sm {
  width: 1em;
  height: 1em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  font-weight: 750;
  color: var(--accent-deep);
  margin: 0 0 0.7rem;
  font-family: var(--sans);
}

.eyebrow-light {
  color: var(--accent);
}

.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.65;
  color: var(--text-2);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  color: var(--accent-deep);
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.2rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  min-height: 44px;
}

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

.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.btn-lg {
  padding: 0.92rem 1.5rem;
  font-size: 1.02rem;
  min-height: 52px;
}

.btn-sm {
  padding: 0.42rem 0.85rem;
  font-size: 0.86rem;
  min-height: 36px;
}

.btn-block {
  width: 100%;
}

/* Primary action: vivid gold with black text. */
.btn-cream,
.btn-gold {
  background: var(--gold);
  color: #000000;
  font-weight: 750;
  border-color: var(--gold);
  box-shadow: 0 8px 24px rgba(255, 208, 0, 0.22);
}

.btn-cream:hover,
.btn-gold:hover {
  background: var(--gold-hover);
  border-color: var(--gold-hover);
}

/* Solid white with black text. */
.btn-dark {
  background: var(--white);
  color: #000000;
  border-color: var(--white);
}

.btn-dark:hover {
  background: var(--gold);
  border-color: var(--gold);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}

.btn-outline:hover {
  background: var(--white);
  color: #000000;
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}

.btn-ghost:hover {
  background: var(--surface-2);
}

/* Secondary action on black (e.g. KCC Arena Portal): black, white border, white text. */
.btn-outline-light {
  background: var(--black);
  color: var(--white);
  border: 2px solid var(--white);
  font-weight: 700;
}

.btn-outline-light:hover {
  background: var(--white);
  color: #000000;
}

.btn-ghost-light {
  background: transparent;
  color: var(--on-ink-2);
}

.btn-ghost-light:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.btn-danger-outline {
  background: transparent;
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 40%, transparent);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
}

.btn-row.center {
  justify-content: center;
}

/* ---------- Tags ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--line);
  line-height: 1.4;
  white-space: nowrap;
}

.tag-arena {
  background: var(--black);
  color: var(--gold);
  border-color: var(--gold);
}

.tag-news,
.tag-type {
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-color: transparent;
}

.tag-open {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: transparent;
}

.tag-live,
.tag-free {
  background: var(--green-soft);
  color: var(--green);
  border-color: transparent;
}

.tag-paid {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: transparent;
}

.tag-full,
.tag-closed {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: transparent;
}

.tag-cancelled {
  background: var(--red-soft);
  color: var(--red);
  border-color: transparent;
}

.tag-female {
  background: var(--pink-soft);
  color: var(--pink);
  border-color: transparent;
}

.tag-male {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: transparent;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0 0 0.7rem;
}

.live-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22b16a;
  flex: none;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 177, 106, 0.55);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(34, 177, 106, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 177, 106, 0);
  }
}

/* ---------- Announcement ---------- */

.announcement {
  background: var(--gold);
  color: #000000;
  font-size: 0.92rem;
  font-weight: 600;
}

.announcement .wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.7rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  text-align: center;
}

.announcement a {
  color: inherit;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* ---------- Heroes & dark bands ---------- */

.hero,
.page-hero,
.portal-band,
.section-dark {
  position: relative;
  color: var(--on-ink);
  background: radial-gradient(900px 520px at 88% 10%, rgba(255, 208, 0, 0.1), transparent 62%), var(--black);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  isolation: isolate;
}

.hero::before,
.page-hero::before,
.portal-band::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: repeating-conic-gradient(rgba(255, 255, 255, 0.035) 0 25%, transparent 0 50%);
  background-size: 72px 72px;
  -webkit-mask-image: linear-gradient(100deg, transparent 20%, #000 85%);
  mask-image: linear-gradient(100deg, transparent 20%, #000 85%);
}

[dir="rtl"] .hero::before,
[dir="rtl"] .page-hero::before,
[dir="rtl"] .portal-band::before {
  -webkit-mask-image: linear-gradient(-100deg, transparent 20%, #000 85%);
  mask-image: linear-gradient(-100deg, transparent 20%, #000 85%);
}

.hero-inner {
  display: grid;
  gap: 2.5rem;
  align-items: center;
  padding-top: clamp(2.8rem, 7vw, 5.5rem);
  padding-bottom: clamp(2.8rem, 7vw, 5.5rem);
}

@media (min-width: 900px) {
  .hero-inner {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.hero h1,
.page-hero h1,
.portal-band h2,
.section-dark h2 {
  color: #fff;
}

.hero .lead,
.page-hero .lead,
.portal-band .lead {
  color: var(--on-ink-2);
  max-width: 660px;
}

.hero .btn-row {
  margin-top: 1.8rem;
}

.hero-stats {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  padding: 0;
  margin: 2rem 0 0;
  color: var(--on-ink-2);
  font-size: 0.95rem;
}

.hero-stats strong {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: #fff;
  margin-inline-end: 0.35rem;
}

.hero-art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
}

.hero-board {
  position: absolute;
  width: min(380px, 84%);
  aspect-ratio: 1;
  border-radius: 28px;
  transform: rotate(-8deg);
  background: repeating-conic-gradient(rgba(255, 208, 0, 0.1) 0 25%, rgba(255, 255, 255, 0.03) 0 50%) 0 0 / 25% 25%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.hero-emblem {
  position: relative;
  width: min(340px, 74%);
  height: auto;
  border-radius: 50%;
  filter: drop-shadow(0 22px 40px rgba(0, 0, 0, 0.55));
}

.hero-art.has-photo {
  min-height: 0;
}

.hero-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

@media (max-width: 899px) {
  .hero-art:not(.has-photo) {
    display: none;
  }
}

.page-hero {
  padding: clamp(2.6rem, 7vw, 4.6rem) 0 clamp(2.2rem, 5vw, 3.6rem);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.9rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.crumbs a {
  color: var(--muted);
  text-decoration: none;
}

.crumbs a::before {
  content: "← ";
}

[dir="rtl"] .crumbs a::before {
  content: "→ ";
}

.crumbs a:hover {
  text-decoration: underline;
}

.crumbs-light a {
  color: var(--on-ink-2);
}

.live-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  padding: 0.9rem 1.1rem;
  border-radius: 14px;
  background: var(--green-soft);
  border: 1px solid color-mix(in srgb, var(--green) 35%, transparent);
  color: var(--text);
}

.live-notice + .live-notice {
  margin-top: 0.6rem;
}

.live-notice > span:not(.live-dot) {
  flex: 1 1 220px;
}

.live-notice a {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 700;
  color: inherit;
}

.countdown {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(2.8rem, 6vw, 5rem) 0;
}

.section-tint {
  background: var(--surface-2);
}

.section-live {
  padding: 1.4rem 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.6rem;
}

.section-head h2 {
  margin: 0;
}

.section-foot {
  margin-top: 1.6rem;
}

.section-dark .eyebrow {
  color: var(--accent);
}

.section-dark .text-link {
  color: var(--accent);
}

/* ---------- Intro & highlights ---------- */

.intro-grid {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 900px) {
  .intro-grid {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: start;
  }
}

.highlights {
  display: grid;
  gap: 1rem;
}

.highlight {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.2rem 1.3rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.highlight h3 {
  margin-bottom: 0.3rem;
}

.highlight p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.97rem;
}

.highlight-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 14px;
  background: var(--ink);
  color: var(--accent);
}

/* Icon tiles are black with a gold icon; the gold outline keeps them visible on black cards. */
.highlight-icon,
.choice-icon,
.choice-badge,
.notif-icon {
  border: 1px solid rgba(255, 208, 0, 0.55);
}

.highlight-icon .icon {
  width: 24px;
  height: 24px;
}

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: clamp(1.1rem, 3vw, 1.6rem);
}

.card h2 {
  font-size: 1.35rem;
}

.card-link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.event-grid,
.news-grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
}

.event-card,
.news-card,
.album-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.event-card:hover,
.news-card:hover,
.album-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}

.event-card.is-live {
  border-color: color-mix(in srgb, var(--green) 50%, var(--line));
}

.section-dark .event-card {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--on-ink);
}

.section-dark .event-card .summary,
.section-dark .event-card .event-facts {
  color: var(--on-ink-2);
}

.event-card .card-link {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 1rem;
  padding: 1.25rem;
}

.event-card.is-cancelled h3 {
  text-decoration: line-through;
  color: var(--muted);
}

.date-badge {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.1rem;
  padding: 0.6rem 0.3rem 0.65rem;
  border-radius: 14px;
  background: var(--black);
  color: var(--white);
  border: 1px solid var(--gold);
  text-align: center;
  align-self: start; /* a compact badge, not the full height of the card */
}

.date-badge .month {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.date-badge .day {
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
}

.date-badge .weekday {
  font-size: 0.72rem;
  color: var(--on-ink-2);
}

.event-body {
  min-width: 0;
}

.event-body h3 {
  margin: 0 0 0.6rem;
}

.event-facts {
  list-style: none;
  padding: 0;
  margin: 0 0 0.8rem;
  display: grid;
  gap: 0.3rem;
  font-size: 0.92rem;
  color: var(--text-2);
}

.event-facts li {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}

.event-facts .icon {
  position: relative;
  top: 0.15em;
  color: var(--accent-deep);
}

.summary {
  color: var(--text-2);
  font-size: 0.95rem;
  margin: 0 0 0.9rem;
}

.more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--accent-deep);
}

.section-dark .more {
  color: var(--accent);
}

.news-media,
.album-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--ink);
  overflow: hidden;
}

.news-media img,
.album-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s;
}

.news-card:hover .news-media img,
.album-card:hover .album-media > img {
  transform: scale(1.03);
}

.media-placeholder {
  height: 100%;
  display: grid;
  place-items: center;
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.04) 0 25%, transparent 0 50%) 0 0 / 40px 40px, var(--ink);
}

.media-placeholder img {
  width: 76px;
  height: 76px;
  opacity: 0.95;
  border-radius: 50%;
}

.news-body,
.album-body {
  padding: 1.2rem 1.3rem 1.35rem;
}

.album-body h3 {
  margin: 0 0 0.2rem;
  font-size: 1.1rem;
}

.album-body p {
  margin: 0;
}

.album-count {
  position: absolute;
  inset-inline-end: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

.album-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
}

/* ---------- Tournaments & Events choices ---------- */

.step-label {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.choice-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.choice-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: clamp(1.3rem, 3vw, 2rem);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  min-height: 150px;
}

a.choice-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--text-2);
}

.choice-card.is-disabled {
  opacity: 0.72;
  background: var(--surface-2);
  cursor: not-allowed;
  border-style: dashed;
}

.choice-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 18px;
  background: var(--ink);
  color: var(--accent);
}

.choice-icon .icon {
  width: 32px;
  height: 32px;
}

.choice-body {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.choice-title {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.15;
}

.choice-text {
  color: var(--text-2);
  font-size: 0.95rem;
}

.choice-count {
  margin-top: 0.3rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-deep);
}

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

.choice-badge {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.quick-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  padding-bottom: 3rem;
}

.quick-links-row a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  color: var(--text-2);
  text-decoration: none;
}

.quick-links-row a:hover {
  color: var(--text);
  text-decoration: underline;
}

/* ---------- Filters & paging ---------- */

.filter-bar {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1.6rem;
}

.filter-tabs {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
}

.filter-bar .filter-tabs {
  margin: 0;
}

.filter-tabs a {
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  color: var(--text-2);
  font-weight: 650;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}

.filter-tabs a:hover {
  border-color: var(--white);
  color: var(--white);
}

.filter-tabs a.active {
  background: var(--strong);
  border-color: var(--strong);
  color: var(--on-strong);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  color: var(--muted);
}

/* ---------- Portal band, rankings strip ---------- */

.portal-band {
  padding: clamp(3rem, 7vw, 5rem) 0;
}

.portal-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 900px) {
  .portal-grid {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

.portal-band .btn-row {
  margin-top: 1.5rem;
}

.portal-steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.7rem;
}

.portal-steps li {
  counter-increment: step;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.95rem 1.1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--on-ink-2);
}

.portal-steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: var(--gold);
  color: #000000;
  font-weight: 800;
}

.portal-steps b {
  color: #fff;
}

.rank-strip {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

.rank-strip li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  min-width: 0;
}

.rank-strip .pos,
.mini-podium .pos,
.podium .pos {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: var(--surface-2);
  font-weight: 800;
  font-size: 0.85rem;
}

/* 1st gold, 2nd white, 3rd bronze (bronze kept only to tell 3rd place apart). */
.rank-strip li:nth-child(1) .pos,
.pos-1 {
  background: var(--gold) !important;
  color: #000000 !important;
}

.rank-strip li:nth-child(2) .pos,
.pos-2 {
  background: var(--white) !important;
  color: #000000 !important;
}

.rank-strip li:nth-child(3) .pos,
.pos-3 {
  background: #cd7f32 !important;
  color: #000000 !important;
}

.rank-strip .pname {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-strip .elo {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.pname a {
  color: inherit;
  font-weight: 650;
  text-decoration: none;
}

.pname a:hover {
  text-decoration: underline;
}

/* ---------- Visit & contact ---------- */

.visit-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 900px) {
  .visit-grid {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
  }
}

.venue {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  color: var(--text-2);
}

.venue .icon {
  margin-top: 0.2rem;
  color: var(--accent-deep);
}

.visit-contact {
  display: grid;
  gap: 1rem;
  justify-items: start;
  padding: 1.8rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.visit-contact h3 {
  margin: 0;
}

.contact-lines,
.contact-cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.contact-lines a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.contact-lines a:hover {
  text-decoration: underline;
}

.contact-lines .icon {
  color: var(--accent-deep);
}

.social-icons {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
}

.social-icons a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: inherit;
  border: 1px solid var(--line-strong);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.social-icons a:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: #000000;
}

/* ♂ / ♀ on the men's and ladies' WhatsApp group icons (.social-badge is in chrome.css). */
.social-icons a,
.social-float-list a,
.whatsapp-cta-icon {
  position: relative;
}

.social-float-list .social-badge {
  inset-block-end: 1px;
  inset-inline-end: 1px;
  border-color: var(--surface);
}

/* "Join the group" on the Male and Female pages of Tournaments & Events */
.whatsapp-cta {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.9rem 1.1rem;
  margin-top: 1.4rem;
  padding: 1.1rem 1.3rem;
  border: 1px solid rgba(255, 208, 0, 0.3);
  border-radius: var(--radius);
  background: radial-gradient(80% 140% at 0% 0%, rgba(255, 208, 0, 0.12), transparent 60%), var(--surface);
}

[dir="rtl"] .whatsapp-cta {
  background: radial-gradient(80% 140% at 100% 0%, rgba(255, 208, 0, 0.12), transparent 60%), var(--surface);
}

.whatsapp-cta-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--gold);
  color: #000000;
}

.whatsapp-cta-icon > .icon {
  width: 28px;
  height: 28px;
}

.whatsapp-cta-icon .social-badge {
  border-color: var(--surface);
  background: var(--white);
}

.whatsapp-cta h2 {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
}

.whatsapp-cta p {
  margin: 0;
  color: var(--text-2);
}

.whatsapp-cta .btn {
  grid-column: 1 / -1;
  justify-self: start;
}

@media (min-width: 700px) {
  .whatsapp-cta {
    grid-template-columns: auto 1fr auto;
  }
  .whatsapp-cta .btn {
    grid-column: auto;
  }
}

.contact-grid {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 900px) {
  .contact-grid {
    grid-template-columns: 0.85fr 1.15fr;
    align-items: start;
  }
}

.contact-info h2 {
  font-size: 1.45rem;
  margin-top: 0.4rem;
}

.contact-cards {
  gap: 0.7rem;
  margin-bottom: 1.2rem;
}

.contact-cards a {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.15rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.contact-cards a:hover {
  border-color: var(--text-2);
}

.contact-cards .icon {
  width: 22px;
  height: 22px;
  color: var(--accent-deep);
}

.contact-venue {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 0.6rem 0.2rem;
  color: var(--text-2);
}

.contact-venue .icon {
  width: 22px;
  height: 22px;
  margin-top: 0.15rem;
  color: var(--accent-deep);
}

.social-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.6rem;
}

.social-list a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
}

.social-list a:hover {
  border-color: var(--text-2);
}

.social-list a .icon-sm {
  margin-inline-start: auto;
  color: var(--muted);
}

.support-card .eyebrow .icon {
  width: 1.1em;
  height: 1.1em;
}

/* ---------- Forms ---------- */

.form {
  display: grid;
  gap: 1rem;
}

.form-row {
  display: grid;
  gap: 1rem;
}

@media (min-width: 600px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.field {
  display: grid;
  gap: 0.4rem;
  align-content: start;
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 0;
}

.field > span:first-child,
.field legend {
  font-weight: 650;
  font-size: 0.93rem;
  padding: 0;
}

.optional {
  font-weight: 400;
  color: var(--muted);
}

.field input,
.field textarea,
.field select,
.search-form input {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.72rem 0.9rem;
}

.field textarea {
  resize: vertical;
  line-height: 1.55;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.search-form input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(255, 208, 0, 0.2);
}

.field-hint {
  font-size: 0.85rem;
  color: var(--muted);
}

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.radio {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  cursor: pointer;
  font-weight: 600;
}

.radio:has(input:checked) {
  border-color: var(--gold);
  background: var(--accent-soft);
}

.radio input {
  accent-color: var(--gold);
}

.check {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  cursor: pointer;
}

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

.check small {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.form-status {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.form-status.ok {
  background: var(--green-soft);
  color: var(--green);
}

.form-status.error {
  background: var(--red-soft);
  color: var(--red);
}

details.optional-fields {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
}

details.optional-fields summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--text-2);
}

details.optional-fields[open] summary {
  margin-bottom: 0.9rem;
}

.photo-picker {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.upload-btn {
  position: relative;
  overflow: hidden;
}

.upload-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.auth-section {
  background: radial-gradient(700px 400px at 50% 0%, rgba(255, 208, 0, 0.12), transparent 70%);
}

.auth-wrap {
  max-width: 520px;
}

.auth-card {
  padding: clamp(1.4rem, 4vw, 2.2rem);
}

.auth-card h1 {
  font-size: 2rem;
}

.auth-logo {
  display: block;
  margin: 0 auto 1rem;
  border-radius: 50%;
}

.auth-alt {
  margin: 1.2rem 0 0;
  text-align: center;
  font-size: 0.95rem;
}

.search-form {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.4rem;
}

.search-form input {
  flex: 1;
}

/* ---------- Avatars ---------- */

.avatar {
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 800;
  overflow: hidden;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 0.75rem;
}

.avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 1.3rem;
}

.avatar-xl {
  width: 108px;
  height: 108px;
  font-size: 2.2rem;
  border: 3px solid var(--gold);
}

.player-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

/* ---------- Tables ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table th {
  text-align: start;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 750;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--surface-2);
}

.table td {
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table tr:last-child td {
  border-bottom: 0;
}

.table .num {
  text-align: end;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table .rank {
  font-weight: 800;
  color: var(--text-2);
}

.table .score,
.elo-cell {
  font-weight: 800;
}

.table tr.is-me td {
  background: var(--accent-soft);
}

.table tr.is-dq td {
  color: var(--muted);
}

.table a {
  color: inherit;
}

/* ---------- Articles & prose ---------- */

.article-head {
  padding: clamp(2.4rem, 6vw, 3.8rem) 0 1.4rem;
}

.article-head h1 {
  font-size: clamp(2rem, 4.4vw, 3rem);
}

.article-cover {
  margin: 0 auto 2rem;
  max-width: 1000px;
}

.article-cover img {
  width: 100%;
  max-height: 560px;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

.prose {
  color: var(--text-2);
  line-height: 1.8;
}

.article-body {
  font-size: 1.08rem;
}

.prose h2 {
  color: var(--text);
  font-size: 1.55rem;
  margin: 2.2rem 0 0.8rem;
}

.prose h3 {
  color: var(--text);
  margin: 1.6rem 0 0.5rem;
}

.prose p {
  margin: 0 0 1.1rem;
}

.prose ul,
.prose ol {
  padding-inline-start: 1.35rem;
  margin: 0 0 1.2rem;
}

.prose li {
  margin: 0.4rem 0;
}

.prose li::marker {
  color: var(--accent-deep);
  font-weight: 700;
}

.prose strong {
  color: var(--text);
}

.prose blockquote {
  margin: 1.6rem 0;
  padding-block: 0.3rem;
  padding-inline-start: 1.3rem;
  border-inline-start: 3px solid var(--gold);
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--text);
}

.prose-sm {
  font-size: 0.95rem;
}

.article-figure {
  margin: 2rem 0;
}

.article-figure img {
  display: block;
  width: 100%;
  border-radius: 14px;
}

figcaption {
  margin-top: 0.55rem;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
}

.share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 2.5rem 0 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.share > span {
  font-weight: 700;
  margin-inline-end: 0.3rem;
}

.preview-banner {
  background: var(--gold);
  color: #000000;
  font-size: 0.93rem;
  font-weight: 600;
}

.preview-banner .wrap {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.preview-banner a {
  color: inherit;
  font-weight: 800;
}

/* ---------- Photo grid & lightbox ---------- */

.photo-grid {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fill, minmax(min(46%, 220px), 1fr));
}

.photo-grid li,
.photo-grid figure {
  margin: 0;
  position: relative;
}

.photo-grid a {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
}

.photo-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.3s;
}

.photo-grid a:hover img {
  transform: scale(1.04);
}

.photo-caption {
  display: block;
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

.album-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: rgba(10, 10, 10, 0.94);
  color: #fff;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--white);
}

.lightbox-stage {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 0 56px;
  touch-action: pan-y;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
  border-radius: 6px;
}

.lightbox-caption {
  text-align: center;
  padding: 12px 16px 20px;
  color: var(--white);
  min-height: 3em;
}

.lightbox button {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 0;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  font-size: 1.4rem;
  cursor: pointer;
}

.lightbox button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox .lb-prev,
.lightbox .lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox .lb-prev {
  inset-inline-start: 8px;
}

.lightbox .lb-next {
  inset-inline-end: 8px;
}

/* ---------- Events ---------- */

.event-layout {
  display: grid;
  gap: 2rem;
}

/* Wide tables scroll inside .table-wrap instead of widening the page. */
.event-layout > * {
  min-width: 0;
}

@media (min-width: 960px) {
  .event-layout {
    grid-template-columns: minmax(0, 1fr) 370px;
    align-items: start;
  }
  .event-aside {
    position: sticky;
    top: 96px;
  }
}

.event-cover {
  margin: 0 0 1.8rem;
}

.event-cover img {
  width: 100%;
  border-radius: var(--radius);
  display: block;
}

.fact-card {
  display: grid;
  gap: 1.2rem;
}

.fact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.9rem;
}

.fact-list li {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  color: var(--text-2);
  flex-wrap: wrap;
}

.fact-list .icon {
  margin-top: 0.15rem;
  color: var(--accent-deep);
}

.fact-list b {
  color: var(--text);
}

.registration,
.organizer,
.prize-list,
.sponsor-mini {
  display: grid;
  gap: 0.7rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.registration h2,
.organizer h2,
.prize-list h2,
.sponsor-mini h2 {
  font-size: 1.2rem;
  margin: 0;
}

.organizer p {
  margin: 0;
}

.reg-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  justify-self: start;
  margin: 0;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.9rem;
}

.reg-open {
  background: var(--green-soft);
  color: var(--green);
}

.reg-full,
.reg-closed {
  background: var(--amber-soft);
  color: var(--amber);
}

.reg-done {
  background: var(--surface-2);
  color: var(--text-2);
}

.reg-cancelled {
  background: var(--red-soft);
  color: var(--red);
}

.capacity-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.capacity-bar span {
  display: block;
  height: 100%;
  background: var(--gold);
  border-radius: 999px;
}

.capacity p {
  margin: 0.4rem 0 0;
}

.prize-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.4rem;
}

.prize-list li {
  display: flex;
  gap: 0.6rem;
}

.sponsor-mini img {
  max-height: 48px;
  max-width: 140px;
  object-fit: contain;
}

.results-title {
  margin-top: 2rem;
}

.podium {
  list-style: none;
  padding: 0;
  margin: 0 0 1.2rem;
  display: grid;
  gap: 0.6rem;
}

.podium li {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.podium .pname {
  flex: 1;
}

.podium .score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.podium-cards {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  margin-bottom: 1.5rem;
}

.podium-card {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  padding: 1.3rem 1rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
}

.podium-card.place-1 {
  border-color: var(--gold);
  box-shadow: 0 8px 26px rgba(255, 208, 0, 0.2);
}

.podium-card .medal {
  font-size: 2.2rem;
  line-height: 1;
}

.podium-card .place {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.podium-card .pname {
  font-weight: 800;
  font-size: 1.1rem;
}

/* ---------- Archive ---------- */

.archive-list {
  list-style: none;
  padding: 0;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.archive-row {
  display: grid;
  gap: 0.5rem 1.2rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
}

.archive-row:last-child {
  border-bottom: 0;
}

@media (min-width: 900px) {
  .archive-row {
    grid-template-columns: 110px minmax(0, 1.3fr) minmax(0, 1fr) auto;
    align-items: center;
  }
}

.archive-date {
  font-size: 0.9rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.archive-main > a {
  font-weight: 750;
  color: var(--text);
  text-decoration: none;
  font-size: 1.05rem;
}

.archive-main > a:hover {
  text-decoration: underline;
}

.archive-main .meta {
  margin: 0.3rem 0 0;
}

.archive-links {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.mini-podium {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.2rem;
  font-size: 0.9rem;
}

.mini-podium li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.mini-podium .pos {
  width: 22px;
  height: 22px;
  font-size: 0.72rem;
}

/* ---------- Players & rankings ---------- */

.player-hero {
  padding: clamp(2.2rem, 5vw, 3.4rem) 0;
}

.player-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.4rem;
}

.player-main {
  flex: 1;
  min-width: 240px;
}

.player-main h1 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  margin-bottom: 0.4rem;
}

.player-main h1 .kt-code {
  font-size: 0.55em;
  vertical-align: 0.3em;
}

.player-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  color: var(--on-ink-2);
  margin-bottom: 0.4rem;
}

.player-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
}

.player-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent);
}

.kcc-id {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-weight: 700;
  color: var(--accent-deep);
  background: var(--accent-soft);
  display: inline-block;
  padding: 0.05rem 0.6rem;
  border-radius: 8px;
}

.player-hero .kcc-id {
  color: #000000;
  background: var(--gold);
}

.kcc-id.big {
  font-size: 1.4rem;
}

.elo-box {
  display: grid;
  justify-items: center;
  padding: 0.9rem 1.6rem;
  border-radius: 18px;
  border: 2px solid var(--accent);
  background: rgba(0, 0, 0, 0.25);
}

.elo-box .label {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.elo-box .value {
  font-family: var(--serif);
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
}

.stat-row {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-bottom: 1.8rem;
}

.stat {
  display: grid;
  gap: 0.2rem;
  padding: 1rem 1.2rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.stat span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 650;
}

.stat strong {
  font-size: 1.8rem;
  line-height: 1.1;
}

.spark {
  margin: 0 0 2rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.spark svg {
  display: block;
  width: 100%;
  height: auto;
}

.spark-line {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.spark-area {
  fill: var(--gold);
  opacity: 0.14;
}

.spark-dot {
  fill: var(--gold);
}

.result-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.4rem;
}

.result-list li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.outcome {
  font-weight: 800;
  min-width: 3.4em;
}

.outcome-WIN {
  color: var(--green);
}

.outcome-LOSS {
  color: var(--red);
}

.outcome-DRAW {
  color: var(--text-2);
}

.delta {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.delta.up {
  color: var(--green);
}

.delta.down {
  color: var(--red);
}

.two-col {
  display: grid;
  gap: 2rem;
}

@media (min-width: 900px) {
  .two-col {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- About ---------- */

.about-intro {
  padding: clamp(2rem, 5vw, 3rem) 0 0;
}

.about-intro .wrap {
  display: flex;
  gap: 2rem;
  align-items: center;
  flex-wrap: wrap-reverse;
}

.lead-prose {
  flex: 1;
  min-width: 260px;
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.6;
  color: var(--text);
}

.about-logo {
  border-radius: 50%;
  box-shadow: var(--shadow);
}

.about-section .wrap {
  max-width: 980px;
}

.about-with-image {
  display: grid;
  gap: 2rem;
}

@media (min-width: 900px) {
  .about-with-image {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: start;
  }
}

.about-image {
  margin: 0;
}

.about-image img {
  width: 100%;
  border-radius: var(--radius);
  display: block;
}

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 1rem 0 1.5rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.steps li {
  counter-increment: step;
  padding: 1.2rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 0.8rem;
  border-radius: 50%;
  background: var(--gold);
  color: #000000;
  font-weight: 800;
}

.steps h3 {
  margin-bottom: 0.35rem;
}

.steps p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.95rem;
}

.fact-bullets {
  padding-inline-start: 1.2rem;
  color: var(--text-2);
}

.fact-bullets li {
  margin: 0.4rem 0;
}

.title-tables {
  display: grid;
  gap: 1.2rem;
  margin: 1.2rem 0;
}

@media (min-width: 760px) {
  .title-tables {
    grid-template-columns: 1fr 1fr;
  }
}

.title-table h3 {
  font-size: 1.05rem;
}

/* ---------- Sponsors ---------- */

.sponsor-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
}

.sponsor-tile,
.sponsor-tile > a {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.5rem;
  min-height: 130px;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.88rem;
}

.sponsor-tile > a {
  border: 0;
  padding: 0;
  min-height: 0;
}

.sponsor-tile img {
  max-height: 70px;
  max-width: 170px;
  object-fit: contain;
}

/* ---------- Notices & empty states ---------- */

.empty-state {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  padding: 2.6rem 1.5rem;
  text-align: center;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
}

.empty-state .icon {
  width: 38px;
  height: 38px;
  color: var(--accent-deep);
  margin-bottom: 0.4rem;
}

.empty-state h3 {
  color: var(--text);
  margin: 0;
}

.empty-state p {
  margin: 0 0 0.6rem;
}

.admin-hint {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin: 1rem 0 0;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--text-2);
  font-size: 0.92rem;
}

.admin-hint .icon {
  margin-top: 0.2rem;
  color: var(--accent-deep);
}

.notice {
  display: block;
  padding: 0.85rem 1.05rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--text-2);
  margin: 0 0 1rem;
}

.notice .icon {
  vertical-align: -0.15em;
}

.section-sub {
  margin-top: 2.5rem;
}

/* ---------- Season standings ---------- */

.season-leader {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.2rem 0 1.6rem;
  padding: 1rem 1.2rem;
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.season-leader .medal {
  font-size: 2.6rem;
  line-height: 1;
}

.season-leader .eyebrow {
  margin-bottom: 0.2rem;
}

.season-leader-name {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
}

.season-leader .muted {
  margin: 0.1rem 0 0;
}

.season-arenas {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.4rem;
}

.season-table .pos {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.85rem;
}

.season-arenas li {
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
}

/* ---------- KCC Arena title progress: the small bar in the rankings ----------
   (The full title progress card is in chrome.css, shared with the Arena Portal.) */

.tp-bar {
  position: relative;
  display: block;
  height: 12px;
  border-radius: 999px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  overflow: hidden;
}

.tp-bar > span {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 208, 0, 0.45), var(--gold));
  box-shadow: 0 0 8px rgba(255, 208, 0, 0.5);
  transition: width 0.6s ease;
}

[dir="rtl"] .tp-bar > span {
  background: linear-gradient(270deg, rgba(255, 208, 0, 0.45), var(--gold));
}

.tp-mini {
  display: grid;
  grid-template-columns: auto minmax(56px, 1fr);
  align-items: center;
  gap: 0.15rem 0.45rem;
  min-width: 128px;
}

.tp-mini .kt-code {
  grid-row: span 2;
}

.tp-bar-sm {
  height: 6px;
}

.tp-mini-text {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .tp-bar > span {
    transition: none;
  }
}

@media print {
  .tp-bar {
    border: 1px solid #000000;
    box-shadow: none;
  }
  .tp-bar > span {
    background: #000000;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* ---------- Floating social media bar ----------
   Always on the side edge, vertically centred. Wide screens (1360px and up):
   the icons as a vertical bar in the empty margin beside the 1240px page.
   Smaller screens: a slim tab as wide as the page's 16px side margin that
   slides the icons out when tapped, so it never covers the content; it steps
   aside while the footer's own social icons are on screen. */

.social-float {
  position: fixed;
  z-index: 30; /* under the header menus (40) and the photo lightbox (200) */
  inset-inline-start: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.2s, visibility 0.2s;
}

.social-float.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.social-float-toggle {
  display: grid;
  place-items: center;
  width: 16px; /* the page's side margin: the tab never overlaps the content */
  height: 64px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-inline-start: 0;
  border-start-start-radius: 0;
  border-end-start-radius: 0;
  border-start-end-radius: 12px;
  border-end-end-radius: 12px;
  background: var(--surface);
  color: var(--gold);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.social-float-toggle .icon {
  width: 14px;
  height: 14px;
}

.social-float-toggle:hover {
  border-color: var(--gold);
}

.social-float-toggle .icon-close,
.social-float.is-open .social-float-toggle .icon-open {
  display: none;
}

.social-float.is-open .social-float-toggle .icon-close {
  display: block;
}

.social-float.is-open .social-float-toggle {
  background: var(--gold);
  border-color: var(--gold);
  color: #000000;
}

.social-float-list {
  list-style: none;
  display: none;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.social-float.is-open .social-float-list {
  display: flex;
}

.social-float-list a {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--white);
  transition: background 0.15s, color 0.15s;
}

.social-float-list a:hover,
.social-float-list a:focus-visible {
  background: var(--gold);
  color: #000000;
}

/* The platform's name slides out next to the icon on hover or keyboard focus. */
.social-float-label {
  position: absolute;
  inset-inline-start: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--gold);
  color: #000000;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.social-float-list a:focus-visible .social-float-label {
  opacity: 1;
}

@media (hover: hover) {
  .social-float-list a:hover .social-float-label {
    opacity: 1;
  }
}

@media (min-width: 1360px) {
  .social-float.is-hidden {
    opacity: 1;
    visibility: visible;
  }
  .social-float-toggle {
    display: none;
  }
  .social-float-list {
    display: flex;
    padding: 6px;
    border-inline-start: 0;
    border-start-start-radius: 0;
    border-end-start-radius: 0;
    border-start-end-radius: 16px;
    border-end-end-radius: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .social-float,
  .social-float-list a,
  .social-float-label {
    transition: none;
  }
}

@media print {
  .social-float {
    display: none;
  }
}

.filter-bar:has(> [data-print]) {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.notice-ok {
  background: var(--green-soft);
  color: var(--green);
  font-weight: 650;
}

.notice-danger {
  background: var(--red-soft);
  color: var(--red);
  font-weight: 650;
}

/* ---------- Jump links at the top of long pages ---------- */

.jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1.2rem 0 0;
}

.jump-nav a {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 0.86rem;
  font-weight: 650;
  text-decoration: none;
}

.jump-nav a:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ---------- Trophies ---------- */

.trophy {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  flex: none;
  vertical-align: -0.2em;
}

.trophy-gold {
  color: var(--gold);
  filter: drop-shadow(0 0 6px rgba(255, 208, 0, 0.45));
}

.trophy-silver {
  color: #c9ced6;
}

.trophy-bronze {
  color: #cd7f32;
}

.trophy-counts {
  display: inline-flex;
  gap: 0.35rem;
  margin-inline-start: 0.7rem;
  vertical-align: middle;
  text-decoration: none;
}

.trophy-count {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--white);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 800;
}

.trophy-count .trophy {
  width: 1.1em;
  height: 1.1em;
}

.trophy-cabinet,
.badge-section {
  margin-top: 2.5rem;
}

.trophy-shelf {
  list-style: none;
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  margin: 0;
  padding: 0;
}

.trophy-item {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  padding: 1.1rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  text-align: center;
}

.trophy-item .trophy {
  width: 3rem;
  height: 3rem;
}

.trophy-item-gold {
  border-color: rgba(255, 208, 0, 0.45);
}

.trophy-place {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trophy-item a {
  color: var(--text);
  font-weight: 700;
}

/* ---------- Podium: 2nd, 1st, 3rd ---------- */

.hof-podium {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 0.8rem;
  max-width: 760px;
  margin: 1.5rem auto 0.5rem;
  padding: 0;
}

.hof-podium-short {
  grid-template-columns: repeat(auto-fit, minmax(0, 220px));
  justify-content: center;
}

.hof-step {
  display: grid;
  gap: 0.6rem;
  min-width: 0;
}

.hof-person {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  text-align: center;
  min-width: 0;
}

.hof-avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--gold);
  font-weight: 800;
  object-fit: cover;
}

.hof-gold .hof-avatar {
  width: 84px;
  height: 84px;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(255, 208, 0, 0.15), 0 0 30px rgba(255, 208, 0, 0.35);
}

.hof-silver .hof-avatar {
  border-color: #c9ced6;
}

.hof-bronze .hof-avatar {
  border-color: #cd7f32;
}

.hof-person .trophy {
  width: 1.8rem;
  height: 1.8rem;
  margin-top: -1.1rem;
}

.hof-gold .hof-person .trophy {
  width: 2.3rem;
  height: 2.3rem;
}

.hof-name {
  max-width: 100%;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.hof-name .kt {
  margin-inline-end: 3px;
}

.hof-value {
  color: var(--gold);
  font-weight: 800;
  font-size: 1.05rem;
}

.hof-note {
  color: var(--muted);
  font-size: 0.8rem;
}

.hof-block {
  display: grid;
  place-items: center;
  border-radius: 14px 14px 4px 4px;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 800;
  color: #000000;
}

.hof-gold .hof-block {
  height: 130px;
  background: linear-gradient(180deg, #ffe45c, var(--gold) 55%, #d9ae00);
  box-shadow: 0 10px 34px rgba(255, 208, 0, 0.28);
}

.hof-silver .hof-block {
  height: 96px;
  background: linear-gradient(180deg, #f2f4f7, #c9ced6 60%, #a7adb6);
}

.hof-bronze .hof-block {
  height: 72px;
  background: linear-gradient(180deg, #e6a468, #cd7f32 60%, #a8651f);
}

.hof-podium-empty {
  text-align: center;
}

@media (max-width: 560px) {
  .hof-podium {
    gap: 0.45rem;
  }
  .hof-avatar {
    width: 48px;
    height: 48px;
  }
  .hof-gold .hof-avatar {
    width: 62px;
    height: 62px;
  }
  .hof-name {
    font-size: 0.88rem;
  }
  .hof-value {
    font-size: 0.92rem;
  }
  .hof-gold .hof-block {
    height: 100px;
  }
  .hof-silver .hof-block {
    height: 74px;
  }
  .hof-bronze .hof-block {
    height: 56px;
  }
}

/* ---------- KCC Champions ---------- */

.hof-section {
  scroll-margin-top: 90px;
}

.hof-sub {
  margin: 2rem 0 0.8rem;
  font-size: 1.15rem;
}

.hof-table th .trophy {
  width: 1.1em;
  height: 1.1em;
}

.hof-now {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 1.2rem auto 0;
  padding: 0.7rem 1rem;
  max-width: 760px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text-2);
  text-align: center;
}

.hof-list {
  list-style: none;
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.hof-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.hof-list-label {
  min-width: 9rem;
  color: var(--muted);
  font-weight: 650;
}

.title-holders {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}

.title-group {
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.title-group h3 {
  margin: 0 0 0.6rem;
  font-size: 1.05rem;
}

.title-group ul {
  list-style: none;
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
}

.title-group li {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
}

.record-grid {
  list-style: none;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  margin: 0;
  padding: 0;
}

.record-card {
  display: grid;
  align-content: start;
  gap: 0.3rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.record-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.record-value {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.15;
}

.record-extra {
  color: var(--text-2);
  font-size: 0.86rem;
}

/* ---------- Achievement badges ---------- */

.badge-tally {
  color: var(--muted);
  font-weight: 650;
}

.badge-grid {
  list-style: none;
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr));
  margin: 0;
  padding: 0;
}

.ach {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.3rem;
  padding: 1rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: center;
  opacity: 0.55;
}

.ach.is-earned {
  opacity: 1;
  border-color: rgba(255, 208, 0, 0.4);
  background: radial-gradient(120% 90% at 50% 0%, rgba(255, 208, 0, 0.12), transparent 60%), var(--surface);
}

.ach-medal {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 0.3rem;
  border-radius: 50%;
  border: 3px dashed var(--line-strong);
  color: var(--muted);
}

.ach.is-earned .ach-medal {
  border: 3px solid var(--gold);
  background: radial-gradient(circle at 35% 30%, #ffe45c, var(--gold) 55%, #c79c00);
  color: #000000;
  box-shadow: 0 0 0 4px rgba(255, 208, 0, 0.14), 0 6px 18px rgba(255, 208, 0, 0.25);
}

.ach-medal .icon {
  width: 28px;
  height: 28px;
}

.badge-num {
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.ach-name {
  font-weight: 750;
}

.ach-text {
  color: var(--muted);
  font-size: 0.8rem;
}

.ach-date {
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 650;
}

.ach.is-earned .ach-date {
  color: var(--gold);
}

/* ---------- Daily chess puzzle ---------- */

.pz {
  display: grid;
  gap: 1.4rem;
  align-items: start;
}

@media (min-width: 860px) {
  .pz {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  }
}

.pz-board-wrap {
  width: 100%;
  max-width: 560px;
}

.pz-compact .pz-board-wrap {
  max-width: 460px;
}

.pz-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  aspect-ratio: 1;
  overflow: hidden;
  border: 6px solid #1f1f1f;
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--line-strong), 0 16px 40px rgba(0, 0, 0, 0.55);
}

.pz.is-solved .pz-board {
  box-shadow: 0 0 0 2px var(--gold), 0 0 40px rgba(255, 208, 0, 0.35);
}

.pz.is-wrong .pz-board {
  animation: pz-shake 0.45s ease;
  box-shadow: 0 0 0 2px var(--red), 0 16px 40px rgba(0, 0, 0, 0.55);
}

@keyframes pz-shake {
  20%,
  60% {
    transform: translateX(-6px);
  }
  40%,
  80% {
    transform: translateX(6px);
  }
}

.sq {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 0;
  border: 0;
  aspect-ratio: 1;
  cursor: pointer;
  font: inherit;
}

.sq-light {
  background: #d4d4d4;
}

.sq-dark {
  background: #6f6f6f;
}

.sq.is-last::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 208, 0, 0.38);
}

.sq.is-selected::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 208, 0, 0.6);
}

.sq.is-target::after {
  content: "";
  position: absolute;
  width: 28%;
  height: 28%;
  border-radius: 50%;
  background: rgba(9, 9, 9, 0.45);
}

.sq.is-capture::after {
  content: "";
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  border: 4px solid rgba(9, 9, 9, 0.45);
}

.sq:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: -3px;
  z-index: 1;
}

.pz-board.is-over .sq {
  cursor: default;
}

.pc {
  position: relative;
  z-index: 1;
  font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "DejaVu Sans", "Apple Symbols", sans-serif;
  font-size: clamp(1.6rem, 7.4vw, 3.3rem);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.pz-compact .pc {
  font-size: clamp(1.5rem, 6.8vw, 2.8rem);
}

.pc-w {
  color: #ffffff;
  text-shadow: 0 0 1px #000, 0 1px 0 #000, 1px 0 0 #000, -1px 0 0 #000, 0 -1px 0 #000, 0 2px 4px rgba(0, 0, 0, 0.45);
}

.pc-b {
  color: #111111;
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.6), 0 1px 0 rgba(255, 255, 255, 0.35), 0 2px 4px rgba(0, 0, 0, 0.35);
}

.sq-rank,
.sq-file {
  position: absolute;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.sq-rank {
  top: 3px;
  left: 3px;
}

.sq-file {
  bottom: 3px;
  right: 4px;
}

.sq-light .sq-rank,
.sq-light .sq-file {
  color: #6f6f6f;
}

.sq-dark .sq-rank,
.sq-dark .sq-file {
  color: #d4d4d4;
}

.pz-panel {
  display: grid;
  gap: 0.7rem;
  align-content: start;
}

.pz-panel .eyebrow {
  margin: 0;
}

.pz-title {
  margin: 0;
  font-size: 1.5rem;
}

.pz-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  margin: 0;
  color: var(--text-2);
}

.pz-turn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 750;
}

.pz-turn::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--white);
}

.pz-turn-w::before {
  background: var(--white);
}

.pz-turn-b::before {
  background: #111111;
}

.pz-level {
  display: inline-flex;
  gap: 3px;
}

.pz-level i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-strong);
}

.pz-level i.on {
  background: var(--gold);
}

.pz-status {
  margin: 0;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.pz-status.is-ok {
  border-color: rgba(79, 211, 140, 0.4);
  background: var(--green-soft);
  color: var(--green);
}

.pz-status.is-error {
  border-color: rgba(255, 123, 114, 0.4);
  background: var(--red-soft);
  color: var(--red);
}

.pz-tries {
  margin: 0;
  font-weight: 650;
}

.pz-actions {
  margin: 0;
}

.pz-guest {
  margin: 0;
  color: var(--muted);
}

.pz-layout {
  display: grid;
  gap: 2rem;
}

@media (min-width: 1100px) {
  .pz-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
  }
  .pz-layout .pz {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  }
}

.pz-aside {
  display: grid;
  gap: 1.2rem;
}

.card-plain {
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.card-plain h2 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}

.pz-leaders {
  list-style: none;
  display: grid;
  gap: 0.4rem;
  margin: 0.6rem 0 0;
  padding: 0;
}

.pz-leaders li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  background: var(--surface-2);
}

.pz-leaders li.is-me {
  outline: 1px solid var(--gold);
}

.pz-leaders .pos {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--line);
  font-size: 0.8rem;
  font-weight: 800;
}

.pz-leader-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pz-leader-points {
  color: var(--gold);
  font-weight: 800;
  white-space: nowrap;
}

.pz-rules {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding-inline-start: 1.1rem;
  color: var(--text-2);
  font-size: 0.9rem;
}

.pz-past {
  list-style: none;
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.pz-past li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.1rem 0.6rem;
}

.pz-past .muted {
  grid-column: 1;
}

.pz-past .pz-level {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
}

.puzzle-band {
  background: radial-gradient(70% 90% at 15% 20%, rgba(255, 208, 0, 0.08), transparent 60%), var(--bg);
  border-block: 1px solid var(--line);
}

.pz-home {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 1100px) {
  .pz-home {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }
}

.pz-home-leaders {
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.pz-home-leaders h3 {
  margin: 0;
  font-size: 1.05rem;
}

.pz-promo p {
  margin: 0 0 0.6rem;
  font-weight: 700;
}

.pz-promo-row {
  display: flex;
  gap: 0.5rem;
}

.pz-promo-row button {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #d4d4d4;
  cursor: pointer;
}

.pz-promo-row .pc {
  font-size: 2.6rem;
}

@media (prefers-reduced-motion: reduce) {
  .pz.is-wrong .pz-board {
    animation: none;
  }
}

/* ---------- KCC Chess Academy ---------- */

.coach-grid,
.lesson-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

.coach-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}

.coach-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.coach-card .card-link {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  padding: 1.1rem;
}

.coach-photo {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  object-fit: cover;
}

.coach-initials {
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--gold);
  font-size: 1.5rem;
  font-weight: 800;
}

.coach-photo-xl {
  width: 150px;
  height: 150px;
  font-size: 2.6rem;
}

.coach-body {
  display: grid;
  gap: 0.25rem;
  align-content: start;
}

.coach-body h3 {
  margin: 0;
  font-size: 1.15rem;
}

.coach-body p {
  margin: 0;
}

.coach-title {
  display: inline-block;
  padding: 0.05em 0.4em;
  border: 1px solid var(--gold);
  border-radius: 4px;
  background: #000000;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 0.7em;
  font-weight: 800;
  vertical-align: 0.15em;
}

.coach-ratings {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.9rem;
  color: var(--text-2);
  font-size: 0.88rem;
}

.coach-ratings b {
  color: var(--white);
}

.coach-ratings-lg {
  font-size: 1rem;
  margin: 0.6rem 0 1rem;
}

.stars {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  color: var(--gold);
  letter-spacing: 0.05em;
}

.stars b {
  color: var(--white);
}

.stars-off {
  color: var(--line-strong);
}

.coach-head {
  display: grid;
  gap: 1.4rem;
  align-items: center;
}

@media (min-width: 760px) {
  .coach-head {
    grid-template-columns: auto 1fr;
  }
}

.lesson-card {
  display: grid;
  align-content: start;
  gap: 0.6rem;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.lesson-card h3 {
  margin: 0;
  font-size: 1.2rem;
}

.lesson-card h3 a {
  color: inherit;
  text-decoration: none;
}

.lesson-card h3 a:hover {
  color: var(--gold);
}

.lesson-card p {
  margin: 0;
  color: var(--text-2);
}

.lesson-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-level-beginner {
  background: var(--green-soft);
  color: var(--green);
  border-color: transparent;
}

.tag-level-intermediate {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: transparent;
}

.tag-level-advanced {
  background: var(--accent-soft);
  color: var(--gold);
  border-color: transparent;
}

.tag-ladies {
  background: var(--pink-soft);
  color: var(--pink);
  border-color: transparent;
}

.lesson-facts {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.9rem;
}

.lesson-facts div {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.6rem;
}

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

.lesson-facts dd {
  margin: 0;
}

.lesson-facts-side div {
  grid-template-columns: 7rem 1fr;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}

.lesson-aside {
  display: grid;
  gap: 1rem;
  align-content: start;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.timetable {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
}

.tt-day {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.tt-day h3 {
  margin: 0 0 0.6rem;
  font-size: 1.05rem;
}

.tt-day ul {
  list-style: none;
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
}

.tt-day li {
  display: grid;
  gap: 0.1rem;
}

.tt-time {
  color: var(--gold);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ladies-band {
  background: radial-gradient(80% 120% at 85% 20%, rgba(255, 143, 192, 0.1), transparent 60%), var(--surface);
  border-block: 1px solid var(--line);
}

.ladies-grid,
.book-band {
  display: grid;
  gap: 1.2rem;
  align-items: center;
}

@media (min-width: 760px) {
  .ladies-grid,
  .book-band {
    grid-template-columns: 1fr auto;
  }
}

.ladies-grid h2,
.book-band h2 {
  margin: 0.2rem 0 0.5rem;
}

.count-pill {
  display: inline-grid;
  place-items: center;
  min-width: 1.6rem;
  height: 1.6rem;
  margin-inline-start: 0.4rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #000000;
  color: var(--gold);
  font-size: 0.8rem;
}

.form-card {
  display: grid;
  gap: 0.9rem;
  align-content: start;
}

.review-form {
  display: grid;
  gap: 0.7rem;
  margin: 1rem 0;
}

.star-input {
  display: inline-flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.star-input legend {
  width: 100%;
  margin-bottom: 0.3rem;
  font-weight: 700;
}

.star-input input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.star-input label {
  color: var(--line-strong);
  font-size: 1.9rem;
  line-height: 1;
  cursor: pointer;
}

.star-input input:checked ~ label,
.star-input label:hover,
.star-input label:hover ~ label {
  color: var(--gold);
}

.star-input input:focus-visible + label {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

.review-list,
.booking-list {
  list-style: none;
  display: grid;
  gap: 0.8rem;
  margin: 1rem 0 0;
  padding: 0;
}

.review-list li,
.booking-list li {
  display: grid;
  gap: 0.3rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.review-list p,
.booking-list p {
  margin: 0;
}

.booking-list li > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.booking-list .btn {
  justify-self: start;
}

/* ---------- Sponsors page ---------- */

.sponsor-tier + .sponsor-tier {
  margin-top: 2.2rem;
}

.sponsor-tier h2 {
  margin: 0 0 1rem;
}

.partner-grid {
  list-style: none;
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  margin: 0;
  padding: 0;
}

.sponsor-tier-main .partner-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
}

.partner-card {
  display: grid;
  gap: 1rem;
  padding: 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.sponsor-tier-main .partner-card {
  border-color: rgba(255, 208, 0, 0.45);
  background: radial-gradient(90% 120% at 0% 0%, rgba(255, 208, 0, 0.1), transparent 60%), var(--surface);
}

.partner-logo {
  display: grid;
  place-items: center;
  min-height: 110px;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: var(--white);
}

.partner-logo img {
  max-width: 100%;
  max-height: 90px;
  object-fit: contain;
}

.sponsor-wordmark {
  color: #000000;
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 800;
  text-align: center;
}

.partner-body {
  display: grid;
  gap: 0.35rem;
}

.partner-body h3,
.partner-body p {
  margin: 0;
}

.reach-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

.reach-stat {
  display: grid;
  gap: 0.2rem;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: center;
}

.reach-stat strong {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 2.2rem;
  line-height: 1.1;
}

.reach-stat span {
  color: var(--text-2);
  font-size: 0.9rem;
}

.reach-note {
  margin: 1rem 0 0;
  color: var(--text-2);
  font-weight: 650;
  text-align: center;
}

.visibility-list {
  list-style: none;
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  margin: 0;
  padding: 0;
}

.visibility-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.visibility-list .icon {
  width: 1.6rem;
  height: 1.6rem;
  color: var(--gold);
}

.visibility-list p {
  margin: 0.2rem 0 0;
  color: var(--text-2);
  font-size: 0.9rem;
}

.package-grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  align-items: stretch;
}

.package-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 0.6rem;
  padding: 1.5rem 1.3rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.package-card h3 {
  margin: 0;
  font-size: 1.3rem;
}

.package-card.is-highlight {
  border: 2px solid var(--gold);
  box-shadow: 0 12px 36px rgba(255, 208, 0, 0.14);
}

.package-flag {
  position: absolute;
  top: -0.8rem;
  inset-inline-start: 1.2rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--gold);
  color: #000000;
  font-size: 0.75rem;
  font-weight: 800;
}

.package-price {
  margin: 0;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 800;
}

.package-benefits {
  list-style: none;
  display: grid;
  align-content: start;
  gap: 0.5rem;
  margin: 0.4rem 0 0.8rem;
  padding: 0;
}

.package-benefits li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem;
  color: var(--text-2);
}

.package-benefits .icon {
  color: var(--gold);
  margin-top: 0.2rem;
}

/* A field for robots only (people never see it). */
.hp-field {
  position: absolute;
  inset-inline-start: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media print {
  .jump-nav,
  .pz-actions {
    display: none;
  }
}

/* ---------- Account, support, messages, notifications ---------- */

.account-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 960px) {
  .account-grid {
    grid-template-columns: 1.3fr 0.9fr;
    align-items: start;
  }
}

.pref-list {
  display: grid;
  gap: 0.6rem;
}

.push-box {
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.push-box h3 {
  font-size: 1.05rem;
}

.mini-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.6rem;
}

.mini-list li {
  display: grid;
  gap: 0.1rem;
}

.mini-list a {
  font-weight: 700;
  color: var(--text);
}

.ticket-list,
.notif-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.ticket-list a {
  display: grid;
  gap: 0.3rem 1rem;
  grid-template-columns: auto 1fr;
  align-items: center;
  padding: 0.9rem 1.1rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}

@media (min-width: 700px) {
  .ticket-list a {
    grid-template-columns: 110px 1fr auto auto;
  }
}

.ticket-list a:hover {
  border-color: var(--text-2);
}

.ticket-list .is-unread a {
  border-inline-start: 4px solid var(--gold);
}

.ticket-ref {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.85rem;
  color: var(--muted);
}

.ticket-subject {
  font-weight: 700;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
}

.ticket-status {
  display: inline-block;
  justify-self: start;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  background: var(--surface-2);
  color: var(--text-2);
}

.ticket-open {
  background: var(--blue-soft);
  color: var(--blue);
}

.ticket-progress {
  background: var(--amber-soft);
  color: var(--amber);
}

.ticket-waiting {
  background: var(--pink-soft);
  color: var(--pink);
}

.ticket-resolved {
  background: var(--green-soft);
  color: var(--green);
}

.ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.thread {
  list-style: none;
  padding: 0;
  margin: 1.2rem 0;
  display: grid;
  gap: 0.8rem;
}

.bubble {
  max-width: min(640px, 92%);
  padding: 0.8rem 1rem;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.bubble.from-me {
  justify-self: end;
  background: var(--accent-soft);
  border-color: transparent;
}

.bubble.from-staff {
  justify-self: start;
  border-inline-start: 4px solid var(--gold);
}

.bubble-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.3rem;
}

.bubble-body {
  white-space: normal;
  overflow-wrap: anywhere;
}

.thread-event {
  text-align: center;
  font-size: 0.84rem;
  color: var(--muted);
}

.notif-list > li > a,
.notif-list > li > div {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 0.9rem 1.1rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}

.notif-list > li.is-new > a,
.notif-list > li.is-new > div {
  border-inline-start: 4px solid var(--gold);
  background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface));
}

.notif-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  background: var(--ink);
  color: var(--accent);
}

.notif-body {
  display: grid;
  gap: 0.15rem;
}

/* Messages app */

.page-messages .site-footer {
  margin-top: 0;
}

.messages-section {
  padding: 1.4rem 0 2.4rem;
}

.messages-app {
  display: grid;
  min-height: min(76vh, 760px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

@media (min-width: 860px) {
  .messages-app {
    grid-template-columns: 330px 1fr;
  }
}

.msg-list {
  display: flex;
  flex-direction: column;
  border-inline-end: 1px solid var(--line);
  min-height: 0;
}

.msg-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
}

.msg-list-head h1 {
  font-size: 1.4rem;
  margin: 0;
}

.msg-convos {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.msg-convos button {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  width: 100%;
  padding: 0.8rem 1rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.msg-convos button:hover,
.msg-convos button.active {
  background: var(--surface-2);
}

.msg-convo-text {
  display: grid;
  min-width: 0;
  flex: 1;
}

.msg-convo-text b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-convo-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.88rem;
}

.msg-unread {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: #000000;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
}

.msg-thread {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.msg-thread-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
}

.msg-thread-head b {
  font-size: 1.05rem;
}

.msg-back {
  display: none;
}

.msg-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--bg);
}

.msg-bubble {
  max-width: 80%;
  padding: 0.6rem 0.9rem;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  align-self: flex-start;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.msg-bubble.mine {
  align-self: flex-end;
  background: var(--white);
  color: #000000;
  border-color: var(--white);
}

.msg-bubble time {
  display: block;
  font-size: 0.72rem;
  opacity: 0.7;
  margin-top: 0.2rem;
}

.staff-badge {
  display: inline-block;
  padding: 0 0.45rem;
  border-radius: 6px;
  background: var(--gold);
  color: #000000;
  font-size: 0.68rem;
  font-weight: 800;
  vertical-align: 0.1em;
  margin-inline-start: 0.3rem;
}

.msg-compose {
  display: flex;
  gap: 0.6rem;
  padding: 0.8rem;
  border-top: 1px solid var(--line);
}

.msg-compose textarea {
  flex: 1;
  font: inherit;
  font-size: 16px;
  padding: 0.6rem 0.8rem;
  border-radius: 14px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  resize: none;
  min-height: 46px;
  max-height: 160px;
}

.msg-empty {
  display: grid;
  place-items: center;
  flex: 1;
  padding: 2rem;
  color: var(--muted);
  text-align: center;
}

.msg-search {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 0.5rem;
}

.msg-search input {
  width: 100%;
  font: inherit;
  font-size: 16px;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

@media (max-width: 859px) {
  .messages-app.show-thread .msg-list {
    display: none;
  }
  .messages-app:not(.show-thread) .msg-thread {
    display: none;
  }
  .msg-back {
    display: inline-flex;
  }
}

/* Search */

.search-group {
  margin-top: 2rem;
}

.search-group h2 {
  font-size: 1.4rem;
}

.search-players,
.search-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.search-players li,
.search-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.8rem;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.search-list a {
  font-weight: 700;
  color: var(--text);
}

.search-players .elo {
  margin-inline-start: auto;
  font-weight: 800;
}

/* ---------- Arabic typography ---------- */

:lang(ar) body,
:lang(ar) .btn,
:lang(ar) input,
:lang(ar) textarea,
:lang(ar) select {
  font-family: var(--arabic);
}

:lang(ar) h1,
:lang(ar) h2,
:lang(ar) h3,
:lang(ar) .choice-title,
:lang(ar) .lead-prose,
:lang(ar) .prose blockquote,
:lang(ar) .hero-stats strong,
:lang(ar) .elo-box .value,
:lang(ar) .date-badge .day {
  font-family: var(--arabic);
  letter-spacing: 0;
}

:lang(ar) h1,
:lang(ar) h2,
:lang(ar) h3 {
  line-height: 1.35;
  font-weight: 700;
}

:lang(ar) body {
  line-height: 1.75;
}

/* Arabic letters join: never space them out or change their case. */
:lang(ar) .eyebrow,
:lang(ar) .tag,
:lang(ar) .step-label,
:lang(ar) .table th,
:lang(ar) .choice-badge,
:lang(ar) .podium-card .place,
:lang(ar) .elo-box .label,
:lang(ar) .date-badge .month {
  letter-spacing: 0;
  text-transform: none;
}

:lang(ar) .tag {
  font-size: 0.78rem;
}

:lang(ar) .eyebrow {
  font-size: 0.86rem;
}

/* ---------- Motion & print ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  /* The screen design is white on black; paper gets black on white. */
  :root {
    color-scheme: light;
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #f2f2f2;
    --text: #000000;
    --text-2: #222222;
    --muted: #444444;
    --line: #cccccc;
    --line-strong: #999999;
    --accent-deep: #000000;
  }
  .site-header,
  .site-footer,
  .announcement,
  .share,
  .no-print,
  .btn {
    display: none !important;
  }
  .hero,
  .page-hero {
    background: none;
    color: #000;
  }
  .hero h1,
  .page-hero h1 {
    color: #000;
  }
}
