@media (max-width: 700px) {
  #hero h1 {
    font-size: clamp(2.2rem, 11vw, 3rem);
  }
}

@media (max-width: 360px) {
  header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
    height: auto;
    min-height: 78px;
    padding: 7px 3vw;
  }

  nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  nav button,
  #session {
    width: 100%;
    min-width: 0;
    padding: 7px 3px;
    font-size: 0.68rem;
    line-height: 1.15;
  }

  #session {
    min-height: 34px;
  }

  main {
    padding-top: 18px;
  }

  #hero {
    padding: 34px 7%;
  }

  #hero h1 {
    overflow-wrap: normal;
    font-size: clamp(2rem, 10.5vw, 2.35rem);
    letter-spacing: -0.06em;
  }

  .section-title {
    font-size: 1.75rem;
  }
}

.competition-picker {
  display: grid;
  gap: .15rem;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
}

.competition-picker select {
  max-width: 20rem;
  padding: .45rem .65rem;
  border-radius: .45rem;
  background: #fff;
  color: #061a3a;
}

.schedule td small {
  display: block;
  max-width: 14rem;
  margin-top: .25rem;
}

#connection-status {
  color: #9ee6b0;
  font-size: .72rem;
  font-weight: 800;
}

.competition-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 18px;
  padding: 15px 18px;
  border: 1px solid #c9d8e8;
  border-left: 6px solid #ffc515;
  border-radius: 12px;
  background: linear-gradient(110deg, #fff 0%, #edf5fd 100%);
  box-shadow: 0 8px 24px #0718310d;
}

.competition-context div {
  display: grid;
  gap: 3px;
}

.competition-context span {
  color: #66778a;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.competition-context strong {
  color: #061a38;
  font-size: 1.05rem;
}

.branch-badge {
  flex: 0 0 auto;
  padding: 8px 13px;
  border-radius: 999px;
  background: #061a38;
  color: #ffc515;
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.notifications {
  margin-bottom: 1rem;
  padding: 1rem;
  border-left: 5px solid #ffc515;
}

@media (min-width: 361px) and (max-width: 850px) {
  header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 10px;
    height: auto;
    min-height: 78px;
    padding: 7px 3vw;
  }

  .brand { grid-column: 1; }
  #session { grid-column: 2; grid-row: 1; }
  .competition-picker { grid-column: 1 / -1; }
  header nav { grid-column: 1 / -1; justify-content: center; }
  .competition-picker { width: 100%; }
  .competition-picker select { max-width: none; width: 100%; }
}

@media (max-width: 360px) {
  .competition-picker,
  .competition-picker select { width: 100%; max-width: none; }
}

/* Layout estable con todos los controles visibles, incluso para administradores. */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

header {
  gap: 12px;
}

#hero {
  padding-top: 42px;
  padding-bottom: 42px;
  background: linear-gradient(125deg, #071a35 0%, #0a315f 58%, #0b5aa4 100%);
}

#hero h1 {
  max-width: 850px;
}

@media (max-width: 1200px) {
  header {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    grid-template-areas:
      "brand session"
      "nav connection";
    height: auto;
    min-height: 96px;
    padding: 10px 4vw;
  }

  header .brand { grid-area: brand; }
  header nav {
    grid-area: nav;
    display: grid;
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    width: 100%;
  }
  header #connection-status { grid-area: connection; justify-self: end; }
  header #session { grid-area: session; justify-self: end; }
}

@media (max-width: 700px) {
  header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand session"
      "nav nav"
      "connection connection";
    min-height: 0;
    padding: 9px 4vw;
  }

  header .brand { display: flex; }
  header .brand > span:last-child { display: none; }
  header nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }
  header nav button,
  header #session {
    min-width: 0;
    padding: 8px 6px;
    white-space: normal;
  }
  header #connection-status { justify-self: start; }

  main {
    padding-top: 22px;
  }

  #hero {
    padding: 32px 7%;
  }

  .competition-context {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 13px 14px;
  }

  .branch-badge {
    align-self: flex-start;
  }
}
