:root {
  --bg: #07080c;
  --bg-elevated: #10131a;
  --surface: rgba(18, 22, 30, 0.72);
  --surface-solid: #151922;
  --surface2: #1c2230;
  --border: rgba(255, 214, 140, 0.14);
  --border-strong: rgba(255, 214, 140, 0.28);
  --text: #f4f1ea;
  --muted: #9aa3b5;
  --crimson: #e11d48;
  --crimson-soft: #fb7185;
  --gold: #e8c47a;
  --gold-deep: #c9a24a;
  --ink: #0a0b10;
  --team-a: #38bdf8;
  --team-b: #fb7185;
  --win: #34d399;
  --radius: 14px;
  --font: "Noto Sans KR", "Outfit", sans-serif;
  --font-display: "Noto Sans KR", sans-serif;
  --font-script: "Nanum Brush Script", "Noto Sans KR", cursive;
  --font-brand: "Outfit", "Noto Sans KR", sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --hero-min-height: min(100svh, 52rem);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  overflow-x: hidden;
}

/* ——— Ambient backdrop ——— */

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* 고정 블러 레이어가 스크롤 중 앞 콘텐츠를 삼키는 Chrome 버그 완화 */
  transform: translateZ(0);
  contain: paint;
  background:
    radial-gradient(ellipse 70% 45% at 85% 15%, rgba(225, 29, 72, 0.2), transparent 55%),
    radial-gradient(ellipse 55% 40% at 12% 55%, rgba(232, 196, 122, 0.1), transparent 50%),
    linear-gradient(165deg, #0e1018 0%, var(--bg) 42%, #090b10 100%);
}

.ambient__grain {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.ambient__orb {
  position: absolute;
  border-radius: 50%;
  /* filter:blur 대신 큰 radial — 스크롤 중 앞 레이어 깜빡임 완화 */
  opacity: 0.55;
  animation: orb-drift 14s var(--ease-out) infinite alternate;
  will-change: transform;
}

.ambient__orb--a {
  width: 36rem;
  height: 36rem;
  top: 12%;
  left: -12%;
  background: radial-gradient(circle, rgba(225, 29, 72, 0.28) 0%, transparent 68%);
}

.ambient__orb--b {
  width: 32rem;
  height: 32rem;
  top: 4%;
  right: -10%;
  background: radial-gradient(circle, rgba(232, 196, 122, 0.2) 0%, transparent 68%);
  animation-delay: -4s;
  animation-duration: 18s;
}

@keyframes orb-drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(3%, -4%, 0) scale(1.08);
  }
}

/* ——— Hero ——— */

.hero {
  position: relative;
  isolation: isolate;
  min-height: auto;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  padding: 1.25rem 1.25rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
  animation: hero-enter 0.9s var(--ease-out) both;
}

@keyframes hero-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.hero__mark {
  margin: 0;
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.28em;
  color: var(--gold);
  text-indent: 0.28em;
}

.site-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
}

.hero__stage {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1.5rem;
  align-items: center;
  animation: copy-rise 1s 0.12s var(--ease-out) both;
}

@keyframes copy-rise {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero__copy {
  max-width: 34rem;
  padding: 0;
  background: none;
  border: none;
  backdrop-filter: none;
}

.hero__brand {
  margin: 0 0 0.35rem;
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: clamp(3.4rem, 12vw, 6.5rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-shadow: 0 0 40px rgba(225, 29, 72, 0.35);
  background: linear-gradient(115deg, #fff 10%, var(--gold) 45%, var(--crimson-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__title {
  margin: 0 0 0.75rem;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(2.35rem, 7vw, 3.6rem);
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: #fff6e8;
  background: linear-gradient(120deg, #ffffff 0%, var(--gold) 48%, #f5d78a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.45));
}

.hero__tagline {
  margin: 0 0 1.15rem;
  max-width: 26rem;
  font-size: 0.98rem;
  color: rgba(244, 241, 234, 0.88);
  line-height: 1.6;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.hero__cta-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Character framed portrait */

.hero__figure {
  position: relative;
  justify-self: center;
  width: min(100%, 22rem);
  display: grid;
  place-items: center;
}

.hero__speech {
  position: absolute;
  z-index: 3;
  left: -4.5rem;
  top: 8%;
  max-width: 12rem;
  padding: 0.95rem 1.1rem 1.05rem;
  background: #fffef7;
  color: #1a1208;
  border: 3px solid #1c1410;
  border-radius: 60% 55% 58% 52% / 62% 58% 55% 60%;
  box-shadow:
    5px 6px 0 rgba(225, 29, 72, 0.28),
    0 10px 24px rgba(0, 0, 0, 0.22);
  transform: rotate(-5deg);
}

.hero__speech-tail {
  position: absolute;
  right: -0.15rem;
  bottom: 1.35rem;
  width: 1.35rem;
  height: 1.1rem;
  background: #fffef7;
  border-right: 3px solid #1c1410;
  border-bottom: 3px solid #1c1410;
  border-radius: 0 0 0.85rem 0;
  transform: rotate(-38deg) skewX(-18deg);
  box-shadow: 3px 3px 0 rgba(225, 29, 72, 0.18);
}

.hero__speech-text {
  margin: 0;
  position: relative;
  z-index: 1;
  font-family: var(--font-script);
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: #1c1410;
  text-align: center;
}

.hero__figure-frame {
  position: relative;
  width: 100%;
  padding: 0.55rem;
  background: linear-gradient(145deg, #f0d78a 0%, var(--gold) 28%, var(--gold-deep) 62%, #8a6a2a 100%);
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25);
  transform: rotate(4deg);
}

.hero__figure-frame::before {
  content: "";
  position: absolute;
  inset: 0.28rem;
  border: 1px solid rgba(90, 60, 20, 0.35);
  pointer-events: none;
  z-index: 2;
}

.hero__figure-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  background: #12141c;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
  user-select: none;
  pointer-events: none;
}

/* hero-specific standings motion only; shell comes from .section-panel */
.standings-panel--hero {
  animation: reveal-up 0.75s 0.2s var(--ease-out) both;
}

@media (min-width: 900px) {
  .hero {
    padding: 1.5rem 2rem 2.5rem;
    gap: 1.6rem;
  }

  .hero__stage {
    grid-template-columns: minmax(0, 1.15fr) minmax(17rem, 0.85fr);
    gap: 1.75rem;
    align-items: center;
  }

  .hero__copy {
    max-width: none;
  }

  .hero__figure {
    width: min(100%, 24rem);
    justify-self: end;
  }

  .hero__speech {
    left: -8rem;
    max-width: 13.5rem;
    padding: 1.05rem 1.2rem 1.15rem;
  }

  .hero__speech-text {
    font-size: 1.28rem;
  }
}

@media (max-width: 640px) {
  .hero {
    padding-bottom: 1.5rem;
  }

  .hero__stage {
    gap: 1.1rem;
  }

  .hero__figure {
    width: min(100%, 17rem);
    order: -1;
    margin-top: 0.5rem;
  }

  .hero__speech {
    left: -1.75rem;
    top: 2%;
    max-width: 10rem;
    padding: 0.75rem 0.85rem 0.85rem;
  }

  .hero__speech-text {
    font-size: 1.05rem;
  }

  .hero__speech-tail {
    bottom: 1rem;
    width: 1.1rem;
    height: 0.9rem;
  }
}

/* ——— Layout ——— */

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.5rem 1.25rem 4rem;
  position: relative;
}

.reveal {
  animation: reveal-up 0.75s var(--ease-out) both;
}

.standings-panel.reveal {
  animation-delay: 0.2s;
}

.matches-panel.reveal {
  animation: none;
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ——— Buttons ——— */

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.55rem 1rem;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.12s ease,
    filter 0.18s ease;
}

button:active {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button:disabled:active {
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--crimson) 0%, #be123c 55%, #9f1239 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  background: rgba(232, 196, 122, 0.1);
  border-color: var(--gold);
  color: var(--gold);
}

.btn-danger {
  background: #7f1d1d;
  color: #fecaca;
}

.btn-danger:hover {
  background: #991b1b;
}

.btn-standings-edit,
.btn-admin {
  flex-shrink: 0;
  padding: 0.5rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(7, 8, 12, 0.45);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  backdrop-filter: blur(10px);
}

.btn-standings-edit:hover,
.btn-admin:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(7, 8, 12, 0.65);
}

.btn-standings-edit[aria-pressed="true"] {
  border-color: var(--crimson);
  color: var(--crimson-soft);
  background: rgba(225, 29, 72, 0.12);
}

.btn-win-a {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
}

.btn-win-a:hover {
  filter: brightness(1.1);
}

.btn-win-b {
  background: linear-gradient(135deg, var(--crimson), #9f1239);
  color: #fff;
}

.btn-win-b:hover {
  filter: brightness(1.1);
}

.btn-win-a:disabled,
.btn-win-b:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-sm {
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
}

/* ——— Shared section panel shell ——— */

.section-panel {
  padding: 1.35rem 1.25rem 1.5rem;
  border: 1px solid rgba(255, 214, 140, 0.28);
  border-radius: calc(var(--radius) + 2px);
  background:
    linear-gradient(145deg, rgba(232, 196, 122, 0.12) 0%, transparent 42%),
    radial-gradient(ellipse 65% 45% at 96% 0%, rgba(225, 29, 72, 0.1), transparent 55%),
    #10131a;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  /* backdrop-filter 는 스크롤 중 자식 텍스트가 사라졌다 나타나는 GPU 버그를 유발함 */
}

.section-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.85rem 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.95rem;
  border-bottom: 1px solid rgba(255, 214, 140, 0.22);
}

.section-panel__heading {
  min-width: 0;
}

.section-panel__eyebrow {
  margin: 0 0 0.2rem;
  font-family: var(--font-brand);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--gold);
  opacity: 0.85;
}

.section-panel__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
  font-weight: 600;
  color: var(--gold);
  letter-spacing: -0.03em;
  line-height: 1.25;
}

/* ——— Standings ——— */

.standings-panel {
  margin-bottom: 1.75rem;
}

.standings-panel--hero {
  margin-bottom: 0;
  overflow: visible;
}

.standings-panel__note {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.standings-table-wrap {
  overflow-x: auto;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.standings-table th,
.standings-table td {
  padding: 0.6rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.standings-table th {
  text-transform: none;
  font-weight: 600;
  font-size: 0.75rem;
}

.standings-table th:first-child {
  color: var(--gold);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.standings-table th:not(:first-child) {
  color: var(--muted);
}

.standings-table tbody tr {
  transition: background 0.15s ease;
}

.standings-table tbody tr:hover {
  background: rgba(232, 196, 122, 0.05);
}

.standings-table tbody tr:last-child td {
  border-bottom: none;
}

.standings-table .cell-name {
  min-width: 8.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #f8fafc;
  letter-spacing: -0.02em;
  vertical-align: middle;
}

.standings-table .cell-balance {
  min-width: 9rem;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-brand);
}

.standings-table .cell-actions {
  width: 4rem;
  text-align: right;
}

.standings-input-name,
.standings-input-balance {
  width: 100%;
  max-width: 16rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--ink);
  font-family: inherit;
}

.standings-input-name {
  font-size: 0.93rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.02em;
  border-color: rgba(232, 196, 122, 0.35);
}

.standings-input-name:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(232, 196, 122, 0.2);
}

.standings-input-balance {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}

.standings-balance-read {
  font-weight: 700;
  font-family: var(--font-brand);
}

.standings-balance-read.positive {
  color: #6ee7b7;
}

.standings-balance-read.negative {
  color: var(--crimson-soft);
}

.standings-balance-read.zero {
  color: var(--muted);
  font-weight: 500;
}

.standings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.standings-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem 0.55rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.standings-pagination__pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.standings-page-btn {
  min-width: 2rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.standings-page-btn:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
}

.standings-page-btn.is-active {
  background: rgba(232, 196, 122, 0.16);
  border-color: var(--gold);
  color: var(--gold);
}

.standings-page-btn--nav {
  min-width: auto;
  padding: 0.35rem 0.7rem;
}

.standings-page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  padding: 0 0.15rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  user-select: none;
}

.standings-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.standings-pagination__meta {
  width: 100%;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
}

.standings-empty {
  margin: 0;
  padding: 0.75rem 0;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ——— Matches panel ——— */

.matches-panel {
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

/* 경기배당 섹션: WIN 뱃지 제외 모든 애니메이션/트랜지션 제거 */
.matches-panel,
.matches-panel *,
.match-list,
.match-list *,
details.match,
details.match * {
  animation: none !important;
  transition: none !important;
}

/* WIN 뱃지 기울기만 유지 (모션 없음) */
.matches-panel .win-badge,
.match-list .win-badge {
  transform: rotate(8deg);
}

.matches-panel .arena-side--b .win-badge,
.matches-panel .pool.team-b .win-badge,
.match-list .arena-side--b .win-badge,
.match-list .pool.team-b .win-badge {
  transform: rotate(-8deg);
}

.matches-panel__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.matches-panel__help {
  font-size: 0.85rem;
  padding: 0.5rem 0.85rem;
}

.matches-panel__add {
  flex-shrink: 0;
}

.match-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ——— Match cards (VS arena) ——— */

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: var(--gold);
  color: var(--ink);
}

details.match {
  background:
    linear-gradient(135deg, rgba(255, 214, 140, 0.06) 0%, transparent 42%),
    #141820;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
}

details.match:hover {
  border-color: var(--border-strong);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

details.match--pending {
  border-color: rgba(255, 214, 140, 0.2);
}

details.match--settled {
  border-color: rgba(52, 211, 153, 0.28);
}

.match-summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  user-select: none;
}

.match-summary--arena {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.95rem 2.35rem 1.05rem 1.1rem;
}

.match-summary::marker {
  content: "";
}

.match-summary::-webkit-details-marker {
  display: none;
}

.match-summary::after {
  content: "";
  position: absolute;
  top: 1.15rem;
  right: 1.1rem;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: rotate(45deg);
  opacity: 0.75;
}

details.match[open] > .match-summary::after {
  transform: rotate(-135deg);
  top: 1.3rem;
}

.arena-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}

.match-date {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.match-date--empty {
  opacity: 0.7;
}

.match-status-badge {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
}

.match-status-badge--pending {
  background: rgba(232, 196, 122, 0.12);
  color: var(--gold);
  border: 1px solid rgba(232, 196, 122, 0.35);
}

.match-status-badge--settled {
  background: rgba(52, 211, 153, 0.14);
  color: #6ee7b7;
  border: 1px solid rgba(110, 231, 183, 0.35);
}

.arena-bout {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.55rem 0.75rem;
  align-items: stretch;
  min-width: 0;
}

.arena-side {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(7, 8, 12, 0.4);
}

.arena-side--a {
  text-align: left;
  border-color: rgba(56, 189, 248, 0.32);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18) 0%, #151922 72%);
}

.arena-side--b {
  text-align: right;
  border-color: rgba(251, 113, 133, 0.36);
  background: linear-gradient(225deg, rgba(225, 29, 72, 0.18) 0%, #151922 72%);
}

.arena-side--won {
  border-color: rgba(52, 211, 153, 0.65);
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.2) 0%, #151922 75%);
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.2);
  padding-top: 1.35rem;
}

/* opacity 대신 색만 낮춤 — 스크롤 합성 중 반투명 레이어 깜빡임 방지 */
.arena-side--dim {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.08);
  background: #12151c;
}

.arena-side--dim .arena-side__label {
  color: #5c6578;
}

.arena-side--dim .arena-side__name {
  color: #6b7385 !important;
}

.arena-side--dim .arena-side__odds {
  color: #7a6f52;
}

.win-badge {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.22rem 0.55rem 0.2rem;
  border-radius: 5px;
  transform: rotate(8deg);
  background: linear-gradient(145deg, #fff1c2 0%, var(--gold) 38%, var(--gold-deep) 72%, #8a6428 100%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

.arena-side--b .win-badge,
.pool.team-b .win-badge {
  right: auto;
  left: 0.45rem;
  transform: rotate(-8deg);
}

.win-badge__text {
  font-family: var(--font-brand);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.pool.won .win-badge {
  top: 0.55rem;
  right: 0.55rem;
}

.pool.team-b.won .win-badge {
  right: auto;
  left: 0.55rem;
}

.arena-side__label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.arena-side__name {
  font-family: var(--font-brand);
  font-size: clamp(0.95rem, 2.4vw, 1.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.arena-side--a .arena-side__name {
  color: #7dd3fc;
}

.arena-side--b .arena-side__name {
  color: #fda4af;
}

.arena-side--won .arena-side__name {
  color: #a7f3d0;
}

.arena-side__odds {
  margin-top: 0.15rem;
  font-family: var(--font-brand);
  font-size: 0.95rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}

.arena-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
}

.arena-vs__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0.35rem 0.45rem;
  border-radius: 999px;
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--ink);
  background: linear-gradient(145deg, #f0d78a 0%, var(--gold) 40%, var(--gold-deep) 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.match-body {
  padding: 0 1.15rem 1.25rem;
  border-top: 1px solid var(--border);
}

.match-body > .match-meta {
  margin-top: 0.85rem;
}

.match-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.pools {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: stretch;
  margin-bottom: 1rem;
}

.pool {
  position: relative;
  background: #12151c;
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid transparent;
}

.pool.team-a {
  border-color: rgba(56, 189, 248, 0.35);
  background: linear-gradient(160deg, rgba(56, 189, 248, 0.14) 0%, #12151c 55%);
}

.pool.team-b {
  border-color: rgba(251, 113, 133, 0.4);
  background: linear-gradient(200deg, rgba(225, 29, 72, 0.14) 0%, #12151c 55%);
}

.pool.won {
  border-color: var(--win);
  background: linear-gradient(160deg, rgba(52, 211, 153, 0.14) 0%, #12151c 60%);
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.18);
  padding-top: 1.55rem;
}

.pool--dim {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.08);
  background: #10131a;
}

.pool--dim .team-name,
.pool--dim .total,
.pool--dim .pool-sub,
.pool--dim h3,
.pool--dim .bettors {
  color: #6b7385 !important;
}

.pool h3 {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pool .team-name {
  font-size: 1.15rem;
  font-weight: 800;
  font-family: var(--font-brand);
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.pool.team-a .team-name {
  color: #7dd3fc;
}

.pool.team-b .team-name {
  color: #fda4af;
}

.pool .total {
  font-size: 1.4rem;
  font-weight: 800;
  font-family: var(--font-brand);
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}

.pool-sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
  line-height: 1.35;
}

.settlement-note {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.vs-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
}

.vs-cell .arena-vs__mark {
  min-width: 2.75rem;
  min-height: 2.75rem;
  font-size: 0.85rem;
}

.bettors {
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

.bettors strong {
  color: var(--muted);
  font-weight: 500;
  display: block;
  margin-bottom: 0.35rem;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}

.pool.team-a .chip {
  border-color: rgba(56, 189, 248, 0.22);
  background: rgba(56, 189, 248, 0.08);
}

.pool.team-b .chip {
  border-color: rgba(251, 113, 133, 0.25);
  background: rgba(225, 29, 72, 0.08);
}

.match-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.match-actions .hint {
  font-size: 0.8rem;
  color: var(--muted);
  width: 100%;
}

@media (max-width: 640px) {
  .section-panel {
    padding: 1.15rem 0.95rem 1.25rem;
  }

  .arena-bout {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .arena-side--a,
  .arena-side--b {
    text-align: left;
  }

  .arena-vs {
    padding: 0.1rem 0;
  }

  .arena-side--a {
    order: -1;
  }

  .pools {
    grid-template-columns: 1fr;
  }

  .vs-cell {
    padding: 0.15rem 0;
  }
}

.settlement {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(52, 211, 153, 0.07);
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: 12px;
  font-size: 0.9rem;
}

.settlement h4 {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--win);
}

.ledger {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ledger li {
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.ledger li:last-child {
  border-bottom: none;
}

.positive {
  color: #6ee7b7;
}

.negative {
  color: var(--crimson-soft);
}

/* ——— Modals ——— */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 8, 0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  backdrop-filter: blur(6px);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay--front {
  z-index: 110;
}

.modal {
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow: auto;
  padding: 1.35rem;
  transform: translateY(12px);
  transition: transform 0.25s var(--ease-out);
}

.modal-overlay.open .modal {
  transform: none;
}

.modal h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: -0.02em;
  line-height: 1.4;
}

.field {
  margin-bottom: 0.85rem;
}

.field label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--ink);
  color: var(--text);
  font-family: inherit;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(232, 196, 122, 0.18);
}

.date-picker-row {
  position: relative;
  min-height: 3rem;
  border-radius: 10px;
}

.date-picker-row__face {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3rem;
  padding: 0.6rem 0.85rem;
  background: var(--ink);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.95rem;
  pointer-events: none;
}

.date-picker-row:focus-within .date-picker-row__face {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(232, 196, 122, 0.18);
}

.date-picker-row__text {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-brand);
}

.date-picker-row__icon {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  border: 1.5px solid var(--gold);
  border-radius: 3px;
  position: relative;
  opacity: 0.9;
}

.date-picker-row__icon::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  right: 0.15rem;
  top: 0.28rem;
  height: 1px;
  background: var(--gold);
}

.date-picker-row__icon::after {
  content: "";
  position: absolute;
  top: -0.2rem;
  left: 0.2rem;
  width: 0.2rem;
  height: 0.35rem;
  border-radius: 1px;
  background: var(--gold);
  box-shadow: 0.45rem 0 0 var(--gold);
}

.date-picker-row__native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
  font-size: 1rem;
  color-scheme: dark;
}

.field small {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.modal--help {
  max-width: 32rem;
}

.modal--log {
  max-width: 28rem;
  max-height: min(88vh, 40rem);
  display: flex;
  flex-direction: column;
}

.activity-log-note {
  margin: -0.35rem 0 0.85rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.activity-log-list {
  flex: 1;
  min-height: 12rem;
  max-height: min(50vh, 24rem);
  overflow-y: auto;
  padding-right: 0.25rem;
  margin-bottom: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.activity-log-pagination {
  margin-top: 0.65rem;
  margin-bottom: 0.15rem;
  border-top: none;
  padding-top: 0.65rem;
}

.matches-pagination {
  margin-top: 0.85rem;
}

.activity-log-empty {
  margin: 1.25rem 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.activity-log-item {
  padding: 0.85rem 0.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.activity-log-item:last-child {
  border-bottom: none;
}

.activity-log-item__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.3rem;
}

.activity-log-item__time {
  display: block;
  margin: 0;
  font-family: var(--font-brand);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--gold);
}

.activity-log-item__delete {
  flex-shrink: 0;
}

.activity-log-item__title {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.activity-log-item__detail {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: keep-all;
}

.settlement-help-body {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text);
}

.settlement-help-body p {
  margin: 0 0 0.85rem;
}

.settlement-help-body p:last-child {
  margin-bottom: 0;
}

.settlement-help-sub {
  margin: 1rem 0 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: -0.01em;
}

.settlement-help-sub:first-of-type {
  margin-top: 0.35rem;
}

.req {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--crimson-soft);
  vertical-align: middle;
}

.empty {
  text-align: center;
  padding: 2.75rem 1.25rem;
  color: var(--muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

@media (prefers-reduced-motion: reduce) {
  .hero,
  .hero__stage,
  .reveal,
  .standings-panel--hero,
  .ambient__orb {
    animation: none !important;
  }

  .ambient__orb {
    will-change: auto;
  }
}
