/* YonoGamesNew — lightweight directory styles (no framework) */

:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --text: #1a1d26;
  --muted: #5c6578;
  --line: #e6e8ef;
  --brand: #6b3fa0;
  --brand-hover: #5a3488;
  --brand-soft: #f3eef9;
  --focus: #2b6cb0;
  --danger-soft: #fff5f5;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(26, 29, 38, 0.06), 0 4px 12px rgba(26, 29, 38, 0.04);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --max: 720px;
  --tap: 44px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--brand-hover);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: var(--surface);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  z-index: 100;
}

.skip-link:focus {
  top: 0.75rem;
}

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.logo {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo:hover {
  color: var(--brand);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--brand);
}

/* Main */
.site-main {
  padding: 1.25rem 0 3rem;
}

.page-hero {
  margin-bottom: 1.25rem;
}

.page-hero h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.page-hero p {
  margin: 0;
  color: var(--muted);
  max-width: 40rem;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1rem 0 0.85rem;
  flex-wrap: wrap;
}

.toolbar h2 {
  margin: 0;
  font-size: 1.05rem;
}

.toolbar-meta {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.sort-control {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.sort-control select {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  min-height: var(--tap);
  cursor: pointer;
}

.notice {
  background: var(--brand-soft);
  border: 1px solid #e0d4f0;
  color: var(--text);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.notice strong {
  font-weight: 700;
}

.category-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

.lead {
  margin: 0.35rem 0 0;
  color: var(--muted);
  max-width: 40rem;
}

.muted-note {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Game cards */
.game-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.game-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.85rem;
}

.game-card-body {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem 0.85rem;
  align-items: center;
}

.game-card-main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem 0.85rem;
  align-items: start;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.game-card-main:hover .game-name {
  color: var(--brand);
}

.game-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
  background: linear-gradient(145deg, #ece7f5, #f7f5fb);
  border: 1px solid var(--line);
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
}

.game-meta {
  min-width: 0;
}

.game-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.game-category {
  margin: 0.3rem 0 0;
}

.game-card-summary {
  margin: 0.4rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.related-meta {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: none;
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

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

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

.btn-secondary {
  background: var(--surface);
  color: var(--brand);
  border: 1px solid #d7c8ea;
}

.btn-secondary:hover {
  background: var(--brand-soft);
  color: var(--brand-hover);
}

.card-action {
  justify-self: end;
}

/* Detail pages */
.breadcrumbs {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.breadcrumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.4rem;
}

.breadcrumbs li:not(:last-child)::after {
  content: ">";
  margin-left: 0.4rem;
  color: #9aa3b5;
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--brand);
}

.breadcrumbs [aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

.detail-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.detail-header .game-icon {
  width: 88px;
  height: 88px;
  border-radius: 20px;
}

.detail-header h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  letter-spacing: -0.03em;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.content-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 0.85rem;
}

.content-block h2 {
  margin: 0 0 0.55rem;
  font-size: 1.1rem;
}

.content-block h3 {
  margin: 1rem 0 0.35rem;
  font-size: 1rem;
}

.content-block p,
.content-block li {
  color: var(--muted);
}

.content-block ul,
.content-block ol {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
}

.key-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.key-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

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

.key-list span {
  color: var(--muted);
}

.disclaimer {
  background: var(--danger-soft);
  border-color: #f0d4d4;
}

.faq details {
  border-top: 1px solid var(--line);
  padding: 0.65rem 0;
}

.faq details:first-of-type {
  border-top: none;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}

.faq p {
  margin: 0.4rem 0 0;
}

.related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.related-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
  background: var(--bg);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  font-weight: 600;
}

.related-list a:hover {
  border-color: #d7c8ea;
  color: var(--brand);
}

/* Info pages */
.prose {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  box-shadow: var(--shadow);
}

.prose h1 {
  margin-top: 0;
  font-size: 1.65rem;
  letter-spacing: -0.03em;
}

.prose h2 {
  font-size: 1.15rem;
  margin-top: 1.4rem;
}

.prose p,
.prose li {
  color: var(--muted);
}

.contact-email {
  font-size: 1.05rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.last-updated {
  font-size: 0.9rem;
}

.placeholder-field {
  font-family: ui-monospace, monospace;
  font-size: 0.88rem;
  background: #f0f2f7;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2rem;
  margin-top: auto;
}

.footer-inner {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.footer-summary {
  grid-column: 1 / -1;
}

.footer-summary p {
  max-width: 38rem;
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-brand {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.footer-heading {
  margin: 0 0 0.45rem;
  color: var(--text);
  font-weight: 700;
  font-size: 0.9rem;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
}

.footer-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.footer-nav a:hover {
  color: var(--brand);
}

.footer-email {
  display: inline-block;
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.footer-note {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

/* 404 */
.error-panel {
  text-align: center;
  padding: 2.5rem 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.error-panel h1 {
  margin: 0 0 0.5rem;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.error-help {
  margin: 1rem 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* Mobile refinements */
@media (max-width: 540px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.45rem;
  }

  .game-card-body {
    grid-template-columns: 1fr;
  }

  .card-action {
    width: 100%;
  }

  .card-action .btn {
    width: 100%;
  }

  .detail-header {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .site-nav {
    gap: 0.55rem 0.85rem;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-summary,
  .footer-note {
    grid-column: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
