:root {
  --ink: #081833;
  --ink-2: #102a54;
  --ink-3: #183d72;
  --paper: #f7f4ea;
  --white: #ffffff;
  --line: rgba(8, 24, 51, 0.14);
  --muted: #6f7d91;
  --gold: #ffd338;
  --gold-deep: #f0ad00;
  --mint: #49d6af;
  --coral: #ff6f61;
  --sky: #63b8ff;
  --violet: #7c6cf2;
  --green: #20a66a;
  --red: #db4051;
  --shadow: 0 24px 60px rgba(5, 20, 45, 0.2);
  --soft-shadow: 0 10px 28px rgba(5, 20, 45, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

html {
  background: var(--ink);
}

body {
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
}

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

button {
  color: inherit;
}

button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
}

.is-hidden {
  display: none !important;
}

.app-shell {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Landing */

.landing-screen {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: 28px;
  color: var(--white);
  background:
    radial-gradient(circle at 16% 20%, rgba(73, 214, 175, 0.22), transparent 30%),
    radial-gradient(circle at 86% 78%, rgba(255, 211, 56, 0.22), transparent 31%),
    linear-gradient(135deg, #06152f 0%, #0a2751 57%, #071a39 100%);
}

.landing-grid {
  position: absolute;
  inset: 0;
  opacity: 0.13;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: perspective(800px) rotateX(58deg) scale(1.45) translateY(18%);
  transform-origin: center bottom;
}

.landing-orb {
  position: absolute;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  pointer-events: none;
}

.landing-orb::before,
.landing-orb::after {
  position: absolute;
  content: "";
  border: inherit;
  border-radius: inherit;
}

.landing-orb-one {
  top: -150px;
  right: -110px;
  width: 430px;
  height: 430px;
  animation: float-orb 12s ease-in-out infinite;
}

.landing-orb-one::before {
  inset: 48px;
}

.landing-orb-one::after {
  inset: 112px;
}

.landing-orb-two {
  bottom: -190px;
  left: -140px;
  width: 520px;
  height: 520px;
  animation: float-orb 15s ease-in-out -4s infinite reverse;
}

.landing-orb-two::before {
  inset: 56px;
}

.landing-orb-two::after {
  inset: 134px;
}

@keyframes float-orb {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(22px, -18px, 0) rotate(8deg); }
}

.landing-card {
  position: relative;
  z-index: 2;
  width: min(940px, 100%);
  padding: clamp(28px, 5vw, 58px);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 34px;
  background: rgba(5, 22, 48, 0.73);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(18px);
}

.landing-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  color: #a9bedb;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.landing-kicker span {
  font-size: 1.1rem;
}

.landing-card h1 {
  margin: 0;
  color: var(--white);
  font-size: clamp(4.2rem, 12vw, 8.9rem);
  font-weight: 1000;
  letter-spacing: -0.075em;
  line-height: 0.82;
  text-shadow: 0 12px 35px rgba(0, 0, 0, 0.28);
}

.landing-card h1 span {
  color: var(--gold);
}

.landing-copy {
  width: min(650px, 100%);
  margin: 24px auto 28px;
  color: #d9e3f1;
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.65;
}

.preview-frame {
  margin: 0 auto 26px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
}

.preview-label-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 11px;
  color: #93aac7;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(28px, 1fr));
  gap: 7px;
}

.preview-slot {
  position: relative;
  min-width: 0;
  height: 30px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: inset 0 -5px 0 rgba(8, 24, 51, 0.05);
}

.preview-slot:nth-child(4n + 1)::after {
  position: absolute;
  inset: 6px auto 6px 6px;
  width: 3px;
  content: "";
  border-radius: 999px;
  background: var(--gold);
}

.start-button {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  width: min(570px, 100%);
  min-height: 82px;
  margin: 0 auto;
  padding: 12px 20px;
  cursor: pointer;
  border: 0;
  border-radius: 20px;
  color: var(--ink);
  background: linear-gradient(135deg, #ffe46f, var(--gold));
  box-shadow: 0 16px 0 #c48900, 0 26px 45px rgba(0, 0, 0, 0.35);
  font-size: clamp(1.15rem, 3vw, 1.55rem);
  font-weight: 1000;
  letter-spacing: 0.06em;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.start-button:hover {
  filter: brightness(1.06);
  transform: translateY(-3px);
  box-shadow: 0 19px 0 #c48900, 0 30px 50px rgba(0, 0, 0, 0.38);
}

.start-button:active {
  transform: translateY(8px);
  box-shadow: 0 8px 0 #c48900, 0 18px 28px rgba(0, 0, 0, 0.3);
}

.start-button-ball,
.start-button-arrow {
  font-size: 1.5rem;
}

.start-button-ball {
  animation: ball-bob 1.7s ease-in-out infinite;
}

@keyframes ball-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-5px) rotate(14deg); }
}

.text-button {
  margin: 25px auto 0;
  padding: 8px 12px;
  cursor: pointer;
  border: 0;
  color: #c9d8e9;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.landing-facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 30px;
  margin-top: 31px;
  color: #9eb2cb;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.landing-facts strong {
  color: var(--white);
  font-size: 1rem;
}

/* Game shell */

.game-screen {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  background: var(--paper);
}

.topbar {
  position: relative;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(420px, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 78px;
  padding: 10px 20px;
  color: var(--white);
  background: linear-gradient(100deg, #06152f, #0c2852 68%, #0e3262);
  box-shadow: 0 8px 24px rgba(3, 17, 38, 0.24);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 1000;
  letter-spacing: -0.02em;
}

.topbar-ball {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.15);
  font-size: 1.2rem;
}

.phase-display {
  display: flex;
  min-width: 205px;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.phase-eyebrow {
  color: #9db2ce;
  font-size: 0.59rem;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.phase-display strong {
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 1000;
  letter-spacing: 0.05em;
}

.topbar-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.control-button,
.icon-button,
.zoom-controls,
.board-jumps button {
  border: 1px solid rgba(255, 255, 255, 0.17);
  background: rgba(255, 255, 255, 0.08);
}

.control-button,
.icon-button {
  min-height: 42px;
  cursor: pointer;
  border-radius: 11px;
  color: var(--white);
  font-weight: 900;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.control-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  font-size: 0.73rem;
  letter-spacing: 0.045em;
}

.control-button:hover,
.icon-button:hover {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.control-button:disabled {
  cursor: default;
  opacity: 0.72;
  border-color: rgba(73, 214, 175, 0.45);
  color: #a9f3de;
  background: rgba(73, 214, 175, 0.12);
  transform: none;
}

.wheel-control {
  border-color: rgba(255, 211, 56, 0.65);
  color: var(--ink);
  background: var(--gold);
  box-shadow: inset 0 -4px 0 rgba(167, 115, 0, 0.24);
}

.wheel-control:hover {
  border-color: var(--gold);
  background: #ffe26d;
}

.icon-button {
  width: 42px;
  padding: 0;
  font-size: 1.05rem;
}

.danger-button {
  color: #ffb8be;
}

.zoom-controls {
  display: grid;
  grid-template-columns: 35px 50px 35px;
  align-items: center;
  min-height: 42px;
  overflow: hidden;
  border-radius: 11px;
  color: var(--white);
}

.zoom-controls button {
  height: 40px;
  cursor: pointer;
  border: 0;
  color: var(--white);
  background: transparent;
  font-size: 1.2rem;
  font-weight: 900;
}

.zoom-controls button:hover {
  background: rgba(255, 255, 255, 0.13);
}

.zoom-controls span {
  text-align: center;
  color: #bacbe0;
  font-size: 0.7rem;
  font-weight: 900;
}

.match-ribbon {
  position: relative;
  z-index: 20;
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 22px;
  border-bottom: 1px solid #d8d8d0;
  background: #fffef9;
  box-shadow: 0 6px 18px rgba(8, 24, 51, 0.05);
}

.next-match-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink-2);
  font-size: 0.84rem;
  font-weight: 850;
}

.live-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 5px rgba(255, 111, 97, 0.14);
  animation: pulse-dot 1.6s ease-out infinite;
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(255, 111, 97, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(255, 111, 97, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 111, 97, 0); }
}

.tournament-progress {
  display: grid;
  grid-template-columns: auto 160px;
  align-items: center;
  gap: 12px;
}

.progress-copy {
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.progress-copy span {
  color: var(--ink);
}

.progress-track {
  width: 160px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe4e8;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--sky));
  transition: width 450ms ease;
}

.board-toolbar {
  position: relative;
  z-index: 15;
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 20px;
  color: #708098;
  background: #eef0eb;
  border-bottom: 1px solid #d8dad4;
}

.board-jumps {
  display: flex;
  gap: 6px;
}

.board-jumps button {
  min-height: 32px;
  padding: 0 12px;
  cursor: pointer;
  border-color: rgba(8, 24, 51, 0.12);
  border-radius: 9px;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.7rem;
  font-weight: 900;
}

.board-jumps button:hover {
  border-color: rgba(8, 24, 51, 0.25);
  background: var(--white);
}

.board-toolbar p {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 750;
}

.board-toolbar p span {
  color: var(--ink-2);
  font-size: 1rem;
}

/* Pan-and-zoom board */

.board-viewport {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  cursor: grab;
  background-color: #dce8d2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    radial-gradient(circle at center, rgba(255, 255, 255, 0.23) 0 1px, transparent 2px);
  background-size: 64px 64px, 64px 64px, 12px 12px;
  scrollbar-color: #8fa385 #d1ddca;
  scrollbar-width: thin;
}

.board-viewport::before {
  position: fixed;
  right: 20px;
  bottom: 17px;
  z-index: 5;
  padding: 6px 9px;
  content: "DRAG TO PAN";
  pointer-events: none;
  border: 1px solid rgba(8, 24, 51, 0.12);
  border-radius: 8px;
  color: rgba(8, 24, 51, 0.52);
  background: rgba(255, 255, 255, 0.65);
  font-size: 0.58rem;
  font-weight: 1000;
  letter-spacing: 0.12em;
  backdrop-filter: blur(8px);
}

.board-viewport.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.board-sizer {
  position: relative;
  min-width: 100%;
  min-height: 100%;
}

.board-world {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  width: max-content;
  min-height: 100%;
  align-items: flex-start;
  gap: 64px;
  padding: 44px 52px 76px;
  transform-origin: left top;
  will-change: transform;
}

.groups-zone {
  width: 1450px;
  flex: 0 0 1450px;
}

.bracket-zone {
  width: 2940px;
  flex: 0 0 2940px;
}

.zone-heading {
  display: flex;
  min-height: 92px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 22px;
  padding: 24px 26px 21px;
  border: 1px solid rgba(8, 24, 51, 0.11);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(10px);
}

.zone-heading h2 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 2.1rem;
  font-weight: 1000;
  letter-spacing: -0.045em;
}

.zone-kicker {
  color: var(--green);
  font-size: 0.65rem;
  font-weight: 1000;
  letter-spacing: 0.16em;
}

.zone-heading p {
  max-width: 470px;
  margin: 0;
  color: #65748a;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: right;
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.group-card {
  position: relative;
  min-height: 510px;
  overflow: hidden;
  border: 1px solid rgba(8, 24, 51, 0.12);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.93);
  box-shadow: var(--soft-shadow);
  transition: box-shadow 180ms ease, transform 180ms ease, border-color 180ms ease;
}

.group-card.is-current {
  border-color: rgba(240, 173, 0, 0.8);
  box-shadow: 0 0 0 4px rgba(255, 211, 56, 0.22), var(--shadow);
  transform: translateY(-2px);
}

.group-card-header {
  display: flex;
  min-height: 67px;
  align-items: center;
  justify-content: space-between;
  padding: 13px 17px;
  color: var(--white);
  background: linear-gradient(105deg, var(--ink), var(--ink-3));
}

.group-title-block {
  display: flex;
  align-items: center;
  gap: 11px;
}

.group-letter {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  color: var(--ink);
  background: var(--gold);
  font-size: 1.1rem;
  font-weight: 1000;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.14);
}

.group-title-block span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  color: #aabbd1;
}

.group-title-block strong {
  color: var(--white);
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.group-match-count {
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9px;
  color: #c8d7e8;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.63rem;
  font-weight: 900;
}

.group-body {
  padding: 16px;
}

.group-team-list {
  display: grid;
  gap: 8px;
}

.team-slot {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  width: 100%;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid #d8dee4;
  border-radius: 11px;
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 4px 10px rgba(8, 24, 51, 0.06);
  text-align: left;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

button.team-slot {
  padding: 0 11px 0 8px;
}

.team-slot:hover:not(.is-pending) {
  border-color: #aebac6;
  box-shadow: 0 7px 16px rgba(8, 24, 51, 0.1);
  transform: translateY(-1px);
}

.team-slot:not(.is-revealed):not(.is-pending)::after {
  position: absolute;
  right: 12px;
  content: "CLICK TO REVEAL";
  color: #9aa6b4;
  font-size: 0.53rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.team-slot:not(.is-revealed):not(.is-pending):hover::after {
  opacity: 1;
  transform: translateY(0);
}

.team-seed {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  color: #718096;
  background: #eef1f3;
  font-size: 0.66rem;
  font-weight: 1000;
}

.team-name {
  min-width: 0;
  overflow: hidden;
  font-size: 0.84rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-slot:not(.is-revealed) .team-name {
  visibility: hidden;
}

.team-slot:not(.is-revealed) .team-name::before {
  content: "Hidden team";
}

.team-slot.is-revealed {
  border-color: rgba(73, 214, 175, 0.7);
  background: linear-gradient(90deg, #ffffff, #f0fff9);
}

.team-slot.is-revealed .team-seed {
  color: #08724e;
  background: #dff8ef;
}

.team-slot.is-pending {
  cursor: default;
  border-style: dashed;
  color: #9da7b2;
  background: #f5f6f6;
  box-shadow: none;
}

.team-slot.is-pending .team-name {
  visibility: visible;
  color: #a2acb7;
  font-style: italic;
  font-weight: 750;
}

.slot-state {
  color: #99a5b1;
  font-size: 0.7rem;
  font-weight: 900;
}

.team-slot.is-revealed .slot-state {
  color: var(--green);
}

.standings-wrap {
  margin-top: 15px;
  overflow: hidden;
  border: 1px solid #e0e4e7;
  border-radius: 12px;
}

.standings-title {
  display: flex;
  justify-content: space-between;
  padding: 9px 11px;
  color: #738096;
  background: #f3f5f5;
  font-size: 0.58rem;
  font-weight: 1000;
  letter-spacing: 0.09em;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.68rem;
}

.standings-table th,
.standings-table td {
  height: 31px;
  padding: 0 6px;
  border-top: 1px solid #edf0f1;
  text-align: center;
}

.standings-table th {
  color: #8793a2;
  background: #fbfcfb;
  font-size: 0.56rem;
  font-weight: 1000;
}

.standings-table th:first-child,
.standings-table td:first-child {
  width: 28px;
}

.standings-table th:nth-child(2),
.standings-table td:nth-child(2) {
  width: auto;
  text-align: left;
}

.standings-table th:not(:nth-child(2)),
.standings-table td:not(:nth-child(2)) {
  width: 36px;
}

.standing-position {
  font-weight: 1000;
}

.standing-name {
  overflow: hidden;
  color: var(--ink-2);
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.standing-name.is-masked {
  color: #a8b1ba;
  letter-spacing: 0.13em;
}

.standings-table tr.qualifier-direct td:first-child {
  color: var(--green);
  box-shadow: inset 4px 0 0 var(--mint);
}

.standings-table tr.qualifier-third td:first-child {
  color: #b57a00;
  box-shadow: inset 4px 0 0 var(--gold);
}

.standings-table tr.eliminated {
  opacity: 0.62;
}

.group-results {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e7e9e8;
}

.group-results-title {
  margin-bottom: 8px;
  color: #7b8795;
  font-size: 0.58rem;
  font-weight: 1000;
  letter-spacing: 0.1em;
}

.result-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-height: 25px;
  color: #6f7b8a;
  font-size: 0.62rem;
  font-weight: 750;
}

.result-row strong {
  min-width: 34px;
  padding: 3px 5px;
  border-radius: 6px;
  color: var(--ink);
  background: #eef1f2;
  text-align: center;
  font-size: 0.65rem;
}

.result-row .result-team:last-child {
  text-align: right;
}

.result-team {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-team.is-masked {
  color: #a9b1b9;
  letter-spacing: 0.12em;
}

/* Bracket */

.bracket-heading .zone-kicker {
  color: var(--violet);
}

.bracket-board {
  display: grid;
  grid-template-columns: 500px 430px 390px 350px 390px;
  gap: 44px;
  min-height: 2280px;
  padding: 24px;
  border: 1px solid rgba(8, 24, 51, 0.11);
  border-radius: 24px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.86)),
    linear-gradient(90deg, transparent 49.8%, rgba(8, 24, 51, 0.05) 50%, transparent 50.2%);
  background-size: auto, 70px 100%;
  box-shadow: var(--soft-shadow);
}

.bracket-column {
  min-width: 0;
}

.bracket-column-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 10px 13px;
  border: 1px solid rgba(8, 24, 51, 0.12);
  border-radius: 13px;
  color: var(--white);
  background: linear-gradient(100deg, var(--ink), var(--ink-3));
  box-shadow: 0 8px 20px rgba(8, 24, 51, 0.17);
}

.bracket-column-header strong {
  font-size: 0.8rem;
  font-weight: 1000;
  letter-spacing: 0.06em;
}

.bracket-column-header span {
  color: #b8c8dd;
  font-size: 0.59rem;
  font-weight: 900;
}

.bracket-list {
  display: grid;
  grid-template-rows: repeat(16, 132px);
  min-height: 2112px;
}

.bracket-match {
  position: relative;
  align-self: center;
  min-height: 111px;
  padding: 9px;
  border: 1px solid #d8dee4;
  border-radius: 15px;
  background: rgba(249, 250, 249, 0.96);
  box-shadow: 0 8px 20px rgba(8, 24, 51, 0.08);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.bracket-match::after {
  position: absolute;
  top: 50%;
  right: -45px;
  width: 45px;
  height: 1px;
  content: "";
  background: rgba(8, 24, 51, 0.18);
}

.bracket-column:last-child .bracket-match::after {
  display: none;
}

.bracket-match.is-current {
  z-index: 2;
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 4px rgba(255, 211, 56, 0.23), 0 12px 28px rgba(8, 24, 51, 0.14);
  transform: scale(1.02);
}

.bracket-match.is-complete {
  border-color: rgba(73, 214, 175, 0.55);
  background: #f8fffc;
}

.bracket-match-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  padding: 0 2px;
}

.match-number {
  color: #728096;
  font-size: 0.58rem;
  font-weight: 1000;
  letter-spacing: 0.08em;
}

.match-state {
  color: #97a2af;
  font-size: 0.54rem;
  font-weight: 1000;
  letter-spacing: 0.07em;
}

.bracket-match.is-current .match-state {
  color: #a56f00;
}

.bracket-match.is-complete .match-state {
  color: var(--green);
}

.bracket-match .team-slot {
  min-height: 35px;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  gap: 7px;
  border-radius: 8px;
  box-shadow: none;
}

.bracket-match .team-slot + .team-slot {
  margin-top: 5px;
}

.bracket-match .team-seed {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 0.54rem;
}

.bracket-match .team-name {
  font-size: 0.69rem;
}

.bracket-match .team-slot:not(.is-revealed):not(.is-pending)::after {
  display: none;
}

.bracket-score {
  min-width: 35px;
  color: var(--ink);
  font-size: 0.66rem;
  font-weight: 1000;
  text-align: right;
}

.bracket-match .team-slot.is-winner {
  border-color: rgba(73, 214, 175, 0.7);
  background: #effcf7;
}

.bracket-match .team-slot.is-loser {
  opacity: 0.58;
}

.bracket-note {
  position: absolute;
  right: 11px;
  bottom: -16px;
  color: #718096;
  font-size: 0.52rem;
  font-weight: 800;
}

.medal-column .bracket-column-header {
  background: linear-gradient(100deg, #5b4300, #b07c00);
}

.medal-column .bracket-match.final-match {
  border-color: rgba(240, 173, 0, 0.5);
  background: linear-gradient(145deg, #fffdf2, #fff8d8);
}

.medal-column .bracket-match.bronze-match {
  border-color: rgba(169, 105, 52, 0.4);
  background: linear-gradient(145deg, #fffaf6, #f4e2d2);
}

/* Wheel modal */

.wheel-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.wheel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 12, 28, 0.82);
  backdrop-filter: blur(10px);
}

.wheel-panel {
  position: relative;
  z-index: 1;
  width: min(1040px, 96vw);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 27px clamp(20px, 4vw, 42px) 34px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 28px;
  color: var(--white);
  background:
    radial-gradient(circle at 15% 10%, rgba(73, 214, 175, 0.17), transparent 29%),
    radial-gradient(circle at 90% 75%, rgba(255, 211, 56, 0.15), transparent 31%),
    linear-gradient(145deg, #071832, #0d2a55);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 17px;
  z-index: 3;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.55rem;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.16);
}

.modal-close:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.wheel-header {
  text-align: center;
}

.wheel-stage {
  display: inline-flex;
  padding: 7px 12px;
  border: 1px solid rgba(255, 211, 56, 0.35);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(255, 211, 56, 0.08);
  font-size: 0.65rem;
  font-weight: 1000;
  letter-spacing: 0.13em;
}

.wheel-header h2 {
  margin: 9px 0 3px;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 1000;
  letter-spacing: -0.05em;
}

.wheel-header p {
  margin: 0;
  color: #aebfd3;
  font-size: 0.82rem;
  font-weight: 700;
}

.duel-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  margin: 20px 0 18px;
}

.duel-team {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.065);
}

.duel-team-a {
  box-shadow: inset 5px 0 0 var(--sky);
}

.duel-team-b {
  box-shadow: inset -5px 0 0 var(--coral);
}

.duel-side {
  color: #8ea6c2;
  font-size: 0.57rem;
  font-weight: 1000;
  letter-spacing: 0.12em;
}

.duel-team strong {
  min-width: 0;
  overflow: hidden;
  font-size: clamp(0.93rem, 2vw, 1.18rem);
  font-weight: 1000;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duel-team > span:last-child {
  min-width: 46px;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
  font-size: 0.69rem;
  font-weight: 1000;
  text-align: center;
}

.duel-vs {
  display: grid;
  place-items: center;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 1000;
}

.wheel-layout {
  display: grid;
  grid-template-columns: minmax(330px, 1fr) 260px;
  align-items: center;
  gap: 28px;
}

.roulette-wrap {
  position: relative;
  width: min(520px, 100%);
  aspect-ratio: 1;
  justify-self: center;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.34));
}

#wheelCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.wheel-pointer {
  position: absolute;
  top: -5px;
  left: 50%;
  z-index: 3;
  width: 0;
  height: 0;
  border-right: 21px solid transparent;
  border-left: 21px solid transparent;
  border-top: 0;
  border-bottom: 45px solid var(--gold);
  filter: drop-shadow(0 5px 3px rgba(0, 0, 0, 0.32));
  transform: translateX(-50%) rotate(180deg);
}

.wheel-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  border: 8px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
  font-size: 2rem;
  transform: translate(-50%, -50%);
}

.odds-card {
  padding: 24px 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.odds-card-label {
  color: #92a8c3;
  font-size: 0.61rem;
  font-weight: 1000;
  letter-spacing: 0.15em;
}

.odds-card > strong {
  display: block;
  margin: 5px 0 9px;
  color: var(--gold);
  font-size: 2.7rem;
  font-weight: 1000;
  letter-spacing: -0.07em;
}

.odds-card p {
  margin: 0;
  color: #b7c5d7;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.55;
}

.entry-summary {
  display: grid;
  gap: 7px;
  margin-top: 17px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.entry-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #d7e1ed;
  font-size: 0.68rem;
  font-weight: 800;
}

.entry-line span:last-child {
  color: var(--white);
}

.spin-button {
  display: flex;
  width: min(610px, 100%);
  min-height: 72px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin: 24px auto 0;
  cursor: pointer;
  border: 0;
  border-radius: 17px;
  color: var(--ink);
  background: linear-gradient(135deg, #ffe268, var(--gold));
  box-shadow: 0 10px 0 #c48b00, 0 18px 30px rgba(0, 0, 0, 0.3);
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.spin-button span {
  font-size: 1.15rem;
  font-weight: 1000;
  letter-spacing: 0.07em;
}

.spin-button small {
  color: #745600;
  font-size: 0.65rem;
  font-weight: 800;
}

.spin-button:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-2px);
  box-shadow: 0 12px 0 #c48b00, 0 22px 34px rgba(0, 0, 0, 0.33);
}

.spin-button:active:not(:disabled) {
  transform: translateY(6px);
  box-shadow: 0 4px 0 #c48b00, 0 12px 20px rgba(0, 0, 0, 0.26);
}

.spin-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.wheel-result {
  margin: 26px auto 0;
  padding: 25px;
  border: 1px solid rgba(73, 214, 175, 0.38);
  border-radius: 18px;
  background: rgba(73, 214, 175, 0.1);
  text-align: center;
}

.result-kicker {
  color: #86e9cb;
  font-size: 0.65rem;
  font-weight: 1000;
  letter-spacing: 0.15em;
}

.wheel-result h3 {
  margin: 5px 0 4px;
  color: var(--white);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 1000;
  letter-spacing: -0.055em;
}

.wheel-result p {
  margin: 0 0 17px;
  color: #d3e2ec;
  font-size: 0.95rem;
  font-weight: 800;
}

.next-match-button {
  min-height: 42px;
  padding: 0 18px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.72rem;
  font-weight: 1000;
  letter-spacing: 0.06em;
}

.next-match-button:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* Phase announcements, toasts, confetti */

.phase-splash {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: rgba(4, 17, 37, 0.63);
  backdrop-filter: blur(5px);
  animation: phase-fade-in 180ms ease both;
}

.phase-splash-inner {
  width: min(720px, calc(100vw - 44px));
  padding: 50px 30px;
  border: 2px solid rgba(255, 211, 56, 0.65);
  border-radius: 27px;
  color: var(--white);
  background:
    radial-gradient(circle at center, rgba(255, 211, 56, 0.13), transparent 54%),
    linear-gradient(135deg, #071a39, #0d3263);
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.48);
  text-align: center;
  animation: phase-pop 420ms cubic-bezier(.2, .9, .2, 1.16) both;
}

.phase-splash-inner span {
  color: var(--gold);
  font-size: 0.67rem;
  font-weight: 1000;
  letter-spacing: 0.18em;
}

.phase-splash-inner strong {
  display: block;
  margin: 8px 0 5px;
  font-size: clamp(2.6rem, 8vw, 6rem);
  font-weight: 1000;
  letter-spacing: -0.07em;
  line-height: 0.98;
}

.phase-splash-inner p {
  margin: 0;
  color: #c4d2e2;
  font-size: 0.95rem;
  font-weight: 750;
}

@keyframes phase-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes phase-pop {
  from { opacity: 0; transform: scale(0.82) rotate(-1.5deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1300;
  display: grid;
  width: min(360px, calc(100vw - 40px));
  gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 13px;
  color: var(--white);
  background: rgba(7, 29, 61, 0.94);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.28);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.45;
  animation: toast-in 220ms ease both, toast-out 260ms ease 3.15s forwards;
  backdrop-filter: blur(10px);
}

.toast strong {
  color: var(--gold);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

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

.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 1250;
  overflow: hidden;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  top: -22px;
  width: 10px;
  height: 18px;
  border-radius: 2px;
  animation: confetti-fall var(--fall-time, 3.8s) cubic-bezier(.18, .68, .25, 1) forwards;
}

@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translate3d(0, -5vh, 0) rotate(0deg);
  }
  100% {
    opacity: 0.95;
    transform: translate3d(var(--drift, 0px), 110vh, 0) rotate(var(--spin, 720deg));
  }
}

/* Responsive */

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: auto auto 1fr;
  }

  .topbar-brand span:last-child {
    display: none;
  }

  .control-button {
    padding: 0 10px;
  }

  .control-button span {
    display: none;
  }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: auto 1fr;
    min-height: 112px;
    align-content: center;
  }

  .phase-display {
    justify-self: end;
  }

  .topbar-actions {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .match-ribbon {
    align-items: flex-start;
  }

  .tournament-progress {
    grid-template-columns: auto 100px;
  }

  .progress-track {
    width: 100px;
  }

  .board-toolbar p {
    display: none;
  }

  .wheel-layout {
    grid-template-columns: 1fr;
  }

  .odds-card {
    width: min(520px, 100%);
    justify-self: center;
  }
}

@media (max-width: 640px) {
  .landing-screen {
    padding: 14px;
  }

  .landing-card {
    padding: 28px 17px;
    border-radius: 23px;
  }

  .landing-card h1 {
    font-size: clamp(3.5rem, 20vw, 5.3rem);
  }

  .preview-grid {
    grid-template-columns: repeat(8, 1fr);
  }

  .preview-slot {
    height: 24px;
  }

  .landing-facts {
    gap: 11px 17px;
  }

  .topbar {
    min-height: 155px;
    padding: 10px;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }

  .phase-display {
    min-width: 170px;
    padding-inline: 13px;
  }

  .control-button {
    min-height: 38px;
    font-size: 0.64rem;
  }

  .zoom-controls,
  .icon-button {
    min-height: 38px;
    height: 38px;
  }

  .match-ribbon {
    min-height: 65px;
    flex-direction: column;
    gap: 8px;
    padding: 9px 12px;
  }

  .tournament-progress {
    width: 100%;
    grid-template-columns: auto 1fr;
  }

  .progress-track {
    width: 100%;
  }

  .board-toolbar {
    padding: 6px 9px;
  }

  .board-jumps {
    width: 100%;
  }

  .board-jumps button {
    flex: 1;
  }

  .wheel-modal {
    padding: 7px;
  }

  .wheel-panel {
    width: 100%;
    max-height: calc(100vh - 14px);
    padding: 22px 13px 28px;
    border-radius: 20px;
  }

  .wheel-header p {
    padding-inline: 25px;
  }

  .duel-strip {
    grid-template-columns: 1fr;
  }

  .duel-vs {
    min-height: 22px;
  }

  .duel-team {
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 58px;
  }

  .roulette-wrap {
    width: min(88vw, 430px);
  }

  .wheel-hub {
    width: 67px;
    height: 67px;
    border-width: 6px;
    font-size: 1.55rem;
  }

  .odds-card > strong {
    font-size: 2.1rem;
  }
}

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

/* Streamlined interface, flags, player setup and stronger mobile fitting */
html,
body,
.app-shell,
.landing-screen,
.game-screen {
  height: 100%;
  height: 100dvh;
}

body.modal-open {
  overflow: hidden;
}

.landing-card {
  width: min(760px, 100%);
  padding: clamp(32px, 7vw, 72px) clamp(20px, 6vw, 58px);
}

.landing-ball {
  display: grid;
  width: 62px;
  height: 62px;
  margin: 0 auto 24px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--gold);
  box-shadow: inset 0 -7px 0 rgba(0, 0, 0, 0.15), 0 16px 35px rgba(0, 0, 0, 0.25);
  font-size: 1.85rem;
}

.landing-card h1 {
  margin-bottom: clamp(34px, 6vw, 52px);
}

.start-button {
  grid-template-columns: 42px minmax(0, 1fr);
  min-height: 72px;
  padding-inline: 18px 28px;
}

.start-button > span:first-child {
  font-size: 1.15rem;
}

.text-button {
  margin-top: 25px;
  letter-spacing: 0.08em;
}

.topbar {
  grid-template-columns: minmax(150px, auto) minmax(180px, auto) minmax(0, 1fr);
  min-height: 68px;
  padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
}

.phase-display {
  min-width: 185px;
  padding: 6px 18px;
}

.phase-display > span {
  color: #9db2ce;
  font-size: 0.56rem;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.control-button b {
  font-size: inherit;
  font-weight: inherit;
}

.match-ribbon {
  min-height: 48px;
  padding-inline: max(14px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-right));
}

.tournament-progress {
  grid-template-columns: auto 150px;
}

.tournament-progress > span {
  color: var(--ink-2);
  font-size: 0.66rem;
  font-weight: 1000;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.board-toolbar {
  min-height: 42px;
  justify-content: center;
  padding: 5px 10px;
}

.board-jumps {
  width: min(520px, 100%);
}

.board-jumps button {
  flex: 1;
}

.board-viewport {
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
}

.board-viewport::before {
  display: none;
}

.zone-heading {
  min-height: 72px;
  align-items: center;
  margin-bottom: 18px;
  padding: 18px 24px;
}

.zone-heading h2 {
  margin: 0;
}

/* Country identities */
.team-identity {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  vertical-align: middle;
}

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

.team-flag {
  width: 26px;
  height: 19px;
  flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid rgba(8, 24, 51, 0.16);
  border-radius: 4px;
  background: #eef1f3;
  box-shadow: 0 1px 3px rgba(8, 24, 51, 0.12);
}

.team-flag.is-broken {
  display: none;
}

.team-name {
  display: flex;
  align-items: center;
}

.team-name .team-identity,
.standing-name .team-identity,
.result-team .team-identity {
  max-width: 100%;
}

.standing-name .team-flag,
.result-team .team-flag,
.bracket-match .team-flag {
  width: 21px;
  height: 15px;
  border-radius: 3px;
}

.result-team:last-child .team-identity {
  justify-content: flex-end;
}

.duel-team {
  grid-template-columns: minmax(0, 1fr) auto;
}

.duel-team-name {
  min-width: 0;
  overflow: hidden;
  font-size: clamp(0.92rem, 2vw, 1.12rem);
  font-weight: 1000;
}

.duel-team-name .team-identity {
  max-width: 100%;
}

.duel-team-name .team-flag {
  width: 34px;
  height: 25px;
}

.duel-team > span:last-child {
  min-width: 50px;
}

.wheel-result h3 .team-identity {
  justify-content: center;
}

.wheel-result h3 .team-flag {
  width: 48px;
  height: 35px;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.player-congratulations {
  margin: 14px auto 18px !important;
  padding: 11px 14px;
  border: 1px solid rgba(255, 211, 56, 0.45);
  border-radius: 11px;
  color: var(--gold) !important;
  background: rgba(255, 211, 56, 0.09);
  font-weight: 1000 !important;
}

/* Player picks modal */
.setup-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  padding: 18px;
}

.setup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 12, 28, 0.88);
  backdrop-filter: blur(12px);
}

.setup-panel {
  position: relative;
  z-index: 1;
  width: min(880px, 100%);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 26px;
  color: var(--white);
  background:
    radial-gradient(circle at 12% 10%, rgba(73, 214, 175, 0.16), transparent 30%),
    radial-gradient(circle at 92% 90%, rgba(255, 211, 56, 0.15), transparent 30%),
    linear-gradient(145deg, #071832, #0d2a55);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55);
}

.setup-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  text-align: center;
}

.setup-header > span {
  font-size: 1.8rem;
}

.setup-header h2 {
  margin: 0;
  font-size: clamp(1.75rem, 5vw, 2.7rem);
  font-weight: 1000;
  letter-spacing: -0.045em;
}

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

.player-card {
  min-width: 0;
  margin: 0;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
}

.player-card legend {
  padding: 0 10px;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 1000;
  letter-spacing: 0.13em;
}

.player-card label {
  display: block;
  margin: 10px 0 6px;
  color: #aebfd3;
  font-size: 0.62rem;
  font-weight: 1000;
  letter-spacing: 0.1em;
}

.player-card input {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.19);
  border-radius: 11px;
  color: var(--ink);
  background: var(--white);
  font-weight: 900;
}

.player-card input:focus {
  border-color: var(--gold);
  outline: 3px solid rgba(255, 211, 56, 0.18);
}

.player-card input.is-invalid {
  border-color: #ff8892;
  outline: 3px solid rgba(255, 111, 97, 0.16);
}

.pick-preview {
  min-height: 24px;
  padding: 5px 3px 0;
  color: #dce7f2;
  font-size: 0.76rem;
  font-weight: 850;
}

.pick-preview .team-flag {
  width: 24px;
  height: 18px;
  border-color: rgba(255, 255, 255, 0.28);
}

.setup-error {
  margin: 16px 0 0;
  color: #ffb8be;
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.setup-submit {
  display: block;
  width: min(520px, 100%);
  min-height: 60px;
  margin: 22px auto 0;
  cursor: pointer;
  border: 0;
  border-radius: 15px;
  color: var(--ink);
  background: linear-gradient(135deg, #ffe46f, var(--gold));
  box-shadow: 0 8px 0 #c48900, 0 16px 26px rgba(0, 0, 0, 0.3);
  font-size: 0.95rem;
  font-weight: 1000;
  letter-spacing: 0.08em;
}

.setup-submit:active {
  transform: translateY(5px);
  box-shadow: 0 3px 0 #c48900, 0 10px 18px rgba(0, 0, 0, 0.26);
}

/* Simplified wheel copy */
.wheel-panel {
  max-height: calc(100dvh - 28px);
}

.wheel-layout {
  grid-template-columns: minmax(320px, 1fr) 210px;
}

.odds-card {
  padding: 22px 18px;
  text-align: center;
}

.odds-card > span {
  color: #92a8c3;
  font-size: 0.61rem;
  font-weight: 1000;
  letter-spacing: 0.15em;
}

.odds-card > strong {
  margin-bottom: 7px;
}

.spin-button {
  min-height: 62px;
  font-size: 1.02rem;
  font-weight: 1000;
  letter-spacing: 0.07em;
}

/* Tablet */
@media (max-width: 980px) {
  .topbar {
    grid-template-columns: auto minmax(160px, 1fr);
    gap: 8px 12px;
    min-height: 108px;
  }

  .phase-display {
    justify-self: end;
  }

  .topbar-actions {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .wheel-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .odds-card {
    width: min(520px, 100%);
    justify-self: center;
  }
}

/* Phones */
@media (max-width: 700px) {
  .landing-screen {
    min-height: 100dvh;
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  }

  .landing-card {
    padding: 30px 16px 34px;
    border-radius: 22px;
  }

  .landing-ball {
    width: 52px;
    height: 52px;
    margin-bottom: 18px;
    font-size: 1.55rem;
  }

  .landing-card h1 {
    margin-bottom: 36px;
    font-size: clamp(3.15rem, 19vw, 5.1rem);
  }

  .start-button {
    min-height: 60px;
    border-radius: 16px;
    font-size: clamp(0.98rem, 4.6vw, 1.25rem);
  }

  .game-screen {
    height: 100dvh;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 103px;
    padding: max(7px, env(safe-area-inset-top)) 8px 7px;
  }

  .topbar-brand {
    gap: 0;
  }

  .topbar-brand > span:last-child {
    display: none;
  }

  .topbar-ball {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }

  .phase-display {
    min-width: 0;
    width: 100%;
    max-width: 220px;
    padding: 5px 10px;
  }

  .phase-display strong {
    max-width: 100%;
    overflow: hidden;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: repeat(2, 42px) 42px minmax(104px, 1fr) 42px 42px;
    width: 100%;
    gap: 5px;
  }

  .control-button,
  .icon-button,
  .zoom-controls {
    min-height: 36px;
    height: 36px;
    border-radius: 9px;
  }

  .control-button {
    width: 42px;
    justify-content: center;
    padding: 0;
  }

  .control-button b {
    display: none;
  }

  .zoom-controls {
    grid-template-columns: 31px minmax(38px, 1fr) 31px;
  }

  .zoom-controls button {
    height: 34px;
  }

  .match-ribbon {
    min-height: 45px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
  }

  .next-match-copy {
    min-width: 0;
    flex: 1;
    font-size: 0.64rem;
  }

  .next-match-copy > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tournament-progress {
    width: 92px;
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .tournament-progress > span {
    font-size: 0.56rem;
    text-align: right;
  }

  .progress-track {
    width: 100%;
    height: 6px;
  }

  .board-toolbar {
    min-height: 39px;
    padding: 4px 6px;
  }

  .board-jumps {
    gap: 4px;
  }

  .board-jumps button {
    min-height: 30px;
    padding: 0 7px;
    font-size: 0.58rem;
  }

  .setup-modal {
    padding: 0;
  }

  .setup-panel {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    padding: max(20px, env(safe-area-inset-top)) 14px max(22px, env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
  }

  .setup-header {
    margin-bottom: 16px;
  }

  .setup-header h2 {
    font-size: 1.7rem;
  }

  .player-pick-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .player-card {
    padding: 14px;
  }

  .player-card input {
    min-height: 44px;
  }

  .setup-submit {
    position: sticky;
    bottom: 0;
    min-height: 54px;
    margin-top: 18px;
  }

  .wheel-modal {
    padding: 0;
  }

  .wheel-panel {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    padding: max(14px, env(safe-area-inset-top)) 10px max(18px, env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
  }

  .modal-close {
    top: max(8px, env(safe-area-inset-top));
    right: 9px;
    width: 34px;
    height: 34px;
    font-size: 1.25rem;
  }

  .wheel-stage {
    padding: 5px 9px;
    font-size: 0.55rem;
  }

  .wheel-header h2 {
    margin-top: 6px;
    font-size: 1.65rem;
  }

  .wheel-header p {
    padding: 0 36px;
    font-size: 0.67rem;
  }

  .duel-strip {
    grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr);
    gap: 5px;
    margin: 12px 0;
  }

  .duel-team {
    grid-template-columns: 1fr;
    gap: 5px;
    min-height: 62px;
    padding: 8px;
    text-align: center;
  }

  .duel-team-name .team-identity {
    width: 100%;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
  }

  .duel-team-name .team-flag {
    width: 30px;
    height: 22px;
  }

  .duel-team > span:last-child {
    min-width: 0;
    justify-self: center;
    padding: 4px 7px;
  }

  .duel-vs {
    font-size: 0.66rem;
  }

  .wheel-layout {
    gap: 10px;
  }

  .roulette-wrap {
    width: min(74vw, 43vh, 340px);
  }

  .wheel-pointer {
    border-right-width: 15px;
    border-left-width: 15px;
    border-bottom-width: 34px;
  }

  .wheel-hub {
    width: 58px;
    height: 58px;
    border-width: 5px;
    font-size: 1.35rem;
  }

  .odds-card {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: min(520px, 100%);
    padding: 9px 12px;
    border-radius: 12px;
    text-align: left;
  }

  .odds-card > strong {
    margin: 0;
    font-size: 1.45rem;
  }

  .odds-card p {
    overflow: hidden;
    font-size: 0.62rem;
    line-height: 1.25;
    text-overflow: ellipsis;
  }

  .spin-button {
    min-height: 52px;
    margin-top: 12px;
    border-radius: 13px;
    font-size: 0.88rem;
  }

  .wheel-result {
    margin-top: 14px;
    padding: 17px 12px;
  }

  .wheel-result h3 {
    font-size: 1.8rem;
  }

  .wheel-result h3 .team-identity {
    flex-direction: column;
    gap: 5px;
  }

  .wheel-result h3 .team-flag {
    width: 38px;
    height: 28px;
  }

  .phase-splash-inner {
    width: calc(100vw - 24px);
    padding: 34px 18px;
  }
}

/* Very narrow phones */
@media (max-width: 390px) {
  .topbar-actions {
    grid-template-columns: repeat(3, 36px) minmax(92px, 1fr) repeat(2, 36px);
  }

  .control-button,
  .icon-button,
  .zoom-controls {
    width: auto;
    min-width: 0;
  }

  .control-button {
    width: 36px;
  }

  .roulette-wrap {
    width: min(70vw, 40vh, 280px);
  }

  .wheel-header p {
    display: none;
  }
}

/* Short landscape screens */
@media (max-height: 600px) and (orientation: landscape) {
  .wheel-panel {
    padding-top: 8px;
  }

  .wheel-header p {
    display: none;
  }

  .duel-strip {
    margin: 7px 0;
  }

  .wheel-layout {
    grid-template-columns: minmax(240px, 52vh) 190px;
    gap: 14px;
  }

  .roulette-wrap {
    width: min(52vh, 340px);
  }

  .odds-card {
    display: block;
  }

  .spin-button {
    min-height: 46px;
    margin-top: 8px;
  }
}

/* Keep unrevealed labels readable without duplicating pseudo text. */
.team-slot:not(.is-revealed) .team-name {
  visibility: visible;
  color: #8d99a8;
}

.team-slot:not(.is-revealed) .team-name::before {
  content: none;
}

.control-button > span {
  display: inline-block;
}

#statusMessage {
  min-width: 0;
}

#statusMessage .team-identity {
  max-width: 220px;
}

.team-slot:not(.is-revealed):not(.is-pending)::after {
  display: none;
}
/* ================================================================
   LIVE MATCH ATMOSPHERE + TWO-STEP SETUP + PWA INSTALL UI
   Append this entire block to the end of foot.css.
   ================================================================ */

/* PWA install button */

.install-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 24px auto 0;
  padding: 0 22px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.09);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  font-size: 0.78rem;
  font-weight: 1000;
  letter-spacing: 0.1em;
  backdrop-filter: blur(10px);
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.install-button > span:first-child {
  color: var(--gold);
  font-size: 1.25rem;
  line-height: 1;
  animation: install-arrow-bounce 1.55s ease-in-out infinite;
}

.install-button:hover {
  border-color: rgba(255, 211, 56, 0.7);
  background: rgba(255, 211, 56, 0.13);
  box-shadow:
    0 13px 30px rgba(0, 0, 0, 0.23),
    0 0 24px rgba(255, 211, 56, 0.12);
  transform: translateY(-2px);
}

.install-button:active {
  transform: translateY(1px);
}

@keyframes install-arrow-bounce {
  0%,
  100% {
    transform: translateY(-1px);
  }

  50% {
    transform: translateY(4px);
  }
}

/* Sequential Player 1 -> Player 2 setup */

.setup-heading-copy {
  min-width: 0;
}

.setup-step-label {
  display: block;
  margin-bottom: 4px;
  color: var(--gold);
  font-size: 0.62rem;
  font-weight: 1000;
  letter-spacing: 0.16em;
}

.player-pick-grid.is-single-step {
  grid-template-columns: minmax(0, 1fr);
  width: min(540px, 100%);
  margin-inline: auto;
}

.player-card.is-step-hidden {
  display: none !important;
}

.player-card.is-step-entering {
  animation:
    setup-card-arrive
    420ms
    cubic-bezier(.2, .9, .2, 1.08)
    both;
}

.player-one-card {
  box-shadow:
    inset 4px 0 0 rgba(99, 184, 255, 0.8);
}

.player-two-card {
  box-shadow:
    inset 4px 0 0 rgba(255, 111, 97, 0.82);
}

@keyframes setup-card-arrive {
  from {
    opacity: 0;
    transform:
      translate3d(28px, 0, 0)
      scale(0.975);
  }

  to {
    opacity: 1;
    transform:
      translate3d(0, 0, 0)
      scale(1);
  }
}

/* Session-only auto reveal state */

#autoRevealButton.is-active {
  border-color: rgba(73, 214, 175, 0.72);
  color: #b9ffea;
  background: rgba(73, 214, 175, 0.18);
  box-shadow:
    inset 0 0 0 1px rgba(73, 214, 175, 0.12),
    0 0 20px rgba(73, 214, 175, 0.12);
}

#autoRevealButton.is-active > span {
  animation:
    auto-reveal-spark
    1.8s
    ease-in-out
    infinite;
}

@keyframes auto-reveal-spark {
  0%,
  100% {
    filter:
      drop-shadow(
        0 0 0 rgba(73, 214, 175, 0)
      );
    transform: scale(1);
  }

  50% {
    filter:
      drop-shadow(
        0 0 8px rgba(73, 214, 175, 0.75)
      );
    transform: scale(1.14);
  }
}

/* Landing-screen energy */

.landing-card {
  overflow: hidden;
}

.landing-card::before {
  position: absolute;
  inset: -2px;
  z-index: -1;
  content: "";
  pointer-events: none;
  border-radius: inherit;
  background:
    conic-gradient(
      from 180deg,
      transparent 0 18%,
      rgba(99, 184, 255, 0.28) 25%,
      transparent 34% 61%,
      rgba(255, 211, 56, 0.25) 70%,
      transparent 79% 100%
    );
  filter: blur(18px);
  animation:
    landing-aura-turn
    14s
    linear
    infinite;
}

.landing-ball {
  animation:
    landing-ball-live
    3.2s
    ease-in-out
    infinite;
}

@keyframes landing-aura-turn {
  to {
    transform: rotate(1turn);
  }
}

@keyframes landing-ball-live {
  0%,
  100% {
    transform:
      translateY(0)
      rotate(-3deg);
  }

  50% {
    transform:
      translateY(-8px)
      rotate(8deg);
  }
}

/* Stadium-light sweep across the top bar */

.topbar {
  overflow: hidden;
}

.topbar::after {
  position: absolute;
  inset: -140% -45%;
  z-index: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(
      105deg,
      transparent 42%,
      rgba(255, 255, 255, 0.02) 47%,
      rgba(255, 255, 255, 0.14) 50%,
      rgba(255, 255, 255, 0.02) 53%,
      transparent 58%
    );
  transform:
    translateX(-38%)
    rotate(8deg);
  animation:
    topbar-light-sweep
    8.5s
    ease-in-out
    infinite;
}

.topbar > * {
  position: relative;
  z-index: 1;
}

.topbar-ball {
  animation:
    topbar-ball-pulse
    2.8s
    ease-in-out
    infinite;
}

@keyframes topbar-light-sweep {
  0%,
  28% {
    opacity: 0;
    transform:
      translateX(-42%)
      rotate(8deg);
  }

  38% {
    opacity: 1;
  }

  64% {
    opacity: 1;
  }

  76%,
  100% {
    opacity: 0;
    transform:
      translateX(42%)
      rotate(8deg);
  }
}

@keyframes topbar-ball-pulse {
  0%,
  100% {
    transform:
      rotate(-4deg)
      scale(1);
    box-shadow:
      inset 0 -5px 0 rgba(0, 0, 0, 0.15),
      0 0 0 rgba(255, 211, 56, 0);
  }

  50% {
    transform:
      rotate(5deg)
      scale(1.06);
    box-shadow:
      inset 0 -5px 0 rgba(0, 0, 0, 0.15),
      0 0 22px rgba(255, 211, 56, 0.28);
  }
}

/* Moving broadcast ribbon and progress shine */

.match-ribbon {
  overflow: hidden;
}

.match-ribbon::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(99, 184, 255, 0.07),
      transparent
    );
  transform: translateX(-100%);
  animation:
    ribbon-scan
    7s
    ease-in-out
    infinite;
}

.match-ribbon > * {
  position: relative;
  z-index: 1;
}

.progress-track span {
  position: relative;
  overflow: hidden;
}

.progress-track span::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(
      100deg,
      transparent 20%,
      rgba(255, 255, 255, 0.82) 48%,
      transparent 76%
    );
  transform: translateX(-130%);
  animation:
    progress-glint
    2.8s
    ease-in-out
    infinite;
}

@keyframes ribbon-scan {
  0%,
  24% {
    opacity: 0;
    transform: translateX(-100%);
  }

  36% {
    opacity: 1;
  }

  72% {
    opacity: 1;
  }

  84%,
  100% {
    opacity: 0;
    transform: translateX(100%);
  }
}

@keyframes progress-glint {
  0%,
  36% {
    transform: translateX(-130%);
  }

  70%,
  100% {
    transform: translateX(130%);
  }
}

/* Slowly moving pitch texture */

.board-viewport {
  animation:
    pitch-texture-drift
    28s
    linear
    infinite;
}

@keyframes pitch-texture-drift {
  0% {
    background-position:
      0 0,
      0 0,
      0 0;
  }

  50% {
    background-position:
      32px 16px,
      16px 32px,
      6px 6px;
  }

  100% {
    background-position:
      64px 32px,
      32px 64px,
      12px 12px;
  }
}

.zone-heading {
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease;
}

.group-card,
.bracket-match {
  backface-visibility: hidden;
}

.group-card.is-current,
.bracket-match.is-current {
  animation:
    current-fixture-breathe
    2.2s
    ease-in-out
    infinite;
}

.group-card.is-current .group-letter {
  animation:
    current-group-letter
    1.9s
    ease-in-out
    infinite;
}

@keyframes current-fixture-breathe {
  0%,
  100% {
    filter: brightness(1);
  }

  50% {
    filter:
      brightness(1.045)
      drop-shadow(
        0 0 10px rgba(255, 211, 56, 0.18)
      );
  }
}

@keyframes current-group-letter {
  0%,
  100% {
    transform:
      rotate(-2deg)
      scale(1);
  }

  50% {
    transform:
      rotate(3deg)
      scale(1.07);
  }
}

@media (hover: hover) {
  .zone-heading:hover {
    border-color: rgba(8, 24, 51, 0.2);
    box-shadow:
      0 16px 38px rgba(5, 20, 45, 0.15);
    transform: translateY(-2px);
  }

  .group-card:hover:not(.is-current) {
    border-color: rgba(99, 184, 255, 0.42);
    box-shadow:
      0 16px 36px rgba(5, 20, 45, 0.15);
    transform: translateY(-3px);
  }

  .bracket-match:hover:not(.is-current) {
    border-color: rgba(124, 108, 242, 0.38);
    box-shadow:
      0 13px 28px rgba(8, 24, 51, 0.13);
    transform: translateY(-2px);
  }
}

/* Reveal-card light swipe */

.team-slot.is-revealed::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(
      105deg,
      transparent 28%,
      rgba(255, 255, 255, 0.86) 50%,
      transparent 72%
    );
  transform: translateX(-140%);
  transition: transform 520ms ease;
}

.team-slot.is-revealed:hover::before {
  transform: translateX(140%);
}

.team-slot > * {
  position: relative;
  z-index: 1;
}

.bracket-match.is-complete::before {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  content: "";
  border-radius: 50%;
  background: var(--mint);
  box-shadow:
    0 0 0 0 rgba(73, 214, 175, 0.45);
  animation:
    completed-match-ping
    2.6s
    ease-out
    infinite;
}

@keyframes completed-match-ping {
  0% {
    box-shadow:
      0 0 0 0 rgba(73, 214, 175, 0.42);
  }

  65%,
  100% {
    box-shadow:
      0 0 0 10px rgba(73, 214, 175, 0);
  }
}

/* Roulette-show atmosphere */

.wheel-panel {
  background-size:
    145% 145%,
    145% 145%,
    100% 100%;
  animation:
    wheel-panel-atmosphere
    10s
    ease-in-out
    infinite
    alternate;
}

.roulette-wrap {
  isolation: isolate;
}

.roulette-wrap::before {
  position: absolute;
  inset: -16px;
  z-index: -1;
  content: "";
  pointer-events: none;
  border-radius: 50%;
  background:
    conic-gradient(
      from 0deg,
      rgba(99, 184, 255, 0.1),
      rgba(99, 184, 255, 0.55),
      rgba(255, 211, 56, 0.18),
      rgba(255, 111, 97, 0.5),
      rgba(99, 184, 255, 0.1)
    );
  filter: blur(13px);
  opacity: 0.62;
  animation:
    wheel-halo-turn
    9s
    linear
    infinite;
}

.wheel-pointer {
  animation:
    pointer-glow
    1.45s
    ease-in-out
    infinite;
}

.spin-button,
.setup-submit {
  position: relative;
  overflow: hidden;
}

.spin-button::after,
.setup-submit::after {
  position: absolute;
  inset: -40% auto -40% -35%;
  width: 28%;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(255, 255, 255, 0.75),
      transparent
    );
  transform: skewX(-18deg);
  animation:
    action-button-shine
    3.1s
    ease-in-out
    infinite;
}

.wheel-result:not(.is-hidden) {
  animation:
    winner-panel-arrive
    520ms
    cubic-bezier(.15, .9, .25, 1.15)
    both;
}

.wheel-result:not(.is-hidden) h3 {
  animation:
    winner-name-breathe
    1.8s
    ease-in-out
    520ms
    infinite;
}

@keyframes wheel-panel-atmosphere {
  0% {
    background-position:
      0% 0%,
      100% 100%,
      0 0;
  }

  100% {
    background-position:
      18% 12%,
      82% 88%,
      0 0;
  }
}

@keyframes wheel-halo-turn {
  to {
    transform: rotate(1turn);
  }
}

@keyframes pointer-glow {
  0%,
  100% {
    filter:
      drop-shadow(
        0 5px 3px rgba(0, 0, 0, 0.32)
      )
      drop-shadow(
        0 0 0 rgba(255, 211, 56, 0)
      );
  }

  50% {
    filter:
      drop-shadow(
        0 5px 3px rgba(0, 0, 0, 0.32)
      )
      drop-shadow(
        0 0 12px rgba(255, 211, 56, 0.75)
      );
  }
}

@keyframes action-button-shine {
  0%,
  50% {
    left: -35%;
    opacity: 0;
  }

  58% {
    opacity: 0.9;
  }

  82%,
  100% {
    left: 115%;
    opacity: 0;
  }
}

@keyframes winner-panel-arrive {
  from {
    opacity: 0;
    transform:
      translateY(20px)
      scale(0.96);
  }

  to {
    opacity: 1;
    transform:
      translateY(0)
      scale(1);
  }
}

@keyframes winner-name-breathe {
  0%,
  100% {
    text-shadow:
      0 0 0 rgba(255, 255, 255, 0);
    transform: scale(1);
  }

  50% {
    text-shadow:
      0 0 22px rgba(255, 255, 255, 0.18);
    transform: scale(1.018);
  }
}

/* Announcements and toasts feel like broadcast graphics */

.phase-splash-inner {
  position: relative;
  overflow: hidden;
}

.phase-splash-inner::before,
.phase-splash-inner::after {
  position: absolute;
  width: 180px;
  height: 180px;
  content: "";
  pointer-events: none;
  border:
    1px solid rgba(255, 255, 255, 0.11);
  border-radius: 50%;
}

.phase-splash-inner::before {
  top: -105px;
  left: -90px;
  animation:
    splash-orbit
    5s
    linear
    infinite;
}

.phase-splash-inner::after {
  right: -95px;
  bottom: -115px;
  animation:
    splash-orbit
    6.5s
    linear
    infinite
    reverse;
}

.toast {
  transform-origin: right center;
}

@keyframes splash-orbit {
  to {
    transform:
      rotate(1turn)
      scale(1.08);
  }
}

@media (max-width: 700px) {
  .install-button {
    min-height: 44px;
    margin-top: 18px;
    padding-inline: 18px;
    font-size: 0.7rem;
  }

  .setup-header {
    align-items: flex-start;
  }

  .setup-step-label {
    font-size: 0.56rem;
  }

  .player-pick-grid.is-single-step {
    width: 100%;
  }

  .roulette-wrap::before {
    inset: -10px;
    filter: blur(9px);
  }
}
/* ================================================================
   FICTIONAL FLAGS + SWIPE WHEEL + LIVE MICRO-INTERACTIONS
   ================================================================ */

/* Fictional flags */

.team-flag-custom {
  object-fit: cover;
  object-position: center;
  background: #ffffff;
}

.team-flag-monogram {
  display: inline-grid;
  place-items: center;
  color: #e87500;
  background: linear-gradient(145deg, #fffdf8, #ffe1b8);
  border-color: rgba(218, 105, 0, 0.58);
  font-size: 0.72rem;
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
  box-shadow:
    inset 0 -2px 0 rgba(218, 105, 0, 0.12),
    0 1px 3px rgba(8, 24, 51, 0.14);
}

.standing-name .team-flag-monogram,
.result-team .team-flag-monogram,
.bracket-match .team-flag-monogram {
  font-size: 0.58rem;
}

.duel-team-name .team-flag-monogram {
  font-size: 0.96rem;
}

.wheel-result h3 .team-flag-monogram {
  font-size: 1.3rem;
}

.team-flag {
  transition:
    transform 160ms ease,
    filter 160ms ease,
    box-shadow 160ms ease;
}

.team-slot:hover .team-flag,
.duel-team:hover .team-flag,
.wheel-result:hover .team-flag {
  filter: saturate(1.12) brightness(1.04);
  transform: translateY(-1px) rotate(-2deg) scale(1.04);
}

/* Tap/swipe wheel interaction */

.roulette-wrap {
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.roulette-wrap:active,
.roulette-wrap.is-swiping {
  cursor: grabbing;
}

#wheelCanvas {
  transition:
    transform 150ms ease,
    filter 150ms ease;
}

.roulette-wrap.is-swiping #wheelCanvas {
  filter: brightness(1.08) saturate(1.12);
  transform: scale(1.025);
}

.roulette-wrap::after {
  position: absolute;
  left: 50%;
  bottom: 5%;
  z-index: 5;
  min-width: max-content;
  padding: 7px 11px;
  content: "TAP OR SWIPE TO SPIN";
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(7, 24, 50, 0.78);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
  font-size: 0.58rem;
  font-weight: 1000;
  letter-spacing: 0.11em;
  opacity: 0.92;
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
  animation: wheel-swipe-hint 1.8s ease-in-out infinite;
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.roulette-wrap.is-swiping::after {
  content: "RELEASE TO SPIN";
  color: var(--ink);
  background: var(--gold);
  transform: translateX(-50%) scale(1.05);
  animation: none;
}

.wheel-panel:has(.spin-button:disabled) .roulette-wrap::after,
.wheel-panel:has(.wheel-result:not(.is-hidden)) .roulette-wrap::after {
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
  animation: none;
}

/* More responsive controls */

.control-button:not(:disabled):active,
.icon-button:not(:disabled):active,
.board-jumps button:active,
.next-match-button:active {
  transform: translateY(1px) scale(0.96);
}

.slot-state {
  display: inline-block;
}

.team-slot:not(.is-revealed):not(.is-pending) .slot-state {
  animation: mystery-slot-pulse 1.45s ease-in-out infinite;
}

/* Active-group stadium-light pass */

.group-card-header {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.group-card-header > * {
  position: relative;
  z-index: 1;
}

.group-card.is-current .group-card-header::after {
  position: absolute;
  inset: -40% auto -40% -28%;
  width: 22%;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(255, 255, 255, 0.34),
      transparent
    );
  transform: skewX(-18deg);
  animation: current-group-sweep 2.8s ease-in-out infinite;
}

/* Current knockout-match beacon */

.bracket-match.is-current .match-state::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  content: "";
  border-radius: 50%;
  background: var(--gold-deep);
  box-shadow: 0 0 0 0 rgba(240, 173, 0, 0.46);
  animation: next-match-beacon 1.45s ease-out infinite;
  vertical-align: 1px;
}

/* Wheel-modal entrances */

.wheel-modal:not(.is-hidden) .duel-team-a {
  animation:
    duel-enter-left
    360ms
    cubic-bezier(.2, .9, .2, 1.08)
    both;
}

.wheel-modal:not(.is-hidden) .duel-team-b {
  animation:
    duel-enter-right
    360ms
    cubic-bezier(.2, .9, .2, 1.08)
    70ms
    both;
}

/* Phase indicator glow */

.phase-display {
  position: relative;
  overflow: hidden;
}

.phase-display::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  border-radius: inherit;
  box-shadow:
    inset 0 0 18px rgba(99, 184, 255, 0.08);
  animation:
    phase-display-glow
    2.6s
    ease-in-out
    infinite;
}

/* Toast countdown meter */

.toast {
  position: relative;
  overflow: hidden;
}

.toast::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  content: "";
  background:
    linear-gradient(
      90deg,
      var(--gold),
      var(--mint),
      var(--sky)
    );
  transform-origin: left center;
  animation:
    toast-life-meter
    3.15s
    linear
    forwards;
}

@keyframes wheel-swipe-hint {
  0%,
  100% {
    box-shadow:
      0 8px 20px rgba(0, 0, 0, 0.24);
    transform:
      translateX(-50%)
      translateY(0);
  }

  50% {
    box-shadow:
      0 10px 24px rgba(0, 0, 0, 0.28),
      0 0 18px rgba(255, 211, 56, 0.2);
    transform:
      translateX(-50%)
      translateY(-4px);
  }
}

@keyframes mystery-slot-pulse {
  0%,
  100% {
    color: #99a5b1;
    transform: scale(1);
  }

  50% {
    color: var(--gold-deep);
    transform: scale(1.18);
  }
}

@keyframes current-group-sweep {
  0%,
  40% {
    left: -28%;
    opacity: 0;
  }

  50% {
    opacity: 1;
  }

  82%,
  100% {
    left: 118%;
    opacity: 0;
  }
}

@keyframes next-match-beacon {
  0% {
    box-shadow:
      0 0 0 0 rgba(240, 173, 0, 0.46);
  }

  72%,
  100% {
    box-shadow:
      0 0 0 9px rgba(240, 173, 0, 0);
  }
}

@keyframes duel-enter-left {
  from {
    opacity: 0;
    transform:
      translateX(-24px)
      scale(0.98);
  }

  to {
    opacity: 1;
    transform:
      translateX(0)
      scale(1);
  }
}

@keyframes duel-enter-right {
  from {
    opacity: 0;
    transform:
      translateX(24px)
      scale(0.98);
  }

  to {
    opacity: 1;
    transform:
      translateX(0)
      scale(1);
  }
}

@keyframes phase-display-glow {
  0%,
  100% {
    opacity: 0.45;
  }

  50% {
    opacity: 1;
  }
}

@keyframes toast-life-meter {
  from {
    transform: scaleX(1);
  }

  to {
    transform: scaleX(0);
  }
}

@media (max-width: 700px) {
  .roulette-wrap::after {
    bottom: 3%;
    padding: 6px 9px;
    font-size: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .roulette-wrap::after,
  .team-slot:not(.is-revealed):not(.is-pending) .slot-state,
  .group-card.is-current .group-card-header::after,
  .bracket-match.is-current .match-state::before,
  .phase-display::after,
  .toast::after {
    animation: none !important;
  }
}

