
:root {
  --bg: #060606;
  --panel: #0a0a0a;
  --panel-2: #111;
  --line: #4a4a4a;
  --line-bright: #e6e6e6;
  --red: #e00012;
  --red-soft: rgba(224, 0, 18, 0.38);
  --yellow: #ffd81a;
  --white: #f5f5f5;
  --muted: #838383;
  --field: #000;
}

* { box-sizing: border-box; }

html, body {
  min-height: 100%;
  margin: 0;
  background: radial-gradient(circle at 50% -20%, #202020 0%, #080808 42%, #000 100%);
  color: var(--white);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  letter-spacing: 0.01em;
}

body::before {
  content: "PLAY GAME        PLAYER PROFILE        NEW GAME        CONTINUE GAME        JOIN A GAME";
  position: fixed;
  top: 3px;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255,255,255,0.22);
  font-size: 24px;
  pointer-events: none;
  z-index: 0;
  word-spacing: 48px;
}

button, textarea, input { font: inherit; letter-spacing: inherit; }
button, .screen-title, .tab-button, .panel-button, .tree-settings-button, .preset-name, .category-title { font-weight: 800; }
button { cursor: pointer; }

.screen-shell {
  position: relative;
  z-index: 1;
  width: min(1880px, calc(100vw - 22px));
  min-height: calc(100vh - 30px);
  margin: 18px auto 12px;
  border: 2px solid var(--red);
  background: rgba(0,0,0,0.82);
  box-shadow: 0 0 28px rgba(224,0,18,0.18);
}

.top-frame {
  height: 54px;
  border-bottom: 2px solid var(--red);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: #030303;
}

.screen-title {
  color: var(--red);
  font-size: 32px;
  line-height: 1;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.server-status {
  min-width: 230px;
  color: var(--muted);
  font-size: 15px;
  text-align: right;
  font-family: "Arial Narrow", Arial, sans-serif;
  letter-spacing: .02em;
}

.danger-button,
.panel-button {
  border: 2px solid var(--line-bright);
  background: #000;
  color: #fff;
  min-height: 48px;
  text-transform: uppercase;
  transition: background .12s, color .12s, border-color .12s, filter .12s;
}

.danger-button:hover,
.panel-button:hover {
  background: #121212;
  filter: brightness(1.15);
}

.primary-load {
  padding: 0 20px;
  border-color: var(--red);
  color: var(--red);
  box-shadow: inset 0 0 18px var(--red-soft), 0 0 16px rgba(224,0,18,.22);
  font-size: 22px;
}

.layout {
  display: grid;
  grid-template-columns: 430px 1fr;
  min-height: calc(100vh - 86px);
}

.sidebar {
  border-right: 2px solid var(--line);
  padding: 12px 28px 18px;
  background: rgba(8,8,8,0.94);
}

.poster-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.poster {
  width: 190px;
  height: 190px;
  object-fit: cover;
  border: 1px solid #203a3f;
  image-rendering: auto;
}

.preset-strip {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  gap: 8px;
  align-items: center;
  margin: 8px 0 16px;
}

.arrow-side {
  background: transparent;
  border: 0;
  color: var(--line-bright);
  font-size: 26px;
  height: 40px;
}

.preset-name {
  height: 40px;
  border: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  font-size: 27px;
}

.panel-button {
  width: 100%;
  margin: 7px 0;
  font-size: 24px;
}

.panel-button.strong {
  color: #fff;
  border-color: #fff;
}

.code-panel {
  margin-top: 16px;
  border-top: 1px solid #333;
  padding-top: 14px;
}

.code-panel label {
  display: block;
  color: #bbb;
  font-size: 18px;
  margin-bottom: 6px;
}

.spaced-label { margin-top: 12px; }

textarea {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  background: #000;
  color: #fff;
  border: 1px solid #333;
  padding: 9px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
  letter-spacing: 0.02em;
}

#pasteCode { min-height: 70px; }

.code-message {
  min-height: 24px;
  margin-top: 8px;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 13px;
  letter-spacing: 0;
}

.code-message.error { color: #ff4242; }
.code-message.ok { color: #d9d9d9; }

.content {
  padding: 20px 44px 34px;
  overflow: hidden;
}

.tab-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(155px, 1fr));
  gap: 10px 12px;
  max-width: 1320px;
  margin: 0 auto 20px;
}

.tab-button {
  position: relative;
  height: 38px;
  background: #090909;
  color: var(--white);
  border: 0;
  border-bottom: 3px solid var(--line-bright);
  border-left: 2px solid var(--line-bright);
  border-right: 2px solid var(--line-bright);
  text-transform: uppercase;
  font-size: 26px;
}

.tab-button:nth-child(n+6) {
  grid-column: span 1;
}

.tab-button.active {
  color: var(--yellow);
  background: linear-gradient(to bottom, rgba(224,0,18,.52), #090909 42%);
  border-bottom-color: var(--red);
  box-shadow: inset 0 -12px 18px rgba(224,0,18,.35);
}

.tab-button.changed::after {
  content: "*";
  color: #fff;
  margin-left: 4px;
}

.content-meta {
  display: flex;
  justify-content: space-between;
  align-items: end;
  max-width: 1260px;
  margin: 0 auto 14px;
  border-bottom: 1px solid #222;
  padding-bottom: 8px;
}

.category-title {
  color: var(--yellow);
  font-size: 21px;
  opacity: .95;
}

.changed-summary {
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 13px;
  letter-spacing: 0;
}

.options-grid {
  max-width: 1260px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 58px;
  align-items: start;
  max-height: calc(100vh - 190px);
  overflow-y: auto;
  padding-right: 18px;
}

.options-grid::-webkit-scrollbar { width: 14px; }
.options-grid::-webkit-scrollbar-track { background: #090909; border: 1px solid #333; }
.options-grid::-webkit-scrollbar-thumb { background: var(--red); }

.section-break {
  grid-column: 1 / -1;
  height: 28px;
}

.setting-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 30px minmax(170px, 230px) 30px;
  gap: 7px;
  align-items: center;
  min-height: 42px;
}

.setting-row.disabled { opacity: .46; }

.setting-label {
  color: #d6d6d6;
  text-align: right;
  font-size: 22px;
  text-transform: capitalize;
  text-shadow: 1px 1px 0 #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.setting-value {
  height: 38px;
  border: 1px solid #2d2d2d;
  background: #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  line-height: 1;
  padding: 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.setting-row.changed .setting-value,
.setting-row.changed .setting-label {
  color: var(--red);
}

.setting-arrow {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 24px;
  height: 38px;
  padding: 0;
}

.setting-arrow:disabled { color: #555; cursor: default; }

.setting-row:not(.disabled) .setting-arrow:hover { color: var(--yellow); }

.setting-help {
  grid-column: 1 / -1;
  color: #777;
  font-family: Arial, sans-serif;
  letter-spacing: 0;
  font-size: 12px;
  margin-top: -7px;
  text-align: right;
}

@media (max-width: 1180px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 2px solid var(--line); display: grid; grid-template-columns: 220px 1fr; gap: 16px 24px; }
  .poster-wrap { margin: 0; }
  .code-panel { grid-column: 1 / -1; }
  .tab-bar { grid-template-columns: repeat(2, minmax(145px, 1fr)); }
  .options-grid { grid-template-columns: 1fr; max-height: none; }
  .section-break { height: 12px; }
}

@media (max-width: 680px) {
  .top-frame { height: auto; align-items: stretch; flex-direction: column; gap: 8px; padding: 12px; }
  .top-actions { flex-direction: column; align-items: stretch; }
  .server-status { text-align: left; }
  .sidebar { display: block; padding: 14px; }
  .content { padding: 14px; }
  .setting-row { grid-template-columns: 1fr 28px minmax(110px, 1fr) 28px; }
  .setting-label { font-size: 18px; }
  .setting-value { font-size: 22px; }
}

.preset-details {
  min-height: 70px;
  border: 1px solid #333;
  background: #050505;
  color: #aaa;
  padding: 8px 10px;
  margin: -4px 0 10px;
  font-family: Arial, sans-serif;
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: 0;
}

.preset-details strong {
  display: block;
  color: var(--yellow);
  font-family: Impact, "Arial Narrow", Arial, sans-serif;
  font-size: 16px;
  letter-spacing: .04em;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.panel-button.red-accent {
  border-color: var(--red);
  color: var(--red);
  box-shadow: inset 0 0 14px var(--red-soft);
}

.arrow-side:disabled {
  color: #444;
  cursor: default;
}

.banner-wrap {
  width: 100%;
  border-bottom: 1px solid #222;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 14px;
}

.site-banner {
  display: block;
  width: 100%;
  max-width: 1180px;
  height: auto;
  max-height: 150px;
  object-fit: contain;
}

.tree-settings-button {
  width: 100%;
  min-height: 58px;
  margin: 0 0 14px;
  border: 3px solid #c6ffc6;
  background: linear-gradient(180deg, #00d646 0%, #007b25 100%);
  color: #fff;
  text-shadow: 2px 2px 0 #003c12;
  font-size: 28px;
  text-transform: uppercase;
  box-shadow: 0 0 22px rgba(0, 255, 85, .55), inset 0 0 16px rgba(255,255,255,.18);
  animation: treeJump 1.35s ease-in-out infinite, treeGlow 1.35s ease-in-out infinite;
}

.tree-settings-button:hover {
  filter: brightness(1.18);
  background: linear-gradient(180deg, #12f35b 0%, #008e2c 100%);
}

@keyframes treeJump {
  0%, 100% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-7px) scale(1.025); }
  55% { transform: translateY(0) scale(1); }
}

@keyframes treeGlow {
  0%, 100% { box-shadow: 0 0 18px rgba(0,255,85,.45), inset 0 0 12px rgba(255,255,255,.16); }
  50% { box-shadow: 0 0 34px rgba(0,255,85,.95), inset 0 0 20px rgba(255,255,255,.28); }
}

.site-footer {
  border-top: 1px solid #333;
  background: #050505;
  padding: 10px 16px 12px;
  color: #aaa;
  font-family: Arial, sans-serif;
  font-size: 13px;
  letter-spacing: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.about-button {
  border: 1px solid #777;
  background: #000;
  color: #fff;
  padding: 4px 14px;
  font-family: Impact, "Arial Narrow", Arial, sans-serif;
  font-size: 16px;
  text-transform: uppercase;
}

.about-button:hover { border-color: var(--red); color: var(--yellow); }

.about-text {
  flex-basis: 100%;
  color: #cfcfcf;
  line-height: 1.35;
}

.poster[src^="https://www.treegamingmt.com/images/logo2026fullsize.png"] {
  object-fit: contain;
  background: #000;
  padding: 6px;
}

@media (max-width: 680px) {
  .site-banner { max-height: 92px; }
  .tree-settings-button { font-size: 24px; min-height: 54px; }
}


/* Tree Gaming readability and overflow fixes */
.screen-shell,
.sidebar,
.content,
.preset-details,
.preset-name,
.changed-summary,
.setting-label,
.setting-value,
.tab-button,
.code-panel,
.site-footer {
  min-width: 0;
  max-width: 100%;
}

.screen-title,
.preset-name,
.preset-details,
.changed-summary,
.setting-label,
.setting-value,
.tab-button,
.code-message,
textarea {
  overflow-wrap: anywhere;
  word-break: normal;
}

body {
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  letter-spacing: 0.01em;
}

body::before {
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-weight: 800;
  letter-spacing: .03em;
}

.screen-title {
  font-size: clamp(24px, 2.1vw, 34px);
  letter-spacing: .03em;
}

.sidebar {
  overflow-x: hidden;
}

.preset-strip {
  grid-template-columns: 34px minmax(0, 1fr) 34px;
}

.preset-name {
  height: auto;
  min-height: 42px;
  padding: 5px 8px;
  font-size: clamp(18px, 2.1vw, 28px);
  line-height: 1.08;
  text-align: center;
  white-space: normal;
  overflow: hidden;
}

.preset-details {
  min-height: 82px;
  max-height: none;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.35;
  white-space: normal;
}

.preset-details strong {
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: .02em;
}

.panel-button,
.about-button,
.tree-settings-button,
.tab-button {
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  letter-spacing: .02em;
}

.tree-settings-button {
  font-size: clamp(22px, 2vw, 30px);
}

.content-meta {
  display: grid;
  grid-template-columns: minmax(140px, auto) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.category-title {
  min-width: 0;
  max-width: none;
  line-height: 1.2;
  white-space: nowrap;
}

.changed-summary {
  min-width: 0;
  text-align: right;
  white-space: normal;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.tab-bar {
  grid-template-columns: repeat(5, minmax(135px, 1fr));
  max-width: 1180px;
  align-items: stretch;
}

.tab-button {
  font-size: clamp(16px, 1.35vw, 24px);
  padding: 0 8px;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.setting-row {
  grid-template-columns: minmax(130px, 1fr) 30px minmax(110px, 230px) 30px;
}

.setting-label {
  white-space: normal;
  line-height: 1.1;
  font-size: clamp(17px, 1.32vw, 22px);
}

.setting-value {
  white-space: normal;
  line-height: 1.05;
  font-size: clamp(18px, 1.8vw, 30px);
  text-align: center;
}

textarea {
  overflow-wrap: anywhere;
  word-break: break-all;
}

.about-text { display: none !important; }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, .78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-overlay[hidden] { display: none !important; }

.modal-window {
  position: relative;
  width: min(620px, 96vw);
  border: 2px solid var(--red);
  background: #080808;
  color: #f2f2f2;
  box-shadow: 0 0 30px rgba(224, 0, 18, .35);
  padding: 24px 24px 22px;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  letter-spacing: 0;
  line-height: 1.45;
}

.modal-window h2 {
  margin: 0 46px 12px 0;
  color: var(--yellow);
  font-size: 26px;
  line-height: 1.1;
  text-transform: uppercase;
}

.modal-window p {
  margin: 10px 0 0;
  font-size: 15px;
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 38px;
  height: 34px;
  border: 1px solid #777;
  background: #000;
  color: #fff;
  font-size: 28px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--yellow);
  border-color: var(--red);
}

@media (max-width: 1180px) {
  .content-meta { grid-template-columns: 1fr; gap: 4px; }
  .category-title { max-width: 100%; white-space: normal; }
  .changed-summary { text-align: left; width: 100%; }
}

@media (max-width: 680px) {
  .preset-strip { grid-template-columns: 30px minmax(0, 1fr) 30px; }
  .preset-name { font-size: 20px; }
  .setting-row { grid-template-columns: minmax(0, 1fr) 28px minmax(96px, 1fr) 28px; }
  .tab-button { white-space: normal; height: auto; min-height: 40px; }
}

/* Mobile tab layout fix: keep category buttons inside the screen */
@media (max-width: 680px) {
  html,
  body,
  .screen-shell,
  .layout,
  .content {
    overflow-x: hidden;
  }

  .screen-shell {
    width: calc(100vw - 18px);
    margin-left: auto;
    margin-right: auto;
  }

  .content {
    padding-left: 12px;
    padding-right: 12px;
  }

  .tab-bar {
    width: 100%;
    max-width: none;
    margin: 0 0 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
  }

  .tab-button {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    height: auto;
    padding: 8px 6px;
    font-size: clamp(15px, 4.2vw, 18px);
    line-height: 1.05;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    text-align: center;
  }
}

@media (max-width: 360px) {
  .tab-bar {
    gap: 8px;
  }

  .tab-button {
    min-height: 48px;
    font-size: 14px;
    padding-left: 4px;
    padding-right: 4px;
  }
}

/* Flashing Main Website button beside the page title */
.title-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.main-website-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border: 2px solid var(--yellow);
  background: linear-gradient(180deg, rgba(224,0,18,.9), rgba(60,0,8,.95));
  color: var(--yellow);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .08em;
  white-space: nowrap;
  box-shadow: inset 0 0 16px rgba(255,216,26,.22), 0 0 18px rgba(224,0,18,.48);
  animation: mainWebsiteFlash 1.1s infinite alternate;
}

.main-website-button:hover,
.main-website-button:focus-visible {
  color: #fff;
  border-color: #fff;
  filter: brightness(1.25);
  outline: none;
}

@keyframes mainWebsiteFlash {
  from {
    transform: scale(1);
    box-shadow: inset 0 0 12px rgba(255,216,26,.18), 0 0 10px rgba(224,0,18,.35);
  }
  to {
    transform: scale(1.045);
    box-shadow: inset 0 0 22px rgba(255,216,26,.42), 0 0 28px rgba(255,216,26,.65), 0 0 20px rgba(224,0,18,.55);
  }
}

@media (max-width: 680px) {
  .title-actions {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .screen-title {
    font-size: clamp(24px, 7vw, 32px);
  }

  .main-website-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: clamp(11px, 3.2vw, 14px);
    letter-spacing: .04em;
  }
}
