/* Clean, zero-framework styles for WordRPG Login + Durable Objects Demo */

:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #181c24;
  --muted: #5c6578;
  --border: #e2e6ef;
  --primary: #3b5bdb;
  --primary-hover: #304bc0;
  --danger: #d93025;
  --danger-bg: #fdecea;
  --admin-bg: #eef2ff;
  --admin-text: #3148b5;
  --visitor-bg: #edf7ed;
  --visitor-text: #1e6b34;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.container {
  max-width: 720px;
  margin: 40px auto;
  padding: 0 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 2px 10px rgba(24, 28, 36, 0.04);
  margin-bottom: 20px;
}

h1, h2, h3 {
  margin-top: 0;
  line-height: 1.25;
}

.subtitle {
  color: var(--muted);
  margin-top: -6px;
}

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

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn:hover {
  background: #f1f3f9;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-google {
  background: #fff;
  border-color: #dadce0;
  color: #3c4043;
  padding: 12px 20px;
  font-size: 16px;
  width: 100%;
}

.btn-google:hover {
  background: #f8f9fa;
  border-color: #c6cacf;
}

.btn-sm {
  padding: 6px 11px;
  font-size: 13px;
}

.btn-danger {
  background: var(--danger-bg);
  border-color: #f5c2be;
  color: var(--danger);
}

.btn-danger:hover {
  background: #fad7d4;
}

/* Form inputs */
input[type="text"] {
  flex: 1;
  min-width: 180px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
}

input[type="text"]:focus {
  outline: 2px solid #bac8ff;
  border-color: var(--primary);
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.badge-admin {
  background: var(--admin-bg);
  color: var(--admin-text);
}

.badge-visitor {
  background: var(--visitor-bg);
  color: var(--visitor-text);
}

.badge-live {
  background: #e6fcf5;
  color: #0b7285;
}

.badge-offline {
  background: #fff3bf;
  color: #8f5f00;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.code-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: #f1f3f9;
  padding: 2px 7px;
  border-radius: 6px;
  color: #364152;
}

/* Avatar */
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--admin-bg);
  color: var(--admin-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

/* Game list on Profile */
.game-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.game-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.game-title {
  font-weight: 600;
  font-size: 16px;
}

.game-meta {
  font-size: 13px;
  color: var(--muted);
}

/* Chat Room */
.chat-log {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafbfe;
  height: 380px;
  overflow-y: auto;
  padding: 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-empty {
  margin: auto;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.msg {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.msg-mine {
  border-color: #c5d1fa;
  background: #f8faff;
}

.msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.msg-author {
  font-weight: 600;
  font-size: 14px;
}

.msg-time {
  font-size: 12px;
  color: var(--muted);
}

.msg-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 15px;
}

.notice {
  background: #fff9db;
  border: 1px solid #ffe066;
  color: #664d03;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  margin-top: 14px;
}

.dev-box {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}

.error-banner {
  background: var(--danger-bg);
  border: 1px solid #f5c2be;
  color: var(--danger);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 12px;
}

.hidden {
  display: none !important;
}
