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

/* ========== OCEAN BACKGROUND ========== */
#ocean-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

#lobsters {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.pixel-lobster {
  position: absolute;
  filter: saturate(0.7) brightness(0.8);
  image-rendering: pixelated;
  text-shadow: 0 0 10px rgba(255, 100, 50, 0.3);
  transform-origin: center;
  will-change: transform;
}

.pixel-bubble {
  position: fixed;
  background: radial-gradient(circle at 30% 30%, rgba(150, 220, 255, 0.6), rgba(100, 180, 220, 0.2));
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
  box-shadow: inset 0 0 3px rgba(255, 255, 255, 0.4);
}

:root {
  --bg-dark: #0a0a0f;
  --bg-card: #12121a;
  --bg-card-hover: #1a1a25;
  --text-primary: #e0e0e0;
  --text-secondary: #888;
  --accent: #ff6b35;
  --accent-glow: rgba(255, 107, 53, 0.3);
  --border: #2a2a3a;
  --molt-orange: #ff6b35;
  --success: #4ade80;
  --grid-line: #1e1e2e;
  --grid-block: #16161f;
}

body {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
  background: transparent;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  position: relative;
}

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

a:hover {
  text-decoration: underline;
}

/* Header - Compact */
header {
  text-align: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo {
  font-size: 2rem;
  margin: 0;
}

header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent) 0%, #ff9f6b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

.tagline {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 0;
  display: none;
}

@media (min-width: 800px) {
  .tagline {
    display: block;
  }
}

/* Hero CTAs */
.hero-ctas {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.cta-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(18, 18, 26, 0.8);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.cta-btn:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.cta-agent {
  border-color: var(--accent);
}

.cta-agent:hover {
  background: rgba(255, 107, 53, 0.1);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.cta-human:hover {
  border-color: #6b8aff;
  background: rgba(107, 138, 255, 0.1);
}

.cta-icon {
  font-size: 1.1rem;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 1rem;
  overflow-y: auto;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: rgba(18, 18, 26, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 2rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

/* Instructions Panel */
.instructions-panel h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.instructions-panel .intro {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.step {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.step-num {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.step-content h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.step-content code {
  display: block;
  background: var(--bg-dark);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  margin: 0.5rem 0;
  white-space: pre-wrap;
  word-break: break-all;
}

.step-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Info boxes for humans */
.info-box {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.info-box h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.info-box.highlight {
  border-color: var(--accent);
  background: rgba(255, 107, 53, 0.05);
}

.info-box ol {
  margin-left: 1.25rem;
}

.info-box li {
  margin-bottom: 0.5rem;
}

.price-big {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.price-table {
  width: 100%;
  font-size: 0.9rem;
}

.price-table td {
  padding: 0.25rem 0;
}

.price-table td:last-child {
  text-align: right;
  color: var(--text-secondary);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  font-family: inherit;
  cursor: pointer;
  border: none;
}

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--accent-glow);
  text-decoration: none;
}

/* Stats Bar - Compact */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.5rem 1rem;
  background: rgba(18, 18, 26, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.stat {
  text-align: center;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Grid Section - Square grid focused */
.grid-section {
  display: flex;
  gap: 1rem;
  max-width: 100%;
  margin: 0 auto;
  padding: 1rem;
  height: calc(100vh - 90px);
  min-height: 500px;
}

@media (max-width: 900px) {
  .grid-section {
    flex-direction: column;
    height: auto;
  }
}

/* Grid Container - Square aspect ratio */
.grid-container {
  background: rgba(18, 18, 26, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.grid-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.grid-controls button {
  background: var(--border);
  color: var(--text-primary);
  border: none;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.grid-controls button:hover {
  background: var(--accent);
}

.zoom-level {
  margin-left: auto;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.grid-wrapper {
  position: relative;
  overflow: auto;
  flex: 1;
  background: var(--grid-block);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#pixel-grid {
  display: block;
  cursor: crosshair;
  image-rendering: pixelated;
  width: 2000px;
  height: 500px;
  min-width: 2000px;
  min-height: 500px;
}

/* Tooltip */
.tooltip {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 100;
  max-width: 250px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.tooltip.visible {
  opacity: 1;
}

.tooltip .owner {
  color: var(--accent);
  font-weight: 600;
}

.tooltip .coords {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.tooltip .available {
  color: var(--success);
  font-weight: 600;
}

/* Sidebar - Compact */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
}

.panel {
  background: rgba(18, 18, 26, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
}

.panel h2 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

/* Selected Panel */
#selected-info {
  min-height: 60px;
}

.no-selection {
  color: var(--text-secondary);
  font-style: italic;
  font-size: 0.8rem;
}

.selected-details {
  font-size: 0.8rem;
}

.selected-details p {
  margin-bottom: 0.35rem;
}

.selected-details .label {
  color: var(--text-secondary);
}

.selected-details .value {
  color: var(--text-primary);
  font-weight: 600;
}

.selected-details img {
  max-width: 100%;
  border-radius: 4px;
  margin-top: 0.5rem;
}

/* Leaderboard */
.leaderboard {
  list-style: none;
}

.leaderboard li {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
}

.leaderboard li:last-child {
  border-bottom: none;
}

.leaderboard .username {
  color: var(--accent);
}

.leaderboard .pixels {
  color: var(--text-secondary);
}

/* Quick Links */
.quick-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.quick-links h2 {
  margin-bottom: 0.35rem;
}

.quick-link {
  display: block;
  padding: 0.35rem 0.5rem;
  background: var(--bg-dark);
  border-radius: 5px;
  font-size: 0.75rem;
  transition: background 0.2s;
}

.quick-link:hover {
  background: var(--border);
  text-decoration: none;
}

/* Footer - Minimal */
footer {
  text-align: center;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.75rem;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

footer p {
  margin: 0;
}

.motto {
  font-style: italic;
}

.links a {
  margin: 0 0.3rem;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}
