@import "tailwindcss";

/* Custom theme layer */
@theme {
  --color-abyss: #0a0e1a;
  --color-deep-sea: #0f1729;
  --color-midnight: #162133;
  --color-brass: #c9a84c;
  --color-brass-bright: #e6c860;
  --color-sea-foam: #3dd6c0;
  --color-rust: #c45a3a;
  --color-parchment: #e8dcc4;
}

/* Base */
body {
  background: linear-gradient(180deg, #0a0e1a 0%, #0f1729 100%);
  font-family: Georgia, 'Times New Roman', serif;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0a0e1a; }
::-webkit-scrollbar-thumb { background: #162133; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #c9a84c; }

/* Card hover */
.game-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.4), 0 0 0 1px rgba(201,168,76,0.2);
}

/* Button styles */
.btn-play {
  background: linear-gradient(135deg, #3dd6c0, #2ba896);
  color: #0a0e1a;
  font-weight: bold;
}
.btn-play:hover {
  background: linear-gradient(135deg, #4ee8d0, #3dd6c0);
}
.btn-mud {
  background: transparent;
  border: 1px solid #c9a84c;
  color: #c9a84c;
}
.btn-mud:hover {
  background: rgba(201,168,76,0.1);
}

/* Inventory slots */
.inv-slot {
  width: 48px;
  height: 48px;
  border: 2px dashed #162133;
  border-radius: 6px;
  background: rgba(15,23,41,0.6);
}
.inv-slot.filled {
  border-style: solid;
  border-color: #c9a84c;
  background: rgba(201,168,76,0.08);
}

/* Dialog log */
.dialog-log {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* MUD mode toggle */
.mud-active {
  display: none;
}
body.mud-mode .graphical-mode { display: none; }
body.mud-mode .mud-active { display: flex; }

/* ScummVM canvas container */
.scummvm-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: #000;
  border: 1px solid #162133;
  border-radius: 8px;
  overflow: hidden;
}
.scummvm-container canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

/* Loading overlay */
.loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10,14,26,0.9);
  z-index: 10;
}

/* ── Mobile Responsive ─────────────────────────── */
@media (max-width: 768px) {
  .scummvm-container {
    aspect-ratio: 4/3;
  }
  .loading-overlay {
    padding: 1rem;
  }
  .loading-overlay .text-4xl {
    font-size: 2rem;
  }
  /* Stack sidebar below game area on mobile */
  .grid-cols-1.lg\:grid-cols-\[1fr_320px\] {
    grid-template-columns: 1fr;
  }
  /* Inventory grid: 3 columns on small screens */
  #inventory-grid {
    grid-template-columns: repeat(6, 1fr) !important;
  }
  .inv-slot {
    width: 40px;
    height: 40px;
  }
  /* Controls grid: 2 columns on mobile */
  .grid-cols-2.md\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  /* Dialog log: shorter on mobile */
  .dialog-log.h-40 {
    height: 120px;
  }
  /* Gallery: 2 columns on mobile */
  .grid-cols-2.sm\:grid-cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  /* Inventory grid: 4 columns on very small screens */
  #inventory-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
  .inv-slot {
    width: 36px;
    height: 36px;
  }
  /* Header: smaller text */
  .text-lg {
    font-size: 0.95rem;
  }
  /* Section spacing */
  .max-w-7xl {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* MUD mode toggle — now a link, keep hover style */
a#mud-toggle {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
a#mud-toggle:hover {
  background: rgba(201,168,76,0.1);
  color: var(--brass-bright);
}
