:root {
  color-scheme: light;
  font-family: "Courier New", "Lucida Console", Monaco, monospace;
  color: #101010;
  background: #101010;
  font-synthesis: none;
  --win-gray: #c0c0c0;
  --win-light: #ffffff;
  --win-mid: #808080;
  --win-dark: #404040;
  --win-black: #0a0a0a;
  --win-blue: #000080;
  --score-bg: #0b1a22;
  --score-grid: #31434b;
  --ct: #48a0ff;
  --t: #ed5959;
  --bot: #e0b552;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    #101010;
  background-size: 4px 4px;
  image-rendering: pixelated;
}

button,
input {
  font: inherit;
}

.desktop {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
}

.window {
  width: min(1500px, 100%);
  border: 3px solid;
  border-color: var(--win-light) var(--win-dark) var(--win-dark) var(--win-light);
  background: var(--win-gray);
  box-shadow:
    0 0 0 2px var(--win-black),
    8px 10px 0 rgba(0, 0, 0, 0.72);
}

.title-bar {
  display: flex;
  align-items: center;
  min-height: 42px;
  margin: 3px;
  padding: 4px 5px 4px 9px;
  color: #fff;
  background: linear-gradient(90deg, #000060, #0000a8 68%, #00145b);
  font-weight: 700;
  letter-spacing: 0.055em;
  text-shadow: 1px 1px #000;
}

.title-icon {
  display: grid;
  width: 25px;
  height: 25px;
  margin-right: 9px;
  place-items: center;
  border: 1px solid #dedede;
  color: #ff9f27;
  background: #151515;
  font-family: Arial, sans-serif;
  font-size: 1.18rem;
  font-weight: 900;
  line-height: 1;
}

.title-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.window-controls {
  display: flex;
  gap: 3px;
  margin-left: auto;
  padding-left: 14px;
}

.window-control {
  display: grid;
  width: 30px;
  height: 28px;
  place-items: center;
  border: 2px solid;
  border-color: var(--win-light) var(--win-dark) var(--win-dark) var(--win-light);
  color: #111;
  background: var(--win-gray);
  font-family: Arial, sans-serif;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: none;
}

.window-close {
  font-size: 1.6rem;
}

.window-body {
  padding: 8px 9px 9px;
}

.raised-panel,
.group-panel,
.classic-button,
.status-bar {
  border: 2px solid;
  border-color: var(--win-light) var(--win-mid) var(--win-mid) var(--win-light);
}

.sunken-panel,
.classic-input,
.map-screen {
  border: 2px solid;
  border-color: var(--win-mid) var(--win-light) var(--win-light) var(--win-mid);
  box-shadow: inset 1px 1px 0 var(--win-dark);
}

.top-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.98fr) minmax(420px, 1.55fr) minmax(260px, 0.72fr);
  gap: 9px;
}

.server-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  padding: 14px 16px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  overflow: hidden;
  font-size: clamp(1.7rem, 2.35vw, 2.2rem);
  line-height: 1;
  letter-spacing: 0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.address {
  margin: 0;
  overflow: hidden;
  font-size: clamp(0.95rem, 1.65vw, 1.36rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-state {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: #4d4d4d;
  font-weight: 700;
}

.status-light {
  width: 20px;
  height: 20px;
  border: 2px solid;
  border-color: #eee #444 #444 #eee;
  border-radius: 50%;
  background: #777;
  box-shadow: inset -3px -3px 4px rgba(0, 0, 0, 0.5);
}

.online-state[data-online="true"] {
  color: #111;
}

.online-state[data-online="true"] .status-light {
  background: #39cf28;
  box-shadow:
    inset -3px -3px 4px rgba(0, 70, 0, 0.5),
    0 0 8px rgba(50, 255, 40, 0.55);
}

.group-panel {
  min-width: 0;
  background: var(--win-gray);
}

.group-title {
  min-height: 30px;
  margin: 0;
  padding: 6px 10px 4px;
  border-bottom: 2px solid;
  border-bottom-color: var(--win-mid);
  font-size: 1rem;
  line-height: 1;
  letter-spacing: 0.045em;
}

.connect-panel,
.online-panel {
  min-height: 100%;
}

.connect-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 10px;
  padding: 10px 12px;
}

.classic-input {
  min-width: 0;
  height: 40px;
  padding: 6px 11px;
  color: #202020;
  background: #f4f4f4;
  font-size: 1rem;
}

.classic-button {
  display: inline-grid;
  min-width: 110px;
  min-height: 40px;
  padding: 7px 15px;
  place-items: center;
  color: #111;
  background: var(--win-gray);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.classic-button:hover,
.classic-button:focus-visible {
  outline: 1px dotted #111;
  outline-offset: -6px;
}

.classic-button:active {
  padding: 8px 14px 6px 16px;
  border-color: var(--win-dark) var(--win-light) var(--win-light) var(--win-dark);
}

.primary-button {
  border-color: #75a3d9 #001d51 #001d51 #75a3d9;
  color: #fff;
  background: #245392;
  text-shadow: 1px 1px #001435;
}

.online-list {
  display: grid;
  gap: 5px;
  max-height: 68px;
  padding: 10px 12px;
  margin: 0;
  overflow: auto;
  list-style: none;
  font-size: 0.95rem;
}

.online-list li {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(290px, 0.82fr) minmax(590px, 2fr);
  gap: 9px;
  margin-top: 9px;
}

.sidebar {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
}

.info-table {
  margin: 0;
  font-size: 0.92rem;
}

.info-table > div {
  display: grid;
  grid-template-columns: minmax(105px, 0.82fr) minmax(125px, 1.3fr);
  min-height: 29px;
  border-bottom: 1px solid #909090;
}

.info-table > div:last-child {
  border-bottom: 0;
}

.info-table dt,
.info-table dd {
  min-width: 0;
  padding: 6px 8px 4px;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info-table dt {
  border-right: 1px solid #909090;
}

.info-table dd {
  font-weight: 700;
}

.status-text[data-online="true"] {
  color: #188313;
}

.status-text[data-online="false"] {
  color: #9b1616;
}

.map-panel {
  padding-bottom: 8px;
}

.map-screen {
  position: relative;
  display: grid;
  min-height: 210px;
  margin: 8px;
  overflow: hidden;
  place-content: center;
  color: #99b2bd;
  background:
    radial-gradient(circle at 50% 46%, rgba(80, 132, 145, 0.28), transparent 2px),
    linear-gradient(135deg, transparent 45%, rgba(79, 112, 122, 0.38) 46%, rgba(79, 112, 122, 0.38) 48%, transparent 49%),
    linear-gradient(28deg, transparent 45%, rgba(79, 112, 122, 0.28) 46%, rgba(79, 112, 122, 0.28) 48%, transparent 49%),
    #09151b;
  text-align: center;
  text-shadow: 1px 1px #000;
}

.map-grid {
  position: absolute;
  inset: 0;
  opacity: 0.38;
  background:
    linear-gradient(rgba(105, 142, 151, 0.32) 1px, transparent 1px),
    linear-gradient(90deg, rgba(105, 142, 151, 0.32) 1px, transparent 1px);
  background-size: 22px 22px;
}

.map-crosshair,
.map-crosshair::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 94px;
  height: 1px;
  background: rgba(106, 176, 190, 0.38);
  content: "";
  transform: translate(-50%, -50%);
}

.map-crosshair::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.map-label,
.map-screen strong {
  position: relative;
  z-index: 1;
}

.map-label {
  margin-bottom: 8px;
  color: #66818c;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
}

.map-screen strong {
  color: #d1e2e6;
  font-size: clamp(1.05rem, 2vw, 1.4rem);
}

.scoreboard-panel {
  display: flex;
  min-height: 550px;
  flex-direction: column;
}

.scoreboard {
  min-height: 0;
  margin: 8px 8px 0;
  overflow: auto;
  flex: 1;
  color: #d5dde0;
  background: var(--score-bg);
  text-shadow: 1px 1px #000;
}

.scoreboard-header,
.scoreboard-row {
  display: grid;
  grid-template-columns: minmax(220px, 2.15fr) minmax(85px, 0.72fr) minmax(100px, 0.8fr) minmax(100px, 0.8fr);
  min-width: 590px;
}

.scoreboard-header {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #d7d7d7;
  background: #27343b;
  font-weight: 700;
  text-align: center;
}

.scoreboard-header span,
.scoreboard-row span {
  min-width: 0;
  padding: 8px 11px 6px;
  overflow: hidden;
  border-right: 1px solid var(--score-grid);
  border-bottom: 1px solid var(--score-grid);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scoreboard-header span:last-child,
.scoreboard-row span:last-child {
  border-right: 0;
}

.team-heading {
  min-width: 590px;
  padding: 9px 14px 6px;
  border-top: 2px solid #53636a;
  border-bottom: 1px solid var(--score-grid);
  background: #0a1820;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.team-heading:first-of-type {
  border-top: 0;
}

.team-heading[data-team="CT"] {
  color: var(--ct);
}

.team-heading[data-team="T"] {
  color: var(--t);
}

.team-heading[data-team="Зритель"] {
  color: #c2c2c2;
}

.team-heading[data-team="BOTS"] {
  color: var(--bot);
}

.scoreboard-row {
  background: rgba(25, 44, 54, 0.58);
}

.scoreboard-row:nth-child(odd) {
  background: rgba(38, 57, 66, 0.58);
}

.scoreboard-row .player-cell {
  color: #f1f1f1;
  font-weight: 700;
}

.scoreboard-row .ct-value {
  color: var(--ct);
}

.scoreboard-row .t-value {
  color: var(--t);
}

.scoreboard-row .bot-value {
  color: var(--bot);
}

.scoreboard-empty {
  min-width: 590px;
  padding: 24px 14px;
  color: #819099;
  text-align: center;
}

.scoreboard-summary {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin: 6px 8px 8px;
  padding: 10px 12px 7px;
  border-top: 2px solid #879095;
  color: #d8dddf;
  background: #101a1f;
  font-weight: 700;
  text-shadow: 1px 1px #000;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 9px;
  padding: 8px 10px 6px;
  font-weight: 700;
}

@media (max-width: 1120px) {
  .top-grid {
    grid-template-columns: 1fr 1.45fr;
  }

  .online-panel {
    grid-column: 1 / -1;
  }

  .online-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main-grid {
    grid-template-columns: minmax(270px, 0.72fr) minmax(520px, 1.5fr);
  }
}

@media (max-width: 860px) {
  .desktop {
    display: block;
    padding: 8px;
  }

  .top-grid,
  .main-grid {
    grid-template-columns: 1fr;
  }

  .online-panel {
    grid-column: auto;
  }

  .scoreboard-panel {
    min-height: 470px;
  }
}

@media (max-width: 600px) {
  .desktop {
    padding: 0;
  }

  .window {
    border-width: 2px;
    box-shadow: none;
  }

  .title-bar {
    min-height: 36px;
    font-size: 0.74rem;
  }

  .title-icon {
    width: 21px;
    height: 21px;
    margin-right: 6px;
  }

  .window-control {
    width: 24px;
    height: 23px;
    font-size: 1rem;
  }

  .window-controls {
    gap: 2px;
    padding-left: 5px;
  }

  .window-body {
    padding: 4px;
  }

  .server-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .connect-row {
    grid-template-columns: 1fr 1fr;
  }

  .classic-input {
    grid-column: 1 / -1;
  }

  .classic-button {
    min-width: 0;
  }

  .online-list {
    grid-template-columns: 1fr;
  }

  .info-table {
    font-size: 0.82rem;
  }

  .map-screen {
    min-height: 175px;
  }

  .scoreboard-summary,
  .status-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .scoreboard-header,
  .scoreboard-row {
    grid-template-columns: minmax(175px, 1.8fr) minmax(70px, 0.8fr);
    min-width: 0;
  }

  .scoreboard-header span:nth-child(n + 3),
  .scoreboard-row span:nth-child(n + 3) {
    display: none;
  }

  .team-heading,
  .scoreboard-empty {
    min-width: 0;
  }
}
