/* Game-a-vision shared styles. Blue theme, phone-first. */

:root {
  --bg: #0b1a33;
  --panel: #13284d;
  --panel-2: #1a3562;
  --line: #2b4c80;
  --text: #e6f0ff;
  --muted: #a9c2e6;
  --accent: #7fc1ff;
  --accent-strong: #bfe0ff;
  --radius: 10px;
  --gutter: 16px;
  --max: 960px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

img, video, iframe { max-width: 100%; }

a { color: var(--accent); }
a:hover, a:focus-visible { color: var(--accent-strong); }
a:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: 1.8rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

main.wrap { flex: 1 0 auto; padding-top: 24px; padding-bottom: 24px; }

/* Header */
.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--accent-strong); }
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.site-nav a {
  color: var(--text);
  text-decoration: none;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* Footer */
.site-footer {
  background: var(--panel);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}
.site-footer .wrap { padding-top: 14px; padding-bottom: 14px; }
.site-footer p { margin: 0; }

/* Panels and cards */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--gutter);
}
.lead { color: var(--muted); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
}
.card:hover,
.card:focus-visible { border-color: var(--accent); background: var(--panel-2); color: var(--text); }
.card-body { padding: 12px var(--gutter) var(--gutter); }
.card-body h2, .card-body h3 { margin-bottom: 4px; }
.card-body p { color: var(--muted); font-size: 0.92rem; margin: 0; }
.card-art {
  display: block;
  aspect-ratio: 4 / 3;
  background: linear-gradient(160deg, var(--panel-2), var(--bg));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.section + .section { margin-top: 32px; }
.section > h2 { border-bottom: 1px solid var(--line); padding-bottom: 6px; }

/* Ruffle player: scales to container, keeps aspect ratio */
.player {
  width: 600px;
  max-width: 100%;
  aspect-ratio: 600 / 408;
  margin: 0 auto;
  background: #999999;
  border-radius: 4px;
  overflow: hidden;
}
.player > * {
  display: block;
  width: 100%;
  height: 100%;
}
.player-note { color: var(--muted); font-size: 0.9rem; margin-top: 12px; text-align: center; }

/* Wallpapers */
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.thumb {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.thumb:hover, .thumb:focus-visible { border-color: var(--accent); }
.thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--bg);
}
.thumb span {
  display: block;
  padding: 6px 8px;
  font-size: 0.82rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* Posters */
.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.file-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px var(--gutter);
}
.file-list .name { font-weight: 600; overflow-wrap: anywhere; }
.btn {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
}
.btn:hover, .btn:focus-visible { background: var(--accent-strong); color: var(--bg); }

/* Videos */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.video-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #000;
}
.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-soon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: repeating-linear-gradient(45deg, var(--panel), var(--panel) 10px, var(--panel-2) 10px, var(--panel-2) 20px);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.video-card .card-body { padding: 12px var(--gutter) var(--gutter); }
.video-card p { color: var(--muted); font-size: 0.92rem; margin: 0; }

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

/* 404 */
.center { text-align: center; }
.big-code { font-size: 4rem; font-weight: 800; color: var(--accent); margin: 0; line-height: 1; }

@media (min-width: 720px) {
  h1 { font-size: 2.2rem; }
  main.wrap { padding-top: 36px; padding-bottom: 36px; }
}
