/* Palette borrowed from the VIC-II, but kept legible rather than authentic. */
:root {
  --c64-blue:        #40318d;
  --c64-light-blue:  #7869c4;
  --c64-cyan:        #7abfc7;
  --c64-yellow:      #d5df7c;
  --c64-grey:        #959595;

  --bg:        #0d0c14;
  --bg-raised: #17162099;
  --border:    #2a2838;
  --text:      #e6e4f0;
  --text-dim:  #9b98ae;

  --radius: 10px;
}

* { box-sizing: border-box; }

/* `hidden` must beat the display values set by .grid and .player below,
   which would otherwise win on specificity and show them anyway. */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c64-cyan); }

/* ---------- header / footer ---------- */

.site-header {
  padding: 3rem 1.5rem 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.site-header h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c64-yellow);
}

.tagline {
  margin: 0.6rem 0 0;
  color: var(--text-dim);
}

.site-footer {
  margin-top: 4rem;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}

.site-footer p { margin: 0; max-width: 60ch; margin-inline: auto; }

/* ---------- status ---------- */

.status {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-dim);
}

.status[data-state="error"] { color: #ff8a80; }

/* ---------- grid ---------- */

.grid {
  list-style: none;
  margin: 2.5rem auto;
  padding: 0 1.5rem;
  max-width: 1100px;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}

.card:hover,
.card:focus-visible {
  border-color: var(--c64-light-blue);
  transform: translateY(-2px);
  outline: none;
}

.card:focus-visible { box-shadow: 0 0 0 2px var(--c64-cyan); }

/* Stand-in for a screenshot: a C64 screen with the group's initials.
   Replaced by real thumbnails once we can capture them. */
.card-screen {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  background: var(--c64-blue);
  border-bottom: 1px solid var(--border);
}

.card-initials {
  font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  letter-spacing: 0.18em;
  color: var(--c64-light-blue);
  text-transform: uppercase;
}

.card-body { padding: 0.9rem 1rem 1.1rem; }

.card-title {
  margin: 0;
  font-size: 1.05rem;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: var(--c64-yellow);
}

.card-group { margin: 0.15rem 0 0; color: var(--text); }

.card-tags {
  margin-top: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.tag-platform { color: var(--c64-cyan); border-color: #2f4a52; }
.tag-todo     { color: var(--c64-grey); border-style: dashed; }

.card-description {
  margin: 0.7rem 0 0;
  font-size: 13px;
  color: var(--text-dim);
}

/* ---------- player overlay ---------- */

.player {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: #000;
}

.player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1rem;
  background: #0d0c14;
  border-bottom: 1px solid var(--border);
}

.player-meta {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  min-width: 0;
}

.player-title {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: var(--c64-yellow);
}

.player-group { color: var(--text-dim); font-size: 13px; }

.player-close {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.player-close:hover { border-color: var(--c64-light-blue); }

.player-close kbd {
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-dim);
}

.player-stage {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
}

/* The C64 frame is 4:3; letterbox it rather than stretching the pixels. */
.player-stage iframe {
  width: 100%;
  height: 100%;
  max-width: calc(100vh * 4 / 3);
  border: 0;
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover, .card:focus-visible { transform: none; }
}
