/* Morris Games Archive — Retro CRT Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;700&family=Press+Start+2P&family=Space+Mono:wght@400;700&display=swap');

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

:root {
  --crt-bg: #0a0a0f;
  --crt-green: #7ae67a;
  --crt-green-dim: #4a9e4a;
  --crt-text: #c8f0c8;
  --crt-muted: #6a9a6a;
  --crt-border: #2a4a2a;
  --crt-card: #0d160d;
}

body {
  background-color: var(--crt-bg);
  color: var(--crt-text);
  font-family: 'IBM Plex Mono', 'Space Mono', monospace;
  min-height: 100vh;
  position: relative;
}

/* Scanline overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  pointer-events: none;
  z-index: 1000;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--crt-border);
  padding: 24px 0 0;
  text-align: center;
}

.site-header .logo {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.85rem;
  color: var(--crt-green);
  letter-spacing: 2px;
  text-shadow: 0 0 12px rgba(122, 230, 122, 0.5);
  display: block;
  margin-bottom: 8px;
  padding: 0 20px;
  line-height: 1.8;
}

.site-header .subtitle {
  font-size: 0.72rem;
  color: var(--crt-muted);
  letter-spacing: 1px;
  padding-bottom: 20px;
}

/* Navigation */
.site-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  border-top: 1px solid var(--crt-border);
  background: rgba(0, 10, 0, 0.5);
}

.site-nav a {
  color: var(--crt-muted);
  text-decoration: none;
  font-size: 0.7rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 10px 20px;
  border-right: 1px solid var(--crt-border);
  transition: color 0.2s, background 0.2s;
}

.site-nav a:first-child {
  border-left: 1px solid var(--crt-border);
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--crt-green);
  background: rgba(122, 230, 122, 0.05);
  text-shadow: 0 0 8px rgba(122, 230, 122, 0.3);
}

/* Container */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Page headings */
.page-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.95rem;
  color: var(--crt-green);
  text-align: center;
  padding: 40px 0 16px;
  letter-spacing: 2px;
  text-shadow: 0 0 15px rgba(122, 230, 122, 0.4);
  line-height: 1.8;
}

.page-subtitle {
  text-align: center;
  color: var(--crt-muted);
  font-size: 0.75rem;
  margin-bottom: 40px;
  letter-spacing: 1px;
  line-height: 1.8;
}

/* Game grid (index page) */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.game-card {
  background: var(--crt-card);
  border: 1px solid var(--crt-border);
  padding: 22px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.game-card:hover {
  border-color: var(--crt-green);
  box-shadow: 0 0 14px rgba(122, 230, 122, 0.08);
}

.game-card .game-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  color: var(--crt-green);
  margin-bottom: 10px;
  line-height: 1.8;
}

.game-card .game-title a {
  color: inherit;
  text-decoration: none;
}

.game-card .game-title a:hover {
  text-shadow: 0 0 8px rgba(122, 230, 122, 0.5);
}

.game-card .game-meta {
  font-size: 0.68rem;
  color: var(--crt-muted);
  margin-bottom: 10px;
  line-height: 1.6;
}

.game-card .game-desc {
  font-size: 0.76rem;
  color: var(--crt-text);
  line-height: 1.7;
  margin-bottom: 14px;
}

.badge {
  display: inline-block;
  font-size: 0.6rem;
  padding: 3px 7px;
  border: 1px solid var(--crt-border);
  color: var(--crt-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-right: 5px;
  margin-bottom: 4px;
  font-family: 'IBM Plex Mono', monospace;
}

.badge.arcade { border-color: #3a6a3a; color: #7ae67a; }
.badge.puzzle { border-color: #3a506a; color: #7ac0e6; }

/* Info box */
.info-box {
  border: 1px solid var(--crt-border);
  background: var(--crt-card);
  padding: 18px 22px;
  margin: 20px 0 60px;
  font-size: 0.78rem;
  color: var(--crt-muted);
  line-height: 1.9;
}

.info-box strong {
  color: var(--crt-green);
}

/* Game page header */
.game-header {
  padding: 36px 0 20px;
  border-bottom: 1px solid var(--crt-border);
  margin-bottom: 0;
}

.game-header .breadcrumb {
  font-size: 0.68rem;
  color: var(--crt-muted);
  margin-bottom: 14px;
  letter-spacing: 1px;
}

.game-header .breadcrumb a {
  color: var(--crt-muted);
  text-decoration: none;
}

.game-header .breadcrumb a:hover {
  color: var(--crt-green);
}

.game-header h1 {
  font-family: 'Press Start 2P', monospace;
  font-size: 1rem;
  color: var(--crt-green);
  text-shadow: 0 0 15px rgba(122, 230, 122, 0.4);
  margin-bottom: 10px;
  line-height: 1.7;
}

.game-header .meta {
  font-size: 0.7rem;
  color: var(--crt-muted);
  letter-spacing: 1px;
}

/* Screen / Emulator area */
.screen-wrap {
  background: #050808;
  border: 2px solid #2a4a2a;
  padding: 16px;
  margin: 28px 0 16px;
  box-shadow:
    0 0 30px rgba(122, 230, 122, 0.06),
    inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.screen-label {
  font-size: 0.62rem;
  color: var(--crt-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.screen-frame {
  background: #030505;
  border: 1px solid #1a3a1a;
  aspect-ratio: 4 / 3;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.screen-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.screen-inner canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.screen-placeholder-text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  color: var(--crt-green-dim, #4a9e4a);
  text-align: left;
  line-height: 2;
  padding: 20px 30px;
  white-space: pre;
}

.screen-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

/* Buttons */
.btn {
  background: transparent;
  border: 1px solid var(--crt-green);
  color: var(--crt-green);
  padding: 10px 22px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: background 0.15s, color 0.15s;
}

.btn:hover:not(:disabled) {
  background: var(--crt-green);
  color: #0a0a0f;
}

.btn:disabled {
  border-color: #2a4a2a;
  color: var(--crt-muted);
  cursor: not-allowed;
}

/* Key mapping */
.key-map {
  background: var(--crt-card);
  border: 1px solid var(--crt-border);
  padding: 14px 20px;
  max-width: 640px;
  margin: 0 auto 28px;
}

.key-map h4 {
  font-size: 0.62rem;
  color: var(--crt-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.key-map table {
  width: 100%;
  font-size: 0.76rem;
  border-collapse: collapse;
}

.key-map td {
  padding: 4px 6px;
  color: var(--crt-text);
}

.key-map td:first-child {
  color: var(--crt-green);
  width: 130px;
}

kbd {
  display: inline-block;
  background: #1a2a1a;
  border: 1px solid #3a5a3a;
  padding: 1px 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--crt-green);
}

/* Info note */
.load-note {
  background: var(--crt-card);
  border-left: 3px solid var(--crt-green-dim, #4a9e4a);
  padding: 12px 16px;
  margin: 12px auto;
  max-width: 640px;
  font-size: 0.74rem;
  color: var(--crt-muted);
  line-height: 1.8;
}

.load-note code {
  color: var(--crt-green);
  font-family: 'IBM Plex Mono', monospace;
}

/* Tabs */
.tabs {
  margin: 28px 0 60px;
  border: 1px solid var(--crt-border);
}

.tab-nav {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--crt-border);
  background: rgba(0, 10, 0, 0.4);
}

.tab-btn {
  background: transparent;
  border: none;
  border-right: 1px solid var(--crt-border);
  padding: 12px 18px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  color: var(--crt-muted);
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.tab-btn:hover {
  color: var(--crt-green);
  background: rgba(122, 230, 122, 0.04);
}

.tab-btn.active {
  color: var(--crt-green);
  background: rgba(122, 230, 122, 0.07);
  border-bottom: 1px solid var(--crt-bg);
  margin-bottom: -1px;
}

.tab-content {
  padding: 24px;
  display: none;
}

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

.tab-content h3 {
  font-size: 0.72rem;
  color: var(--crt-green);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.tab-content p,
.tab-content li {
  font-size: 0.8rem;
  line-height: 1.9;
  color: var(--crt-text);
  margin-bottom: 10px;
}

.tab-content ul,
.tab-content ol {
  padding-left: 22px;
}

.tab-content a {
  color: var(--crt-green);
}

.tab-content strong {
  color: var(--crt-green);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--crt-border);
  padding: 24px;
  text-align: center;
  font-size: 0.68rem;
  color: var(--crt-muted);
  letter-spacing: 1px;
  margin-top: 0;
  line-height: 1.8;
}

.site-footer a {
  color: var(--crt-green);
  text-decoration: none;
}

/* Responsive */
@media (max-width: 600px) {
  .game-grid {
    grid-template-columns: 1fr;
  }

  .page-title {
    font-size: 0.65rem;
  }

  .game-header h1 {
    font-size: 0.7rem;
  }

  .site-nav a {
    padding: 8px 12px;
    font-size: 0.62rem;
  }

  .screen-placeholder-text {
    font-size: 0.65rem;
    padding: 16px;
    white-space: pre-wrap;
  }
}
