/* Mobile layouts come after the desktop skin. Keep the crimson palette intact. */
@media (max-width: 900px) {
  :root { --page-gutter: clamp(16px, 4.5vw, 30px); }
  body { padding: 0; }
  .stage { border: 0; border-radius: 0; }
  .header { gap: 12px; }
  .header > *, .section-page, .section-content { min-width: 0; }
  .section-heading h1 { overflow-wrap: anywhere; }
  .inner-page .stage {
    padding: calc(20px + env(safe-area-inset-top, 0px)) max(var(--page-gutter), env(safe-area-inset-right, 0px)) calc(45px + env(safe-area-inset-bottom, 0px)) max(var(--page-gutter), env(safe-area-inset-left, 0px));
  }
  .inner-page .header { position: relative; inset: auto; }
  .inner-page .section-page { margin-top: 30px; }
  .page-back { min-height: 44px; font-size: 13px; margin-bottom: 20px; }
  .section-heading { margin-bottom: 30px; }
  .section-intro { font-size: 15px; line-height: 1.7; }
  .filter-bar { gap: 24px; padding: 3px; margin-inline: -3px; scrollbar-width: thin; overscroll-behavior-x: contain; }
  .filter-bar button { min-height: 48px; padding: 12px 4px 15px; font-size: 15px; }
  .section-action { min-height: 46px; font-size: 14px; }
  .edition-name, .edition-winner, .edition-winner > span { min-width: 0; }
  .edition-winner b, .match-team > span { overflow-wrap: anywhere; }
  .edition-content { min-width: 0; }
  .bracket-scroll { max-width: 100%; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: 10px; padding-bottom: 12px; }
  .bracket-round { min-width: 0; scroll-snap-align: start; }
  .edition-bottom { flex-wrap: wrap; gap: 10px 24px; }
  .catalog-controls { grid-template-columns: minmax(0, 1fr) 130px 180px; }
  .catalog-search input, .catalog-select select, .catalog-sort select { font-size: 16px; }
  .catalog-select, .catalog-sort { min-width: 0; }
  .catalog-select > span { font-size: 12px; }
  .catalog-formats button { min-height: 48px; font-size: 14px; }
  .catalog-sort select { min-height: 44px; width: 185px; }
  .catalog-sort { padding-bottom: 6px; }
  .team-summary-copy, .team-honours, .team-summary-copy > strong, .player-copy, .streamer-meta { min-width: 0; overflow-wrap: anywhere; }
  .team-summary-copy > strong { line-height: 1.3; }
  .roster-toolbar { flex-wrap: wrap; gap: 4px 15px; }
  .player-copy p, .player-copy > span { font-size: 13px; line-height: 1.5; }
  .player-copy h3 { font-size: 15px; line-height: 1.4; }
  .player-photo { height: auto; aspect-ratio: 3 / 4; }
  .streamer-description { min-height: 0; font-size: 15px; line-height: 1.7; }
  .streamer-name, .streamer-link { font-size: 14px; }
  .streamer-link { min-height: 52px; }
  .streamer-portrait { height: auto; aspect-ratio: 4 / 5; }
  .streamer-platform { top: 14px; left: 14px; max-width: calc(50% - 20px); }
  .streamer-game { top: 16px; right: 14px; max-width: calc(50% - 20px); text-align: right; overflow-wrap: anywhere; }
  .rules-layout, .rules-sections { min-width: 0; }
  .rule-section h3, .rule-section > p { overflow-wrap: anywhere; }
  .rule-section summary { min-height: 66px; }
  .rule-section h3 { font-size: 16px; }
  .rule-section > p, .rules-notice { font-size: 15px; }
  .album-heading { flex-wrap: wrap; }
  .album-heading h2 { overflow-wrap: anywhere; }
  .values-list p { font-size: 15px; }
  .dialog-close { width: 44px; height: 44px; }
  .detail-dialog { max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
  .lightbox-nav button { min-width: 85px; min-height: 46px; }
}

/* Short, independently scrollable navigation inside a wide arc. */
@media (max-width: 900px), (pointer: coarse) {
  .navigation { width: min(410px, calc(100vw - 16px)); height: 100dvh; --menu-icon: 50px; --menu-label: 20px; --menu-gap: 17px; --menu-row: 62px; }
  .arc-surface { clip-path: url(#mobile-menu-clip); }
  .arc-border-desktop { display: none; }
  .arc-border-mobile { display: block; }
  .nav-content {
    width: 100%; height: 100%; display: flex; flex-direction: column; overflow: hidden;
    padding: calc(16px + env(safe-area-inset-top, 0px)) 40px calc(12px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
  }
  .menu-close { width: 44px; height: 44px; margin-bottom: 18px; flex: 0 0 44px; }
  .menu-close span, .menu-close span + span { left: 12px; top: 21px; }
  .nav-brand.wordmark { font-size: 19px; line-height: 1.15; margin-bottom: 18px; flex-shrink: 0; }
  .nav-links { flex: 0 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; gap: 4px; padding: 4px 4px 8px; margin: -4px; scrollbar-width: none; overscroll-behavior-y: contain; }
  .nav-link { grid-template-columns: 42px minmax(0, 1fr); gap: 14px; width: min(268px, 100%); min-height: 50px; flex: 0 0 auto; padding: 4px 16px 4px 0; }
  .nav-link strong { font-size: 15px; line-height: 1.35; }
  .nav-icon { width: 42px; height: 42px; min-width: 42px; min-height: 42px; }
  .nav-icon svg { width: 21px; height: 21px; }
  .nav-link:after { right: 5px; width: 8px; }
  .languages { flex-shrink: 0; gap: 12px; margin-top: 12px; }
  .languages button { min-width: 44px; min-height: 44px; font-size: 13px; padding: 8px; }
  .nav-sculpture { opacity: .4; bottom: -2%; height: 30%; }
  .menu-open .navigation { filter: none; }
  .round-button, .join-button, .register-button { min-height: 44px; }
}
.arc-border-mobile { display: none; }
@media (max-width: 900px), (pointer: coarse) { .arc-border-mobile { display: block; } }
.menu-scroll-locked { position: fixed; top: var(--menu-scroll-offset, 0px); left: 0; right: 0; width: 100%; }

@media (max-width: 600px) {
  .header { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
  .header .wordmark { font-size: clamp(12px, 3.3vw, 16px); letter-spacing: .03em; }
  .header-right { margin: 0; }
  .header .register-button { padding: 10px 12px; min-height: 44px; font-size: 12px; gap: 8px; }
  .header .register-button svg { width: 15px; height: 15px; }
  .menu-toggle { width: 44px; height: 44px; }
  body[data-page="home"] .stage {
    display: flex; flex-direction: column; min-height: 100svh; height: auto;
    padding: calc(88px + env(safe-area-inset-top, 0px)) var(--page-gutter) calc(28px + env(safe-area-inset-bottom, 0px));
  }
  body[data-page="home"] .header { top: calc(18px + env(safe-area-inset-top, 0px)); left: max(var(--page-gutter), env(safe-area-inset-left, 0px)); right: max(var(--page-gutter), env(safe-area-inset-right, 0px)); }
  .hero { position: relative; inset: auto; transform: none; width: 100%; margin: clamp(140px, 24svh, 235px) auto 45px; }
  .hero h1 { font-size: clamp(48px, 13vw, 78px); line-height: 1.02; letter-spacing: -.035em; }
  .hero h1 .matmech { font-size: .84em; margin-top: 9px; }
  .hero-description { font-size: 17px; line-height: 1.5; margin-top: 25px; }
  .hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 28px; }
  .hero-actions .join-button { min-width: 0; width: 100%; min-height: 50px; padding: 13px 10px; font-size: 13px; gap: 10px; }
  .scene { background-position: 55% 25%; background-size: auto 100%; transform: none; will-change: auto; }
  .scene-shade { background: linear-gradient(0deg, #060708e8, #06070855 40%, transparent 76%); }
  .footer { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .arena-corners { inset: 10px; }
  .grain { opacity: .028; }
  .inner-page .scene { background-position: 56% top; }
  .inner-page .section-page { margin-top: 22px; }
  .page-back { margin-bottom: 16px; }
  .section-heading h1 { font-size: clamp(32px, 8.6vw, 48px); line-height: 1.15; letter-spacing: -.045em; }
  .section-intro { margin-top: 14px; padding: 0; }
  .demo-note { font-size: 12px; margin-bottom: 20px; }
  .tournament-edition > summary { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 24px; gap: 12px; }
  .edition-year { grid-column: 1; grid-row: 1; }
  .edition-name { grid-column: 1; grid-row: 2; }
  .edition-winner { grid-column: 2; grid-row: 1 / 3; }
  .tournament-edition > summary > .details-plus { grid-column: 3; grid-row: 1 / 3; }
  .edition-name strong { font-size: 22px; }
  .edition-name > span, .edition-winner small { font-size: 12px; line-height: 1.6; }
  .edition-winner b { font-size: 16px; }
  .edition-winner { gap: 8px; }
  .edition-winner > svg { flex-shrink: 0; width: 21px; height: 21px; }
  .edition-content { padding: 0 10px 16px; }
  .bracket { min-width: 0; width: max-content; grid-template-columns: repeat(var(--rounds), minmax(210px, 245px)); gap: 44px; padding-inline: 3px; }
  .bracket-round h3 { font-size: 14px; }
  .match-team { font-size: 14px; }
  .edition-bottom .section-action { font-size: 13px; }
  .catalog-controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .catalog-search { grid-column: 1 / -1; padding-inline: 14px; }
  .catalog-search input { height: 54px; }
  .catalog-select { padding: 10px 12px; min-height: 66px; }
  .catalog-select select { width: 100%; }
  .catalog-tools { margin-top: 20px; }
  .catalog-formats { width: 100%; gap: 22px; }
  .catalog-formats button { padding-bottom: 14px; }
  .catalog-sort { padding: 6px 0; width: 100%; }
  .catalog-sort > span { font-size: 12px; }
  .catalog-count { font-size: 13px; }
  .team-summary { grid-template-columns: 52px minmax(0, 1fr) 22px; padding: 16px 13px; gap: 10px 12px; }
  .team-summary .team-emblem { width: 52px; height: 60px; font-size: 36px; }
  .team-summary-copy > strong { font-size: clamp(18px, 5.2vw, 24px); }
  .team-summary-copy > span { font-size: 12px; line-height: 1.5; }
  .team-honours { font-size: 12px; }
  .team-roster { padding: 5px 12px 24px; }
  .roster-toolbar h2 { font-size: 14px; }
  .roster-toolbar .section-action { font-size: 13px; }
  .player-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  .player-photo { height: auto; aspect-ratio: 3 / 4; }
  .player-copy { padding-top: 13px; }
  .portrait-placeholder > span { font-size: 12px; }
  .catalog-pagination { gap: 12px; }
  .catalog-pagination .join-button { min-width: 95px; min-height: 48px; padding: 10px 12px; }
  .streamer-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .streamer-card:last-child { max-width: none; grid-column: auto; }
  .streamer-card:nth-child(2) { margin: 0; }
  .streamer-portrait { height: auto; aspect-ratio: 1 / 1.05; }
  .streamer-meta { padding: 24px 20px 0; }
  .streamer-meta h2 { font-size: 28px; line-height: 1.2; }
  .streamer-description { margin-top: 18px; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: clamp(125px, 34vw, 200px); gap: 10px; }
  .photo-grid > :first-child { grid-column: span 2; grid-row: span 2; }
  .photo-grid > :nth-child(4) { grid-row: span 1; }
  .photo-grid > :nth-child(6) { grid-column: span 2; }
  .album-heading > span { font-size: 13px; line-height: 1.6; }
  .album-cover-title { font-size: clamp(48px, 15vw, 78px); left: 22px; bottom: 24px; }
  .rules-layout { grid-template-columns: minmax(0, 1fr); margin-top: 25px; gap: 32px; }
  .rules-cover { min-height: 215px; padding: 25px; margin-right: 8px; }
  .rules-cover h2 { font-size: 49px; }
  .rules-cover > p, .rules-pending { font-size: 14px; }
  .rule-section summary { gap: 12px; padding-block: 20px; }
  .rule-section > p { padding: 0 5px 24px 29px; line-height: 1.8; }
  .rule-number { font-size: 13px; }
  .news-coming { min-height: 350px; padding: 30px 12px; }
  .news-coming p { font-size: 15px; line-height: 1.7; }
  .about-intro { padding-block: 27px; }
  .about-intro > p { font-size: 22px; }
  .values-list { gap: 28px; }
  .detail-dialog { width: calc(100% - 24px); padding: 65px 20px 25px; }
  .detail-dialog.is-photo[open] { display: flex; flex-direction: column; }
  .detail-dialog.is-photo {
    width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0;
    padding: calc(70px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  }
  .is-photo .dialog-close { top: calc(14px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); }
  .detail-dialog.is-photo h2 { font-size: 16px; line-height: 1.5; margin-bottom: 16px; overflow-wrap: anywhere; }
  .is-photo #dialog-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
  .lightbox-image { flex: 1; width: 100%; min-height: 0; max-height: 100%; object-fit: contain; touch-action: pan-y pinch-zoom; }
  .lightbox-nav { flex-shrink: 0; margin-top: 16px; }
}

@media (max-width: 360px) {
  .header { gap: 9px; }
  .header .register-button { font-size: 11px; padding-inline: 10px; }
  .header .register-button svg { display: none; }
  .hero-actions .join-button { font-size: 12px; gap: 7px; }
  .hero-actions .join-button svg { width: 16px; }
  .nav-content { padding-left: 16px; padding-right: 32px; }
  .navigation { --menu-icon: 46px; --menu-label: 18px; --menu-gap: 14px; --menu-row: 58px; }
  .nav-link strong { font-size: 14px; }
  .catalog-formats { gap: 17px; }
  .player-copy h3 { font-size: 14px; }
  .edition-winner > svg { display: none; }
}

@media (max-height: 500px) and (max-width: 1000px) and (orientation: landscape) {
  body[data-page="home"] .stage { min-height: 500px; height: auto; padding: 110px 30px 50px; }
  .hero { position: relative; inset: auto; transform: none; width: min(520px, 100%); margin: 35px auto 25px; }
  .hero h1 { font-size: 58px; }
  .hero-description { margin-top: 20px; }
  .hero-actions { margin-top: 20px; }
  .nav-content { padding-top: max(12px, env(safe-area-inset-top, 0px)); padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)); }
  .menu-close { margin-bottom: 12px; }
  .nav-brand.wordmark { display: none; }
  .languages { margin-top: 8px; }
}

@media (hover: none) and (pointer: coarse) {
  .streamer-card:hover, .register-button:hover, .join-button:hover { transform: none; }
  .player-card:hover .player-photo > img, .streamer-card:hover .streamer-portrait > img, .album-photo:hover img { transform: none; }
  .register-button:active, .join-button:active { background: #681e18; }
  .scene { transform: none; will-change: auto; }
}
