/* Phone / tablet only. Desktop rules in main.css stay as they are. */
@media (max-width: 1023px) {
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-x: none;
  }

  html.has-mobile-nav,
  body.has-mobile-nav {
    overflow: hidden;
    height: 100%;
    overscroll-behavior: none;
    touch-action: none;
  }

  a,
  button {
    touch-action: manipulation;
  }

  .site-header {
    padding-top: env(safe-area-inset-top, 0px);
  }

  .header-inner {
    height: 3.85rem;
    gap: 0.75rem;
    padding: 0 1rem;
  }

  .brand-mark img {
    width: 3.6rem;
    height: 2.35rem;
  }

  .menu-toggle {
    width: 2.85rem;
    height: 2.85rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    backdrop-filter: blur(12px);
  }

  .site-header.is-scrolled .menu-toggle {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
  }

  .menu-burger {
    position: relative;
    display: block;
    width: 16px;
    height: 12px;
  }

  .menu-burger i {
    position: absolute;
    left: 0;
    right: 0;
    height: 1.5px;
    border-radius: 99px;
    background: currentColor;
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), top 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s;
  }

  .menu-burger i:nth-child(1) { top: 0; }
  .menu-burger i:nth-child(2) { top: 5px; }
  .menu-burger i:nth-child(3) { top: 10px; }

  .menu-toggle[aria-expanded="true"] .menu-burger i:nth-child(1) {
    top: 5px;
    transform: rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] .menu-burger i:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle[aria-expanded="true"] .menu-burger i:nth-child(3) {
    top: 5px;
    transform: rotate(-45deg);
  }

  .mobile-nav {
    display: block;
    position: fixed;
    top: calc(3.85rem + env(safe-area-inset-top, 0px));
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    padding: 0;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
    background: rgba(10, 8, 24, 0.55);
    -webkit-backdrop-filter: blur(22px) saturate(1.35);
    backdrop-filter: blur(22px) saturate(1.35);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.38s ease, visibility 0.38s ease;
    border: 0;
  }

  .mobile-nav.is-open {
    display: block;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .mobile-nav-inner {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: auto;
    overflow: hidden;
    padding: 0.85rem 1.25rem 1.15rem;
  }

  .mobile-nav-kicker {
    margin-bottom: 0.45rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(238, 242, 255, 0.42);
  }

  .mobile-nav-inner > a {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.7rem;
    min-height: 0;
    padding: 0.62rem 0;
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    color: #fff;
    opacity: 0;
    transform: translateY(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .mobile-nav.is-open .mobile-nav-inner > a,
  .mobile-nav.is-open .mobile-nav-cta {
    opacity: 1;
    transform: none;
    transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1), transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: calc(80ms + var(--i, 0) * 55ms);
  }

  .mobile-nav-inner > a span {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: #7ec8ff;
  }

  .mobile-nav-cta {
    flex: 0 0 auto;
    margin-top: 0.85rem;
    opacity: 0;
    transform: translateY(16px);
  }

  .mobile-nav-cta .btn-lg {
    width: 100%;
  }

  .hero,
  .hero-top {
    min-height: 100svh;
    min-height: 100dvh;
  }

  .hero-top {
    align-items: flex-end;
    padding: calc(5.4rem + env(safe-area-inset-top, 0px)) 0 calc(4.4rem + env(safe-area-inset-bottom, 0px));
  }

  .hero-content {
    position: static;
    width: 100%;
    gap: 0.85rem;
    padding: 0 1rem 2.6rem;
  }

  .hero-logo-slot {
    top: calc(6.35rem + env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    z-index: 12;
    width: min(98vw, 470px);
    margin-inline: auto;
  }

  .hero-logo {
    max-height: 10.4rem;
  }

  .hero-content .js-hero-ip,
  .hero-content .hero-ctas {
    width: 100%;
    max-width: 22rem;
  }

  .hero-ctas {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .hero-ctas .btn-lg {
    width: 100%;
    height: 3.15rem;
    padding: 0 1.15rem;
  }

  .ip-card {
    width: 100%;
    padding: 0.45rem 0.45rem 0.45rem 1rem;
  }

  .ip-value {
    font-size: 0.92rem;
    word-break: break-all;
  }

  .ip-copy {
    min-width: 5.4rem;
    height: 2.55rem;
    padding: 0 0.75rem;
  }

  .scroll-hint {
    bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
  }

  .page-title {
    padding: 7.25rem 0 2rem;
  }

  .page-title h1 {
    font-size: clamp(2.1rem, 10vw, 2.75rem);
  }

  .wrap {
    padding: 0 1rem;
  }

  .cta-section,
  .cta-section.is-over-scene {
    padding: 2rem 0 calc(2.5rem + env(safe-area-inset-bottom, 0px));
  }

  body[data-page="home"] .cta-section.is-over-scene {
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  }

  body[data-page="home"] .hero::after {
    height: 13rem;
  }

  body[data-page="home"] .site-footer {
    margin-top: -2rem;
  }

  .cta-card,
  .cta-section.is-over-scene .cta-card {
    min-height: 0;
    padding: 2rem 1.15rem 1.7rem;
    border-radius: 1.25rem;
  }

  .cta-inner h2 {
    font-size: 1.7rem;
  }

  .cta-inner .hero-ctas {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-inner .btn-lg {
    width: 100%;
    height: 3.15rem;
  }

  .footer-body {
    padding-top: 2.5rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    padding-bottom: 2rem;
  }

  .footer-brand {
    grid-column: span 1;
  }

  .footer-wordmark .footer-logo-long {
    margin-left: 0;
    width: min(14rem, 78vw);
  }

  .footer-bar-inner {
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
    text-align: center;
  }

  .btn-lg,
  .btn-md {
    min-height: 2.75rem;
  }

  .card-soft-hover:hover,
  .hero-top .btn-bevel:hover,
  .cta-section.is-over-scene .btn-bevel:hover,
  .brand-mark:hover img,
  .footer-wordmark:hover img {
    transform: none;
  }

  body[data-page="store"] .page-title {
    padding: 7.25rem 0 1.1rem;
  }

  .store-heading {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .store-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
  }

  .store-tools {
    margin-left: 0;
    justify-content: flex-end;
  }

  .store-tools .btn-bevel {
    flex: 0 1 auto;
  }

  .store-blend {
    height: 7rem;
    margin: 1rem 0 0;
  }

  body[data-page="store"] .cta-section {
    padding-top: 2.75rem;
  }

  .store-art {
    height: 16.75rem;
  }

  .pack-modal-art { min-height: 14.5rem; }

  .store-coupon,
  .store-coupon-form {
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
  }

  .pack-modal {
    padding: 0.75rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    align-items: end;
  }

  .pack-modal-card {
    max-height: min(92dvh, 52rem);
    overflow: auto;
  }

  .store-cart {
    width: 100%;
  }

  .store-fab {
    right: 0.85rem;
    bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
  }

  .store-modal {
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }

  .store-modal-card input,
  .store-coupon-form input,
  .store-cart-coupon input {
    font-size: 16px;
  }

  .vote-card {
    flex-wrap: wrap;
  }

  .vote-go {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }

  .info-grid {
    margin-top: 2rem;
  }

  .toast {
    left: 1rem;
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    width: auto;
    transform: translateY(20px);
  }

  .toast.is-on {
    transform: translateY(0);
  }

  .clicker-bar {
    top: calc(4.15rem + env(safe-area-inset-top, 0px));
    width: calc(100% - 1rem);
    gap: 0.4rem;
    padding: 0.35rem 0.4rem;
  }

  .clicker-ident small { display: none; }
  .clicker-bank small { font-size: 0.6rem; }
  .clicker-bank strong { font-size: 1.05rem; }
  .clicker-mode { padding: 0 0.7rem; height: 1.85rem; font-size: 0.85rem; }

  .clicker-drawer {
    top: auto;
    left: 0.6rem;
    right: 0.6rem;
    bottom: calc(4.4rem + env(safe-area-inset-bottom, 0px));
    width: auto;
    z-index: 12;
  }

  .clicker-drawer.is-left,
  .clicker-drawer.is-right {
    left: 0.6rem;
    right: 0.6rem;
  }

  .clicker-drawer-panel {
    width: 100%;
    max-height: 0;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
  }

  .clicker-drawer.is-wide .clicker-drawer-panel,
  .clicker-drawer.is-open .clicker-drawer-panel {
    width: 100%;
  }

  .clicker-drawer.is-open .clicker-drawer-panel {
    max-height: min(66vh, 34rem);
    background: rgba(12, 8, 34, 0.86);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  }

  .clicker-drawer-hit { display: none; }
  .clicker-drawer-body { max-height: min(66vh, 34rem); }

  .clicker-goldcast {
    top: 54%;
  }

  .clicker-goldcast strong { font-size: 1.7rem; }
  .clicker-goldwatch { width: 3.5rem; height: 3.5rem; }

  .clicker-dock {
    display: flex;
    position: absolute;
    left: 50%;
    bottom: calc(0.7rem + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    gap: 0.4rem;
    padding: 0.3rem;
    border-radius: 999px;
    background: rgba(12, 8, 34, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(14px);
  }

  .clicker-dock button {
    height: 2.3rem;
    padding: 0 0.95rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
  }

  body[data-clicker-sheet="shop"] .clicker-dock [data-sheet="shop"],
  body[data-clicker-sheet="run"] .clicker-dock [data-sheet="run"],
  body:not([data-clicker-sheet="shop"]):not([data-clicker-sheet="run"]) .clicker-dock [data-sheet=""] {
    background: #365FFF;
  }

  .clicker-about { padding: 2rem 0 0.5rem; }
  .clicker-about-grid { grid-template-columns: 1fr; }

  .clicker-chip { bottom: 24%; }

  .site-radio {
    left: max(0.7rem, env(safe-area-inset-left, 0px));
    bottom: max(0.85rem, env(safe-area-inset-bottom, 0px));
    width: min(26.5rem, calc(100vw - 1.4rem));
    grid-template-columns: 3.6rem minmax(0, 1fr) auto;
    gap: 0.65rem;
    padding: 0.65rem 0.7rem;
  }

  .site-radio-art {
    width: 3.6rem;
    height: 3.6rem;
  }

  .site-radio-meta strong { font-size: 1rem; }

  .site-radio-vol-slide {
    grid-template-columns: 4.4rem 1.55rem;
  }

  body[data-page="clicker"] .site-radio {
    bottom: calc(5.2rem + env(safe-area-inset-bottom, 0px));
  }

  .clicker-over {
    top: 10%;
    width: calc(100% - 1.4rem);
  }

  .clicker-over-card strong { font-size: 1.55rem; letter-spacing: 0.05em; }
  .clicker-over-card .clicker-stat { padding: 0 1rem; }
  .clicker-forge-view { height: 13.5rem; }
  .clicker-totem-banner { font-size: 1.25rem; }
}

@media (max-width: 430px) {
  .site-radio {
    grid-template-columns: 3.2rem minmax(0, 1fr);
    width: calc(100vw - 1.2rem);
  }

  .site-radio-side {
    grid-column: 1 / -1;
    width: 100%;
    justify-items: stretch;
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .site-radio-vol { justify-content: end; }

  .hero-logo-slot {
    top: calc(6.15rem + env(safe-area-inset-top, 0px));
    width: min(98vw, 440px);
  }

  .hero-logo {
    max-height: 9.8rem;
  }

  .hero-content {
    padding-bottom: 2.1rem;
  }
}
