/* YGORDONA: mobile server cards — stable named grid areas.
   Desktop styles and the existing player modal / click handler are untouched. */
@media screen and (max-width: 767.98px) {
  html body .wapper .monitoring #servers .server {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto 150px auto auto auto !important;
    grid-auto-flow: row !important;
    align-content: start !important;
    column-gap: 0 !important;
    row-gap: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 15px !important;
    float: none !important;
    position: relative !important;
    left: auto !important;
    transform: none !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    overflow: hidden !important;
    justify-self: stretch !important;
    border: 1px solid rgba(174,91,255,.78) !important;
    border-bottom: 2px solid rgba(174,91,255,.95) !important;
    border-radius: 17px !important;
    background: linear-gradient(135deg,rgba(31,31,55,.96),rgba(24,27,48,.94)) !important;
    box-shadow: 0 7px 22px rgba(0,0,0,.30),0 0 13px rgba(139,55,255,.17) !important;
  }

  html body .wapper .monitoring #servers {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-flow: row !important;
    align-items: stretch !important;
    gap: 14px !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 14px !important;
    overflow: visible !important;
    white-space: normal !important;
    box-sizing: border-box !important;
  }

  html body .wapper .monitoring {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 0 0 22px !important;
    padding: 0 !important;
    text-align: left !important;
  }

  html body .wapper .monitoring #servers .server h3 {
    grid-area: auto !important;
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
    margin: 0 0 12px !important;
    padding: 0 !important;
    color: #eee9ff !important;
    font-size: 17px !important;
    line-height: 1.25 !important;
    font-weight: 800 !important;
    letter-spacing: .1px !important;
    white-space: normal !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-shadow: 0 1px 5px rgba(0,0,0,.45) !important;
  }

  html body .wapper .monitoring #servers .server .map-image {
    grid-area: auto !important;
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    position: static !important;
    width: 100% !important;
    height: 150px !important;
    min-width: 0 !important;
    min-height: 150px !important;
    max-width: 100% !important;
    max-height: 150px !important;
    margin: 0 0 12px !important;
    border-radius: 12px !important;
    background-size: cover !important;
    background-position: center !important;
    box-shadow: 0 3px 10px rgba(0,0,0,.30) !important;
  }

  html body .wapper .monitoring #servers .server > p {
    position: static !important;
    grid-area: auto !important;
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 0 9px !important;
    padding: 0 !important;
    color: #d4c9ed !important;
    font-size: 15px !important;
    line-height: 1.35 !important;
    font-weight: 600 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    text-overflow: clip !important;
  }

  html body .wapper .monitoring #servers .server > p.server-map-name {
    grid-area: auto !important;
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
    color: #d4c9ed !important;
  }

  html body .wapper .monitoring #servers .server > p.server-player-count {
    grid-area: auto !important;
    grid-column: 1 / -1 !important;
    grid-row: 4 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 5 !important;
    width: 100% !important;
    min-height: 38px !important;
    height: auto !important;
    margin: 2px 0 12px !important;
    padding: 8px 10px !important;
    box-sizing: border-box !important;
    color: #f0d28a !important;
    font-size: 16px !important;
    line-height: 1.35 !important;
    font-weight: 800 !important;
    text-align: center !important;
    white-space: normal !important;
    overflow: visible !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    background: rgba(240,210,138,.08) !important;
    border: 1px solid rgba(240,210,138,.28) !important;
    border-radius: 9px !important;
  }

  html body .wapper .monitoring #servers .server > p.server-address {
    grid-area: auto !important;
    grid-column: 1 / -1 !important;
    grid-row: 5 !important;
    margin-bottom: 0 !important;
    color: #70dcff !important;
  }

  html body .wapper .monitoring #servers .server > p.server-address a {
    color: #70dcff !important;
    font-weight: 800 !important;
    text-decoration: none !important;
  }

  html body .wapper .monitoring #servers .server:nth-child(2) > p.server-address a {
    color: #ffd078 !important;
  }

  html body .wapper .monitoring #servers .server:nth-child(3) > p.server-address a {
    color: #66e5c0 !important;
  }
}

@media screen and (min-width: 768px) {
  /* Desktop monitoring is intentionally unchanged. */
}


/* YGORDONA v13: override the legacy primary.css nth-child absolute positioning.
   Pin each real card child to a fixed grid row; reset every legacy offset. */
@media screen and (max-width: 767.98px) {
  html body .wapper .monitoring #servers > .server {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto 150px auto auto auto !important;
    grid-auto-rows: auto !important;
    grid-auto-flow: row !important;
    align-content: start !important;
  }

  html body .wapper .monitoring #servers > .server > h3 {
    grid-area: auto !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
  }

  html body .wapper .monitoring #servers > .server > .map-image {
    grid-area: auto !important;
    grid-column: 1 !important;
    grid-row: 2 !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    width: 100% !important;
    height: 150px !important;
    min-height: 150px !important;
    max-height: 150px !important;
    margin: 0 0 12px !important;
  }

  html body .wapper .monitoring #servers > .server > p.server-map-name {
    grid-area: auto !important;
    grid-column: 1 !important;
    grid-row: 3 !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 0 9px !important;
  }

  html body .wapper .monitoring #servers > .server > p.server-player-count {
    grid-area: auto !important;
    grid-column: 1 !important;
    grid-row: 4 !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    min-height: 38px !important;
    height: auto !important;
    margin: 2px 0 12px !important;
    padding: 8px 10px !important;
    box-sizing: border-box !important;
    text-align: center !important;
    color: #f0d28a !important;
    background: rgba(240,210,138,.08) !important;
    border: 1px solid rgba(240,210,138,.28) !important;
    border-radius: 9px !important;
    z-index: 5 !important;
    pointer-events: auto !important;
  }

  html body .wapper .monitoring #servers > .server > p.server-address {
    grid-area: auto !important;
    grid-column: 1 !important;
    grid-row: 5 !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
  }
}


/* YGORDONA: mobile project news — one card per row.
   Keep the desktop two-column layout unchanged. */
@media screen and (max-width: 1100px) {
  html body .wapper .news-project-block #new_news {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 16px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 12px 22px !important;
    box-sizing: border-box !important;
  }

  html body .wapper .news-project-block #new_news > div:not(.loader) {
    display: block !important;
    flex: 0 0 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 14px !important;
    float: none !important;
    clear: both !important;
    box-sizing: border-box !important;
  }

  html body .wapper .news-project-block #new_news > div:not(.loader) a {
    display: block !important;
    max-width: 100% !important;
  }

  html body .wapper .news-project-block #new_news > div:not(.loader) a img {
    display: block !important;
    width: 100% !important;
    height: 250px !important;
    max-width: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    margin: 0 auto !important;
    background: rgba(0,0,0,.16) !important;
    border-radius: 9px !important;
  }

  html body .wapper .news-project-block #new_news > div:not(.loader) a h3 {
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  html body .wapper .news-project-block #new_news > div:not(.loader) p {
    overflow-wrap: anywhere !important;
  }
}
