/* Clueffy — dark game-finder theme.
   Mobile-first, safe-area aware, no external CSS. */

:root {
  --bg: #0b1020;
  --bg2: #121a33;
  --card: #161f3d;
  --card2: #1e2a4d;
  --text: #eef2ff;
  --dim: #a9b4d4;
  --accent: #7c9cff;
  --accent2: #a78bfa;
  --line: rgba(255, 255, 255, 0.1);
  --max: 1180px;
  --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 620px at 12% -8%, #1d2a55 0, transparent 62%),
    radial-gradient(900px 520px at 92% 4%, #241f52 0, transparent 58%),
    var(--bg);
  color: var(--text);
  font: 16px/1.65 "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; touch-action: manipulation; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 40px 20px max(64px, env(safe-area-inset-bottom)); }

/* ---------------------------------------------------------------- nav */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 16, 32, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-in {
  max-width: var(--max); margin: 0 auto; height: 66px;
  padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 0;
  background: no-repeat center/58% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b1020' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 8 6-8 6Z'/%3E%3C/svg%3E");
}
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 15px; color: var(--dim); }
.nav-links a:hover { color: var(--text); }
.nav-cta {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #0b1020 !important; font-weight: 800;
  padding: 9px 16px; border-radius: 999px;
}

/* ---------------------------------------------------------------- hero */

.hero { padding: clamp(48px, 9vw, 104px) 20px clamp(36px, 6vw, 64px); }
.hero-in {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr);
  gap: clamp(28px, 5vw, 64px); align-items: center;
}
.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 800;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 16px;
}
.hero h1 { font-size: clamp(38px, 7vw, 74px); margin: 0 0 18px; font-weight: 850; }
.hero-lede { font-size: clamp(16px, 2vw, 19px); color: var(--dim); margin: 0 0 26px; max-width: 54ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.hero-note { font-size: 13px; color: var(--dim); margin: 0; opacity: 0.8; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 13px 24px; border-radius: 999px;
  font-weight: 800; font-size: 15px; border: 1px solid transparent;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #0b1020; box-shadow: 0 14px 40px rgba(124, 156, 255, 0.34);
}
.btn-ghost { background: var(--card2); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); }

.hero-art { position: relative; min-height: 340px; }
.hero-card {
  position: absolute; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: 0 26px 60px rgba(0, 0, 0, 0.5);
  background: var(--card);
}
.hero-card img {
  width: 100%; height: 100%; object-fit: cover; object-position: center top;
  display: block; font-size: 0; color: transparent;
}
.hero-card-1 { width: 62%; top: 0; left: 2%; transform: rotate(-3deg); z-index: 3; aspect-ratio: 16/10; }
.hero-card-2 { width: 50%; top: 26%; right: 0; transform: rotate(4deg); z-index: 2; aspect-ratio: 16/10; }
.hero-card-3 { width: 46%; bottom: 0; left: 14%; transform: rotate(-1.5deg); z-index: 1; aspect-ratio: 16/10; }
/* ---------------------------------------------------------------- search band */

.search-band { border-block: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); }
.band-in { max-width: var(--max); margin: 0 auto; padding: 30px 20px; }
.band-in h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--dim); margin: 0 0 16px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  min-height: 44px; padding: 11px 18px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  font-weight: 700; font-size: 14px; transition: border-color 0.16s, background 0.16s;
}
.chip:hover { border-color: var(--accent); background: var(--card2); }
.chip[aria-pressed="true"] { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #0b1020; border-color: transparent; }
.band-hint { font-size: 13px; color: var(--dim); margin: 14px 0 0; }

/* ---------------------------------------------------------------- sections */

.section { max-width: var(--max); margin: 0 auto; padding: clamp(48px, 7vw, 84px) 20px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(24px, 4vw, 36px); margin: 0; }
#result-count { color: var(--dim); font-size: 14px; }
.see-all { color: var(--accent); font-weight: 700; font-size: 15px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.game-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.game-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card-media { position: relative; display: block; background: var(--bg2); }
.card-media img { width: 100%; aspect-ratio: 16/10; object-fit: cover; object-position: center top; font-size: 0; color: transparent; }
.card-badge {
  position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: 999px;
  background: var(--accent); color: #0b1020; font-size: 11px; font-weight: 850;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.card-badge-out { background: rgba(11, 16, 32, 0.82); color: var(--dim); border: 1px solid var(--line); }
.card-body { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.card-genre { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.card-body h3 { font-size: 21px; margin: 0 0 6px; }
.card-cue { font-size: 13px; color: var(--dim); font-style: italic; margin: 0 0 10px; }
.card-desc { font-size: 14px; color: var(--dim); margin: 0 0 18px; flex: 1; }
.card-cta {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 11px 18px; border-radius: 10px;
  background: var(--card2); border: 1px solid var(--line);
  font-weight: 800; font-size: 14px; text-align: center;
}
.card-cta:hover { border-color: var(--accent); }
.card-cta-embed { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #0b1020; border-color: transparent; }
.empty { text-align: center; color: var(--dim); padding: 40px 0; }

/* ---------------------------------------------------------------- how band */

.how-band { background: rgba(255, 255, 255, 0.02); border-block: 1px solid var(--line); }
.how-in { max-width: var(--max); margin: 0 auto; }
.how-copy { max-width: 780px; }
.how-copy h2 { font-size: clamp(24px, 4vw, 36px); margin: 0 0 14px; }
.how-lede { color: var(--dim); margin: 0 0 26px; }
.how-steps { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 14px; counter-reset: step; }
.how-steps li {
  counter-increment: step; position: relative; padding-left: 46px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding-block: 16px; padding-right: 18px;
}
.how-steps li::before {
  content: counter(step); position: absolute; left: 14px; top: 14px;
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #0b1020;
  display: grid; place-items: center; font-size: 13px; font-weight: 850;
}

/* ---------------------------------------------------------------- guides band */

.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; }
.guide-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform 0.18s ease, border-color 0.18s ease;
}
.guide-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.guide-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.guide-card div { padding: 18px; }
.guide-card h3 { font-size: 18px; margin: 0 0 8px; }
.guide-card p { font-size: 14px; color: var(--dim); margin: 0 0 12px; }
.read-more { color: var(--accent); font-weight: 700; font-size: 14px; }

/* ---------------------------------------------------------------- faq */

.faq-band { background: rgba(255, 255, 255, 0.02); border-top: 1px solid var(--line); }
.faq-in { max-width: 860px; margin: 0 auto; }
.faq-in h2 { font-size: clamp(24px, 4vw, 34px); margin: 0 0 24px; text-align: center; }
.questions details {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  margin-bottom: 12px; overflow: hidden;
}
.questions summary {
  list-style: none; cursor: pointer; padding: 17px 20px;
  font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.questions summary::-webkit-details-marker { display: none; }
.questions summary svg { flex: none; transition: transform 0.2s ease; opacity: 0.7; }
.questions details[open] summary svg { transform: rotate(45deg); }
.questions details p { margin: 0; padding: 0 20px 18px; color: var(--dim); font-size: 15px; }

/* ---------------------------------------------------------------- game pages */

.crumb { color: var(--dim); font-size: 14px; margin-bottom: 18px; display: flex; gap: 8px; flex-wrap: wrap; }
.crumb a { color: var(--accent); }
.game-hero { margin-bottom: 28px; }
.game-hero h1 { font-size: clamp(30px, 5.5vw, 54px); margin: 0 0 12px; }
.lead { font-size: clamp(16px, 2vw, 18px); color: var(--dim); max-width: 74ch; margin: 0 0 10px; }
.cue-line { color: var(--accent); font-style: italic; font-size: 15px; margin: 0 0 26px; }

.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.play-column { min-width: 0; }

.player {
  position: relative; aspect-ratio: 16/11; max-height: 78vh;
  border-radius: var(--radius); overflow: hidden; background: var(--bg2);
  border: 1px solid var(--line); box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: none; background: #05070f; }
.player.playing iframe { display: block; }
.player.playing .cover { display: none; }
.cover { position: absolute; inset: 0; display: grid; place-items: center; background: center/cover no-repeat; }
.cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(8, 12, 26, 0.92), rgba(8, 12, 26, 0.25)); }
.cover-in { position: relative; z-index: 1; text-align: center; padding: 24px; }
.cover h2 { font-size: clamp(22px, 4vw, 38px); margin: 0 0 8px; text-shadow: 0 4px 18px #000; }
.cover-note { color: var(--dim); font-size: 14px; margin: 0 0 18px; }
.play {
  border: 0; cursor: pointer; color: #0b1020; font-weight: 850; font-size: 17px;
  min-height: 52px; padding: 15px 30px; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 14px 42px rgba(124, 156, 255, 0.45);
  display: inline-flex; align-items: center; gap: 8px;
}
.play:hover { transform: translateY(-2px); }
.play-link { text-decoration: none; }
.player-fallback {
  position: absolute; inset: 0; z-index: 5;
  display: grid; place-content: center; gap: 16px; text-align: center;
  padding: 24px; background: rgba(8, 12, 26, 0.97);
}
.player-fallback[hidden] { display: none; }
.player-fallback p { margin: 0; color: var(--dim); }
/* Slow-load hint. Deliberately NOT an overlay: it must never cover a game
   that is still loading, so it sits under the frame as a normal line. */
.player-notice {
  margin: 12px 0 0; padding: 11px 16px; font-size: 14px; color: var(--dim);
  border: 1px solid var(--line); border-radius: 12px; background: var(--card2);
}
.player-notice[hidden] { display: none; }
.player-notice a { color: var(--accent); }

.toolbar { display: flex; gap: 12px; align-items: center; padding: 12px 2px 0; }
.toolbar strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolbtn {
  cursor: pointer; color: var(--text); background: var(--card2);
  border: 1px solid var(--line); border-radius: 10px; min-height: 44px; padding: 9px 14px; font-weight: 700; font-size: 14px;
}
.toolbtn:hover { border-color: var(--accent); }

.details { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; margin-top: 28px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.panel h2 { margin: 0 0 10px; font-size: 23px; }
.panel h3 { margin: 26px 0 10px; font-size: 18px; }
.panel p { color: var(--dim); margin: 0 0 12px; }
.facts { margin: 0; padding-left: 20px; color: var(--dim); }
.facts li { margin-bottom: 6px; }
.disclaimer { font-size: 13px; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 16px !important; opacity: 0.85; }
.meta { display: grid; gap: 10px; align-content: start; }
.meta div { display: flex; justify-content: space-between; gap: 18px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.meta span { color: var(--dim); }
.meta b { text-align: right; }

/* ---------------------------------------------------------------- sidebar */

.related-sidebar { position: sticky; top: 86px; align-self: start; max-height: calc(100vh - 110px); display: flex; flex-direction: column; min-width: 0; }
.related-sidebar.is-expanded { position: static; max-height: none; }
.related-heading { display: flex; align-items: center; margin: 0 0 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.related-heading-toggle {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 0;
  background: none; border: 0; color: var(--dim); font-size: 12px;
  letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700;
}
.related-heading-toggle::after { content: "▾"; transition: transform 0.2s ease; }
.related-sidebar.is-expanded .related-heading-toggle::after { transform: rotate(180deg); }
.related-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; overflow-y: auto; scrollbar-width: thin; }
.related-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); transition: border-color 0.18s, transform 0.18s; }
.related-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.related-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.related-card b { display: block; padding: 8px 10px; font-size: 12px; line-height: 1.3; min-height: 38px; }
.related-toggle {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 42px; margin-top: 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card2); color: var(--text); font-weight: 700; font-size: 14px;
}
.related-toggle::after { content: "▾"; margin-left: 8px; transition: transform 0.2s ease; }
.related-sidebar:not(.is-expanded) .related-card:nth-child(n+5) { display: none; }

/* ---------------------------------------------------------------- guide article */

.guide-article { max-width: 780px; }
.guide-article h1 { font-size: clamp(28px, 5vw, 46px); margin: 0 0 16px; }
.guide-body { margin-top: 34px; }
.guide-body section { margin-bottom: 30px; }
.guide-body h2 { font-size: 24px; margin: 0 0 10px; }
.guide-body p { color: var(--dim); margin: 0; }
.guide-body b { color: var(--text); }
.guide-cta { margin-top: 44px; padding: 26px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.guide-cta h2 { margin: 0 0 8px; font-size: 22px; }
.guide-cta p { color: var(--dim); margin: 0 0 16px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; }
.legal h1 { font-size: clamp(28px, 5vw, 42px); margin: 0 0 8px; }
.legal h2 { font-size: 21px; margin: 30px 0 8px; }
.legal p { color: var(--dim); margin: 0 0 12px; }

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

.site-footer { border-top: 1px solid var(--line); background: rgba(0, 0, 0, 0.24); }
.foot-in {
  max-width: var(--max); margin: 0 auto;
  padding: 44px 20px max(36px, env(safe-area-inset-bottom));
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 32px;
}
.foot-brand { display: grid; gap: 8px; align-content: start; }
.foot-brand b { font-size: 17px; }
.foot-brand p { color: var(--dim); margin: 0; font-size: 14px; }
.foot-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.foot-links h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--dim); margin: 0 0 12px; }
.foot-links a { display: block; font-size: 14px; color: var(--dim); padding: 5px 0; }
.foot-links a:hover { color: var(--accent); }
.independence {
  grid-column: 1 / -1; margin: 8px 0 0; padding-top: 22px;
  border-top: 1px solid var(--line); color: var(--dim); font-size: 13px; max-width: 90ch;
}

/* ---------------------------------------------------------------- mobile fullscreen */

.mobile-fullscreen-exit {
  position: absolute; z-index: 10; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right));
  display: none; width: 46px; height: 46px; border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%; background: rgba(11, 16, 32, 0.82); color: #fff; font-size: 24px; line-height: 1;
  place-items: center; backdrop-filter: blur(8px);
}
body.mobile-game-expanded { overflow: hidden; overscroll-behavior: none; }
.player.mobile-expanded {
  position: fixed; inset: 0; z-index: 1000; width: 100vw; height: 100dvh;
  max-width: none; max-height: none; aspect-ratio: auto; border: 0; border-radius: 0;
}
.player.mobile-expanded .mobile-fullscreen-exit { display: grid; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 980px) {
  .hero-in { grid-template-columns: 1fr; }
  .hero-art { min-height: 260px; order: -1; }
  .hero-card-1 { width: 66%; }
  .game-layout { grid-template-columns: minmax(0, 1fr); }
  .related-sidebar { position: static; max-height: none; margin-top: 24px; }
  .related-list { overflow: visible; }
  .details { grid-template-columns: 1fr; }
  .foot-in { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav-in { height: 58px; padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .brand { font-size: 16px; }
  .brand-mark { width: 26px; height: 26px; }
  .nav-links { gap: 14px; font-size: 14px; }
  .nav-links a:not(.nav-cta) { display: none; }
  .nav-cta { padding: 8px 14px; font-size: 14px; }
  .wrap { padding: 26px 16px max(48px, env(safe-area-inset-bottom)); }
  .section { padding: 42px 16px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
  .player { aspect-ratio: 4/3; max-height: none; }
  .toolbar { flex-wrap: wrap; }
  .toolbar strong { flex-basis: 100%; }
  .toolbtn { flex: 1; }
  .panel { padding: 20px; }
  .hero-card-1 { width: 74%; }
  .hero-card-2 { width: 56%; }
  .hero-card-3 { width: 50%; }
}

@media (max-width: 420px) {
  .brand-name { display: none; }
  .grid { grid-template-columns: 1fr; }
  .foot-links { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
