/* ============================================================
   The Agent Cafe — Noir Coffee House
   Aesthetic: Cyberpunk cafe meets cozy den
   Fonts: Instrument Serif (display) + IBM Plex Mono (body)
   ============================================================ */

:root {
  /* Surface elevation: each layer +4-6 lightness for clear separation */
  --bg: #0e0c0a;
  --surface: #161412;
  --surface-2: #1e1b18;
  --surface-3: #282420;
  --border: #332e28;
  --border-hover: #483f36;
  /* Text: off-whites with warm tint. Body ≥4.5:1 contrast on --surface */
  --text: #ece4d8;
  --text-dim: #a89e90;
  --text-muted: #6e6458;
  /* Accent: warm amber — ONE primary accent, green for status only */
  --accent: #d4a06a;
  --accent-light: #e8c09a;
  --accent-warm: #f0b888;
  --accent-glow: rgba(212, 160, 106, 0.10);
  --accent-glow-strong: rgba(212, 160, 106, 0.22);
  /* Status colors — used sparingly */
  --green: #5ecf82;
  --green-dim: rgba(94, 207, 130, 0.08);
  --yellow: #f5c842;
  --yellow-dim: rgba(245, 200, 66, 0.08);
  --red: #e86060;
  --red-dim: rgba(232, 96, 96, 0.08);
  --blue: #78b4f5;
  --blue-dim: rgba(120, 180, 245, 0.08);
  /* Scene colors */
  --coffee: #6b4226;
  --coffee-light: #8b5a34;
  /* Spacing & shape */
  --radius: 8px;
  --radius-lg: 12px;
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'IBM Plex Mono', 'SF Mono', 'Fira Code', monospace;
  --shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 6px 28px rgba(0, 0, 0, 0.5);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 450;
  line-height: 1.65;
  letter-spacing: 0.01em;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ===== Atmospheric Layers ===== */
.rain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.rain-drop {
  position: absolute;
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(212, 165, 116, 0.08));
  animation: rainFall linear infinite;
}

@keyframes rainFall {
  0% { transform: translateY(-100vh); }
  100% { transform: translateY(100vh); }
}

.ambient-glow {
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(212, 165, 116, 0.04) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
  animation: ambientPulse 8s ease-in-out infinite;
}

@keyframes ambientPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

/* ===== App Container ===== */
#app {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  position: relative;
  z-index: 1;
}

/* ===== Header ===== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

header h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--accent-light);
  letter-spacing: -0.01em;
}

.title-icon {
  margin-right: 0.25rem;
  filter: drop-shadow(0 0 8px rgba(212, 165, 116, 0.4));
}

.subtitle {
  font-family: var(--font-body);
  color: var(--text-muted);
  font-size: 0.7rem;
  display: block;
  margin-top: 0.2rem;
  letter-spacing: 0.04em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.live-label {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.12em;
}

.observer-badge {
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--surface);
  letter-spacing: 0.04em;
}

.eye-icon {
  color: var(--accent);
  margin-right: 0.15rem;
}

/* ===== Pulse dot ===== */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(94, 207, 130, 0.5); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(94, 207, 130, 0); }
}

/* ===== Badges ===== */
.badge {
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.badge-mainnet {
  background: rgba(0, 200, 83, 0.08);
  color: #00c853;
  border: 1px solid rgba(0, 200, 83, 0.2);
}

.badge-testnet {
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid rgba(120, 180, 245, 0.2);
}

/* ===== Buttons ===== */
.btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none !important; }

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

.btn-primary:hover {
  background: var(--accent-light);
  box-shadow: 0 0 20px rgba(212, 165, 116, 0.3);
}

.btn-secondary {
  background: var(--surface-2);
  border-color: var(--border);
}

/* ===== Stats Bar ===== */
.stats-bar {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.stat {
  flex: 1 1 0;
  min-width: 110px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem 0.75rem;
  text-align: center;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.stat-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center bottom, var(--accent-glow) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.stat:hover .stat-glow { opacity: 1; }

.stat::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.stat:hover::after { opacity: 0.6; }
.stat:hover { border-color: var(--border-hover); transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }

.stat-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}

.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--accent-light);
  line-height: 1.15;
  transition: color 0.3s;
  word-break: break-all;
}

.stat-sub {
  display: block;
  color: var(--text-muted);
  font-size: 0.52rem;
  letter-spacing: 0.04em;
  margin-top: 0.25rem;
}

/* ===== Onboarding Banner ===== */
.onboarding-banner {
  margin-bottom: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 0 30px rgba(212, 165, 116, 0.06);
}

.onboarding-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  transition: background 0.2s;
}

.onboarding-header:hover { background: var(--surface-2); }

.onboarding-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--accent-light);
  font-weight: 400;
  border: none;
  padding: 0;
}

.expand-hint { font-size: 0.7rem; color: var(--text-dim); }
.hidden { display: none; }
#onboarding-details { padding: 0 1.25rem 1.25rem; }

.onboarding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.onboarding-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.onboarding-card h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--accent-warm);
  font-weight: 400;
}

.onboarding-card p { margin: 4px 0 8px; font-size: 0.78rem; color: var(--text-dim); }

.onboarding-card pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.65rem;
  overflow-x: auto;
  font-size: 0.7rem;
  line-height: 1.45;
  color: var(--text);
  margin: 6px 0;
}

.onboarding-card ul { margin: 4px 0; padding-left: 18px; font-size: 0.78rem; color: var(--text-dim); }
.onboarding-card li { margin: 4px 0; }
.onboarding-card li strong { color: var(--accent-light); }
.onboarding-footer { font-size: 0.75rem; color: var(--text-dim); text-align: center; }
.onboarding-footer a { color: var(--accent); }

/* ===== Cafe Scene ===== */
.cafe-scene-wrapper {
  margin-bottom: 1.5rem;
  position: relative;
}

.window-frame {
  border: 2px solid var(--coffee-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  box-shadow:
    0 0 0 4px var(--surface-3),
    0 0 0 6px var(--coffee),
    0 0 60px rgba(212, 165, 116, 0.08),
    var(--shadow-lg);
  background: var(--surface);
}

.window-glare {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 40%, transparent 60%, rgba(255,255,255,0.01) 100%);
  pointer-events: none;
  z-index: 8;
}

.window-label {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.52rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  z-index: 10;
  background: rgba(8, 6, 4, 0.85);
  padding: 0.2rem 0.65rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  backdrop-filter: blur(4px);
}

.cafe-scene {
  width: 100%;
  height: 280px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #160e04 0%, #1e140a 30%, #261c10 70%, #1a1208 100%);
}

/* Warm ambient light in scene */
.cafe-scene::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 120px;
  background: radial-gradient(ellipse, rgba(245, 200, 66, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 2;
}

/* Cafe background */
.cafe-bg {
  position: absolute;
  inset: 0;
}

.cafe-wall {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 120px;
  background: linear-gradient(180deg, #140c04 0%, #1e140a 60%, #261c10 100%);
  border-bottom: 2px solid var(--coffee);
}

.cafe-wall::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0px,
    transparent 52px,
    rgba(107, 66, 38, 0.06) 52px,
    rgba(107, 66, 38, 0.06) 54px
  );
}

/* Hanging lights */
.cafe-lights {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  padding: 0 80px;
  z-index: 3;
}

.cafe-light {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cafe-light::before {
  content: '';
  width: 1px;
  height: 45px;
  background: linear-gradient(to bottom, var(--border), var(--coffee));
}

.cafe-light::after {
  content: '💡';
  font-size: 1.2rem;
  filter: drop-shadow(0 0 14px rgba(245, 200, 66, 0.7)) drop-shadow(0 8px 20px rgba(245, 180, 50, 0.3));
  animation: lightFlicker 5s ease-in-out infinite;
}

.cafe-light:nth-child(2)::after { animation-delay: 1.7s; }
.cafe-light:nth-child(3)::after { animation-delay: 3.2s; }

/* Light cones beneath each bulb */
.cafe-light {
  position: relative;
}

.cafe-light > .light-cone {
  position: absolute;
  top: 55px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 120px;
  background: radial-gradient(ellipse at top, rgba(245, 200, 66, 0.07) 0%, transparent 70%);
  pointer-events: none;
}

@keyframes lightFlicker {
  0%, 92%, 100% { opacity: 1; transform: scale(1); }
  94% { opacity: 0.7; transform: scale(0.9); }
  96% { opacity: 1; transform: scale(1); }
  98% { opacity: 0.8; transform: scale(0.95); }
}

/* Bar / counter */
.cafe-bar {
  position: absolute;
  top: 50px;
  right: 0;
  width: 160px;
  height: 230px;
  background: linear-gradient(180deg, #2a1c0c 0%, #1a1008 100%);
  border-left: 2px solid var(--coffee);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 12px;
}

.bar-shelves {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.85rem;
  opacity: 0.6;
}

.bar-shelves::before {
  content: '';
  display: block;
  width: 120px;
  height: 1px;
  background: var(--coffee);
  margin-bottom: 4px;
}

.bar-item { display: inline; margin: 0 2px; }

/* Barista */
.barista {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: 8px;
}

.agent-avatar {
  font-size: 1.8rem;
  line-height: 1;
  animation: breathe 3.5s ease-in-out infinite;
}

.barista-bot {
  animation: barista-work 3s ease-in-out infinite;
}

@keyframes barista-work {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-3px) rotate(-3deg); }
  75% { transform: translateY(-2px) rotate(3deg); }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.agent-name {
  font-size: 0.58rem;
  color: var(--accent);
  font-weight: 600;
  text-align: center;
}

.agent-role {
  font-size: 0.5rem;
  color: var(--text-muted);
  text-align: center;
}

/* Tables area */
.tables-area {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 160px;
  height: 210px;
  display: flex;
  align-items: flex-end;
  padding: 0 20px 12px;
  justify-content: space-around;
}

.table-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.table-surface {
  width: 90px;
  height: 18px;
  background: linear-gradient(180deg, #5a3820 0%, #3d2512 100%);
  border-radius: 6px 6px 2px 2px;
  border-top: 2px solid var(--coffee-light);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
}

.table-small .table-surface { width: 60px; }

.table-item {
  font-size: 0.85rem;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
  animation: itemFloat 3.5s ease-in-out infinite;
}

@keyframes itemFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.table-leg {
  width: 6px;
  height: 30px;
  background: linear-gradient(180deg, #3d2512 0%, #2a1a0a 100%);
}

.table-group::after {
  content: '';
  position: absolute;
  bottom: -5px;
  width: 100px;
  height: 10px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.5) 0%, transparent 70%);
}

/* Table seats */
.table-seats {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  min-height: 60px;
  align-items: flex-end;
}

.seat {
  width: 44px;
  height: 50px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.seat.occupied .agent-at-table { display: flex; }

.agent-at-table {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  animation: agentArrive 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.agent-at-table:hover { filter: brightness(1.2); }

@keyframes agentArrive {
  from { opacity: 0; transform: translateY(16px) scale(0.5); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.agent-at-table .agent-avatar {
  font-size: 1.4rem;
  position: relative;
}

.agent-at-table .agent-name {
  font-size: 0.48rem;
  color: var(--text-dim);
  max-width: 44px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* Status glow ring */
.agent-at-table .status-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid transparent;
  pointer-events: none;
}

.agent-at-table.status-fed .status-ring { border-color: var(--green); box-shadow: 0 0 10px rgba(94,207,130,0.4); }
.agent-at-table.status-hungry .status-ring { border-color: var(--yellow); box-shadow: 0 0 10px rgba(245,200,66,0.4); }
.agent-at-table.status-starving .status-ring { border-color: var(--red); box-shadow: 0 0 10px rgba(232,96,96,0.4); animation: starvePulse 1s ease-in-out infinite; }

@keyframes starvePulse {
  0%, 100% { box-shadow: 0 0 8px rgba(232,96,96,0.4); }
  50% { box-shadow: 0 0 24px rgba(232,96,96,0.8); }
}

/* Eating animation */
.agent-at-table.eating .agent-avatar {
  animation: eating 0.6s ease-in-out infinite;
}

@keyframes eating {
  0%, 100% { transform: scale(1) rotate(-5deg); }
  50% { transform: scale(1.15) rotate(5deg); }
}

/* Speech bubble */
.agent-speech {
  position: absolute;
  top: -38px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-3);
  border: 1px solid var(--border-hover);
  border-radius: 8px;
  padding: 3px 7px;
  font-size: 0.5rem;
  color: var(--text-dim);
  white-space: nowrap;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 10;
  animation: speechFadeIn 0.3s ease;
  pointer-events: none;
}

.agent-speech::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--border-hover);
}

@keyframes speechFadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Steam effects */
.scene-steam {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.steam-puff {
  position: absolute;
  font-size: 0.7rem;
  opacity: 0;
  animation: steamRise 3s ease-in-out forwards;
  pointer-events: none;
  color: rgba(212, 165, 116, 0.3);
}

@keyframes steamRise {
  0% { opacity: 0; transform: translateY(0) scale(0.5); }
  20% { opacity: 0.35; }
  100% { opacity: 0; transform: translateY(-70px) scale(2.5); }
}

/* Floating particles */
.scene-particles { position: absolute; inset: 0; pointer-events: none; z-index: 3; }

.dust-particle {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgba(212, 165, 116, 0.15);
  animation: dustFloat 10s linear infinite;
}

@keyframes dustFloat {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 0.5; }
  90% { opacity: 0.2; }
  100% { transform: translateY(-220px) translateX(30px); opacity: 0; }
}

/* Caption below scene */
.scene-caption {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--surface);
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: italic;
}

.caption-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: captionPulse 2.5s ease-in-out infinite;
}

@keyframes captionPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ===== Panels ===== */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.panel:hover { border-color: var(--border-hover); box-shadow: 0 2px 12px rgba(0,0,0,0.15); }

.panel h2 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h2 { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }

.panel-badge {
  font-size: 0.52rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.panel-note {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  font-style: italic;
}

/* ===== Main Grid ===== */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr 0.85fr;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.center-col {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* ===== Menu Items ===== */
.menu-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.6rem;
  transition: all 0.25s ease;
  cursor: default;
}

.menu-item:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
  transform: translateX(4px);
  box-shadow: 0 0 16px rgba(212, 165, 116, 0.06);
}

.item-icon {
  font-size: 1.6rem;
  width: 38px;
  text-align: center;
  flex-shrink: 0;
  padding-top: 2px;
}

.item-info { flex: 1; min-width: 0; }

.item-info h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 400;
  margin-bottom: 2px;
}

.item-info p { color: var(--text-dim); font-size: 0.68rem; margin-bottom: 4px; }

.item-meta {
  display: flex;
  gap: 0.6rem;
  font-size: 0.65rem;
  align-items: center;
  margin-bottom: 5px;
}

.bean-cost {
  color: var(--yellow);
  background: var(--yellow-dim);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
  border: 1px solid rgba(245, 200, 66, 0.15);
}

.eth-cost { color: var(--text-muted); }

.item-perks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.perk {
  font-size: 0.55rem;
  color: var(--text-muted);
  background: var(--surface-3);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ===== Contracts ===== */
.contracts-section {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.contracts-section h2 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.6rem;
  border-bottom: none;
  padding-bottom: 0;
}

.contract-list { display: flex; flex-direction: column; gap: 3px; }

.contract-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  color: inherit;
}

.contract-item:hover {
  border-color: var(--accent);
  background: var(--surface-2);
  text-decoration: none;
  transform: translateX(2px);
}

.contract-name {
  font-size: 0.62rem;
  color: var(--accent);
  font-weight: 700;
  min-width: 72px;
}

.contract-addr {
  font-size: 0.58rem;
  color: var(--text-muted);
  flex: 1;
  font-family: var(--font-body);
}

.contract-link-icon {
  font-size: 0.6rem;
  color: var(--text-muted);
  transition: color 0.15s;
}

.contract-item:hover .contract-link-icon { color: var(--accent); }

/* ===== Activity Feed ===== */
.feed-panel {
  display: flex;
  flex-direction: column;
  max-height: 360px;
}

.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.feed-header h2 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0;
  padding: 0;
  border: none;
}

.feed-count {
  font-size: 0.58rem;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}

#activity-feed {
  flex: 1;
  overflow-y: auto;
  min-height: 150px;
}

.feed-empty {
  color: var(--text-dim);
  text-align: center;
  padding: 2.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
}

.feed-empty-icon {
  font-size: 1.5rem;
  color: var(--accent);
  animation: pulse 2.5s ease-in-out infinite;
}

.feed-empty-sub {
  font-size: 0.62rem;
  color: var(--text-muted);
}

.feed-event {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  animation: feedSlideIn 0.35s ease-out;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.15s;
  cursor: default;
}

.feed-event:hover { background: var(--surface-2); }

@keyframes feedSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.feed-event .event-icon { font-size: 0.85rem; flex-shrink: 0; }

.feed-event .event-type {
  font-weight: 700;
  font-size: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  flex-shrink: 0;
  min-width: 48px;
  text-align: center;
}

.feed-event .event-type.fed { color: var(--green); background: var(--green-dim); border: 1px solid rgba(94,207,130,0.12); }
.feed-event .event-type.hungry { color: var(--yellow); background: var(--yellow-dim); border: 1px solid rgba(245,200,66,0.12); }
.feed-event .event-type.starving { color: var(--red); background: var(--red-dim); border: 1px solid rgba(232,96,96,0.12); }
.feed-event .event-type.visitor { color: var(--blue); background: var(--blue-dim); border: 1px solid rgba(120,180,245,0.12); }
.feed-event .event-type.withdrawn { color: var(--text-dim); background: var(--surface-3); border: 1px solid var(--border); }
.feed-event .event-type.checkin { color: var(--blue); background: var(--blue-dim); border: 1px solid rgba(120,180,245,0.12); }
.feed-event .event-type.chat { color: var(--accent-warm); background: rgba(240,184,136,0.08); border: 1px solid rgba(240,184,136,0.12); }
.feed-event .event-type.social { color: #c78bf5; background: rgba(199,139,245,0.08); border: 1px solid rgba(199,139,245,0.12); }

.feed-event .event-detail {
  flex: 1;
  color: var(--text);
  font-size: 0.68rem;
  line-height: 1.4;
}

.feed-event .event-block {
  color: var(--text-muted);
  font-size: 0.55rem;
  flex-shrink: 0;
}

/* ===== Chat ===== */
.chat-panel { flex: 1; }

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.chat-header h2 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0;
  padding: 0;
  border: none;
}

.agents-only-badge {
  font-size: 0.52rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

#chat-messages {
  height: 170px;
  overflow-y: auto;
  padding: 0.6rem;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.chat-msg {
  font-size: 0.7rem;
  animation: feedSlideIn 0.3s ease-out;
  line-height: 1.5;
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}

.chat-msg.system { color: var(--text-muted); font-style: italic; }
.chat-msg .sender { color: var(--accent); font-weight: 700; flex-shrink: 0; }
.chat-msg .chat-time { color: var(--text-muted); font-size: 0.55rem; flex-shrink: 0; }
.chat-msg .chat-body { color: var(--text-dim); }
.chat-msg.agent-msg .sender { color: var(--blue); }

/* ===== Gas Tank ===== */
.tank-visual {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}

.tank-container {
  width: 85px;
  height: 155px;
  border: 2px solid var(--border);
  border-radius: 6px 6px 14px 14px;
  position: relative;
  overflow: hidden;
  background: var(--bg);
  box-shadow: inset 0 0 25px rgba(0,0,0,0.5), 0 0 0 1px rgba(212,165,116,0.04);
}

.tank-fill {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, var(--accent), rgba(212,165,116,0.3));
  transition: height 1s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0 0 12px 12px;
}

.tank-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: rgba(255,255,255,0.1);
  filter: blur(2px);
}

.tank-bubbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.tank-bubble {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(212,165,116,0.25);
  animation: bubbleRise 3s ease-in infinite;
}

@keyframes bubbleRise {
  0% { transform: translateY(0) scale(1); opacity: 0.5; }
  100% { transform: translateY(-140px) scale(0.3); opacity: 0; }
}

.tank-level {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  color: var(--text);
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
  z-index: 2;
  text-align: center;
  padding: 0.2rem;
}

.tank-markers {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 155px;
  font-size: 0.48rem;
  color: var(--text-muted);
  padding: 2px 0;
}

.tank-stats { margin-bottom: 0.75rem; }

.tank-stat {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(46,38,32,0.4);
  font-size: 0.72rem;
}

.tank-stat-label { color: var(--text-dim); }
.tank-stat-value { font-weight: 700; }

/* ===== Input Fields ===== */
.input-field {
  flex: 1;
  padding: 0.45rem 0.7rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.72rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.input-field::placeholder { color: var(--text-muted); }

/* ===== Lookup ===== */
.lookup-section { margin-bottom: 1rem; }

.lookup-row {
  display: flex;
  gap: 0.5rem;
}

.lookup-result {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-dim);
  min-height: 1.5rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all 0.3s;
}

.lookup-result.has-data { border-color: var(--border); }

.lookup-stat {
  display: flex;
  justify-content: space-between;
  padding: 0.2rem 0;
}

.lookup-stat-label { color: var(--text-muted); }
.lookup-stat-value { font-weight: 700; }

/* ===== Agent Roster ===== */
.roster-section {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.roster-section h2 {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0.6rem;
}

.agent-roster {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 150px;
  overflow-y: auto;
}

.roster-empty {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 0.5rem;
}

.roster-agent {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.65rem;
  cursor: pointer;
  transition: all 0.15s;
  animation: feedSlideIn 0.3s ease-out;
}

.roster-agent:hover {
  border-color: var(--border-hover);
  background: var(--surface-2);
}

.roster-agent .agent-emoji { font-size: 0.85rem; }
.roster-agent .agent-short { color: var(--text-dim); flex: 1; font-family: var(--font-body); }
.roster-agent .agent-hunger { font-size: 0.55rem; font-weight: 700; }

.roster-agent .hunger-fed { color: var(--green); }
.roster-agent .hunger-hungry { color: var(--yellow); }
.roster-agent .hunger-starving { color: var(--red); }
.roster-agent .presence-dot {
  width: 6px; height: 6px; border-radius: 50%; display: inline-block;
  background: var(--text-dim);
}
.roster-agent .presence-dot.present {
  background: var(--green);
  box-shadow: 0 0 4px var(--green);
}

/* ===== Status colors ===== */
.status-fed { color: var(--green); }
.status-hungry { color: var(--yellow); }
.status-starving { color: var(--red); }

/* ===== Modal ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal.hidden { display: none; }

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  width: 360px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(0,0,0,0.5);
  animation: modalSlideUp 0.3s ease;
  position: relative;
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-agent { width: 360px; }

.agent-profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.agent-profile-avatar { font-size: 2.5rem; }

.agent-profile-addr {
  font-size: 0.78rem;
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 700;
}

.agent-profile-status {
  font-size: 0.62rem;
  font-weight: 700;
  margin-top: 2px;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  transition: all 0.15s;
}

.modal-close:hover { border-color: var(--accent); color: var(--accent); }

.agent-profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.profile-stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
}

.profile-stat-label {
  display: block;
  font-size: 0.55rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

.profile-stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--accent);
}

.profile-mini-tank {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.mini-tank-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-warm));
  border-radius: 4px;
  transition: width 0.8s ease;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.72rem;
  z-index: 200;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  animation: toastSlideUp 0.3s ease;
}

.toast.hidden { display: none; }
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error { border-color: var(--red); color: var(--red); }
.toast.info { border-color: var(--accent); color: var(--accent); }

@keyframes toastSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Footer ===== */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.65rem;
  color: var(--text-dim);
}

footer a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

footer a:hover { opacity: 0.75; text-decoration: underline; }

.sep { margin: 0 0.4rem; color: var(--text-muted); }
.footer-tag { color: var(--text-muted); font-family: var(--font-display); font-style: italic; }

/* ===== Number animation ===== */
.stat-value.counting { color: var(--accent-light); text-shadow: 0 0 20px rgba(212,165,116,0.3); }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .main-grid { grid-template-columns: 1fr 1fr; }
  .tank-panel { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  #app { padding: 0.75rem; }

  header { flex-direction: column; gap: 0.75rem; text-align: center; }
  header h1 { font-size: 1.5rem; }
  .header-right { justify-content: center; flex-wrap: wrap; }

  .stat { min-width: 100px; }
  .stat-value { font-size: 1.4rem; }

  .cafe-scene { height: 200px; }
  .cafe-bar { width: 120px; }
  .tables-area { right: 120px; }

  .main-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .tank-panel { grid-column: auto; }

  footer { flex-direction: column; gap: 0.4rem; text-align: center; }

  .modal-content { margin: 1rem; width: calc(100vw - 2rem); }
  .toast { left: 1rem; right: 1rem; max-width: none; }
}

@media (max-width: 480px) {
  header h1 { font-size: 1.25rem; }
  .stat { padding: 0.65rem; }
  .stat-value { font-size: 1.2rem; }
  .cafe-scene { height: 160px; }
  .cafe-bar { width: 90px; }
  .tables-area { right: 90px; padding: 0 8px 8px; }
  .table-surface { width: 70px; }
  .onboarding-grid { grid-template-columns: 1fr; }
}
