:root {
  color-scheme: light;
  --bg: #f5f7f2;
  --surface: #ffffff;
  --ink: #16211a;
  --muted: #5d6f64;
  --line: #dbe3dc;
  --accent: #157a6e;
  --accent-dark: #0e5f56;
  --danger: #a43b3b;
  --shadow: 0 20px 60px rgba(22, 33, 26, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(21, 122, 110, 0.14), transparent 34%),
    linear-gradient(315deg, rgba(216, 128, 69, 0.13), transparent 28%),
    var(--bg);
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0;
}

.workspace {
  display: grid;
  gap: 18px;
}

.heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.05;
}

h2 {
  font-size: 18px;
}

.status {
  min-width: 132px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.status.ready {
  color: var(--accent-dark);
  border-color: rgba(21, 122, 110, 0.28);
}

.status.missing {
  color: var(--danger);
  border-color: rgba(164, 59, 59, 0.28);
}

.panel,
.result {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 18px;
}

.lobbyPanel {
  grid-template-columns: 1fr;
}

.vendorList {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.vendorChip {
  flex: 0 0 auto;
  min-height: 40px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vendorChip.active {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.searchBox {
  width: 100%;
}

.gameGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 14px;
}

.gameCard {
  position: relative;
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 206px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(22, 33, 26, 0.08);
  text-align: left;
}

.gameCard:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(22, 33, 26, 0.12);
}

.gameCard:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.gameCard.loading::after {
  content: "启动中";
  position: absolute;
  inset: 10px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: rgba(14, 95, 86, 0.78);
  font-weight: 800;
}

.gameMedia {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 6px;
  background: #eef3ef;
}

.gameMedia img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gameFallback {
  color: var(--accent-dark);
  font-size: 24px;
  font-weight: 900;
}

.gameName {
  min-height: 42px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
}

.gameVendor {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.badge {
  position: absolute;
  top: 8px;
  right: 8px;
  border-radius: 5px;
  padding: 4px 6px;
  color: #fff;
  background: #cf5a2d;
  font-size: 11px;
  font-weight: 900;
}

.badge.maintenance {
  background: #747b80;
}

.loadingText {
  padding: 18px;
  color: var(--muted);
  font-weight: 800;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  background: #fbfcfb;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(21, 122, 110, 0.12);
}

input[readonly] {
  color: var(--muted);
  background: #f4f7f5;
}

.wide {
  grid-column: 1 / -1;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  color: var(--ink);
  background: #f8faf8;
  cursor: pointer;
}

button:hover {
  border-color: rgba(21, 122, 110, 0.45);
}

button.primary {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

button.primary:hover {
  background: var(--accent-dark);
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

button.ghost {
  min-height: 34px;
  padding: 0 11px;
  color: var(--muted);
  background: transparent;
}

.result {
  overflow: hidden;
}

.hidden {
  display: none;
}

.resultHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

pre {
  min-height: 260px;
  max-height: 520px;
  margin: 0;
  overflow: auto;
  padding: 16px;
  color: #13231e;
  background: #fbfcfb;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

a.launchLink {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  margin: 14px 16px 0;
  border-radius: 6px;
  padding: 0 14px;
  color: #fff;
  background: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

@media (max-width: 760px) {
  .heading {
    align-items: stretch;
    flex-direction: column;
  }

  .panel {
    grid-template-columns: 1fr;
  }

  .shell {
    width: min(100% - 20px, 1120px);
    padding: 18px 0;
  }

  h1 {
    font-size: 34px;
  }

  .gameGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .gameCard {
    min-height: 188px;
    padding: 8px;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
