:root {
  --bg-main: #121212;
  --bg-elevated: #181818;
  --bg-elevated-2: #1E1E1E;
  --bg-card: #252525;
  --bg-card-alt: #333333;
  --bg-terminal: #0E0E0E;
  --bg-terminal-input: #161616;
  --border-subtle: #2A2A2A;
  --accent: #4CAF50;
  --text-main: #FFFFFF;
  --text-muted: #D0D0D0;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
}

.window {
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  grid-template-rows: 48px 1fr 40px; /* top, main, dedication */
  background: var(--bg-main);
}


/* Top bar */
.top-bar {
  background: var(--bg-elevated-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 0 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 12px;
}

.top-left,
.top-center,
.top-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-left-title {
  font-size: 16px;
  font-weight: 700;
}

.logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #444;
  object-fit: contain;
}

button,
.button {
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  background: #2A2A2A;
  color: var(--text-main);
  font: inherit;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

button:hover,
.button:hover {
  background: #3A3A3A;
}

button:active,
.button:active {
  transform: translateY(1px);
}

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

.button-primary:hover {
  background: #5ec761;
}

input[type="text"],
select,
.input {
  border-radius: var(--radius-sm);
  border: 1px solid #2A2A2A;
  padding: 6px 10px;
  background: #202020;
  color: var(--text-main);
  font: inherit;
  outline: none;
}

input[type="text"]::placeholder {
  color: #888;
}

.search-box {
  width: 200px;
}

.top-center {
  justify-content: center;
}

.top-right {
  justify-content: flex-end;
}

/* Main content layout */
.main {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  overflow: hidden;
}

.systems-panel {
  margin: 12px;
  padding: 8px;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
}

.systems-title {
  font-weight: 700;
  margin: 6px 6px 12px 6px;
  font-size: 14px;
}

.systems-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.system-button {
  background: #2A2A2A;
  color: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 10px 6px;
  text-align: left;
  width: 100%;
}

.games-scroll {
  overflow: auto;
  padding-right: 4px;
}

.games-scroll {
  overflow: auto;
  padding: 16px;
}

/* New info panel to replace game cards */
.info-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
}

.info-text {
  flex: 2 1 260px;
  min-width: 260px;
}

.info-text h2 {
  margin-top: 0;
  margin-bottom: 8px;
}

.info-text p {
  margin-top: 0;
  margin-bottom: 10px;
  line-height: 1.5;
}

.info-links {
  flex: 1 1 200px;
  min-width: 200px;
  background: #181818;
  border-radius: 12px;
  padding: 12px 14px;
}

.info-links h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 14px;
}

.info-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.info-links li {
  margin-bottom: 6px;
}

.info-links a {
  color: #9ad5ff;
  text-decoration: none;
}

.info-links a:hover {
  text-decoration: underline;
}


/* Status bar list */
.status-bar {
  background: #0A0A0A;
  border-top: 1px solid var(--border-subtle);
  padding: 4px 12px;
  display: flex;
  align-items: center; /* Changed from stretch */
  height: 40px; /* Fixed height */
}

.status-games-scroll {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-games-list {
  display: flex;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.status-game-item {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #181818;
  white-space: nowrap;
  cursor: pointer;
}


/* Terminal */
.terminal-container {
  margin: 12px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border: 1px solid var(--border-subtle);
  background: var(--bg-terminal);
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
}

.terminal-output {
  overflow-y: auto;
  padding: 6px;
}

.terminal-output pre {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.terminal-input-wrapper {
  background: var(--bg-terminal-input);
  padding: 8px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.terminal-input {
  width: 100%;
  border: none;
  outline: none;
  background: var(--bg-terminal-input);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 12px;
}

.terminal-input::placeholder {
  color: #777;
}

/* ================= MOBILE / TABLET ================= */

/* Up to ~960px: stack sidebar under top bar, games full width, terminal shorter */
@media (max-width: 960px) {
  .window {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  .top-bar {
    grid-template-columns: 1fr;
    row-gap: 8px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .top-left {
    justify-content: flex-start;
  }

  .top-center {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .top-right {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .search-box {
    width: 100%;
  }

  .main {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .systems-panel {
    margin: 12px 12px 0 12px;
  }

  .games-scroll {
    max-height: none;
  }

  .games-grid {
    justify-content: center;
  }

  .status-bar {
    order: 3;
    padding: 6px 8px;
  }

  .terminal-container {
    order: 4;
    margin: 8px 8px 16px 8px;
    max-height: 260px;
  }
}

/* Very small phones: narrow cards, buttons stack better */
@media (max-width: 600px) {
  .game-card {
    width: 46vw;
    max-width: 220px;
    height: auto;
    grid-template-rows: minmax(120px, 40vw) auto auto;
  }

  .game-title {
    font-size: 13px;
  }

  .top-bar {
    border-radius: 0;
  }

  .systems-panel {
    border-radius: 0;
    margin: 0;
  }

  .terminal-container {
    border-radius: 0;
    margin: 8px 8px 16px 8px;
    max-height: 220px;
  }
}

/* Ultra small (~360px and below): single-column cards */
@media (max-width: 380px) {
  .games-grid {
    justify-content: center;
  }

  .game-card {
    width: 90vw;
  }
}
