@charset "UTF-8";
/* Local static fonts: Google Sans 400/500/700; Google Sans Mono 400/500/600/700. */
@font-face {
  font-family: 'Google Sans';
  src: url('../fonts/GoogleSans-Regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Google Sans';
  src: url('../fonts/GoogleSans-Medium.ttf') format('truetype');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Google Sans';
  src: url('../fonts/GoogleSans-Bold.ttf') format('truetype');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Google Sans';
  src: url('../fonts/GoogleSans-Italic.ttf') format('truetype');
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Google Sans';
  src: url('../fonts/GoogleSans-MediumItalic.ttf') format('truetype');
  font-style: italic;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Google Sans';
  src: url('../fonts/GoogleSans-BoldItalic.ttf') format('truetype');
  font-style: italic;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Google Sans Mono';
  src: url('../fonts/GoogleSansMono-Regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Google Sans Mono';
  src: url('../fonts/GoogleSansMono-Medium.ttf') format('truetype');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Google Sans Mono';
  src: url('../fonts/GoogleSansMono-SemiBold.ttf') format('truetype');
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Google Sans Mono';
  src: url('../fonts/GoogleSansMono-Bold.ttf') format('truetype');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Google Sans Mono';
  src: url('../fonts/GoogleSansMono-Italic.ttf') format('truetype');
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Google Sans Mono';
  src: url('../fonts/GoogleSansMono-MediumItalic.ttf') format('truetype');
  font-style: italic;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Google Sans Mono';
  src: url('../fonts/GoogleSansMono-SemiBoldItalic.ttf') format('truetype');
  font-style: italic;
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Google Sans Mono';
  src: url('../fonts/GoogleSansMono-BoldItalic.ttf') format('truetype');
  font-style: italic;
  font-weight: 700;
  font-display: swap;
}

:root {
  font-synthesis: none;
}

:root {
  --bg: #0b0b16;
  --panel: #151528;
  --panel2: #1d1d35;
  --text: #f5f4ff;
  --muted: #a7a6c2;
  --purple: #8b5cf6;
  --red: #ff496c;
  --blue: #36a3ff;
  --line: rgba(255,255,255,.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(139,92,246,.2), transparent 32rem),
    radial-gradient(circle at 95% 15%, rgba(255,73,108,.13), transparent 28rem),
    var(--bg);
  font-family: 'Google Sans', sans-serif;
  min-height: 100vh;
}

/* Keep every public-page heading on the locally hosted Google Sans family. */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Google Sans', sans-serif;
  overflow-wrap: anywhere;
}

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

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

/* =====================================
   HEADER
===================================== */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px max(24px, calc((100% - 1250px)/2));
  border-bottom: 1px solid var(--line);
  background: rgba(11,11,22,.94);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.partner-logo img {
  width: 49px;
  height: 49px;
  object-fit: contain;
}

.gamefest-logo img {
  width: 110px;
  height: 48px;
  object-fit: contain;
}

.logo-divider,
.footer-divider {
  height: 35px;
  width: 1px;
  background: rgba(255,255,255,.2);
}

.brand-caption {
  font-family: 'Google Sans', sans-serif;
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 14px;
  color: var(--muted);
}

.brand {
  font: 700 23px 'Google Sans', sans-serif;
  letter-spacing: 1.2px;
}

.brand span {
  color: var(--red);
}

.nav {
  display: flex;
  gap: 20px;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .7px;
  color: var(--muted);
}

.nav a {
  transition: color .2s;
}

.nav a.active,
.nav a:hover {
  color: white;
}

.nav a.active {
  color: var(--red);
}

.sign-in-btn {
  white-space: nowrap;
  font-size: 11px;
}

.public-auth {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.public-auth p {
  margin: 0 0 8px;
}

.public-auth .muted {
  font-size: 13px;
}

/* =====================================
   GENERAL LAYOUT
===================================== */

main {
  width: min(1200px, calc(100% - 36px));
  margin: 35px auto 100px;
}

h1, h2, h3 {
  font-family: 'Google Sans', sans-serif;
  text-transform: uppercase;
  margin: 8px 0;
}

h1 {
  font-size: clamp(42px, 7vw, 76px);
  line-height: .98;
  font-weight: 700;
}

h2 {
  font-size: 34px;
}

h3 {
  font-size: 23px;
}

p {
  line-height: 1.7;
}

.muted {
  color: var(--muted);
  line-height: 1.7;
}

.eyebrow {
  color: #c7b7ff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
}

.highlight-red {
  color: var(--red);
}

/* =====================================
   BUTTONS
===================================== */

.btn {
  border: 0;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: center;
  padding: 12px 17px;
  border-radius: 10px;
  color: white;
  font-weight: 700;
  font-size: 13px;
  background: linear-gradient(100deg, var(--purple), #6244d9);
  transition: transform .2s, filter .2s;
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.12);
}

.btn.secondary {
  background: var(--panel2);
  border: 1px solid var(--line);
}

.btn.red {
  background: linear-gradient(100deg, var(--red), #d82d64);
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.btn-large {
  padding: 15px 22px;
  font-size: 12px;
  letter-spacing: .6px;
}

/* =====================================
   HOMEPAGE HERO
===================================== */

.home-hero {
  position: relative;
  overflow: hidden;
  min-height: 440px;
  display: grid;
  grid-template-columns: 1.35fr .8fr;
  align-items: center;
  gap: 30px;
  padding: 55px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 24px;
  background:
    radial-gradient(circle at 85% 20%, rgba(255,73,108,.22), transparent 22rem),
    radial-gradient(circle at 20% 100%, rgba(139,92,246,.25), transparent 28rem),
    linear-gradient(120deg, #17152b, #171328 60%, #21152c);
}

.hero-content,
.hero-side {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.home-hero h1 {
  max-width: 750px;
  margin: 22px 0;
}

.hero-subtitle {
  color: #c2bfd7;
  max-width: 570px;
  font-size: 14px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 25px;
}


.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #50e3a4;
  border-radius: 50%;
  margin-right: 7px;
  box-shadow: 0 0 12px #50e3a4;
}

.hero-game-card {
  max-width: 330px;
  margin: auto;
  padding: 22px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,.1), rgba(255,255,255,.025));
  box-shadow: 0 25px 70px rgba(0,0,0,.3);
  transform: rotate(3deg);
}

.game-card-top,
.game-card-bottom {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #c7b7ff;
}

.game-status {
  color: #50e3a4;
}

.game-card-center {
  text-align: center;
  padding: 35px 0;
}

.game-symbol {
  display: grid;
  place-items: center;
  margin: auto;
  width: 105px;
  height: 105px;
  border-radius: 22px;
  font: 700 70px 'Google Sans';
  color: white;
  background: linear-gradient(135deg, var(--purple), var(--red));
  box-shadow: 0 0 45px rgba(139,92,246,.35);
}

.game-card-center h2 {
  font-size: 42px;
  letter-spacing: 3px;
}

.game-card-center p {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--muted);
}

.hero-decoration {
  position: absolute;
  border: 1px solid rgba(255,255,255,.07);
  transform: rotate(35deg);
  pointer-events: none;
}

.decoration-one {
  width: 200px;
  height: 200px;
  right: -80px;
  top: -80px;
}

.decoration-two {
  width: 120px;
  height: 120px;
  right: 35%;
  bottom: -80px;
}

/* =====================================
   QUICK STATS
===================================== */

.quick-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin: 22px 0 55px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(21,21,40,.9);
}

.stat-icon {
  font-size: 27px;
  color: var(--red);
}

.stat-card div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.stat-card strong {
  font: 700 30px 'Google Sans';
}

.stat-card div span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .5px;
}

/* =====================================
   HOMEPAGE SECTIONS
===================================== */

.home-section {
  margin: 65px 0;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 22px;
}

.section-heading h2 {
  font-size: clamp(30px, 5vw, 43px);
}

.section-heading p {
  font-size: 13px;
  margin-bottom: 0;
}

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

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

.center-action {
  text-align: center;
  margin-top: 25px;
}

/* Existing card styles */
.card {
  min-width: 0;
  background: rgba(21,21,40,.94);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 17px;
}

.card h3 {
  font-size: 22px;
}

.room-tag,
.pill {
  display: inline-block;
  border-radius: 99px;
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .7px;
  background: rgba(139,92,246,.18);
  color: #c9baff;
}

/* =====================================
   PARTICIPATION CARDS
===================================== */

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

.feature-card {
  position: relative;
  overflow: hidden;
  padding: 27px;
  min-height: 240px;
  background: linear-gradient(145deg, #19182f, #121222);
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: transform .2s, border-color .2s;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: rgba(139,92,246,.6);
}

.feature-number {
  position: absolute;
  right: 17px;
  top: 8px;
  font: 700 65px 'Google Sans';
  color: rgba(255,255,255,.05);
}

.feature-icon {
  font-size: 30px;
  margin-bottom: 15px;
}

.feature-card h3 {
  font-size: 24px;
}

.feature-card p {
  font-size: 12px;
  color: var(--muted);
}

/* =====================================
   CALL TO ACTION
===================================== */

.cta-section {
  position: relative;
  overflow: hidden;
  margin: 75px 0;
  padding: 45px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px;
  background: linear-gradient(110deg, rgba(139,92,246,.23), rgba(255,73,108,.15));
}

.cta-content {
  position: relative;
  z-index: 2;
  max-width: 650px;
}

.cta-section h2 {
  font-size: clamp(35px, 6vw, 55px);
}

.cta-section p {
  color: #c4bfd8;
  font-size: 13px;
  margin-bottom: 24px;
}

.cta-decoration {
  position: absolute;
  right: -15px;
  bottom: -28px;
  font: 700 clamp(55px, 10vw, 130px) 'Google Sans';
  color: rgba(255,255,255,.045);
  transform: rotate(-8deg);
}

/* =====================================
   LEADERBOARD PROMOTION
===================================== */

.leaderboard-promo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px;
  background: #151528;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.leaderboard-promo h2 {
  font-size: 36px;
}

.leaderboard-promo p {
  font-size: 12px;
  margin-bottom: 0;
}

/* =====================================
   MATCHES / FORMS / NOTICES
===================================== */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 14px;
}

.match-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

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

.player {
  font-weight: 700;
  font-size: 13px;
}

.vs {
  color: var(--muted);
  font: 700 13px 'Google Sans';
}

.score {
  color: #ffcf70;
  font-size: 12px;
  font-weight: 700;
}

.field {
  min-width: 0;
  display: grid;
  gap: 7px;
  margin: 12px 0;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 12px;
  color: var(--text);
  background: #101022;
  outline: none;
}

.field textarea {
  min-height: 100px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--purple);
}

.notice {
  padding: 11px 13px;
  margin: 12px 0;
  border-radius: 9px;
  background: #24243d;
  color: #d8d6ef;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.notice.error {
  background: rgba(255,73,108,.14);
  color: #ff9eb0;
}

.notice.success {
  background: rgba(52,211,153,.13);
  color: #83e9c2;
}

.empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 14px;
}

/* =====================================
   TABLE
===================================== */

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 460px;
}

th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

th {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1px;
}

.rank {
  font: 700 22px 'Google Sans';
  color: #ffc66b;
}

/* =====================================
   FOOTER
===================================== */

.site-footer {
  text-align: center;
  padding: 35px 20px 45px;
  border-top: 1px solid var(--line);
  background: rgba(10,10,20,.8);
}

.footer-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-bottom: 17px;
}

.footer-brand img {
  width: 65px;
  height: 45px;
  object-fit: contain;
}

.site-footer > p {
  font: 700 14px 'Google Sans';
  letter-spacing: 1.5px;
}

.site-footer .footer-small {
  color: var(--muted);
  font: 400 11px 'Google Sans', sans-serif;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 11px;
}

.footer-links a:hover {
  color: white;
}

footer {
  text-align: center;
  color: #77768e;
  padding: 20px;
  font-size: 11px;
}

/* =====================================
   MOBILE NAVIGATION
===================================== */

.bottom-nav {
  display: none;
  position: fixed;
  z-index: 30;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 9px 8px calc(9px + env(safe-area-inset-bottom));
  background: rgba(15,15,31,.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(15px);
  justify-content: space-around;
}

.bottom-nav a {
  display: grid;
  justify-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
}

.bottom-nav a.active {
  color: #c8b6ff;
}

.bottom-nav b {
  font-size: 18px;
}

/* =====================================
   ADMIN COMPATIBILITY
===================================== */

.admin-card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 18px;
  border-radius: 14px;
}

/* =====================================
   RESPONSIVE DESIGN
===================================== */

@media(max-width: 950px) {
  .topbar {
    gap: 12px;
  }

  .nav {
    gap: 12px;
  }

  .brand-caption {
    display: none;
  }

  .home-hero {
    grid-template-columns: 1fr .7fr;
    padding: 35px;
  }

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

  .stat-card {
    padding: 13px;
  }
}

@media(max-width: 760px) {
  .topbar {
    padding: 12px 16px;
  }

  .nav {
    display: none;
  }

  .header-brand {
    gap: 8px;
  }

  .partner-logo img {
    width: 38px;
    height: 38px;
  }

  .gamefest-logo img {
    width: 85px;
    height: 40px;
  }

  .sign-in-btn {
    font-size: 9px;
    padding: 10px;
  }

  main {
    width: calc(100% - 24px);
    margin-top: 18px;
  }

  .home-hero {
    grid-template-columns: 1fr;
    padding: 27px 20px;
  }

  .hero-side {
    display: none;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .quick-stats {
    grid-template-columns: repeat(2,1fr);
    margin-bottom: 35px;
  }

  .stat-card strong {
    font-size: 25px;
  }

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

  .home-section {
    margin: 45px 0;
  }

  .cta-section {
    padding: 30px 20px;
  }

  .leaderboard-promo {
    flex-direction: column;
    align-items: flex-start;
  }

  .bottom-nav {
    display: flex;
  }

  body {
    padding-bottom: 55px;
  }

  .section-head {
    align-items: center;
  }
}

@media(max-width: 480px) {
  h1 {
    font-size: 43px;
  }

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

  .quick-stats {
    gap: 8px;
  }

  .stat-card {
    gap: 8px;
    padding: 12px 9px;
  }

  .stat-card div span {
    font-size: 8px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-links {
    gap: 13px;
  }
}


/* ==========================================
   GAMEFEST MATCHES PAGE
========================================== */

.matches-main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 38px 0 90px;
}

.matches-hero {
  min-height: 390px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 55px;
  margin-bottom: 55px;
  border: 1px solid rgba(139, 92, 246, .35);
  border-radius: 22px;
  background:
    radial-gradient(circle at 80% 20%, rgba(139, 92, 246, .25), transparent 35%),
    linear-gradient(120deg, #17152d, #10101d 70%);
}

.matches-hero-content {
  max-width: 650px;
  position: relative;
  z-index: 2;
}

.matches-hero .eyebrow,
.matches-overview .eyebrow,
.all-matches-section .eyebrow,
.matches-bottom-banner .eyebrow {
  color: #a99aff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: #ff496c;
  box-shadow: 0 0 12px rgba(255, 73, 108, .8);
  vertical-align: middle;
}

.matches-hero h1 {
  margin: 22px 0 14px;
  font-family: 'Google Sans', sans-serif;
  font-size: clamp(58px, 8vw, 100px);
  line-height: .86;
  font-weight: 700;
  letter-spacing: -2px;
}

.matches-hero h1 span {
  color: #a78bfa;
}

.matches-hero-content p {
  max-width: 480px;
  color: #b5b3cc;
  line-height: 1.8;
  font-size: 14px;
  margin-bottom: 25px;
}

.matches-hero-btn,
.matches-predict-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-radius: 9px;
  background: #8b5cf6;
  color: white;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .7px;
  text-decoration: none;
  transition: .2s ease;
}

.matches-hero-btn:hover,
.matches-predict-btn:hover {
  background: #7040e8;
  transform: translateY(-2px);
}

.matches-hero-side {
  min-width: 210px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-stat-card {
  position: relative;
  z-index: 2;
  width: 190px;
  padding: 25px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 15px;
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(10px);
  transform: rotate(5deg);
}

.hero-stat-label,
.hero-stat-caption {
  display: block;
  color: #aaa7c4;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

.hero-stat-card strong {
  display: block;
  margin: 12px 0;
  color: white;
  font-family: 'Google Sans', sans-serif;
  font-size: 65px;
  line-height: 1;
}

.hero-decoration {
  position: absolute;
  width: 220px;
  height: 220px;
  transform: rotate(12deg);
  opacity: .7;
}

.deco-block {
  position: absolute;
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 8px;
}

.block-one {
  top: 0;
  left: 0;
  background: #8b5cf6;
}

.block-two {
  top: 55px;
  left: 55px;
  background: #ff496c;
}

.block-three {
  top: 110px;
  left: 110px;
  background: #36a3ff;
}

.block-four {
  top: 55px;
  left: 165px;
  background: #8b5cf6;
}

/* Overview */

.matches-overview {
  margin-bottom: 65px;
}

.matches-overview-heading,
.matches-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.matches-overview-heading h2,
.matches-section-heading h2 {
  margin: 8px 0 0;
  font-family: 'Google Sans', sans-serif;
  font-size: 34px;
  font-weight: 700;
}

.matches-live-label {
  color: #aaa7c4;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
}

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

.matches-stat {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
}

.matches-stat span {
  display: block;
  color: #a7a6c2;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
}

.matches-stat strong {
  display: block;
  margin-top: 10px;
  font-family: 'Google Sans', sans-serif;
  font-size: 38px;
  font-weight: 700;
}

/* Match filters */

.all-matches-section {
  scroll-margin-top: 30px;
}

.matches-section-heading {
  margin-bottom: 20px;
}

.matches-section-heading p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}

.matches-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 28px;
}

.match-filter {
  display: inline-flex;
  align-items: center;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: #aaa7c4;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .8px;
  cursor: pointer;
  transition: .2s ease;
}

.match-filter:hover {
  border-color: #8b5cf6;
  color: white;
}

.match-filter.active {
  border-color: #8b5cf6;
  background: rgba(139, 92, 246, .2);
  color: white;
}

/* Match groups */

.match-group {
  margin-bottom: 35px;
}

.match-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding-bottom: 14px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.match-group-label {
  color: #a78bfa;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.match-group-heading h3 {
  margin: 5px 0 0;
  font-family: 'Google Sans', sans-serif;
  font-size: 25px;
  font-weight: 700;
  text-transform: uppercase;
}

.match-group-count {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #aaa7c4;
  font-size: 10px;
  font-weight: 700;
}

/* Match cards */

.match-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.match-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  transition: .2s ease;
}

.match-card:hover {
  border-color: rgba(139, 92, 246, .65);
  transform: translateY(-3px);
}

.match-card-top,
.match-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.match-number,
.match-player-label {
  color: #8987a5;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
}

.match-status {
  display: inline-block;
  flex-shrink: 0;
  white-space: nowrap;
  padding: 6px 9px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .8px;
}

.status-live {
  background: rgba(255, 73, 108, .15);
  color: #ff6c89;
}

.status-upcoming {
  background: rgba(54, 163, 255, .13);
  color: #65baff;
}

.status-completed {
  background: rgba(52, 211, 153, .13);
  color: #55d9a9;
}

.match-players {
  display: grid;
  grid-template-columns: 1fr 42px 1fr;
  align-items: center;
  gap: 8px;
  padding: 24px 0;
}

.match-player {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.match-player:last-child {
  text-align: right;
  align-items: flex-end;
}

.match-player strong {
  overflow-wrap: anywhere;
  color: white;
  font-family: 'Google Sans', sans-serif;
  font-size: clamp(19px, 2.5vw, 27px);
  font-weight: 700;
  text-transform: uppercase;
}

.match-winner strong {
  color: #a78bfa;
}

.match-vs {
  color: #77748f;
  font-family: 'Google Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.winner-tag {
  padding: 4px 7px;
  border-radius: 4px;
  background: rgba(139, 92, 246, .2);
  color: #bba7ff;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .8px;
}

.match-card-bottom {
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.match-result {
  color: #aaa7c4;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .7px;
  overflow-wrap: anywhere;
}

.match-arrow {
  color: #8b5cf6;
  font-size: 18px;
}

/* Empty state */

.matches-empty-state {
  padding: 55px 20px;
  border: 1px dashed rgba(167, 139, 250, .35);
  border-radius: 14px;
  background: rgba(139, 92, 246, .04);
  text-align: center;
}

.matches-empty-icon {
  color: #a78bfa;
  font-size: 38px;
}

.matches-empty-state h3 {
  margin: 12px 0 7px;
  font-family: 'Google Sans', sans-serif;
  font-size: 25px;
}

.matches-empty-state p {
  color: var(--muted);
  font-size: 13px;
}

/* Bottom banner */

.matches-bottom-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 35px;
  margin-top: 65px;
  border: 1px solid rgba(139, 92, 246, .3);
  border-radius: 16px;
  background:
    linear-gradient(110deg, rgba(139, 92, 246, .15), transparent),
    var(--panel);
}

.matches-bottom-banner h2 {
  margin: 10px 0;
  font-family: 'Google Sans', sans-serif;
  font-size: 35px;
  line-height: .95;
}

.matches-bottom-banner p {
  color: var(--muted);
  font-size: 13px;
}

/* Responsive */

@media (max-width: 760px) {
  .matches-main {
    width: min(100% - 28px, 1180px);
    padding-top: 22px;
  }

  .matches-hero {
    min-height: 350px;
    padding: 32px 25px;
  }

  .matches-hero-side {
    display: none;
  }

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

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

  .matches-overview-heading,
  .matches-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .matches-bottom-banner {
    align-items: flex-start;
    flex-direction: column;
    padding: 25px;
  }
}

@media (max-width: 420px) {
  .matches-hero h1 {
    font-size: 58px;
  }

  .matches-filters {
    gap: 7px;
  }

  .match-filter {
    padding: 10px 11px;
    font-size: 9px;
  }

  .matches-stat {
    padding: 16px;
  }
}

/* =========================================
   SHARED HEADER BRANDING
========================================= */

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.partner-logo,
.gamefest-logo {
    display: flex;
    align-items: center;
}

.partner-logo img {
    width: 65px;
    height: 55px;
    object-fit: contain;
}

.logo-divider {
    width: 1px;
    height: 38px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 2px;
}

.gamefest-logo {
    margin-left: -30px;
}

.gamefest-logo img {
    width: 120px;
    height: 55px;
    object-fit: contain;
}

.brand-caption {
    font-family: 'Google Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    white-space: nowrap;
    margin-left: 2px;
}

/* =========================================
   SHARED FOOTER
========================================= */

.site-footer {
    text-align: center;
    padding: 40px 20px 30px;
    margin-top: 60px;
    border-top: 1px solid var(--line);
    background: rgba(11, 11, 22, 0.85);
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 20px;
}

.footer-brand img {
    width: 90px;
    height: 55px;
    object-fit: contain;
}

.footer-divider {
    width: 1px;
    height: 38px;
    background: rgba(255, 255, 255, 0.3);
}

.site-footer > p {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 1.5px;
    margin: 8px 0;
}

.site-footer .footer-small {
    font-size: 11px;
    letter-spacing: 0.5px;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 25px;
    margin-top: 22px;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #fff;
}

/* =========================================
   SHARED MOBILE NAVIGATION
========================================= */

.bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    .header-brand {
        gap: 7px;
    }

    .partner-logo img {
        width: 43px;
        height: 42px;
    }

    .gamefest-logo img {
        width: 85px;
        height: 42px;
    }

    .brand-caption {
        font-size: 10px;
        white-space: normal;
        max-width: 115px;
    }

    .logo-divider {
        height: 30px;
    }

    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        justify-content: space-around;
        align-items: center;
        padding: 10px 5px;
        background: rgba(11, 11, 22, 0.97);
        border-top: 1px solid var(--line);
        backdrop-filter: blur(12px);
    }

    .bottom-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        color: var(--muted);
        text-decoration: none;
        font-size: 10px;
        font-weight: 700;
    }

    .bottom-nav a b {
        font-size: 19px;
    }

    .bottom-nav a.active {
        color: #fff;
    }

    body {
        padding-bottom: 65px;
    }
}


/* ==========================================
   PREDICT & LEADERBOARD PAGE DESIGN
   GAMEFEST
========================================== */

.page-main {
    width: min(1180px, calc(100% - 40px));
    margin: 35px auto 90px;
}

.page-hero {
    position: relative;
    overflow: hidden;
    min-height: 350px;
    display: flex;
    align-items: center;
    padding: 55px;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,.12);
    background:
        radial-gradient(circle at 90% 15%, rgba(255,73,108,.22), transparent 24rem),
        radial-gradient(circle at 10% 90%, rgba(139,92,246,.25), transparent 25rem),
        linear-gradient(120deg, #17152e, #101020);
}

.page-hero-content {
    position: relative;
    z-index: 2;
    max-width: 780px;
}

.page-hero h1 {
    font-size: clamp(42px, 7vw, 76px);
    line-height: .98;
    margin: 22px 0;
}

.highlight-red {
    color: var(--red);
}

.page-subtitle {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.8;
    max-width: 650px;
}

.page-section {
    margin-top: 65px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 24px;
}

.section-heading h2 {
    font-size: clamp(30px, 5vw, 43px);
    margin: 8px 0;
}

.section-heading p {
    margin: 5px 0;
}

.live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    margin-right: 8px;
    box-shadow: 0 0 12px #4ade80;
}

/* ==========================================
   PREDICTION HERO
========================================== */

.prediction-hero {
    background:
        radial-gradient(circle at 85% 50%, rgba(139,92,246,.28), transparent 25rem),
        radial-gradient(circle at 10% 100%, rgba(255,73,108,.15), transparent 22rem),
        #111022;
}

.prediction-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.prediction-highlight {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 145px;
    padding: 14px 17px;
    background: rgba(255,255,255,.045);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.prediction-highlight strong {
    color: #fff;
    font-family: 'Google Sans', sans-serif;
    font-size: 25px;
}

.prediction-highlight span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
}

.prediction-steps {
    grid-template-columns: repeat(3, minmax(0,1fr));
}

.feature-card {
    position: relative;
    overflow: hidden;
    min-height: 230px;
    padding: 25px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 17px;
    transition: transform .2s, border-color .2s;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: rgba(139,92,246,.6);
}

.feature-number {
    position: absolute;
    right: 18px;
    top: 12px;
    font-family: 'Google Sans', sans-serif;
    font-size: 48px;
    font-weight: 700;
    color: rgba(255,255,255,.08);
}

.feature-icon {
    font-size: 32px;
    margin: 15px 0;
}

.feature-card h3 {
    font-size: 23px;
}

.feature-card p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

.prediction-status-panel {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(139,92,246,.09);
}

.status-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(139,92,246,.2);
    font-size: 23px;
}

.prediction-status-panel h3 {
    font-size: 19px;
    margin: 0 0 5px;
}

.prediction-status-panel p {
    color: var(--muted);
    font-size: 12px;
    margin: 0;
}

.prediction-list {
    margin-top: 18px;
}

.prediction-list .card {
    margin-bottom: 15px;
}

.prediction-list button {
    transition: .2s ease;
}

.prediction-list button:hover {
    transform: translateY(-2px);
}

.prediction-list .field {
    margin: 15px 0;
}

/* The public username editor stays separate from prediction room updates. */
.username-editor[hidden],
.username-editor [hidden] {
    display: none;
}

.username-editor {
    margin-bottom: 40px;
}

.username-editor h2 {
    margin: 0 0 12px;
    font-size: 28px;
}

.username-editor p {
    max-width: 70ch;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.username-editor form {
    max-width: 640px;
    margin-top: 18px;
}

.username-editor .field p {
    margin: 0;
    font-size: 12px;
}

.username-editor .username-error {
    color: #ff9eb0;
}

.username-editor input[aria-invalid="true"] {
    border-color: var(--red);
}

.username-editor input:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 3px;
}

.username-editor .username-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 600px) {
    .username-editor .btn {
        width: 100%;
    }
}

/* ==========================================
   LEADERBOARD HERO
========================================== */

.leaderboard-hero {
    background:
        radial-gradient(circle at 85% 30%, rgba(255,73,108,.2), transparent 24rem),
        radial-gradient(circle at 10% 90%, rgba(54,163,255,.16), transparent 24rem),
        #111022;
}

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

.leaderboard-info-grid .stat-card {
    min-height: 105px;
}

.leaderboard-info-grid .stat-card strong {
    font-family: 'Google Sans', sans-serif;
    font-size: 36px;
    color: white;
}

.leaderboard-panel {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(21,21,40,.96);
}

.leaderboard-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 23px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(100deg, rgba(139,92,246,.15), transparent);
}

.leaderboard-panel-header h3 {
    font-size: 28px;
    margin: 5px 0 0;
}

.ranking-badge {
    display: inline-block;
    padding: 9px 13px;
    border-radius: 8px;
    background: rgba(255,73,108,.13);
    color: #ff91a5;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 540px;
}

.leaderboard-table th {
    padding: 17px 20px;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 1px;
    text-align: left;
    background: rgba(255,255,255,.025);
}

.leaderboard-table td {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}

.leaderboard-table tbody tr {
    transition: background .2s;
}

.leaderboard-table tbody tr:hover {
    background: rgba(139,92,246,.08);
}

.leaderboard-table tbody tr:last-child td {
    border-bottom: none;
}

.leaderboard-table .rank {
    font-family: 'Google Sans', sans-serif;
    font-size: 25px;
    font-weight: 700;
    color: #ffcf70;
}

.leaderboard-table .loading-cell {
    padding: 35px;
    text-align: center;
    color: var(--muted);
}

.leaderboard-table td:last-child {
    color: #ffcf70;
    font-weight: 700;
}

.leaderboard-note {
    padding: 15px 22px;
    margin: 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
}

/* ==========================================
   RESPONSIVE DESIGN
========================================== */

@media(max-width: 768px) {

    .page-main {
        width: calc(100% - 24px);
        margin-top: 18px;
    }

    .page-hero {
        min-height: auto;
        padding: 30px 20px;
        border-radius: 17px;
    }

    .page-hero h1 {
        font-size: clamp(38px, 10vw, 55px);
    }

    .page-subtitle {
        font-size: 13px;
    }

    .page-section {
        margin-top: 42px;
    }

    .prediction-steps {
        grid-template-columns: 1fr;
    }

    .leaderboard-info-grid {
        grid-template-columns: 1fr;
    }

    .prediction-highlight {
        flex: 1;
        min-width: 110px;
    }

    .section-heading {
        align-items: flex-start;
    }

    .leaderboard-panel-header {
        padding: 17px;
    }

    .prediction-status-panel {
        align-items: flex-start;
    }

    .cta-section {
        padding: 28px 20px;
    }

}



/* ==========================================
   PREDICTION PAGE
========================================== */

.prediction-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.prediction-card {
  padding: 22px;
  transition: transform .2s ease, border-color .2s ease;
}

.prediction-card:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 92, 246, .6);
}

.prediction-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.prediction-title {
  margin: 22px 0;
  font-size: 27px;
}

.prediction-versus {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.prediction-versus .btn {
  min-height: 52px;
  padding: 12px 8px;
  overflow-wrap: anywhere;
}

.prediction-versus .vs {
  font-size: 18px;
  font-weight: 700;
}

.pick-btn.selected {
  background: linear-gradient(100deg, var(--purple), var(--red));
  border: 1px solid rgba(255,255,255,.3);
}

.prediction-result {
  margin-top: 20px;
  font-size: 12px;
}

.prediction-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  font-size: 11px;
}

/* ==========================================
   LEADERBOARD PAGE
========================================== */

.leaderboard-card {
  padding: 22px;
}

.leaderboard-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.leaderboard-heading h3 {
  font-size: 25px;
}

.leaderboard-card table {
  width: 100%;
  min-width: 550px;
  table-layout: fixed;
}

.leaderboard-card th:first-child {
  width: 64px;
}

.leaderboard-card th:nth-child(n+3) {
  width: 120px;
}

.leaderboard-card td:nth-child(2) {
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.leaderboard-card th,
.leaderboard-card td {
  padding: 17px 12px;
}

.leaderboard-card tbody tr {
  transition: background .2s ease;
}

.leaderboard-card tbody tr:hover {
  background: rgba(139, 92, 246, .08);
}

.rank {
  font-size: 23px;
  font-weight: 700;
}

.top-rank {
  color: #ffd166;
}

.second-rank {
  color: #c6c9d6;
}

.third-rank {
  color: #d99b70;
}

.leaderboard-card .score {
  color: #ffcf70;
  font-weight: 700;
}

.leaderboard-card #leaderboardNote {
  margin-top: 18px;
  font-size: 11px;
}

/* ==========================================
   RESPONSIVE DESIGN
========================================== */

@media(max-width: 760px) {
  .prediction-grid {
    grid-template-columns: 1fr;
  }

  .prediction-card {
    padding: 17px;
  }

  .prediction-versus {
    gap: 6px;
  }

  .prediction-versus .btn {
    font-size: 11px;
  }

  .leaderboard-card {
    padding: 14px;
  }

  .leaderboard-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* ==========================================
   PREDICTION SELECTION STATES
========================================== */


.room-prediction-players .prediction-player {
  min-width: 0;
}

.room-prediction-players .prediction-player strong {
  max-width: 100%;
  line-height: 1.4;
}

.room-prediction-players .prediction-player.selected {
  background: linear-gradient(135deg, #7040d8, #5630b5) !important;
  border: 2px solid #b69aff !important;
  color: #fff !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .18), 0 8px 22px rgba(91, 52, 180, .28);
}

.room-prediction-players .prediction-player.selected strong {
  color: #fff !important;
}

.room-prediction-players .prediction-player.selected span {
  color: #e2d7ff !important;
  opacity: 1 !important;
}

.room-prediction-players .prediction-player.selected::after {
  content: "\2713 SELECTED";
  display: inline-block;
  margin-top: 5px;
  padding: 4px 8px;
  border-radius: 20px;
  background: #fff;
  color: #5630b5;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
}

.room-prediction-players .prediction-player:disabled:not(.selected) {
  opacity: .55;
}



/* =========================================================
   LOGO ROUNDING FIX — STRUCTURAL CLIPPING
   The square source images are clipped in square wrappers.
   Outer slots retain the original layout widths and spacing.
   Only header/footer logo presentation is affected.
========================================================= */

/* Header: preserve original 65px / 120px logo link footprints */
.topbar .header-brand > .partner-logo,
.topbar .header-brand > .gamefest-logo {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.topbar .header-brand > .partner-logo {
  width: 65px;
  flex: 0 0 65px;
}

.topbar .header-brand > .gamefest-logo {
  width: 120px;
  flex: 0 0 120px;
}

.topbar .header-brand .logo-crop {
  display: block !important;
  width: 55px !important;
  height: 55px !important;
  flex: 0 0 55px !important;
  overflow: hidden !important;
  border-radius: 20px !important;
  -webkit-border-radius: 20px !important;
  clip-path: inset(0 round 20px) !important;
  -webkit-clip-path: inset(0 round 20px) !important;
  line-height: 0;
}

.topbar .header-brand .logo-crop img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  border-radius: 0 !important;
}

/* Footer: retain each original 90px-wide image slot */
.site-footer .footer-brand > .footer-logo-slot {
  width: 90px;
  height: 55px;
  flex: 0 0 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-footer .footer-brand .logo-crop {
  display: block !important;
  width: 55px !important;
  height: 55px !important;
  flex: 0 0 55px !important;
  overflow: hidden !important;
  border-radius: 20px !important;
  -webkit-border-radius: 20px !important;
  clip-path: inset(0 round 20px) !important;
  -webkit-clip-path: inset(0 round 20px) !important;
  line-height: 0;
}

.site-footer .footer-brand .logo-crop img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  border-radius: 0 !important;
}

@media (max-width: 768px) {
  .topbar .header-brand > .partner-logo {
    width: 43px;
    flex-basis: 43px;
  }

  .topbar .header-brand > .gamefest-logo {
    width: 85px;
    flex-basis: 85px;
  }

  .topbar .header-brand .logo-crop {
    width: 42px !important;
    height: 42px !important;
    flex-basis: 42px !important;
  }
}

/* =========================================
   MOBILE GAMEFEST LOGO POSITION FIX
   Align the visible Gamefest logo to the
   left side of its existing logo container.
   Desktop layout remains unchanged.
========================================= */

@media (max-width: 768px) {
  .topbar .header-brand > a.gamefest-logo {
    margin-left: 0 !important;
    justify-content: flex-start !important;
  }

  .topbar .header-brand > a.gamefest-logo > .logo-crop {
    margin-left: 0 !important;
    transform: none !important;
    position: static !important;
  }
}

/* Tournament tracks use the existing arena palette and type system. */
.tournament-card h3 {
  margin: 14px 0 6px;
  font: 700 24px/1.1 'Google Sans', sans-serif;
}

.series-target,
.slot-label {
  color: var(--muted);
  font-size: 11px;
}

.series-target { margin: 0 0 16px; }
.tournament-players { display: grid; gap: 8px; }
.tournament-player {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.tournament-player .slot-label { grid-column: 1; }
.tournament-player strong {
  grid-column: 1;
  overflow-wrap: anywhere;
  font: 700 18px/1.2 'Google Sans', sans-serif;
}

.series-score {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  color: var(--text);
  font: 700 28px/1 'Google Sans', sans-serif;
}

.tournament-player.is-winner { border-color: var(--purple); }
.tournament-player.is-winner strong { color: #c6b4ff; }
.tournament-result {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.knockout-bracket {
  --track-gap: 40px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--track-gap);
  margin-top: 26px;
}

.bracket-round { display: flex; flex-direction: column; min-width: 0; }
.bracket-round h4 {
  min-height: 54px;
  margin: 0;
  font: 700 22px/1.2 'Google Sans', sans-serif;
}

.bracket-round h4 span { display: block; margin-top: 4px; color: var(--muted); font: 500 11px 'Google Sans', sans-serif; }
.bracket-matches {
  display: grid;
  grid-template-rows: repeat(8, minmax(0, 1fr));
  gap: 12px;
  flex: 1;
}

.bracket-card { position: relative; grid-row: span 2; padding: 16px; }
.bracket-card:hover { transform: none; }
.round-semifinal .bracket-card:nth-child(1) { grid-row: 2 / span 2; }
.round-semifinal .bracket-card:nth-child(2) { grid-row: 6 / span 2; }
.round-final .bracket-card { grid-row: 4 / span 2; }

/* Each pair joins halfway across the gutter, then enters its next series. */
.round-quarterfinal .bracket-card::after,
.round-semifinal .bracket-card::after {
  content: "";
  position: absolute;
  left: 100%;
  width: calc(var(--track-gap) / 2);
  height: calc(50% + 7px);
  border-right: 2px solid var(--red);
  pointer-events: none;
}

.round-quarterfinal .bracket-card:nth-child(odd)::after,
.round-semifinal .bracket-card:nth-child(odd)::after {
  top: 50%;
  border-top: 2px solid var(--red);
}

.round-quarterfinal .bracket-card:nth-child(even)::after,
.round-semifinal .bracket-card:nth-child(even)::after {
  bottom: 50%;
  border-bottom: 2px solid var(--red);
}

.round-semifinal .bracket-card::after { height: calc(100% + 14px); }
.round-semifinal .bracket-card::before,
.round-final .bracket-card::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 100%;
  width: calc(var(--track-gap) / 2);
  border-top: 2px solid var(--red);
  pointer-events: none;
}

.filter-muted { opacity: .4; }
.third-place-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px dashed var(--line);
}

.third-place-section h3 { font: 700 30px 'Google Sans', sans-serif; }
.placement-section { margin-top: 38px; padding-top: 28px; border-top: 1px solid var(--line); }
.placement-table { width: 100%; min-width: 650px; }
.placement-table td, .placement-table th { padding: 14px 10px; text-align: left; }
.placement-table small, .home-player-list small { display: block; color: var(--muted); margin-top: 5px; font-size: 11px; }
.prediction-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.saved-prediction { margin-top: 16px; padding: 14px; border-left: 3px solid var(--purple); background: var(--bg); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.saved-prediction p { margin: 6px 0; }
.home-player-list { list-style: none; padding: 0; display: grid; gap: 8px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.home-player-list li { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.room-details-link { display: inline-block; margin-top: 12px; color: #c6b4ff; font-size: 12px; font-weight: 700; }
.tournament-card, .prediction-card { scroll-margin-top: 100px; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }

@media (max-width: 900px) {
  .knockout-bracket { display: block; }
  .bracket-round { margin-top: 28px; }
  .bracket-round h4 { min-height: auto; margin-bottom: 16px; }
  .bracket-matches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; gap: 14px; }
  .bracket-matches .bracket-card { grid-row: auto; }
  .bracket-card::before, .bracket-card::after { display: none; }
  .round-final .bracket-matches { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .bracket-matches, .third-place-section { grid-template-columns: 1fr; }
  .third-place-section { gap: 12px; }
  .prediction-actions { width: 100%; }
  .prediction-actions .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tournament-card, .prediction-card { transition: none; }
  .tournament-card:hover, .prediction-card:hover { transform: none; }
}

/* Google Sans Mono: use for compact tournament metadata and labels. */
.room-tag,
.pill,
.match-number,
.match-player-label,
.match-result,
.slot-label,
.series-target,
.ranking-badge,
.game-card-top,
.game-card-bottom {
  font-family: 'Google Sans Mono', monospace;
}

/* Public navigation with the FAQ link. Scoped so the Admin dashboard is unchanged. */
.nav-with-faq {
  min-width: 0;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-with-faq a {
  white-space: nowrap;
}

@media (max-width: 1100px) and (min-width: 769px) {
  .nav-with-faq {
    gap: 8px 12px;
    font-size: 10px;
  }
}

@media (max-width: 768px) {
  .nav-with-faq {
    display: none;
  }

  .bottom-nav-with-faq a {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    justify-content: center;
  }
}

/* ==========================================
   ISSUE #32: PERSONAL LEADERBOARD STATISTICS
========================================== */

.personal-leaderboard-summary {
  margin: 0 0 18px;
  padding: 22px;
  border: 1px solid rgba(139, 92, 246, .42);
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 73, 108, .08), transparent 18rem),
    linear-gradient(125deg, rgba(139, 92, 246, .12), rgba(21, 21, 40, .96));
}

.personal-leaderboard-summary[hidden] {
  display: none;
}

.personal-summary-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.personal-summary-heading h3 {
  margin: 5px 0;
  font-size: 22px;
}

.personal-summary-heading p {
  margin: 0;
  overflow-wrap: anywhere;
}

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

.personal-summary-stat {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(17, 16, 34, .65);
}

.personal-summary-stat span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .8px;
  line-height: 1.5;
}

.personal-summary-stat strong {
  display: block;
  margin-top: 7px;
  color: #fff;
  font: 700 clamp(19px, 3vw, 27px)/1.15 'Google Sans', sans-serif;
  overflow-wrap: anywhere;
}

.personal-summary-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.personal-summary-footer p {
  flex: 1 1 260px;
  margin: 0;
  font-size: 11px;
  line-height: 1.6;
}

.personal-summary-footer .btn {
  flex-shrink: 0;
  font-size: 10px;
}

.you-indicator {
  display: inline-block;
  vertical-align: middle;
  margin-left: 7px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 207, 112, .5);
  border-radius: 20px;
  background: rgba(255, 207, 112, .12);
  color: #ffcf70;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .7px;
}

.leaderboard-card tbody tr.current-user-row {
  background: rgba(139, 92, 246, .16);
  box-shadow: inset 3px 0 0 #b69aff;
}

.leaderboard-card tbody tr.current-user-row:hover {
  background: rgba(139, 92, 246, .22);
}

.leaderboard-card tbody tr.current-user-row:focus {
  outline: 2px solid #b69aff;
  outline-offset: -2px;
}

@media (max-width: 760px) {
  .personal-leaderboard-summary {
    padding: 16px;
  }

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

@media (max-width: 380px) {
  .personal-summary-stat {
    padding: 11px;
  }

  .personal-summary-stat span {
    font-size: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .leaderboard-card tbody tr {
    transition: none;
  }
}

