@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --bg: #09090b;
  --surface: #111113;
  --surface-2: #18181b;
  --border: #27272a;
  --border-hover: #3f3f46;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --dim: #71717a;
  --accent: #e4e4e7;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
}

body {
  line-height: 1.5;
}

a {
  color: inherit;
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 40px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-avatar {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface);
}

.brand h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.brand p {
  margin: 2px 0 0;
  color: var(--dim);
  font-size: 0.82rem;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.text-btn,
.discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: border-color 120ms ease, background 120ms ease;
}

.text-btn:hover,
.discord-btn:hover {
  border-color: var(--border-hover);
  background: var(--surface-2);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 20px;
  align-items: start;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.status-panel {
  padding: 18px 20px;
  margin-bottom: 18px;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.76rem;
  color: var(--muted);
  background: var(--surface-2);
}

.pill strong {
  color: var(--text);
  font-weight: 600;
}

.pill.live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
}

.history-panel {
  margin-top: 14px;
}

.history-head {
  padding-bottom: 0;
}

.history-head h2 {
  margin-bottom: 4px;
}

.history-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--dim);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 20px;
}

.history-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font: inherit;
  font-size: 0.76rem;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.history-chip:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.history-chip.active {
  border-color: var(--accent);
  background: #151518;
  color: var(--text);
}

.history-chip.live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

.history-chip-label {
  font-weight: 600;
  color: var(--text);
}

.history-chip-meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--dim);
}

.history-empty {
  margin: 0;
  color: var(--dim);
  font-size: 0.78rem;
}

.section {
  padding: 18px 20px 8px;
}

.section h2 {
  margin: 0 0 14px;
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 108px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  text-decoration: none;
  transition: border-color 120ms ease, transform 120ms ease;
  cursor: pointer;
}

.card:hover,
.card.active {
  border-color: var(--border-hover);
}

.card.active {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

.card.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
}

.card p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--dim);
}

.card i {
  font-size: 1.2rem;
  color: var(--muted);
}

.preview-panel {
  position: sticky;
  top: 20px;
  overflow: hidden;
}

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

.preview-head h2 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 650;
}

.preview-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--dim);
}

.preview-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 0.75rem;
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-hover);
}

.icon-btn.copied {
  color: #4ade80;
  border-color: #4ade80;
  background: #102416;
  animation: copyPop 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes copyPop {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

.copy-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid #4ade80;
  border-radius: 10px;
  background: #102416;
  color: #bbf7d0;
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.copy-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.copy-toast i {
  font-size: 1rem;
}

.preview-body {
  margin: 0;
  padding: 16px;
  min-height: 420px;
  max-height: 70vh;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.55;
  color: #d4d4d8;
  white-space: pre-wrap;
  word-break: break-word;
}

.preview-body .k {
  color: #93c5fd;
}

.preview-body .s {
  color: #86efac;
}

.preview-body .n {
  color: #fca5a5;
}

.preview-body .c {
  color: var(--dim);
}

.preview-body .kw {
  color: #c4b5fd;
}

.preview-body .ty {
  color: #7dd3fc;
}

.preview-body .pp {
  color: #f0abfc;
}

.preview-body .b {
  color: #fbbf24;
}

.preview-body .sec {
  color: #f4f4f5;
  font-weight: 600;
}

.preview-body .lbl {
  color: #a1a1aa;
}

.footnote {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--dim);
  font-size: 0.8rem;
}

.footnote code {
  font-family: var(--mono);
  color: var(--muted);
}

.hub-page {
  display: flex;
  align-items: center;
  min-height: 100vh;
}

.hub-shell {
  width: 100%;
  max-width: 520px;
  padding-top: 48px;
  padding-bottom: 48px;
}

.hub-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}

.hub-discord-btn {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 20;
  padding: 12px 16px;
  font-size: 0.95rem;
  border-radius: 12px;
}

.hub-discord-btn i {
  font-size: 1.15rem;
}

.hub-icon {
  width: 96px;
  height: 96px;
  border: 1px solid var(--border);
  border-radius: 18px;
  object-fit: cover;
  background: var(--surface);
}

.hub-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.hub-hero {
  display: none;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 360px;
  margin: 0 auto;
}

.game-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 120px;
  padding: 22px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 120ms ease, background 120ms ease;
}

.game-card:hover {
  border-color: var(--border-hover);
  background: var(--surface-2);
}

.game-card-emoji {
  font-size: 2.2rem;
  line-height: 1;
}

.game-card-img {
  height: 48px;
  width: auto;
  max-width: 88px;
  object-fit: contain;
  border-radius: 8px;
}

.game-card-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.game-card.disabled {
  opacity: 0.42;
  pointer-events: none;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    position: static;
  }
}

@media (max-width: 560px) {
  .grid,
  .game-grid {
    grid-template-columns: 1fr;
  }

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

  .hub-discord-btn {
    top: 16px;
    right: 16px;
    padding: 10px 14px;
    font-size: 0.88rem;
  }
}
