/* =====================================================
   SOE LAYOUT FIX — 3-column grid, overflow containment
   Loaded last. Overrides float layout that wraps the
   right column under Latest News on every screen width.
   ===================================================== */

html {
  box-sizing: border-box;
  overflow-x: hidden;
  max-width: 100%;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

html,
body {
  max-width: 100%;
}

body,
body.karmia-dark {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: #0c0c0e !important;
  background-image:
    radial-gradient(ellipse 90% 55% at 50% -10%, #2a2a30 0%, transparent 58%),
    radial-gradient(ellipse 70% 45% at 50% 110%, #16161a 0%, transparent 55%),
    linear-gradient(180deg, #18181c 0%, #101014 42%, #0a0a0c 100%) !important;
  background-repeat: no-repeat !important;
  background-position: center top !important;
  background-size: cover !important;
  background-attachment: fixed !important;
}

/* Soft vignette — art blends into page, no hard frame */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 50% 40% at 50% 22%, rgba(0, 0, 0, 0.05) 0%, transparent 65%),
    radial-gradient(ellipse 100% 100% at 50% 40%, transparent 42%, rgba(0, 0, 0, 0.7) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0.05) 28%, rgba(0, 0, 0, 0.55) 100%);
}

body > * {
  position: relative;
  z-index: 1;
}

/* Restore content-box only where decorative pixel borders need it */
.news_headline,
.news_body {
  box-sizing: border-box;
}

/* ── MAIN SHELL ── */
.container {
  display: grid !important;
  grid-template-columns: 210px minmax(0, 1fr) 210px;
  column-gap: 20px;
  row-gap: 8px;
  align-items: start;
  width: 100% !important;
  max-width: 1480px !important;
  margin: 28px auto 48px auto !important;
  padding: 0 16px !important;
  position: relative;
  z-index: 1;
  float: none !important;
}

.container > [style*="clear"] {
  display: none;
}

.container_left,
.container_mid,
.container_right {
  float: none !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  position: relative;
  min-width: 0;
  text-align: center;
}

.container_mid {
  min-height: 200px;
}

/* ── CENTER PANEL ── */
.xContainer {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  margin-top: 0 !important;
  margin-left: 0 !important;
  min-width: 0;
}

.xContainer_header_title {
  display: block;
  margin: 0 auto;
  padding: 0 12px;
  color: var(--m-text, #ececec);
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 32px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 48px);
}

.xContainer_inner {
  width: calc(100% - 12px) !important;
  max-width: calc(100% - 12px) !important;
  margin: 0 6px !important;
  padding: 18px 22px 20px 22px !important;
  box-sizing: border-box !important;
  min-width: 0;
  overflow-x: hidden;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.xContainer_inner img,
.xContainer_inner svg,
.xContainer_inner video,
.xContainer_inner iframe,
.xContainer_inner canvas,
.xContainer_inner embed {
  max-width: 100% !important;
  height: auto !important;
}

.xContainer_inner img.char-outfit-img {
  width: 96px !important;
  height: 96px !important;
  max-width: none !important;
  max-height: none !important;
}

.xContainer_inner table {
  max-width: 100%;
}

.xContainer_inner:has(.hs-page) {
  overflow-x: auto !important;
}

.xContainer_inner:has(.hs-page) table.hs-table {
  max-width: none;
}

.xContainer_inner pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
}

/* ── NEWS ── */
.NewsHeadline,
.news_item {
  width: 100%;
  max-width: 100%;
  margin-top: 22px;
  overflow: hidden;
}

.news_item:first-child,
.NewsHeadline:first-child {
  margin-top: 0;
}

.news_headline,
.NewsHeadlineBackground {
  width: 100% !important;
  min-height: 40px;
  height: auto !important;
  padding: 10px 16px !important;
  box-sizing: border-box !important;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  background: linear-gradient(90deg, #222 0%, #161616 100%);
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.news_headline_inner {
  width: 100%;
  height: auto;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
}

.news_title,
.NewsHeadlineText,
.NewsHeadlineDate {
  float: none !important;
  position: static !important;
  width: auto !important;
  color: var(--m-text, #ececec);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.NewsHeadlineIcon {
  position: static !important;
  width: 16px;
  height: 16px;
  margin: 0 6px 0 0;
  flex-shrink: 0;
}

.news_author,
.NewsHeadlineAuthor {
  float: none !important;
  position: static !important;
  margin: 0 !important;
  height: auto;
  font-size: 11px;
  color: #8a8070;
  margin-left: auto !important;
}

.news_body {
  width: 100% !important;
  padding: 16px 14px !important;
  box-sizing: border-box !important;
  overflow-wrap: break-word;
}

.news_body img,
.NewsHeadline + table img {
  max-width: 100% !important;
  height: auto !important;
}

.news_comments {
  text-align: right;
  margin: 8px 4px 0;
  font-size: 13px;
}

.news-tickers {
  margin-bottom: 14px;
}

#tickersList {
  padding: 4px 8px;
  color: var(--m-text2, #b5b5b5);
  font-size: 13px;
  text-align: left;
}

.ticker-row {
  margin-bottom: 6px;
  overflow-wrap: break-word;
}

.ticker-date {
  color: var(--m-accent, #cfcfcf);
  font-weight: bold;
  margin-right: 6px;
}

/* ── SIDEBARS ── */
.container .sidebar-box-container {
  width: 100%;
  max-width: 210px;
  margin-left: auto;
  margin-right: auto;
}

.container .sidebar-box-container img {
  max-width: 100%;
}

.container .sidebar-box-container-header,
.container .sidebar-box-container-header-thin {
  width: 210px;
  max-width: calc(100% + 10px);
}

#topPlayers,
.menu_panel,
#statsPanel,
#accountPanel,
#streamWidget,
#casts,
#worldChanges {
  max-width: 100%;
  overflow: hidden;
}

#discordWidget {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 16px 12px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  background-image: none;
}

#top_bar {
  width: 100%;
  height: 48px;
  margin-bottom: 8px;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

.top_bar_icon {
  float: none !important;
}

/* ── FOOTER ── */
#footer {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

#footer_container {
  width: 100% !important;
  max-width: 1480px;
  height: auto !important;
  min-height: 80px;
  padding: 16px 12px;
  box-sizing: border-box;
}

#footer_info {
  width: 100% !important;
  height: auto !important;
  float: none !important;
}

#footer_info_inner {
  font-size: 15px;
  padding: 0 12px;
  overflow-wrap: anywhere;
}

/* ── FORMS / ACCOUNT ── */
.am-wrap {
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.am-main {
  min-width: 0;
  width: 100%;
  overflow: visible;
}

.reg-wrapper,
.login-wrap {
  max-width: 100%;
}

.xContainer_inner input[type="text"],
.xContainer_inner input[type="password"],
.xContainer_inner input[type="email"],
.xContainer_inner input[type="number"],
.xContainer_inner textarea,
.xContainer_inner select {
  max-width: 100% !important;
}

/* ── TABLE SCROLL ── */
.xContainer_inner .dataTables_wrapper {
  overflow-x: auto;
  max-width: 100%;
}

/* ── W3 CONFLICTS ── */
.container a {
  color: var(--m-text, #ececec);
}

.menu_title,
.nav_section a,
.topPlayers_name a {
  color: var(--m-text2, #b5b5b5);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 1320px) {
  .container {
    grid-template-columns: 190px minmax(0, 1fr);
    max-width: 1180px !important;
  }

  .container_right {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px 22px;
    margin-top: 12px !important;
  }

  .container_right .sidebar-box-container {
    flex: 0 0 200px;
  }
}

@media (max-width: 820px) {
  .container {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 16px !important;
    padding: 0 10px !important;
  }

  .container_left,
  .container_right {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px 22px;
  }

  .container_left .sidebar-box-container,
  .container_right .sidebar-box-container {
    flex: 0 0 220px;
  }

  #top_bar {
    justify-content: center;
    margin-bottom: 12px;
  }

  .xContainer_inner {
    padding: 12px 10px 16px 10px !important;
  }

  .am-wrap {
    flex-direction: column;
  }

  .am-sidebar {
    width: 100% !important;
  }

  .skullArt_separator {
    display: none;
  }

  body {
    background-attachment: scroll !important;
  }
}

@media (max-width: 480px) {
  .news_headline,
  .NewsHeadlineBackground {
    flex-direction: column;
    align-items: flex-start;
  }

  .news_author,
  .NewsHeadlineAuthor {
    margin-left: 0 !important;
  }

  #footer_info_inner {
    font-size: 13px;
  }
}


/* Transparent logo — greyer + larger, title kept readable */
body.karmia-dark::after {
  content: "";
  position: fixed;
  left: 50%;
  top: 0;
  width: min(1040px, 98vw);
  height: 430px;
  transform: translateX(-50%);
  z-index: 0;
  pointer-events: none;
  background: url(img/bg_karmia.png?v=15) center center / contain no-repeat;
  opacity: 0.98;
  /* stronger grey look, light enough for KARMIA.ONLINE */
  filter: grayscale(0.85) saturate(0.15) contrast(1.08) brightness(0.94);
  /* soft edge only — do not crop lower text */
  mask-image: radial-gradient(ellipse 82% 88% at 50% 48%, #000 58%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 82% 88% at 50% 48%, #000 58%, transparent 100%);
}

.karmia-hero { display: none !important; }

/* room for stone + KARMIA.ONLINE + TEST SERVER */
body.karmia-dark .container {
  padding-top: 410px !important;
  position: relative;
  z-index: 1;
}

@media (max-width: 900px) {
  body.karmia-dark::after {
    top: 0;
    height: 320px;
    width: min(720px, 100vw);
    opacity: 0.96;
  }
  body.karmia-dark .container {
    padding-top: 310px !important;
  }
}

/* Menu without icons */
.menu_icon {
  display: none !important;
}
.menu_title {
  width: 100% !important;
  margin-left: 0 !important;
  float: none !important;
}
.menu_row_inner {
  display: flex !important;
  align-items: center !important;
  height: auto !important;
  min-height: 18px;
}

/* Hide footer skeleton art */
#footer_skull {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  background: none !important;
}


/* ── Downloads page centered layout ── */
.dl-page--centered {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
  padding: 4px 8px 20px;
}

.dl-page--centered .dl-heading,
.dl-page--centered .hs-heading {
  text-align: center;
}

.dl-page--centered .dl-heading h2,
.dl-page--centered .hs-heading h2 {
  text-align: center !important;
  width: 100%;
}

.dl-page--centered .dl-lead {
  text-align: center;
  max-width: 520px;
  margin: 0 auto 22px;
  line-height: 1.65;
}

.dl-page--centered .dl-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

.dl-page--centered .dl-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  margin: 0;
  padding: 26px 22px 24px;
}

.dl-page--centered .dl-hero-copy {
  width: 100%;
  max-width: 420px;
}

.dl-page--centered .dl-hero-copy h3 {
  text-align: center !important;
}

.dl-page--centered .dl-cta {
  margin: 0 auto;
}

.dl-page--centered .dl-hero-meta {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  text-align: left;
}

.dl-page--centered .dl-panel--extras,
.dl-page--centered .dl-panel {
  width: 100%;
  margin: 0 auto;
  text-align: left;
}

.dl-page--centered .dl-extras {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.dl-page--centered .dl-link-row {
  text-align: left;
}

@media (min-width: 560px) {
  .dl-page--centered .dl-extras {
    grid-template-columns: 1fr 1fr;
  }
  .dl-page--centered .dl-link-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-height: 72px;
  }
}


/* ── Server Info centered layout ── */
.si-page--centered {
  max-width: 760px;
  margin: 0 auto;
  padding: 4px 8px 22px;
  text-align: center;
}

.si-page--centered .si-heading h2,
.si-page--centered .hs-heading h2 {
  text-align: center !important;
  width: 100%;
}

.si-page--centered .si-lead {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 16px;
}

.si-page--centered .si-quick {
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.si-page--centered .si-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  text-align: left;
}

.si-page--centered .dl-panel {
  width: 100%;
  margin: 0;
}

.si-page--centered .si-rates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
}

@media (max-width: 560px) {
  .si-page--centered .si-rates {
    grid-template-columns: 1fr;
  }
}
