﻿/* Shared responsive refinements for public pages, profiles, account forms and admin. */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

body {
  min-width: 320px;
}

.wrap,
.cms-layout,
.cms-main,
.panel,
.card,
.cms-card,
.observatory-table-card {
  min-width: 0;
}

img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
}

.tablewrap,
.cms-table-wrap,
.observatory-chart-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.data,
.cms-table {
  max-width: 100%;
}

.field,
input,
select,
textarea,
button,
.btn {
  max-width: 100%;
}

@media (max-width: 900px) {
  .navrow {
    min-width: 0;
  }

  .hamb {
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
  }

  .navlinks.open {
    display: flex !important;
    z-index: 95;
    box-shadow: 0 18px 35px #0008;
  }

  .rightnav {
    min-width: 0;
  }

  .cms-admin-page .cms-layout {
    display: block;
    min-width: 0;
  }

  .cms-admin-page .cms-side {
    position: relative;
    width: 100%;
    height: auto;
    overflow: visible;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--obs-line);
  }

  .cms-admin-page .cms-side nav {
    display: flex;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .cms-admin-page .cms-side nav a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .cms-admin-page .cms-main {
    min-width: 0;
  }
}

@media (max-width: 700px) {
  .wrap {
    padding-inline: 14px;
  }

  .pagehero .wrap,
  .content .wrap,
  .section .wrap {
    min-width: 0;
  }

  .pagehero {
    padding-block: 38px 34px;
  }

  .pagehero h1,
  .head h2,
  .profile-heading h1,
  .cms-top h1 {
    overflow-wrap: anywhere;
    line-height: 1.2;
  }

  .pagehero p,
  .head p {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .toolbar {
    width: 100%;
    min-width: 0;
  }

  .toolbar .field,
  .toolbar select.field,
  .toolbar input.field {
    width: 100%;
    min-width: 0;
    max-width: none;
    flex: 1 1 100%;
  }

  .row > .field {
    min-width: 0;
    max-width: 100%;
  }

  .tabs {
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    padding: 0 1px 7px;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .tabs .tab {
    flex: 0 0 auto;
    min-height: 42px;
    white-space: nowrap;
  }

  .grid2,
  .equipment-columns,
  .observatory-lower-grid,
  .cms-content-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .statusgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .statusbox,
  .rate,
  .account-wallet,
  .account-character-layout,
  .account-support-create,
  .account-password-form,
  .silk-checkout-form,
  .cms-fields {
    min-width: 0;
  }

  .data {
    min-width: 560px;
  }

  .cms-table {
    min-width: 600px;
  }

  .cms-admin-page .cms-main {
    padding: 18px 14px 38px;
  }

  .cms-admin-page .cms-fields,
  .cms-admin-page .cms-content-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cms-admin-page .cms-form label,
  .cms-admin-page .cms-form input:not([type="checkbox"]),
  .cms-admin-page .cms-form textarea,
  .cms-admin-page .cms-form select,
  .cms-admin-page .cms-inline input {
    min-width: 0;
    width: 100%;
  }

  .cms-admin-page .cms-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .cms-admin-page .cms-inline input {
    flex: 1 1 180px;
  }

  .cms-admin-page .cms-inline .btn {
    flex: 0 0 auto;
  }

  .cms-admin-page .cms-top > div:last-child {
    max-width: 100%;
  }

  .support-admin-ticket > header,
  .account-support-ticket > header {
    flex-wrap: wrap;
  }
}

@media (max-width: 600px) {
  .hero {
    min-height: 690px;
    background-position: 58% center;
  }

  .hero-inner {
    width: 100%;
    min-width: 0;
    padding: 20px 14px 190px;
  }

  .hero-inner > .overline {
    display: block;
    max-width: 100%;
    font-size: 9px;
    line-height: 1.6;
    letter-spacing: 1.8px;
    overflow-wrap: anywhere;
  }

  .hero-logo-wrap {
    display: block;
    width: min(100%, 360px);
    margin-inline: auto;
  }

  .hero h1 {
    max-width: 100%;
    font-size: clamp(22px, 7vw, 29px);
    line-height: 1.22;
    overflow-wrap: anywhere;
  }

  .hero p {
    width: 100%;
    max-width: 440px;
    padding-inline: 2px;
    font-size: 12px;
    line-height: 1.65;
    overflow-wrap: anywhere;
  }

  .hero-actions {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 9px;
  }

  .hero-actions > .btn,
  .hero-actions > .hero-register-stack {
    width: min(100%, 280px);
    min-width: 0;
    max-width: 100%;
    flex: 0 1 auto;
  }

  .hero-actions .btn.silkroad-cta-play,
  .hero-actions .btn.silkroad-cta-silk,
  .hero-register-stack > .silkroad-cta-register,
  .hero-register-stack .hero-discord-row .silkroad-cta-discord {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .hero-register-stack {
    align-items: stretch;
  }

  .hero-discord-row,
  .hero-register-stack > .hero-discord-row {
    width: 100%;
    min-width: 0;
  }

  .hero-stats .statrow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-updates .wrap {
    padding-inline: 10px;
  }

  .silk-package-grid,
  .news-cards,
  .vote-link-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .silk-package-buy {
    align-items: center;
    flex-wrap: wrap;
  }

  .silk-package-price {
    flex: 1 1 120px;
    white-space: normal;
    line-height: 1.25;
  }

  .silk-package-buy .btn.silk-package-action {
    width: 100%;
    flex: 1 1 100%;
  }

  .account-page-heading,
  .account-page-actions,
  .silk-shop-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .account-page-actions > *,
  .account-page-actions .btn,
  .account-bottom-actions > *,
  .account-bottom-actions .btn {
    width: 100%;
  }

  .account-wallet {
    grid-template-columns: minmax(0, 1fr);
  }

  .account-wallet > * {
    min-width: 0;
  }

  .account-wallet strong,
  .account-wallet span,
  .account-character-card,
  .account-character-layout,
  .account-data-empty,
  .account-support-ticket,
  .account-security {
    overflow-wrap: anywhere;
  }

  .support-rich-editor,
  .support-rich-content,
  .wys-editor {
    min-width: 0;
    max-width: 100%;
  }

  .support-rich-content img,
  .support-message-body img,
  .wys-editor img {
    max-width: 100%;
    height: auto;
  }

  .profile-viewer-wrap {
    max-width: 100%;
  }

  .unique-kill-banner,
  .unique-history-panel,
  .unique-card,
  .news-card,
  .announcement-slide {
    min-width: 0;
  }
}

@media (max-width: 420px) {
  .wrap {
    padding-inline: 11px;
  }

  .topline {
    padding-inline: 6px;
    text-align: center;
    line-height: 1.3;
  }

  .hero-inner {
    padding-inline: 11px;
  }

  .hero-actions > .btn,
  .hero-actions > .hero-register-stack {
    width: min(100%, 260px);
  }

  .hero-actions .btn.silkroad-cta-play {
    min-height: 56px;
    padding-inline: 9px;
  }

  .hero-cta-label {
    overflow-wrap: anywhere;
  }

  .statusgrid,
  .observatory-kpis,
  .cms-admin-page .cms-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel,
  .card,
  .cms-admin-page .cms-card,
  .observatory-table-card {
    padding: 13px;
  }

  .account-support-ticket-actions,
  .account-support-reply {
    grid-template-columns: minmax(0, 1fr);
  }

  .announcement-carousel {
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-actions .silkroad-cta-play,
  .hero-actions .silkroad-cta-silk,
  .hero-discord-row .silkroad-cta-discord {
    animation: none !important;
  }
}
