@font-face {
  font-family: 'Geist';
  src: url('https://musechain.io/fonts/geist/geist-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg-primary: #0a0b0d;
  --bg-surface: #121418;
  --bg-card: #181b22;
  --bg-card-hover: #1f232b;
  --text-main: #f0f3f6;
  --text-muted: #8b949e;
  --accent-lime: #ccff00;
  --accent-lime-dim: rgba(204, 255, 0, 0.15);
  --accent-cyan: #00f0ff;
  --border-color: #272d38;
  --border-focus: #444d5d;
  --status-red: #ff4a5a;
  --status-yellow: #f59e0b;
  --status-green: #10b981;
  --font-family: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  color: #e2e8f0;
}

/* Header & Passport Ribbon */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 1rem;
}

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

.badge-tag {
  background: var(--accent-lime);
  color: #000;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.passport-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.88rem;
}

.agent-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

.agent-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-lime);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-lime);
}

.agent-name {
  font-weight: 600;
  color: var(--text-main);
}

.nav-link {
  color: var(--text-muted);
}

.nav-link:hover {
  color: var(--text-main);
  text-decoration: none;
}

/* Layout Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Hero / Contract Banner */
.contract-banner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  align-items: center;
}

.banner-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  width: fit-content;
}

.pulsar {
  width: 6px;
  height: 6px;
  background: #34d399;
  border-radius: 50%;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

.hero-title {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.contract-address-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.contract-address-box .label {
  font-size: 0.75rem;
  color: var(--accent-lime);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.contract-address-box .addr {
  font-size: 0.88rem;
  color: #fff;
}

.btn-scan {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-lime);
  margin-left: auto;
}

.banner-right {
  display: flex;
  justify-content: center;
}

.cover-frame {
  position: relative;
  width: 100%;
  max-width: 380px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.cover-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.overlay-tag {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: var(--accent-lime);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
}

/* Stat Ribbon */
.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stat-val.highlight {
  color: var(--accent-lime);
}

.stat-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stamina-track {
  width: 100%;
  height: 8px;
  background: #272d38;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}

.stamina-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, var(--accent-lime));
  transition: width 0.4s ease, background 0.3s ease;
}

/* Workspace Split */
.workspace-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
}

.panel-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

.panel-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.contract-call-tag {
  font-size: 0.75rem;
  font-family: monospace;
  background: rgba(204, 255, 0, 0.1);
  color: var(--accent-lime);
  border: 1px solid var(--accent-lime);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Transaction Notifications */
.tx-notice {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--bg-card);
  border-left: 4px solid var(--accent-lime);
  padding: 1rem;
  border-radius: 6px;
  position: relative;
  transition: opacity 0.3s ease;
}

.tx-notice.hidden {
  display: none;
}

.tx-notice.pending {
  border-color: var(--status-yellow);
}

.tx-notice.success {
  border-color: var(--status-green);
}

.tx-notice.error {
  border-color: var(--status-red);
}

.notice-icon {
  font-size: 1.4rem;
}

.notice-content h4 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.notice-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.notice-hash {
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--accent-lime);
  margin-top: 0.35rem;
  word-break: break-all;
}

.notice-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  margin-left: auto;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-card);
}

.tab-btn.active {
  color: #000;
  background: var(--accent-lime);
}

.tab-content {
  display: none;
  flex-direction: column;
  gap: 1.25rem;
}

.tab-content.active {
  display: flex;
}

/* Action Cards */
.action-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.fn-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #ef4444;
  color: #fff;
  padding: 2px 6px;
  border-radius: 3px;
}

.action-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-row .field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

input, select {
  background: #0d0f13;
  border: 1px solid var(--border-color);
  color: #fff;
  font-family: var(--font-family);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}

input:focus, select:focus {
  border-color: var(--accent-lime);
}

.action-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.cost-indicator {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: monospace;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-outline {
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 9px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: var(--accent-lime);
  color: #000;
}

.btn-primary:hover:not(:disabled) {
  background: #ddff33;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #2563eb;
  color: #fff;
}

.btn-secondary:hover:not(:disabled) {
  background: #3b82f6;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--accent-lime);
  color: var(--accent-lime);
}

.btn-outline:hover:not(:disabled) {
  background: var(--accent-lime-dim);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(1);
}

/* Match list under challenge */
.pending-box {
  margin-top: 0.5rem;
}

.subheading {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.match-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.match-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.match-item .opp-team {
  font-weight: 600;
}

.match-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-sm-accept {
  background: var(--accent-lime);
  color: #000;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-sm-decline {
  background: rgba(255, 74, 90, 0.2);
  color: var(--status-red);
  border: 1px solid var(--status-red);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  cursor: pointer;
}

/* Tactical Pitch Hologram */
.pitch-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pitch-grass {
  position: relative;
  width: 100%;
  height: 220px;
  background: radial-gradient(circle at center, #0f2e1a 0%, #06150c 100%);
  border: 2px solid #1c5230;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 255, 128, 0.1);
}

.pitch-line {
  position: absolute;
  border: 1px solid rgba(46, 204, 113, 0.35);
}

.pitch-line.half-way {
  top: 0;
  bottom: 0;
  left: 50%;
  border-left: 1px solid rgba(46, 204, 113, 0.35);
}

.pitch-line.center-circle {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  border-radius: 50%;
}

.pitch-line.penalty-box.left {
  top: 40px;
  bottom: 40px;
  left: 0;
  width: 45px;
  border-left: none;
}

.pitch-line.penalty-box.right {
  top: 40px;
  bottom: 40px;
  right: 0;
  width: 45px;
  border-right: none;
}

.player-dot {
  position: absolute;
  width: 26px;
  height: 26px;
  background: var(--accent-lime);
  color: #000;
  font-weight: 800;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(204, 255, 0, 0.8);
  cursor: pointer;
  transition: transform 0.3s ease;
}

.player-dot:hover {
  transform: scale(1.2);
}

.player-dot.gk { top: 44%; left: 8%; }
.player-dot.def1 { top: 25%; left: 24%; }
.player-dot.def2 { top: 65%; left: 24%; }
.player-dot.mid1 { top: 35%; left: 42%; }
.player-dot.mid2 { top: 58%; left: 42%; }
.player-dot.fwd { top: 45%; left: 70%; }

.pitch-status-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
}

.pitch-status-bar .pill-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent-lime);
}

.status-msg {
  color: var(--text-muted);
}

/* Specs & Read Inspect Table */
.read-specs {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
}

.read-specs h4 {
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
}

.spec-table {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.spec-fn {
  font-family: monospace;
  color: var(--text-main);
}

.spec-type {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.spec-val {
  font-weight: 600;
  color: var(--accent-lime);
}

.data-mode-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: #34d399;
  margin-top: 0.75rem;
}

.dot-online {
  width: 6px;
  height: 6px;
  background: #34d399;
  border-radius: 50%;
}

/* Event Feed */
.log-box {
  background: #0a0b0d;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.clear-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
}

.clear-btn:hover {
  color: #fff;
}

.log-stream {
  font-family: monospace;
  font-size: 0.78rem;
  max-height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.log-line {
  line-height: 1.4;
  color: #cbd5e1;
}

.log-line .time {
  color: #64748b;
  margin-right: 0.4rem;
}

.log-line.success { color: #86efac; }
.log-line.warning { color: #fde047; }
.log-line.error { color: #fca5a5; }

/* Studio Footer */
.studio-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.studio-footer h4 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.clean-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Responsiveness */
@media (max-width: 900px) {
  .contract-banner {
    grid-template-columns: 1fr;
  }
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}