/* ---------- Design tokens ---------- */
:root {
  --bg: #f7f5f0;          /* warm off-white */
  --bg-soft: #efece4;
  --surface: #ffffff;
  --ink: #16130f;         /* near-black text */
  --ink-soft: #5d574e;    /* muted text */
  --line: #e1ddd3;        /* hairline borders */
  --line-strong: #16130f;

  --red: #d83a2c;         /* Portuguese red — primary accent */
  --red-dark: #bd2c20;
  --green: #0e7549;       /* secondary accent */
  --yellow: #e7a92c;      /* warm gold — trading-card accent */
  --blue: #1f5d8c;

  --radius: 10px;
  --maxw: 1140px;

  --shadow-sm: 0 1px 2px rgba(22, 19, 15, 0.05), 0 4px 14px rgba(22, 19, 15, 0.06);
  --shadow-md: 0 6px 20px rgba(22, 19, 15, 0.1), 0 2px 6px rgba(22, 19, 15, 0.06);
  --shadow-lg: 0 18px 44px rgba(22, 19, 15, 0.14);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  /* warm paper: a soft highlight from the top + a faint film grain */
  background-image:
    radial-gradient(120% 75% at 50% -8%, rgba(231, 169, 44, 0.08), transparent 62%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* thin accent strip across the very top — the 3-bar motif */
body::before {
  content: "";
  display: block;
  height: 5px;
  background: linear-gradient(
    90deg,
    var(--green) 0 33.33%,
    var(--yellow) 33.33% 66.66%,
    var(--red) 66.66% 100%
  );
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

.muted {
  color: var(--ink-soft);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 245, 240, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(22, 19, 15, 0.02), 0 6px 20px rgba(22, 19, 15, 0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

/* 3-bar identity mark (matches the favicon + top strip) */
.brand-mark {
  width: 22px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 2px;
  background:
    linear-gradient(var(--green) 0 0) left / 5px 100% no-repeat,
    linear-gradient(var(--yellow) 0 0) center / 5px 100% no-repeat,
    linear-gradient(var(--red) 0 0) right / 5px 100% no-repeat;
}

/* language switcher (flags) */
.lang-switch {
  display: inline-flex;
  gap: 6px;
}

.lang-btn {
  display: inline-flex;
  padding: 3px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  line-height: 0;
  opacity: 0.45;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.lang-btn img {
  display: block;
  width: 26px;
  height: 20px;
  border-radius: 2px;
  object-fit: cover;
}

.lang-btn:hover {
  opacity: 0.85;
}

.lang-btn.active {
  opacity: 1;
  border-color: var(--ink);
}

.nav {
  display: flex;
  gap: 30px;
  font-size: 0.92rem;
  font-weight: 600;
}

.nav a {
  color: var(--ink);
  position: relative;
  padding: 4px 0;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--red);
  transition: width 0.18s ease;
}

.nav a:hover::after {
  width: 100%;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 14px 26px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.95rem;
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  cursor: pointer;
  border: 2px solid var(--ink);
  transition: transform 0.14s ease, box-shadow 0.18s ease,
    background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 4px 14px rgba(226, 58, 46, 0.28);
}

.btn-primary:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(226, 58, 46, 0.34);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-2px);
}

/* ---------- Hero ---------- */
.hero {
  padding: 110px 0 80px;
}

.hero-inner {
  max-width: 920px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--red);
  margin: 0 0 22px;
}

.hero h1 {
  font-size: clamp(2.8rem, 8vw, 6rem);
  font-weight: 700;
}

.hero h1 .hl {
  color: var(--red);
  position: relative;
  white-space: nowrap;
}

.lede {
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  color: var(--ink-soft);
  margin: 28px 0 36px;
  max-width: 640px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ---------- One-screen landing ---------- */
.landing {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
}

.landing .hero {
  width: 100%;
  padding: 32px 0;
}

.landing .hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 4.6rem);
}

.landing .lede {
  margin: 20px 0 30px;
}

.landing-stats {
  margin-top: 48px;
  max-width: 720px;
}

@media (max-height: 720px) {
  .landing .hero {
    padding: 20px 0;
  }
  .landing-stats {
    margin-top: 28px;
  }
}

/* ---------- About page ---------- */
.about-page {
  padding: 12px 0 72px;
}

.about-page .prose p {
  color: var(--ink-soft);
}

.about-page .prose strong {
  color: var(--ink);
}

/* ---------- Sections ---------- */
section {
  padding: 80px 0;
}

.section-head {
  margin-bottom: 40px;
  padding-bottom: 18px;
  position: relative;
}

.section-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--line);
}

/* short coloured accent above the hairline */
.section-head::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 56px;
  height: 3px;
  background: var(--red);
  border-radius: 3px;
  z-index: 1;
}

.section-head h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.section-head h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.section-head p {
  margin: 12px 0 0;
}

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}

.search {
  flex: 1 1 280px;
  min-width: 220px;
  padding: 13px 16px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 0.95rem;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search::placeholder {
  color: var(--ink-soft);
}

.search:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(226, 58, 46, 0.15);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 9px 16px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all 0.14s ease;
}

.chip:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.results-count {
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 22px;
}

/* verified-only toggle (looks like a chip) */
.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.toggle-chip input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
  cursor: pointer;
  margin: 0;
}

/* labelled filter rows (platform / tags) */
.filter-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.filter-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.filter-label {
  flex-shrink: 0;
  min-width: 64px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

/* card / list view toggle */
.view-toggle {
  display: inline-flex;
  border: 2px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}

.view-btn {
  padding: 9px 16px;
  background: transparent;
  border: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--ink);
  cursor: pointer;
}

.view-btn.active {
  background: var(--ink);
  color: var(--bg);
}

/* ---------- List view ---------- */
.list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: background 0.12s ease;
}
.list-row:last-child {
  border-bottom: none;
}
.list-row:hover {
  background: var(--bg-soft);
}

.list-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.list-verified {
  flex-shrink: 0;
  align-self: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.list-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}

.list-meta {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.list-platforms {
  flex-shrink: 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .list-platforms {
    display: none;
  }
}

/* ---------- Grid + cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card-cover {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.4rem;
  color: #fff;
}

/* rotate accent colors so the grid feels lively */
.card:nth-child(4n + 1) .card-cover { background: var(--red); }
.card:nth-child(4n + 2) .card-cover { background: var(--green); }
.card:nth-child(4n + 3) .card-cover { background: var(--blue); }
.card:nth-child(4n + 4) .card-cover { background: var(--ink); }

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.card-meta {
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-desc {
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin: 4px 0 0;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 12px;
}

.tag {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-display);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink);
  border: 1.5px solid var(--ink);
}

.empty {
  text-align: center;
  color: var(--ink-soft);
  padding: 48px 0;
}

/* ---------- About ---------- */
.about {
  background: var(--ink);
  color: var(--bg);
}

.about .section-head::after {
  background: rgba(247, 245, 240, 0.2);
}

.about .section-head h2,
.about .prose strong {
  color: var(--bg);
}

.prose {
  max-width: 720px;
  font-size: 1.15rem;
}

.prose p {
  margin: 0 0 20px;
  color: #d8d3c8;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 40px;
  background: var(--ink);
  color: #d8d3c8;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
  padding: 60px 28px 44px;
}

.footer-brand .brand {
  color: var(--bg);
  margin-bottom: 14px;
}

.footer-brand p {
  margin: 0;
  max-width: 380px;
  color: #a9a297;
  line-height: 1.6;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col h4 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--bg);
}

.footer-col a {
  color: #b8b1a6;
  width: fit-content;
  transition: color 0.15s ease;
}

.footer-col a:hover {
  color: var(--yellow);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 20px 28px;
  border-top: 1px solid rgba(247, 245, 240, 0.12);
  font-size: 0.84rem;
  color: #a9a297;
}

/* the footer container overrides */
.site-footer .container.footer-grid,
.site-footer .container.footer-bottom {
  max-width: var(--maxw);
}

/* ---------- Admin / forms ---------- */
.admin {
  padding: 64px 0 90px;
}

.admin-narrow {
  max-width: 700px;
}

.notice {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px;
  box-shadow: var(--shadow-sm);
}

.notice code {
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.form .hint {
  font-weight: 500;
  font-size: 0.78em;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-soft);
}

.form .check-label {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  align-self: center;
}

.form .check-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
  cursor: pointer;
}

.verify-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.verify-steps-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.form input,
.form textarea {
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 0.95rem;
  font-family: var(--font-body);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  resize: vertical;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form input:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(226, 58, 46, 0.15);
}

.form .btn {
  align-self: flex-start;
}

.form-msg {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 1.2em;
}

.form-msg.error {
  color: var(--red-dark);
}

.form-msg.success {
  color: var(--green);
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease;
}

.admin-row:hover {
  box-shadow: var(--shadow-md);
}

.admin-row .chip {
  padding: 6px 14px;
  font-size: 0.78rem;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.chip-danger:hover:not(:disabled) {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-row .chip:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ---------- Motion ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* hero entrance */
.hero .eyebrow,
.hero h1,
.hero .lede,
.hero .hero-actions {
  opacity: 0;
  animation: fadeUp 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.hero .eyebrow      { animation-delay: 0.05s; }
.hero h1            { animation-delay: 0.15s; }
.hero .lede         { animation-delay: 0.32s; }
.hero .hero-actions { animation-delay: 0.46s; }

/* card entrance (replays subtly on filter/sort) */
.card {
  opacity: 0;
  animation: cardIn 0.4s ease forwards;
}

/* scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  .hero .eyebrow,
  .hero h1,
  .hero .lede,
  .hero .hero-actions,
  .card,
  .reveal {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ---------- Stats band ---------- */
.stats {
  padding: 0;
}

.stats-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.stat {
  padding: 36px 24px;
  text-align: center;
  border-right: 1px solid var(--line);
}

.stat:last-child {
  border-right: none;
}

.stat-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1;
  color: var(--red);
  letter-spacing: -0.02em;
}

.stat-label {
  margin-top: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

/* ---------- Sort select ---------- */
.sort {
  padding: 13px 16px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease;
}

.sort:focus {
  outline: none;
  border-color: var(--red);
}

/* ---------- Card cover image ---------- */
.card-cover.has-image {
  padding: 0;
}

.card-cover.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* clickable cards (now anchors) */
.card {
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}
.card:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

/* ---------- Trading-card game cards (flip) ---------- */
.game-card {
  position: relative;
  background: transparent;
  border: none;
  border-radius: 16px;
  padding: 0;
  overflow: visible;
  cursor: pointer;
  aspect-ratio: 13 / 21;
  perspective: 1200px;
}

/* frame colour rotates per card: green → yellow → red */
.game-card:nth-child(3n + 1) { --tc: var(--green); }
.game-card:nth-child(3n + 2) { --tc: var(--yellow); }
.game-card:nth-child(3n + 3) { --tc: var(--red); }

/* flip mechanics */
.tc-flip {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.game-card.flipped .tc-flip {
  transform: rotateY(180deg);
}

.tc-face {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  background: var(--tc, var(--red));
  border: 2px solid var(--ink);
  border-radius: 16px;
  padding: 9px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tc-back {
  transform: rotateY(180deg);
}

/* back of the card: a "rules text" panel — fixed sections, never scrolls */
.tc-back-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 9px;
  padding: 14px;
  overflow: hidden;
  color: var(--ink);
}
.tc-back-title {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.12;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* description takes all the space the sections below don't need, then clamps
   so the back never scrolls; the "more" button signals the full text */
.tc-back-desc {
  flex: 0 1 auto;
  min-height: 0;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 9;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tc-back-row {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.tc-back-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.tc-back-meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}
/* "more on the page" indicator pinned to the bottom of the back */
.tc-back-link {
  flex-shrink: 0;
  margin-top: auto;
  align-self: stretch;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--ink);
  background: var(--bg);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  transition: background 0.2s ease, color 0.2s ease;
}
.tc-back-link:hover {
  color: #fff;
  background: var(--ink);
}

/* flip affordance in the lower-right corner */
.tc-flip-badge {
  position: absolute;
  right: 13px;
  bottom: 13px;
  z-index: 3;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--ink);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s ease;
}
.game-card:hover .tc-flip-badge {
  transform: rotate(180deg);
}

/* type-line year (replaces platforms on the front) */
.tc-year {
  flex-shrink: 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  white-space: nowrap;
}

.tc-frame {
  display: flex;
  flex-direction: column;
  gap: 7px;
  height: 100%;
}

.tc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 1px 3px 0;
}


.tc-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* the light yellow frame needs a dark title + initials to stay readable */
.game-card:nth-child(3n + 2) .tc-name {
  color: var(--ink);
}
.game-card:nth-child(3n + 2) .tc-initials {
  color: #b8860b;
}

.tc-cost {
  flex-shrink: 0;
  background: var(--bg);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 2px 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.3;
}

.tc-art {
  aspect-ratio: 4 / 3;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* description panel on the front — grows to fill, same size as before the
   flip redesign (art keeps its fixed 4:3 size above it) */
.tc-frontdesc {
  flex: 1;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 9px;
  padding: 11px 12px;
  min-height: 56px;
  overflow: hidden;
}
.tc-frontdesc .tc-flavor {
  -webkit-line-clamp: 3;
}

/* a few tag chips on the front, below the description; the flip badge sits
   at the right, vertically centred with the tag row */
.tc-fronttags {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  gap: 5px;
  overflow: hidden;
  min-height: 30px;
  max-height: 56px;
  padding-right: 34px;
}
.tc-fronttags .tag {
  font-size: 0.66rem;
  padding: 2px 8px;
}
.tc-fronttags .tc-flip-badge {
  top: 50%;
  right: 0;
  bottom: auto;
  transform: translateY(-50%);
}
.game-card:hover .tc-fronttags .tc-flip-badge {
  transform: translateY(-50%) rotate(180deg);
}

.tc-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tc-initials {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.7rem;
  letter-spacing: -0.02em;
  color: var(--tc, var(--red));
}

/* richer empty covers: a soft tint of the frame colour + dot texture */
.tc-art:not(.has-image) {
  background-color: var(--tc, var(--red));
  background-image:
    radial-gradient(circle at 1px 1px, rgba(22, 19, 15, 0.07) 1px, transparent 0),
    linear-gradient(rgba(247, 245, 240, 0.87), rgba(247, 245, 240, 0.87));
  background-size: 12px 12px, auto;
}

/* studio empty covers stay on black, with a faint light texture */
.studio-card .tc-art:not(.has-image) {
  background-color: #000;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.09) 1px, transparent 0);
  background-size: 11px 11px;
}

.tc-typeline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  overflow: hidden;
  background: var(--bg);
  border: 2px solid var(--ink);
  border-radius: 7px;
  padding: 5px 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--ink);
}

.tc-type {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tc-platforms {
  flex-shrink: 0;
  color: var(--ink-soft);
  font-size: 0.7rem;
  white-space: nowrap;
}

.tc-textbox {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 9px;
  padding: 11px 12px;
  color: var(--ink);
  min-height: 64px;
}

.tc-flavor {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  font-style: italic;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tc-textbox .card-tags {
  margin-top: auto;
  padding-top: 0;
}

/* holographic sheen on hover (front face) */
.tc-front::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  pointer-events: none;
  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0) 42%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0) 58%
  );
  background-size: 250% 250%;
  background-position: 100% 100%;
  opacity: 0;
}

.game-card:hover .tc-front::after {
  opacity: 1;
  animation: holo 1.1s ease forwards;
}

@keyframes holo {
  from { background-position: 100% 100%; }
  to   { background-position: 0% 0%; }
}

@media (prefers-reduced-motion: reduce) {
  .game-card:hover .tc-front::after {
    animation: none;
    opacity: 0;
  }
  .tc-flip {
    transition: none;
  }
}

/* verified check badge in the card art corner */
.tc-art {
  position: relative;
}

/* verification dots — sit on the line between the header and the art */
.tc-artwrap {
  position: relative;
}

.tc-verify {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tc-artwrap .tc-verify {
  position: absolute;
  top: 0;
  right: 8px;
  transform: translateY(-50%);
  z-index: 3;
}

/* empty step: small dot, no number */
.tc-vdot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: rgba(22, 19, 15, 0.6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0;
  line-height: 1;
}

/* filled step: larger white dot with the number */
.tc-vdot.filled {
  width: 18px;
  height: 18px;
  background: #fff;
  color: var(--ink);
  font-size: 9px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* list view: same idea, scaled down */
.list-verify {
  align-self: center;
}
.list-verify .tc-vdot {
  width: 8px;
  height: 8px;
}
.list-verify .tc-vdot.filled {
  width: 14px;
  height: 14px;
  font-size: 7px;
}

/* studio trading cards: logo on a black window, fit fully (not cropped) */
.studio-card .tc-art {
  background: #000;
}

.studio-card .tc-art img {
  object-fit: contain;
  padding: 10px;
}

.game-card.studio-card .tc-initials {
  color: #fff;
}

/* ---------- Detail page ---------- */
.detail {
  padding: 48px 0 90px;
}

.back-link {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 28px;
  color: var(--ink);
}
.back-link:hover {
  color: var(--red);
}

.detail-body {
  max-width: 720px;
}

.detail-cover {
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--red);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 4rem;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
  animation: fadeUp 0.5s ease both;
}

.detail-cover.has-image {
  background: var(--bg-soft);
}

/* dot texture on solid (no-image) detail covers */
.detail-cover:not(.has-image):not(.studio-cover) {
  background-image:
    radial-gradient(circle at 2px 2px, rgba(255, 255, 255, 0.1) 1.5px, transparent 0);
  background-size: 16px 16px;
}
.detail-cover.studio-cover:not(.has-image) {
  background-image:
    radial-gradient(circle at 2px 2px, rgba(255, 255, 255, 0.08) 1.5px, transparent 0);
  background-size: 16px 16px;
}

.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* studio profile logo: black window, logo fit fully (not cropped) */
.detail-cover.studio-cover,
.detail-cover.studio-cover.has-image {
  background: #000;
  color: #fff;
}

.detail-cover.studio-cover img {
  object-fit: contain;
  padding: 24px;
}

.detail-title {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  letter-spacing: -0.02em;
}

.detail-meta {
  margin: 14px 0 26px;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.detail-summary {
  font-size: 1.2rem;
  color: var(--ink-soft);
  margin: 0 0 32px;
}

.detail-field {
  display: flex;
  gap: 16px;
  align-items: baseline;
  flex-wrap: wrap;
  padding: 16px 0;
  border-top: 1.5px solid var(--line);
}

.detail-field-label {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
  color: var(--ink);
  min-width: 96px;
}

.detail-link {
  margin-top: 28px;
}

.detail-studio-link {
  color: var(--ink);
  border-bottom: 2px solid var(--red);
  padding-bottom: 1px;
  transition: color 0.12s ease;
}
.detail-studio-link:hover {
  color: var(--red);
}

/* verified pill + source link on detail pages */
.detail-badges {
  margin: 0 0 22px;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  border-radius: 999px;
}

.detail-source-link {
  color: var(--ink);
  border-bottom: 2px solid var(--green);
  padding-bottom: 1px;
  transition: color 0.12s ease;
}
.detail-source-link:hover {
  color: var(--green);
}

/* ---------- Verification breakdown (detail pages) ---------- */
.verify-breakdown {
  padding: 16px 0;
  border-top: 1.5px solid var(--line);
}
.vb-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.vb-head::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink-soft);
  flex-shrink: 0;
}
.vb-level-1 .vb-head::before { background: var(--ink); }
.vb-level-2 .vb-head::before { background: var(--yellow); }
.vb-level-3 .vb-head::before { background: var(--green); }
.vb-tier {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.vb-count {
  font-size: 0.8rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.vb-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.vb-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.vb-mark {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  line-height: 1;
  color: var(--ink-soft);
  background: var(--surface);
}
.vb-step.done .vb-mark {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}
.vb-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.vb-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.vb-step.done .vb-label {
  color: var(--ink);
}
.vb-desc {
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

/* ---------- Page header (listing pages) ---------- */
.page-head {
  padding: 28px 0 8px;
}
.page-head .lede {
  margin-top: 10px;
  margin-bottom: 0;
}

/* tighten the gap between a page header and the content below it */
.page-head + section {
  padding-top: 28px;
}

/* ---------- Admin tabs ---------- */
.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 36px;
}

.tab {
  padding: 12px 24px;
  background: transparent;
  border: 2px solid var(--ink);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink-soft);
  cursor: pointer;
  margin-bottom: -2px;
}

.tab.active {
  background: var(--ink);
  color: var(--bg);
}

/* ---------- Hamburger / mobile nav ---------- */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Skeleton loading ---------- */
.skeleton {
  opacity: 1;
  animation: none;
  pointer-events: none;
}

.sk-cover {
  height: 130px;
  border-bottom: 2px solid var(--ink);
}

.sk-line {
  height: 12px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.sk-line-lg { height: 18px; width: 70%; }
.sk-line-sm { width: 45%; }

.skeleton .sk-cover,
.skeleton .sk-line {
  background: linear-gradient(
    90deg,
    var(--bg-soft) 25%,
    #e9e5db 37%,
    var(--bg-soft) 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
  from { background-position: 100% 0; }
  to   { background-position: -100% 0; }
}

/* ---------- Empty state ---------- */
.empty p {
  margin: 0 0 18px;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .stats-inner {
    grid-template-columns: 1fr;
  }
  .stat {
    border-right: none;
    border-bottom: 2px solid var(--ink);
    padding: 22px;
  }
  .stat:last-child {
    border-bottom: none;
  }
}

/* collapse nav into a hamburger menu */
@media (max-width: 720px) {
  .nav-toggle {
    display: flex;
  }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    display: none;
    background: var(--bg);
    border-bottom: 2px solid var(--ink);
    padding: 6px 0 10px;
    box-shadow: var(--shadow, 0 12px 24px rgba(0, 0, 0, 0.12));
  }
  .nav.open {
    display: flex;
  }
  .nav a {
    padding: 14px 28px;
  }
  .nav a::after {
    display: none;
  }
}

@media (max-width: 760px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px 24px;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 70px 0 56px;
  }
  section {
    padding: 60px 0;
  }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  /* in a column toolbar the 280px flex-basis would stretch the input's
     height into a square — reset it so it stays a normal field */
  .search {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
  }
  .sort {
    width: 100%;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    padding: 44px 28px 32px;
  }
}

@media (max-width: 520px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  .brand {
    font-size: 1rem;
  }
  .header-left {
    gap: 10px;
  }
  .lang-btn img {
    width: 22px;
    height: 17px;
  }
}
