/* ── variables ── */
:root {
  --bg:       #0f0f0d;
  --surface:  #181710;
  --border:   #2a2820;
  --accent:   #c8a44a;
  --accent-dim: #8a6e2f;
  --green:    #7ab648;
  --red:      #d45a4a;
  --text:     #d4cfc0;
  --mid:      #9a9488;
  --dim:      #5a5550;
  --radius:   6px;
  --font:     'JetBrains Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── header ── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-logo {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .03em;
}

.site-header nav {
  display: flex;
  gap: 20px;
  font-size: 11px;
  color: var(--dim);
}

.site-header nav a { color: var(--mid); }

.site-main {
  padding: 32px 20px;
  max-width: 1100px;
  margin: 0 auto;
}

/* ── buttons ── */
.btn {
  display: inline-block;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 11px;
  letter-spacing: .05em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity .15s, border-color .15s;
}

.btn-primary {
  background: var(--accent);
  color: #0f0f0d;
  font-weight: 700;
  border-color: var(--accent);
}

.btn-primary:hover { opacity: .85; }

.btn-secondary {
  background: none;
  color: var(--mid);
  border-color: var(--border);
}

.btn-secondary:hover { border-color: var(--accent-dim); color: var(--text); }

/* ── labels ── */
.panel-label {
  font-size: 9px;
  color: var(--dim);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.dim { color: var(--dim); }
.hint { color: var(--dim); font-size: 11px; margin-top: 10px; }

/* ── panel ── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.center-panel {
  max-width: 520px;
  margin: 0 auto;
}

.center-panel h2 {
  font-size: 18px;
  color: var(--text);
  margin-bottom: 10px;
}

.center-panel p {
  color: var(--mid);
  margin-bottom: 20px;
}

/* ── hero ── */
.hero {
  max-width: 680px;
  margin: 0 auto;
  padding-top: 20px;
}

.hero-label {
  font-size: 9px;
  color: var(--dim);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero h1 {
  font-size: 28px;
  color: var(--accent);
  margin-bottom: 16px;
}

.hero-sub {
  color: var(--mid);
  line-height: 1.9;
  margin-bottom: 32px;
  font-size: 13px;
}

.hero-roles {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.role-card {
  flex: 1;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.role-icon { font-size: 24px; margin-bottom: 8px; }
.role-label {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.role-desc { color: var(--mid); font-size: 12px; margin-bottom: 14px; line-height: 1.7; }

.role-divider {
  color: var(--dim);
  font-size: 11px;
  padding: 0 4px;
}

.hero-footer { font-size: 11px; color: var(--dim); }

/* ── join form ── */
.join-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.code-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  letter-spacing: .15em;
  padding: 10px 14px;
  width: 160px;
  text-transform: uppercase;
  outline: none;
  transition: border-color .15s;
}

.code-input:focus { border-color: var(--accent-dim); }

.alert-error {
  background: #2a1010;
  border: 1px solid #5a2020;
  border-radius: var(--radius);
  color: var(--red);
  padding: 10px 14px;
  font-size: 12px;
  margin-bottom: 14px;
}

/* ── game layout ── */
.game-layout {
  display: flex;
  gap: 16px;
  height: calc(100vh - 120px);
}

.game-sidebar {
  width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.room-code {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .1em;
}

.sidebar-hint { font-size: 11px; color: var(--dim); }

.round-counter {
  font-size: 12px;
  color: var(--mid);
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.bird-status, .bird-status-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--dim);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dim);
  flex-shrink: 0;
}

.dot-online  { background: var(--green); }
.dot-offline { background: var(--dim); }

.guess-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.guess-section p { font-size: 11px; color: var(--mid); margin-bottom: 4px; }
.guess-btn { width: 100%; text-align: center; }

.hidden { display: none !important; }

/* ── lanes ── */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.lanes {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-height: 0;
}

.lane {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.lane-header {
  padding: 8px 14px;
  font-size: 10px;
  color: var(--accent);
  letter-spacing: .08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.lane-log {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lane-log::-webkit-scrollbar { width: 3px; }
.lane-log::-webkit-scrollbar-thumb { background: var(--border); }

/* ── messages ── */
.msg {
  font-size: 12px;
  line-height: 1.7;
  padding: 8px 10px;
  border-radius: 4px;
}

.msg-question {
  color: var(--accent);
  font-size: 11px;
  background: #1a1500;
  border-left: 2px solid var(--accent-dim);
}

.msg-reply {
  color: var(--text);
  background: #12120f;
  border-left: 2px solid var(--border);
}

.msg-system {
  color: var(--dim);
  font-size: 10px;
  text-align: center;
  border: none;
  background: none;
  padding: 2px;
}

.msg-typing {
  color: var(--dim);
  font-size: 16px;
  letter-spacing: 3px;
  padding: 4px 10px;
  animation: blink 1s infinite;
}

@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.2} }

/* ── question bar ── */
.question-bar {
  display: flex;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  flex-shrink: 0;
}

.question-bar input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
}

.question-bar input::placeholder { color: var(--dim); }
.question-bar input:disabled { opacity: .4; }

/* ── bird view ── */
.bird-layout {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bird-header h2 { font-size: 20px; color: var(--accent); margin-bottom: 8px; }
.bird-header p { color: var(--mid); font-size: 12px; line-height: 1.7; margin-bottom: 10px; }

.bird-log {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  min-height: 280px;
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bird-log::-webkit-scrollbar { width: 3px; }
.bird-log::-webkit-scrollbar-thumb { background: var(--border); }
.bird-log-empty { color: var(--dim); font-size: 12px; }

.bird-msg {
  font-size: 12px;
  line-height: 1.8;
  padding: 8px 12px;
  border-radius: 4px;
}

.bird-question {
  color: var(--accent);
  background: #1a1500;
  border-left: 2px solid var(--accent-dim);
}

.bird-sent {
  color: var(--text);
  background: #12120f;
  border-left: 2px solid var(--green);
}

.bird-system {
  color: var(--dim);
  font-size: 10px;
  text-align: center;
  background: none;
  padding: 2px;
}

.round-label {
  display: block;
  font-size: 9px;
  color: var(--dim);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.bird-input-bar {
  display: flex;
  gap: 8px;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.bird-input-bar textarea {
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  resize: none;
  outline: none;
  width: 100%;
}

.bird-input-bar textarea::placeholder { color: var(--dim); }
.bird-input-bar textarea:disabled { opacity: .4; }
.bird-input-bar .btn { align-self: flex-end; }

/* ── reveal ── */
.reveal-layout {
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.reveal-badge {
  display: inline-block;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 3px;
  align-self: flex-start;
}

.reveal-correct {
  background: #0f2a0f;
  border: 1px solid var(--green);
  color: var(--green);
}

.reveal-fooled {
  background: #2a0f0f;
  border: 1px solid var(--red);
  color: var(--red);
}

.reveal-heading { font-size: 24px; color: var(--text); }

.reveal-species-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.species-name { font-size: 20px; color: var(--accent); margin-bottom: 4px; }
.species-sci { font-size: 11px; color: var(--dim); margin-bottom: 10px; font-style: italic; }
.species-personality { color: var(--mid); font-size: 12px; line-height: 1.7; margin-bottom: 12px; }
.species-assignment { font-size: 11px; color: var(--dim); }
.species-assignment strong { color: var(--mid); }

/* ── leaderboard table ── */
.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 12px;
}

.lb-table th {
  text-align: left;
  color: var(--dim);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}

.lb-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--mid);
}

.lb-table tr:last-child td { border-bottom: none; }
.lb-current td { color: var(--text); }

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

/* ── reveal leaderboard ── */
.reveal-leaderboard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
