/* BONUSSA responsive continuity v4: compact desktop, mobile-first content and unobstructed dock */

html {
  scroll-padding-top: 88px;
  scroll-padding-bottom: 118px;
}

.mobile-dock {
  will-change: transform, opacity;
}

@media (max-width: 1100px) and (min-width: 721px) {
  body.nav-locked {
    overflow: hidden;
    overscroll-behavior: none;
  }

  .site-header {
    height: 76px;
    padding-inline: 24px;
  }

  .nav-toggle {
    position: relative;
    z-index: 54;
    display: block;
  }

  .site-header nav {
    position: fixed;
    z-index: 52;
    top: 76px;
    right: 0;
    bottom: 0;
    width: min(430px, 100%);
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    padding: 22px;
    overflow-y: auto;
    border-left: 1px solid #323338;
    background:
      radial-gradient(circle at 90% 0, #aa831d20, transparent 30rem),
      linear-gradient(180deg, #111216 0%, #07080a 100%);
    box-shadow: -34px 0 90px #000d;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(34px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
  }

  .site-header.menu-open nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  .nav-panel-head {
    display: block;
    padding-bottom: 16px;
    border-bottom: 1px solid #292a2e;
  }

  .nav-panel-head > h2 {
    margin: 8px 0 4px;
    font-size: 27px;
  }

  .nav-panel-head > p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
  }

  .nav-account-card {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-top: 13px;
    padding: 14px;
    border: 1px solid #3e3823;
    border-radius: 17px;
    background: linear-gradient(135deg, #19170e, #0e0f12);
  }

  .nav-account-avatar {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border: 1px solid #a88b26;
    border-radius: 14px;
    background: #171408;
    color: var(--gold);
    font: 900 26px Georgia, serif;
  }

  .nav-account-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
  }

  .nav-account-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-account-copy small {
    color: var(--muted);
    font-size: 11px;
  }

  .nav-links {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px !important;
  }

  .nav-links > a,
  .nav-links .link-button {
    width: 100%;
    min-height: 70px;
    display: grid !important;
    align-content: center;
    gap: 3px;
    padding: 12px 13px !important;
    border: 1px solid #2b2c31;
    border-radius: 14px;
    background: linear-gradient(145deg, #15161a, #0c0d0f);
    color: #ededf0 !important;
    text-align: left;
  }

  .nav-links > a.active {
    border-color: #6f5d25;
    background: linear-gradient(145deg, #252116, #111214);
    color: #ffe36b !important;
    box-shadow: inset 3px 0 0 #d5ac25;
  }

  .nav-link-main {
    font-size: 15px;
    font-weight: 900;
  }

  .nav-link-note {
    display: block;
    color: #92949b;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.35;
  }

  .nav-links .inline,
  .nav-logout-form,
  .nav-links .install-app-button {
    grid-column: 1 / -1;
    width: 100%;
    margin: 0;
  }

  .nav-links .nav-logout {
    border-color: #473034;
    background: #160e11;
    color: #ffc3ce !important;
  }

  .hero {
    min-height: auto;
    grid-template-columns: minmax(0, 1fr) minmax(290px, .72fr);
    gap: 30px;
    padding-block: 70px;
  }

  .sponsor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .event-grid,
  .event-feed,
  .support-grid {
    grid-template-columns: 1fr;
  }

  .support-grid aside {
    grid-column: 1;
  }

  .event-feed .event-card,
  .support-grid article {
    width: 100%;
  }

  .telegram-post,
  .comments,
  .winners {
    max-width: 860px;
  }

  .auth-wrap,
  .auth-wrap-login,
  .auth-wrap-register {
    min-height: calc(100svh - 76px);
    place-items: start center;
    padding-top: clamp(48px, 8vh, 90px);
  }
}

@media (max-width: 720px) {
  html {
    scroll-padding-top: 76px;
    scroll-padding-bottom: 108px;
  }

  body.has-mobile-dock {
    padding-bottom: 108px;
    padding-bottom: calc(108px + env(safe-area-inset-bottom));
  }

  .mobile-dock {
    right: 9px;
    bottom: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 9px;
    height: 66px;
    padding: 6px 5px 5px;
    border-radius: 22px;
  }

  .mobile-dock.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + 26px));
  }

  .mobile-dock a {
    min-height: 52px;
    grid-template-rows: 29px auto;
    border-radius: 15px;
    font-size: 8px;
  }

  .mobile-dock a::after {
    width: 32px;
    height: 29px;
  }

  .mobile-dock svg {
    width: 20px;
    height: 20px;
  }

  .page-head,
  .mission-head,
  .market-head.page-head {
    padding-top: 32px;
    padding-bottom: 21px;
  }

  .page-head h1,
  .mission-head h1 {
    font-size: clamp(33px, 10.4vw, 42px);
    line-height: 1.06;
    letter-spacing: -1.7px;
  }

  .page-head p,
  .mission-head p {
    font-size: 14px;
    line-height: 1.58;
  }

  .event-feed {
    gap: 12px;
    padding-bottom: 36px;
  }

  .event-card {
    border-radius: 19px;
  }

  .event-cover {
    height: 172px;
    padding: 16px;
  }

  .event-body {
    padding: 17px;
  }

  .event-meta {
    gap: 10px;
    font-size: 10px;
  }

  .telegram-post {
    margin-top: 13px;
    border-radius: 19px;
  }

  .post-content {
    padding: 17px;
  }

  .post-content h1 {
    margin: 15px 0 11px;
  }

  .entry-status {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .comments,
  .winners {
    margin-top: 19px;
    margin-bottom: 34px;
  }

  .comment-list > article {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    padding: 15px 0;
  }

  .comment-avatar {
    width: 38px;
    height: 38px;
    font-size: 21px;
  }

  .comment-list header {
    align-items: baseline;
    flex-wrap: wrap;
    gap: 3px 8px;
  }

  .comment-list p {
    overflow-wrap: anywhere;
    font-size: 13px;
    line-height: 1.55;
  }

  .leaderboard {
    padding-bottom: 38px;
  }

  .period-tabs {
    position: sticky;
    z-index: 12;
    top: 77px;
    margin-bottom: 13px;
    background: #0b0c0ff2;
    backdrop-filter: blur(16px);
  }

  .league-hero {
    gap: 17px;
    padding: 18px;
    border-radius: 20px;
  }

  .league-budget {
    padding-top: 13px;
    border-top: 1px solid #302d22;
  }

  .prize-grid {
    margin-inline: -2px;
    padding: 0 2px 8px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .prize-grid article {
    scroll-snap-align: start;
  }

  .league-rule-note,
  .league-separation-note {
    padding: 16px;
    border-radius: 15px;
  }

  .support-grid {
    gap: 12px;
    padding-bottom: 38px;
  }

  .support-grid article {
    padding: 20px;
    border-radius: 20px;
  }

  .support-grid aside {
    padding: 16px;
  }

  .auth-wrap,
  .auth-wrap-login,
  .auth-wrap-register {
    min-height: auto;
    place-items: start center;
    padding: 15px 12px 30px;
  }

  .auth-card-premium,
  .auth-card-login,
  .auth-card-register {
    width: 100%;
    max-width: 500px;
  }

  .community-dashboard,
  .market-grid,
  .mission-grid {
    padding-bottom: 40px;
  }

  :is(a, button, input, select, textarea, summary) {
    -webkit-tap-highlight-color: transparent;
  }
}

@media (max-width: 390px) {
  .mobile-dock {
    right: 6px;
    left: 6px;
  }

  .mobile-dock a {
    font-size: 7.4px;
  }

  .page-head h1,
  .mission-head h1 {
    font-size: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-dock {
    transition: none !important;
  }
}
