:root {
  --bg: #081025;
  --card: #121b35;
  --card2: #172344;
  --text: #f7fbff;
  --muted: #9fb2d5;
  --line: #26385f;
  --accent: #22c55e;
  --accent2: #38bdf8;
  --danger: #ef4444;
  --gold: #facc15;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.24);
  --radius: 20px;
  --page-inline: clamp(10px, 3vw, 28px);
}
* {
  box-sizing: border-box;
  min-width: 0;
}
html {
  width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    Tahoma,
    Arial,
    sans-serif;
  background: radial-gradient(
    circle at top,
    #163064 0,
    #081025 45%,
    #050816 100%
  );
  color: var(--text);
  min-height: 100svh;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
}
img,
svg,
table {
  max-width: 100%;
}
.hero {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(
    135deg,
    rgba(8, 16, 37, 0.98),
    rgba(20, 35, 75, 0.96)
  );
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px var(--page-inline);
  max-height: 120px;
  opacity: 1;
  overflow: hidden;
  transition:
    max-height 0.28s ease,
    padding 0.28s ease,
    opacity 0.18s ease;
}
.hero.compact .topbar {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  pointer-events: none;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ball {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #22c55e, #38bdf8);
  font-size: 22px;
  flex: 0 0 auto;
}
.brand h1 {
  font-size: clamp(18px, 3.2vw, 28px);
  line-height: 1.25;
  margin: 0;
}
.brand p {
  display: none;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.pill,
.primary {
  border-radius: 999px;
  padding: 9px 12px;
  background: #203156;
  color: var(--text);
  border: 1px solid var(--line);
}
.pill:hover,
.primary:hover {
  filter: brightness(1.12);
}
.danger {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.4);
}
.primary {
  background: linear-gradient(135deg, #16a34a, #0284c7);
  font-weight: 800;
}
.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding: 8px var(--page-inline) 10px;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tabs button {
  white-space: nowrap;
  color: var(--muted);
  background: #111a33;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px 13px;
  flex: 0 0 auto;
}
.tabs button.active {
  color: #04111f;
  background: linear-gradient(135deg, #bbf7d0, #bae6fd);
  font-weight: 900;
}
main {
  width: min(100%, 1440px);
  margin-inline: auto;
  main {
    width: min(100%, 1440px);
    margin-inline: auto;
    padding: 16px var(--page-inline) 8px;
  }
}
.page {
  display: none;
}
.page.active {
  display: block;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 14px;
}
.section-head h2 {
  margin: 0 0 5px;
  font-size: clamp(21px, 3vw, 30px);
}
.section-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.status-card,
.notice,
.info-card {
  background: rgba(18, 27, 53, 0.88);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 13px;
  box-shadow: var(--shadow);
}
.status-card b {
  color: var(--gold);
}
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 14px;
}

@media (min-width: 901px) {
  .groups-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.group-card,
.round-card {
  background: rgba(18, 27, 53, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.group-card h3,
.round-card h3 {
  margin: 0 0 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.team {
  display: flex;
  align-items: center;
  gap: 7px;
  line-height: 1.25;
}
.flag {
  font-size: 20px;
}
.matches {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.match-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px 12px 46px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  background: #0d1730;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 7px;
}
.match-row input {
  width: 46px;
  text-align: center;
  border-radius: 11px;
  border: 1px solid #3b4f7e;
  background: #071226;
  color: var(--text);
  padding: 7px;
}
.match-row .away {
  text-align: end;
  justify-content: flex-end;
}
.standings-box {
  overflow-x: auto;
  scrollbar-width: thin;
}
.standings {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 430px;
}
.standings th,
.standings td {
  padding: 7px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.standings th:first-child,
.standings td:first-child {
  text-align: start;
}
.rank1 {
  background: rgba(34, 197, 94, 0.13);
}
.rank2 {
  background: rgba(56, 189, 248, 0.12);
}
.rank3 {
  background: rgba(250, 204, 21, 0.1);
}
.table-wrap {
  overflow: auto;
  background: rgba(18, 27, 53, 0.88);
  border: 1px solid var(--line);
  border-radius: 18px;
  max-width: 100%;
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}
.table-wrap th,
.table-wrap td {
  padding: 11px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.table-wrap th {
  color: #dbeafe;
  background: #0d1730;
}
.qualified {
  color: #86efac;
  font-weight: 900;
}
.out {
  color: #fca5a5;
}
.bracket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 14px;
  margin-top: 14px;
}
.ko-match {
  background: #0d1730;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  margin-bottom: 9px;
}
.ko-head {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
  gap: 8px;
}
.ko-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 8px;
  align-items: center;
  margin: 6px 0;
}
.ko-row input {
  width: 52px;
  text-align: center;
  background: #071226;
  border: 1px solid #3b4f7e;
  color: var(--text);
  border-radius: 10px;
  padding: 7px;
}
.ko-winner {
  margin-top: 8px;
  width: 100%;
  border-radius: 12px;
  background: #172344;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 8px;
}
.winner-name {
  color: #86efac;
  font-weight: 900;
}
.schedule-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: 12px;
}
.schedule-card {
  background: rgba(18, 27, 53, 0.9);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 13px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.schedule-date {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #bae6fd;
  font-weight: 800;
}
.schedule-teams {
  font-size: 17px;
  font-weight: 900;
  margin: 10px 0;
}
.venue {
  color: var(--muted);
  margin-bottom: 0;
}
.info-card {
  max-width: 900px;
  line-height: 1.8;
}
.info-card code {
  display: block;
  white-space: pre-wrap;
  background: #081225;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px;
  color: #bbf7d0;
  direction: ltr;
  text-align: left;
  overflow: auto;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 9px;
  background: #172344;
  border: 1px solid var(--line);
  color: #c7d2fe;
  font-size: 12px;
}
.empty {
  color: var(--muted);
  text-align: center;
  padding: 18px;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(2, 6, 23, 0.64);
  backdrop-filter: blur(10px);
}
.modal-overlay.show {
  display: grid;
  animation: modalFade 0.18s ease;
}
.app-modal {
  animation: modalFade 0.2s ease;
  width: min(100%, 380px);
  background: linear-gradient(180deg, #172344, #0d1730);
  border: 1px solid rgba(186, 230, 253, 0.25);
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  text-align: center;
}
.modal-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #bbf7d0, #bae6fd);
  font-size: 27px;
}
.app-modal h3 {
  margin: 0 0 8px;
  font-size: 22px;
}
.app-modal p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}
.modal-actions button {
  min-width: 110px;
}
.modal-cancel {
  background: #203156;
}
.modal-ok {
  border: 1px solid rgba(255, 255, 255, 0.12);
}
@keyframes modalFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
footer {
  text-align: center;
  color: var(--muted);
  padding: 6px var(--page-inline) 8px;
  opacity: 0.72;
  font-size: 12px;
}
@media (max-width: 720px) {
  .topbar {
    padding: 8px var(--page-inline);
    align-items: flex-start;
  }
  .brand h1 {
    font-size: 18px;
  }
  .ball {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    font-size: 20px;
  }
  .actions {
    width: 100%;
    justify-content: flex-start;
  }
  .pill,
  .primary {
    padding: 8px 10px;
    font-size: 13px;
  }
  .tabs {
    padding-top: 7px;
    padding-bottom: 8px;
  }
  .tabs button {
    padding: 8px 11px;
    font-size: 13px;
  }
  .section-head {
    flex-direction: column;
    align-items: stretch;
  }
  .section-head p {
    font-size: 13px;
  }
  .groups-grid {
    gap: 12px;
  }
  .group-card,
  .round-card {
    padding: 12px;
    border-radius: 18px;
  }
  .match-row {
    grid-template-columns: minmax(0, 1fr) 40px 10px 40px minmax(0, 1fr);
    font-size: 12px;
  }
  .match-row input {
    width: 40px;
    padding: 6px;
  }
  .standings {
    font-size: 12px;
  }
  .standings th,
  .standings td {
    padding: 6px;
  }
  .status-card {
    padding: 10px;
  }
  .schedule-teams {
    font-size: 16px;
  }
}
@media (max-width: 420px) {
  :root {
    --page-inline: 8px;
  }
  .team {
    font-size: 11.5px;
  }
  .match-row {
    gap: 4px;
    padding: 6px;
  }
  .group-card h3,
  .round-card h3 {
    font-size: 16px;
  }
  .brand {
    gap: 8px;
  }
  .actions .danger {
    max-width: 145px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Native-app polish: prevent blue selection/tap flash while keeping inputs usable */
body,
button,
a,
.team,
.badge,
.schedule-card,
.group-card,
.round-card,
.info-card {
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
input,
textarea,
select {
  -webkit-user-select: text;
  user-select: text;
}
button,
input,
select {
  touch-action: manipulation;
}
.lang-options {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.lang-option {
  width: 100%;
  border-radius: 15px;
  padding: 12px 14px;
  background: #172344;
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 800;
  text-align: center;
}
.lang-option.active {
  background: linear-gradient(135deg, #bbf7d0, #bae6fd);
  color: #04111f;
}
.lang-option:hover {
  filter: brightness(1.12);
}
.app-modal.lang-modal {
  max-width: 340px;
}
input.invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

/* Compact mobile group UI: same identity, less scroll */
.compact-groups-grid {
  grid-template-columns: 1fr;
  gap: 10px;
}
.compact-group-card {
  display: block;
  width: 100%;
  text-align: inherit;
  color: var(--text);
  padding: 12px;
  background: rgba(18, 27, 53, 0.9);
}
.compact-group-card:active {
  transform: scale(0.995);
}
.compact-group-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px 42px 42px;
  gap: 6px;
  align-items: center;
  color: #dbeafe;
  margin-bottom: 8px;
  font-size: 13px;
}
.compact-group-head strong {
  font-size: 16px;
  color: var(--text);
}
.compact-team-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px 42px 42px;
  gap: 6px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(38, 56, 95, 0.75);
  font-size: 13px;
}
.compact-team-row:last-of-type {
  border-bottom: 0;
}
.compact-team-name {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
}
.flag-circle {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #0d1730;
  border: 1px solid rgba(186, 230, 253, 0.25);
  font-size: 17px;
  line-height: 1;
  flex: 0 0 auto;
  vertical-align: middle;
}
.compact-open-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.compact-modal {
  width: min(100%, 430px);
  padding: 14px;
  text-align: initial;
}
.compact-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.compact-modal-head h3 {
  margin: 0;
  font-size: 20px;
}
.modal-x {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #203156;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  border: 1px solid var(--line);
}
.group-matches-list {
  display: grid;
  gap: 9px;
  max-height: min(70svh, 540px);
  overflow: auto;
  padding: 1px;
}
.compact-match-line {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: #0d1730;
  color: var(--text);
  font-weight: 800;
}
.compact-match-line span:first-child {
  text-align: start;
  white-space: nowrap;
}
.compact-match-line span:last-child {
  text-align: end;
  white-space: nowrap;
}
.compact-match-line b {
  text-align: center;
  color: #bbf7d0;
  font-size: 17px;
}
.score-edit-modal {
  text-align: center;
  width: min(100%, 390px);
}
.score-teams-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  font-weight: 900;
  line-height: 1.25;
  margin: 4px 0 18px;
}
.score-teams-line span:first-child,
.score-teams-line span:last-child {
  white-space: normal;
  overflow: hidden;
}
.score-teams-line .vs {
  color: var(--muted);
  font-size: 12px;
}
.score-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: center;
  justify-items: center;
  margin: 8px 18px 10px;
}
.score-col {
  display: grid;
  gap: 10px;
  justify-items: center;
}
.score-step {
  width: 54px;
  height: 44px;
  border-radius: 15px;
  background: linear-gradient(135deg, #203156, #172344);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 24px;
  font-weight: 900;
}
.score-number {
  width: 62px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #071226;
  border: 1px solid #3b4f7e;
  color: #bbf7d0;
  font-size: 25px;
  font-weight: 900;
}
@media (min-width: 721px) {
  .compact-groups-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  }
}

@media (max-width: 720px) {
  .score-step {
    width: 60px;
    height: 50px;
    font-size: 27px;
    border-radius: 17px;
  }

  .score-number {
    width: 70px;
    height: 56px;
    font-size: 27px;
    border-radius: 18px;
  }
}
/* v8: real 2-in-1 view switch. Compact is visibly different and can be tested on any screen. */
#viewBtn {
  border-color: rgba(186, 230, 253, 0.35);
}
body.compact-view #groups .section-head p::after {
  content: " · Compact";
  color: #bbf7d0;
  font-weight: 800;
}
body.compact-view .compact-groups-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
}
body.compact-view .compact-group-card {
  cursor: pointer;
  border-color: rgba(186, 230, 253, 0.22);
  background: linear-gradient(
    180deg,
    rgba(18, 27, 53, 0.96),
    rgba(13, 23, 48, 0.96)
  );
}
body.compact-view .compact-group-card:hover {
  border-color: rgba(187, 247, 208, 0.45);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.34);
}
body.compact-view .classic-group-card {
  display: none !important;
}
body.classic-view .compact-group-card {
  display: none !important;
}
@media (max-width: 900px) {
  .compact-groups-grid {
    grid-template-columns: 1fr !important;
  }
  .compact-team-row,
  .compact-group-head {
    grid-template-columns: minmax(0, 1fr) 38px 38px 38px;
  }
  .compact-group-card {
    min-height: auto;
  }
}
@media (min-width: 901px) {
  .compact-modal {
    max-width: 460px;
  }
}

/* v11: fixed knockout layout + no mobile keyboard for knockouts */
.bracket-grid {
  display: grid;
  align-items: start;
  gap: 14px;
  margin-top: 14px;
}
.round-card.round-round32 {
  grid-area: r32;
}
.round-card.round-round16 {
  grid-area: r16;
}
.round-card.round-qf {
  grid-area: qf;
}
.round-card.round-sf {
  grid-area: sf;
}
.round-card.round-final {
  grid-area: final;
}
.round-card.round-third {
  grid-area: third;
}
@media (min-width: 1180px) {
  .bracket-grid {
    grid-template-columns:
      minmax(250px, 1.35fr) minmax(225px, 1.08fr) minmax(205px, 0.92fr)
      minmax(205px, 0.9fr) minmax(230px, 0.95fr);
    grid-template-areas:
      "r32 r16 qf sf final"
      "r32 r16 qf third final";
  }
  .round-card.round-third {
    align-self: start;
  }
}
@media (min-width: 721px) and (max-width: 1179px) {
  .bracket-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "r32 r16"
      "qf sf"
      "final third";
  }
}
@media (max-width: 720px) {
  .bracket-grid {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "r32"
      "r16"
      "qf"
      "sf"
      "final"
      "third";
    gap: 10px;
  }
  .ko-match {
    margin-bottom: 8px;
    padding: 9px;
    border-radius: 14px;
  }
  .ko-head {
    font-size: 11px;
    margin-bottom: 6px;
  }
  .ko-row {
    grid-template-columns: minmax(0, 1fr) 86px;
    gap: 7px;
    font-size: 13px;
  }
}
.ko-row {
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 8px;
}

.ko-score-control {
  display: grid;
  grid-template-columns: 36px 40px 36px;
  gap: 4px;
  align-items: center;
  justify-content: end;
}

.ko-score-control button {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: 1px solid #3b4f7e;
  background: linear-gradient(135deg, #203156, #172344);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.ko-score-control strong {
  display: grid;
  place-items: center;
  width: 40px;
  height: 36px;
  border-radius: 11px;
  background: #071226;
  border: 1px solid #3b4f7e;
  color: #facc15;
  font-size: 18px;
  font-weight: 900;
}
/* v11: viral challenge sharing modal - preview matches real shared image */
.challenge-modal {
  position: relative;
  width: min(100%, 460px);
  text-align: center;
  overflow: hidden;
}
.challenge-modal:before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% 0%,
    rgba(250, 204, 21, 0.18),
    transparent 42%
  );
  pointer-events: none;
}
.challenge-close {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  z-index: 2;
}
.challenge-preview {
  position: relative;
  margin: 16px auto 10px;
  max-height: 58vh;
  overflow: hidden;
  border-radius: 22px;
  background: #071226;
  border: 1px solid rgba(250, 204, 21, 0.45);
  display: grid;
  place-items: center;
  box-shadow:
    inset 0 0 28px rgba(250, 204, 21, 0.05),
    0 18px 40px rgba(0, 0, 0, 0.35);
}
.challenge-preview-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 58vh;
  object-fit: contain;
}
.challenge-loading {
  padding: 34px 18px;
  color: #facc15;
  font-weight: 900;
}
.challenge-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.challenge-actions .primary {
  background: linear-gradient(135deg, #22c55e, #84cc16);
  color: #06111f;
  font-weight: 950;
}
.challenge-actions .pill {
  background: #203156;
}
@media (max-width: 420px) {
  .challenge-actions {
    grid-template-columns: 1fr;
  }
  .challenge-modal {
    padding: 17px;
  }
  .challenge-preview {
    max-height: 54vh;
  }
  .challenge-preview-img {
    max-height: 54vh;
  }
}

/* v12: emergency restore - mobile header buttons stable and visible */
@media (max-width: 720px) {
  .hero {
    position: sticky;
    top: 0;
    z-index: 50;
  }
  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    max-height: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  .hero.compact .topbar {
    max-height: none !important;
    padding: 8px var(--page-inline) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    width: 100%;
  }
  .actions .pill,
  .actions .primary {
    width: 100%;
    min-height: 38px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #resetBtn {
    grid-column: 1 / -1;
    max-width: none !important;
  }
  .tabs {
    position: relative;
    z-index: 52;
  }
}

/* v16 real schedule + bracket fix */
#openingSchedule.schedule-list {
  display: grid !important;
  grid-template-columns: repeat(
    auto-fit,
    minmax(min(100%, 270px), 1fr)
  ) !important;
  gap: 12px !important;
  width: 100% !important;
}
#openingSchedule .schedule-card {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.bracket-layout-fixed {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(300px, 1fr)) !important;
  gap: 14px !important;
  align-items: start !important;
  overflow-x: auto !important;
}
.bracket-layout-fixed .bracket-col {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  min-width: 0 !important;
}
.bracket-layout-fixed .round-card {
  margin: 0 !important;
  width: auto !important;
  max-width: none !important;
}
.bracket-layout-fixed .bracket-col-sf .round-third {
  order: 2 !important;
  margin-top: 0 !important;
}
@media (max-width: 900px) {
  .bracket-layout-fixed {
    display: grid !important;
    grid-template-columns: 1fr !important;
    overflow-x: visible !important;
  }
  .bracket-layout-fixed .bracket-col {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }
}

.app-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.install-box {
  margin: 8px auto 6px;
  max-width: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
}

.install-box[hidden] {
  display: none;
}

.install-box button {
  border: 0;
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

#installBtn {
  background: #f7c948;
  color: #111;
}

#installLater {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.official-box,
.official-card,
.about-card {
  line-height: 1.8;
  overflow-wrap: anywhere;
  word-break: normal;
}
.page:not(.active) .install-box {
  display: none;
}

.studio-box {
  margin-top: 16px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}

.studio-box strong {
  display: block;
  margin-bottom: 6px;
  color: #f7c948;
}

.studio-box p {
  margin: 0 0 8px;
}

.studio-box a {
  color: #7dd3fc;
  font-weight: 800;
  text-decoration: none;
}

.compact-modal-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.modal-handle {
  width: 52px;
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  padding: 0;
  cursor: pointer;
}
