:root {
  --black: #050608;
  --ink: #0b0d12;
  --surface: #111318;
  --surface2: #181b22;
  --surface3: #1e2230;
  --line: rgba(255, 255, 255, 0.06);
  --line-hi: rgba(255, 255, 255, 0.12);
  --accent: #ffd700;
  --accent2: #4caf50;
  --accent3: #8b5a3c;
  --accent-brown: #6b4423;
  --accent-green: #2d7a4a;
  --accent-gold: #ffc107;
  --red: #ff3b52;
  --white: #f0f4ff;
  --muted: #4a5568;
  --muted2: #2d3545;
  --green: #4caf50;

  --font-d: "Anton", system-ui, sans-serif;
  --font-b: "DM Sans", system-ui, sans-serif;
  --font-m: "DM Mono", monospace;

  --topbar-h: 56px;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-b);
  background: var(--black);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
}

#bgCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--topbar-h);
  background: rgba(5, 6, 8, 0.88);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex-shrink: 0;
}
.brand-mark svg {
  width: 100%;
  height: 100%;
}

.topbar-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
  gap: 2px;
}
.topbar-title {
  font-family: var(--font-d);
  font-size: 0.95rem;
  letter-spacing: 4px;
  color: var(--white);
}
.topbar-year {
  font-family: var(--font-m);
  font-size: 0.6rem;
  letter-spacing: 3px;
  color: var(--accent);
}

.topbar-stats {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 0 6px;
}
.stat-pill {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 7px 14px;
}
.stat-val {
  font-family: var(--font-d);
  font-size: 1.25rem;
  color: var(--accent);
  line-height: 1;
  letter-spacing: 1px;
  transition: all 0.3s;
}
.stat-lbl {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}
.stat-divider {
  width: 1px;
  height: 20px;
  background: var(--line);
}

.host-flags {
  display: flex;
  gap: 4px;
  align-items: center;
}
.host-flags img {
  width: 22px;
  height: auto;
  border-radius: 3px;
  opacity: 0.7;
  filter: saturate(0.8);
  transition:
    opacity 0.2s,
    filter 0.2s;
}
.host-flags img:hover {
  opacity: 1;
  filter: saturate(1);
}

.progress-track {
  height: 2px;
  background: var(--surface);
}
.progress-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--accent-green),
    var(--accent),
    var(--accent-brown)
  );
  width: 0%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── PAGE ── */
.page-wrap {
  padding-top: var(--topbar-h);
  position: relative;
  z-index: 2;
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

/* ── HERO ── */
.hero {
  text-align: center;
  padding: 60px 0 48px;
  position: relative;
}

.hero-tag {
  display: inline-block;
  font-family: var(--font-m);
  font-size: 0.68rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: var(--r-pill);
  padding: 6px 20px;
  margin-bottom: 28px;
}

.hero-title {
  font-family: var(--font-d);
  line-height: 0.88;
  letter-spacing: -2px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero-title em {
  font-style: normal;
  font-size: clamp(5rem, 18vw, 13rem);
  color: var(--white);
  opacity: 0.4;
  font-weight: 700;
  letter-spacing: -2px;
}
.hero-title strong {
  font-style: normal;
  font-size: clamp(6rem, 22vw, 16rem);
  background: linear-gradient(
    160deg,
    var(--accent) 0%,
    var(--accent-green) 50%,
    var(--accent-brown) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 0.85;
  letter-spacing: -4px;
}

.hero-meta {
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 1px;
  margin-bottom: 32px;
  font-family: var(--font-m);
}

.host-trio {
  display: flex;
  justify-content: center;
  gap: 32px;
}
.host-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.host-item img {
  width: 64px;
  height: auto;
  border-radius: var(--r-sm);
  filter: saturate(0.9);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--line-hi);
  transition:
    transform 0.25s,
    box-shadow 0.25s;
}
.host-item img:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
}
.host-item span {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--muted);
}

.draw-zone {
  text-align: center;
  margin-bottom: 32px;
}

.btn-draw {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  border-radius: var(--r-pill);
  overflow: hidden;
  padding: 0;
  min-width: 300px;
  height: 72px;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s;
}
.btn-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    var(--accent-green),
    var(--accent),
    var(--accent-brown)
  );
  border-radius: inherit;
  transition: background 0.2s;
}
.btn-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-d);
  font-size: 2rem;
  letter-spacing: 12px;
  color: var(--black);
  padding: 0 40px;
}
.btn-icon {
  width: 22px;
  height: 22px;
  color: var(--black);
}
.btn-glow {
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, var(--accent-green), var(--accent));
  border-radius: inherit;
  filter: blur(20px);
  opacity: 0;
  z-index: 0;
  transition: opacity 0.3s;
}

.btn-draw:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 20px 60px rgba(255, 215, 0, 0.35);
}
.btn-draw:hover .btn-glow {
  opacity: 0.5;
}
.btn-draw:hover .btn-bg {
  background: linear-gradient(135deg, var(--accent2), var(--accent-gold));
}
.btn-draw:active {
  transform: translateY(-2px) scale(0.99);
}
.btn-draw:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.draw-hint {
  margin-top: 14px;
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--font-m);
  letter-spacing: 0.5px;
}

.result-duo {
  display: grid;
  grid-template-columns: 1fr 80px 1fr;
  gap: 12px;
  margin-bottom: 28px;
  opacity: 0;
  transform: translateY(20px) scale(0.98);
  transition:
    opacity 0.5s cubic-bezier(0.34, 1.3, 0.64, 1),
    transform 0.5s cubic-bezier(0.34, 1.3, 0.64, 1);
  pointer-events: none;
}
.result-duo.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.result-half {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line-hi);
  border-radius: var(--r-xl);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  overflow: hidden;
  min-height: 120px;
}
.result-half::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.result-half-player::before {
  background: linear-gradient(90deg, transparent, rgba(255,215,0,0.5), transparent);
}
.result-half-nation::before {
  background: linear-gradient(90deg, transparent, rgba(76,175,80,0.5), transparent);
}

.result-nation-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.result-flag-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.15);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.result-half-flag {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.result-half-name {
  font-family: var(--font-d);
  font-size: clamp(1.3rem, 3.5vw, 2.2rem);
  letter-spacing: 1px;
  color: var(--white);
  line-height: 1.1;
}
.result-nation-name {
  color: var(--accent);
}

.result-vs-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* ── RESULT CARD (legacy, keep for shimmer ref) ── */
.result-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line-hi);
  border-radius: var(--r-xl);
  margin-bottom: 28px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.98);
  transition:
    opacity 0.5s cubic-bezier(0.34, 1.3, 0.64, 1),
    transform 0.5s cubic-bezier(0.34, 1.3, 0.64, 1);
  pointer-events: none;
}
.result-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.result-card.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.result-eyebrow {
  font-family: var(--font-m);
  font-size: 0.6rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}
.result-flag-img {
  width: clamp(40px, 8vw, 64px);
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: block;
  flex-shrink: 0;
}
.ball-flag-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  pointer-events: none;
}

.ball-flag-img {
  width: 26px;
  height: auto;
  border-radius: 2px;
  display: block;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}
.list-flag-img {
  width: 22px;
  height: auto;
  border-radius: 3px;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
#nationResult {
  color: var(--accent);
}

.result-representative {
  font-family: var(--font-m);
  font-size: 0.65rem;
  letter-spacing: 1px;
  color: var(--accent-green);
  background: rgba(76, 175, 80, 0.08);
  border: 1px solid rgba(76, 175, 80, 0.22);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

.result-center {
  display: flex;
  justify-content: center;
  align-items: center;
}
.vs-ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1.5px solid var(--line-hi);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
}
.vs-ring span {
  font-family: var(--font-d);
  font-size: 0.8rem;
  letter-spacing: 2px;
  color: var(--muted);
}

.result-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 215, 0, 0.03) 50%,
    transparent 60%
  );
  pointer-events: none;
}

/* ── URNE ── */
.urns-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

.urn-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.25s;
}
.urn-panel.mixing {
  border-color: rgba(255, 215, 0, 0.25);
}

.urn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.urn-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-d);
  font-size: 1rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--white);
}
.urn-icon {
  font-size: 0.9rem;
}
.urn-count {
  font-family: var(--font-m);
  font-size: 0.72rem;
  color: var(--accent);
  background: rgba(255, 215, 0, 0.07);
  border: 1px solid rgba(255, 215, 0, 0.15);
  border-radius: var(--r-pill);
  padding: 3px 12px;
}

.urn-vessel {
  height: 200px;
  border-radius: var(--r-md);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
}
.vessel-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 120% 80% at 50% 0%,
    #141a26,
    var(--ink) 70%
  );
}
.vessel-sheen {
  position: absolute;
  top: 0;
  left: 5%;
  right: 5%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.08),
    transparent
  );
  pointer-events: none;
  z-index: 10;
}

.balls-container-wrap {
  position: absolute;
  inset: 0;
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 215, 0, 0.3) transparent;
}

.balls-container-wrap::-webkit-scrollbar {
  width: 6px;
}

.balls-container-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.balls-container-wrap::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 0, 0.25);
  border-radius: 3px;
}

.balls-container-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 215, 0, 0.4);
}

.balls-container {
  position: relative;
  padding: 10px;
  min-height: 100%;
}

.ball {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  box-shadow:
    inset -3px -3px 7px rgba(0, 0, 0, 0.6),
    inset 2px 2px 4px rgba(255, 255, 255, 0.1),
    0 4px 14px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: default;
  overflow: hidden;
  transition: transform 0.2s;
  z-index: 1;
}
.ball:hover {
  transform: scale(1.3) translateY(-4px) !important;
  z-index: 20;
}

.ball-nation {
  flex-direction: column;
  gap: 1px;
}
.ball-flag {
  font-size: 16px;
  line-height: 1;
  font-family:
    "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}
.ball-nation-code {
  font-family: var(--font-d);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  line-height: 1;
}

.ball-player {
  background: radial-gradient(circle at 30% 30%, #f5e6b3, var(--accent));
  color: var(--black);
  font-family: var(--font-d);
  font-size: 10px;
  letter-spacing: 0.5px;
}

.ball-code {
  font-family: var(--font-d);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.5px;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  position: relative;
  z-index: 2;
}

@keyframes realMix {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(var(--tx), var(--ty)) rotate(90deg);
  }
  50% {
    transform: translate(calc(var(--tx) * -1), calc(var(--ty) * 0.5))
      rotate(180deg);
  }
  75% {
    transform: translate(calc(var(--tx) * 0.5), calc(var(--ty) * -1))
      rotate(270deg);
  }
  100% {
    transform: translate(0, 0) rotate(360deg);
  }
}
.mixing .ball {
  animation: realMix 0.55s infinite linear;
  animation-delay: var(--delay);
}

.urn-roster {
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.roster-head {
  font-family: var(--font-m);
  font-size: 0.58rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 7px 12px 5px;
  border-bottom: 1px solid var(--line);
}
.roster-body {
  max-height: 130px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--muted2) transparent;
}
.roster-body::-webkit-scrollbar {
  width: 3px;
}
.roster-body::-webkit-scrollbar-thumb {
  background: var(--muted2);
  border-radius: 999px;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  font-size: 0.78rem;
  color: rgba(240, 244, 255, 0.65);
  border-bottom: 1px solid var(--line);
  transition: background 0.1s;
}
.list-item:hover {
  background: rgba(255, 255, 255, 0.025);
}
.list-item:last-child {
  border-bottom: none;
}
.list-icon {
  font-size: 0.8rem;
  opacity: 0.5;
  flex-shrink: 0;
}
.list-empty {
  padding: 10px 12px;
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
}

.list-item-nation {
  align-items: center;
  gap: 8px;
}
.list-nation-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.list-nation-name {
  font-size: 0.78rem;
  color: rgba(240, 244, 255, 0.65);
}
.list-rep-name {
  font-family: var(--font-m);
  font-size: 0.6rem;
  color: var(--accent-green);
  opacity: 0.85;
  letter-spacing: 0.3px;
}

/* ── HISTORY ── */
.history-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 24px;
}
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.history-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.history-icon {
  font-size: 1rem;
  color: var(--accent);
  line-height: 1;
}
.history-title h2 {
  font-family: var(--font-d);
  font-size: 1.4rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--white);
}
.history-badge {
  font-family: var(--font-m);
  font-size: 0.62rem;
  color: var(--muted);
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 3px 10px;
}

.history-actions {
  display: flex;
  gap: 8px;
}
.btn-wa,
.btn-reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-b);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}
.btn-wa {
  background: var(--accent-green);
  color: #fff;
  box-shadow: 0 4px 16px rgba(76, 175, 80, 0.25);
}
.btn-wa:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-reset {
  background: rgba(255, 59, 82, 0.08);
  border: 1px solid rgba(255, 59, 82, 0.3);
  color: #ff7085;
}
.btn-reset:hover {
  background: rgba(255, 59, 82, 0.15);
  transform: translateY(-1px);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-empty {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 40px 0;
  font-family: var(--font-m);
}
.history-empty strong {
  color: var(--accent);
}
.history-empty.hidden {
  display: none;
}

.history-entry {
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 18px;
  transition:
    border-color 0.2s,
    transform 0.15s;
  animation: entryIn 0.3s ease both;
}
.history-entry:hover {
  border-color: var(--line-hi);
  transform: translateX(4px);
}
.history-entry:first-child {
  border-color: rgba(255, 215, 0, 0.2);
  background: rgba(255, 215, 0, 0.025);
}
@keyframes entryIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.history-left {
  text-align: right;
  overflow: hidden;
}
.history-right {
  text-align: left;
  overflow: hidden;
}

.history-player {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.history-name {
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--white);
}

.history-nation {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  flex-wrap: wrap;
}
.history-nation-info {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  overflow: hidden;
}
.history-team {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-rep {
  font-family: var(--font-m);
  font-size: 0.62rem;
  color: var(--accent-green);
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 28px;
  background: var(--surface2);
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  font-size: 0.7rem;
  color: var(--muted);
}

.flash-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10000;
  background: rgba(255, 215, 0, 0.12);
  opacity: 0;
  transition: opacity 0.1s ease;
}
.flash-overlay.flash {
  opacity: 1;
}

@media (max-width: 780px) {
  .urns-grid {
    grid-template-columns: 1fr;
  }
  .result-duo {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .result-vs-col {
    flex-direction: row;
  }
  .vs-ring {
    width: 48px;
    height: 48px;
  }
  .topbar-stats {
    display: none;
  }
}

@media (max-width: 500px) {
  :root {
    --topbar-h: 50px;
  }
  .container {
    padding: 20px 14px 60px;
  }
  .hero {
    padding: 36px 0 28px;
  }
  .hero-title strong {
    letter-spacing: -2px;
  }
  .btn-draw {
    min-width: 240px;
    height: 62px;
  }
  .btn-content {
    font-size: 1.7rem;
    letter-spacing: 8px;
  }
  .host-flags {
    display: none;
  }
  .history-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .history-actions {
    width: 100%;
  }
  .btn-wa,
  .btn-reset {
    flex: 1;
    justify-content: center;
  }
  .history-entry {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 10px 14px;
  }
  .history-left {
    text-align: left;
  }
  .history-player {
    align-items: flex-start;
  }
  .history-arrow {
    display: none;
  }
}

.rep-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  background: rgba(11, 13, 18, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 215, 0, 0.2);
  padding: 12px 0;
}
.rep-panel-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}
.rep-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.rep-panel-icon {
  font-size: 0.85rem;
}
.rep-panel-title {
  font-family: var(--font-d);
  font-size: 0.7rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
}
.rep-panel-badge {
  font-family: var(--font-m);
  font-size: 0.58rem;
  background: rgba(255,215,0,0.1);
  border: 1px solid rgba(255,215,0,0.25);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--accent);
}
.rep-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rep-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 6px 12px 6px 6px;
  transition: border-color 0.2s;
}
.rep-card:hover {
  border-color: rgba(255,215,0,0.3);
}
.rep-flag-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}
.rep-flag-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rep-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.rep-nation {
  font-family: var(--font-d);
  font-size: 0.72rem;
  letter-spacing: 1px;
  color: var(--white);
  line-height: 1;
}
.rep-name {
  font-family: var(--font-m);
  font-size: 0.6rem;
  color: var(--accent-green);
  letter-spacing: 0.3px;
}

body.has-rep-panel .page-wrap {
  padding-bottom: 110px;
}