* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #111318;
  color: #e8e8ec;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #2a2d36;
}
.topbar h1 { font-size: 18px; margin: 0; }
.userbox { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #9a9da8; }
.userbox input {
  background: #1b1e26; border: 1px solid #2a2d36; color: #e8e8ec;
  padding: 6px 8px; border-radius: 6px; width: 120px;
}
main { max-width: 720px; margin: 0 auto; padding: 20px; }
.games { display: grid; gap: 12px; margin-bottom: 20px; }
.game-card {
  background: #1b1e26; border: 1px solid #2a2d36; border-radius: 10px;
  padding: 14px 16px;
}
.game-card h3 { margin: 0 0 4px; font-size: 16px; }
.game-card .meta { font-size: 12px; color: #9a9da8; margin-bottom: 8px; }
.game-card .metrics { font-size: 12px; color: #7fd1a0; margin-bottom: 10px; }
.game-card a.play-btn, .game-card button {
  display: inline-block; background: #3a63ff; color: white; border: none;
  padding: 8px 14px; border-radius: 6px; text-decoration: none; font-size: 13px; cursor: pointer;
}
.status-pill {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: #2a2d36; color: #9a9da8; margin-left: 8px;
}
.new-game-launcher { text-align: center; margin: 16px 0; }
#new-game-btn {
  background: #23262f; color: #e8e8ec; border: 1px solid #3a3d46;
  padding: 10px 18px; border-radius: 8px; font-size: 14px; cursor: pointer;
}
.hidden { display: none !important; }
.chat-panel {
  background: #1b1e26; border: 1px solid #2a2d36; border-radius: 10px;
  padding: 16px; margin-top: 16px;
}
.chat-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.chat-header h2 { font-size: 15px; margin: 0; }
.chat-header button { background: none; border: none; color: #9a9da8; cursor: pointer; }
.chat-log { max-height: 340px; overflow-y: auto; margin-bottom: 12px; }
.msg { padding: 10px 12px; border-radius: 8px; margin-bottom: 8px; font-size: 14px; line-height: 1.4; white-space: pre-wrap; }
.msg.user { background: #3a63ff22; margin-left: 30px; }
.msg.assistant { background: #262a34; margin-right: 30px; }
.chat-form { display: flex; gap: 8px; }
.chat-form textarea {
  flex: 1; background: #12141a; border: 1px solid #2a2d36; color: #e8e8ec;
  border-radius: 8px; padding: 8px; resize: vertical; font-family: inherit;
}
.chat-form button, .brief-actions button {
  background: #3a63ff; color: white; border: none; padding: 0 16px; border-radius: 8px; cursor: pointer;
}
.brief-actions { margin-bottom: 12px; }
.brief-result { background: #1b1e26; border: 1px solid #2a2d36; border-radius: 10px; padding: 16px; margin-top: 16px; }
.brief-result pre { white-space: pre-wrap; background: #12141a; padding: 12px; border-radius: 8px; font-size: 13px; }
.publish-form { display: flex; gap: 8px; margin-top: 10px; }
.publish-form input {
  flex: 1; background: #12141a; border: 1px solid #2a2d36; color: #e8e8ec; padding: 8px; border-radius: 6px;
}
.publish-form button { background: #2fae6a; color: white; border: none; padding: 0 16px; border-radius: 6px; cursor: pointer; }

@media (max-width: 480px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .userbox input { width: 100px; }
}
