@import url('/legacy-games.css');

:root {
  color-scheme: light;
  --ground: #FAF8F4;
  --surface: #FFFFFF;
  --raised: #F1ECE2;
  --hover: #E7E0D3;
  --text: #14171F;
  --muted: #555D6B;
  --accent: #2B4C7E;
  --on-accent: #FFFFFF;
  --line: #DFD8CA;
  --negative: #B52240;
  --positive: #1E7E5A;
  --badge-puzzle-bg: #E8EEFC;
  --badge-puzzle-fg: #2B479C;
  --badge-cards-bg: #E3F3EC;
  --badge-cards-fg: #156245;
  --badge-arcade-bg: #FDF0E1;
  --badge-arcade-fg: #9D4800;
  --badge-skill-bg: #FCE9E4;
  --badge-skill-fg: #A32D10;
  --badge-brain-bg: #E7EBFF;
  --badge-brain-fg: #2F3FA8;
  font-family: Inter, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  background: var(--ground);
  color: var(--text);
}

:root[data-theme=dark] {
  color-scheme: dark;
  --ground: #101218;
  --surface: #181C24;
  --raised: #222834;
  --hover: #2C3444;
  --text: #F4F1EA;
  --muted: #B6B3AC;
  --accent: #74B9FF;
  --on-accent: #0B192C;
  --line: #303747;
  --negative: #FF9AAB;
  --positive: #6EE7B7;
  --badge-puzzle-bg: #222D4A;
  --badge-puzzle-fg: #A9C2FF;
  --badge-cards-bg: #18362B;
  --badge-cards-fg: #82E2BA;
  --badge-arcade-bg: #3C2816;
  --badge-arcade-fg: #FFC380;
  --badge-skill-bg: #3D201A;
  --badge-skill-fg: #FFB29E;
  --badge-brain-bg: #1C2350;
  --badge-brain-fg: #B7C3FF;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
}

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

a:hover {
  text-decoration: underline;
}

button,
input,
select {
  font: inherit;
  color: var(--text);
}

button,
select {
  border: 0;
  min-height: 44px;
  border-radius: 8px;
  padding: 10px 16px;
  background: var(--raised);
  cursor: pointer;
}

input {
  min-height: 44px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  min-width: 0;
}

button:hover {
  background: var(--hover);
}

button:active {
  transform: scale(.98);
}

button:disabled {
  opacity: .55;
  cursor: default;
}

button,
a,
select {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: 'Inter Tight', Inter, sans-serif;
  line-height: 1.12;
  letter-spacing: -.025em;
  font-weight: 700;
}

h1 {
  font-size: 40px;
}

h2 {
  font-size: 28px;
}

h3 {
  font-size: 20px;
}

p {
  max-width: 68ch;
}

small,
.small {
  font-size: 14px;
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

.container {
  width: min(1240px, calc(100% - 64px));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.skip {
  position: fixed;
  top: -100px;
  left: 20px;
  z-index: 100;
  background: var(--accent);
  color: var(--on-accent);
  padding: 12px 16px;
  border-radius: 6px;
}

.skip:focus {
  top: 12px;
}

/* Header */
.site-header {
  background: var(--ground);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 10;
}

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

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-family: 'Inter Tight', Inter, sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.035em;
  white-space: nowrap;
}

.brand svg {
  width: 32px;
  height: 30px;
  color: var(--accent);
}

.brand:hover {
  text-decoration: none;
}

.site-header nav {
  display: flex;
  gap: 22px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.site-header nav a {
  padding: 10px 2px;
  white-space: nowrap;
}

.site-header nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.header-tools,
.utilities {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-button {
  background: transparent;
  width: 44px;
  height: 44px;
  padding: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.icon-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#mobile-toggle {
  display: none;
}

/* Buttons & Badges */
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 8px;
  padding: 12px 20px;
  min-height: 46px;
  font-weight: 600;
  font-size: 14px;
  border: 0;
  cursor: pointer;
  transition: transform .15s, filter .15s;
}

.primary:hover {
  background: var(--accent);
  filter: brightness(1.08);
  text-decoration: none;
  transform: translateY(-1px);
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 11px 18px;
  min-height: 46px;
  font-weight: 600;
  font-size: 14px;
}

.secondary-btn:hover {
  background: var(--raised);
  text-decoration: none;
}

.cat-badge,
.meta-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.2;
}

.cat-puzzle {
  background: var(--badge-puzzle-bg);
  color: var(--badge-puzzle-fg);
}

.cat-cards {
  background: var(--badge-cards-bg);
  color: var(--badge-cards-fg);
}

.cat-arcade {
  background: var(--badge-arcade-bg);
  color: var(--badge-arcade-fg);
}

.cat-skill {
  background: var(--badge-skill-bg);
  color: var(--badge-skill-fg);
}

.cat-brain {
  background: var(--badge-brain-bg);
  color: var(--badge-brain-fg);
}

.meta-badge {
  background: var(--raised);
  color: var(--text);
  border: 1px solid var(--line);
}

/* Editorial Masthead */
.masthead {
  margin: 28px 0 36px;
  padding: 28px 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.masthead-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.edition-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}

.masthead-pills {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--raised);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
}

.surprise-btn {
  min-height: 38px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.masthead-body {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: end;
}

.masthead-body h1 {
  font-size: clamp(32px, 4vw, 50px);
  line-height: 1.06;
  letter-spacing: -.035em;
  max-width: 16ch;
}

.masthead-lead {
  color: var(--muted);
  font-size: 16px;
  margin: 16px 0 22px;
  max-width: 54ch;
}

.masthead-ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.resume-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  padding: 8px 6px;
}

.club-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}

.club-stats>div {
  display: grid;
  gap: 4px;
}

.club-stats span {
  font-size: 12px;
  color: var(--muted);
}

.club-stats strong {
  font-family: 'Inter Tight', Inter, sans-serif;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Daily Break Trio */
.section-eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: 6px;
}

.daily-edition {
  padding: 8px 0 40px;
  scroll-margin-top: 24px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.section-head a {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.daily-extras {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.daily-extras a {
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.daily-extras a:hover {
  background: var(--raised);
  text-decoration: none;
}

.daily-extras a.done,
.daily-chip.done {
  background: var(--badge-cards-bg);
  color: var(--badge-cards-fg);
  border-color: transparent;
}

.daily-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

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

.daily-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(20, 23, 31, .08);
  text-decoration: none;
}

.daily-art {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
}

.daily-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}

.daily-card:hover .daily-art img {
  transform: scale(1.03);
}

.daily-chip {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(250, 248, 244, .94);
  color: #14171F;
  font-size: 12px;
  font-weight: 700;
}

.daily-copy {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.daily-copy h3 {
  font-size: 21px;
}

.daily-copy p {
  font-size: 14px;
  color: var(--muted);
  flex: 1;
}

.daily-cta {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

/* Curated Quick Break Rail */
.curated-rail {
  padding: 8px 0 36px;
}

.rail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.mini-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: transform .18s;
}

.mini-card:hover {
  background: var(--raised);
  transform: translateY(-2px);
  text-decoration: none;
}

.mini-card img {
  width: 76px;
  height: 58px;
  object-fit: cover;
  border-radius: 9px;
  flex-shrink: 0;
}

.mini-card h3 {
  font-size: 16px;
  margin-top: 5px;
}

.mini-card p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* Intro for secondary pages */
.intro {
  padding: 34px 0 22px;
}

.intro h1 {
  font-size: clamp(30px, 3.6vw, 42px);
}

.intro p {
  color: var(--muted);
  margin-top: 10px;
}

.category-note {
  font-size: 14px;
  margin-top: 10px;
  color: var(--muted);
}

/* Catalogue & Game Cards */
.library {
  padding: 18px 0 44px;
  scroll-margin-top: 24px;
}

.library-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.catalogue-description {
  color: var(--muted);
  font-size: 14px;
  margin-top: 8px;
  max-width: 56ch;
}

.search-field {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding-left: 14px;
  width: 300px;
}

.search-field svg {
  width: 18px;
  height: 18px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 1.7;
  flex-shrink: 0;
}

.search-field input {
  width: 100%;
  border: 0;
  background: transparent;
  font-size: 14px;
  min-height: 44px;
}

.catalogue-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
}

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

.filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--muted);
  padding: 8px 13px;
  min-height: 40px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
}

.filter:hover {
  background: var(--raised);
  color: var(--text);
}

.filter[aria-pressed=true] {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.filter-count {
  font-size: 11px;
  opacity: .82;
  font-variant-numeric: tabular-nums;
}

.result-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#result-count {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  padding-right: 4px;
}

.reset-filters {
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.reset-filters:hover {
  border-color: var(--accent);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px 18px;
}

.game-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform .2s, box-shadow .2s;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(20, 23, 31, .08);
  text-decoration: none;
}

.game-art {
  position: relative;
  aspect-ratio: 1.6;
  overflow: hidden;
}

.game-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}

.game-card:hover .game-art img {
  transform: scale(1.04);
}

.card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.play-reveal {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 7px 12px;
  background: rgba(250, 248, 244, .95);
  color: #14171F;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .2s, transform .2s;
}

.game-card:hover .play-reveal,
.game-card:focus-visible .play-reveal {
  opacity: 1;
  transform: none;
}

.game-caption {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 15px 16px 16px;
  gap: 10px;
  flex: 1;
}

.game-caption h3 {
  font-size: 18px;
}

.game-caption p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.duration-pill {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

.card-arrow {
  font-size: 18px;
  color: var(--muted);
}

.card-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 16px 11px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--raised) 55%, var(--surface));
  font-size: 12px;
}

.card-stars {
  color: #B4690E;
  letter-spacing: 1px;
  font-weight: 700;
}

:root[data-theme=dark] .card-stars {
  color: #FFC53D;
}

.card-best {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.offline-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--raised);
  color: var(--text);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.empty-results {
  text-align: center;
  padding: 52px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.empty-results p {
  margin: 14px auto 20px;
  color: var(--muted);
}

/* Footer (adapted from footer.txt to ArcadeBreeze Design 1) */
.club-footer {
  position: relative;
  overflow: hidden;
  overflow-x: clip;
  margin-top: 40px;
  background: var(--raised);
  border-top: 1px solid var(--line);
  color: var(--text);
}

.club-footer-grid {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, .85fr) minmax(0, .9fr) minmax(0, 1.35fr);
  gap: 36px;
  padding: 52px 0 40px;
}

.club-footer-grid>* {
  min-width: 0;
}

.club-footer-brand .brand {
  margin-bottom: 14px;
  font-size: 20px;
}

.club-footer-brand img {
  border-radius: 10px;
  display: block;
}

.club-footer-brand p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
}

.club-footer-col h3,
.club-footer-newsletter h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
}

.club-footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.club-footer-col a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.club-footer-col a:hover {
  color: var(--accent);
  text-decoration: none;
}

.newsletter-lead {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
}

.newsletter-form {
  position: relative;
  max-width: 360px;
}

.newsletter-input-wrap {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.newsletter-input-wrap input {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 14px;
  padding: 10px 12px;
  min-height: 46px;
}

.newsletter-input-wrap input:focus-visible {
  outline-offset: -3px;
}

.newsletter-submit {
  border-radius: 0;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 600;
  padding: 0 16px;
  min-height: 46px;
  flex-shrink: 0;
}

.newsletter-submit:hover {
  background: var(--accent);
  filter: brightness(1.08);
}

.newsletter-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  padding: 0 12px;
  text-align: center;
}

.newsletter-status.success {
  color: var(--positive);
}

.newsletter-status.error {
  color: var(--negative);
}

.newsletter-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.5;
}

.club-footer-bottom {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 28px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}

.club-footer-bottom nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.club-footer-bottom a:hover {
  color: var(--text);
}

.club-footer-drop {
  margin: 0;
  padding: 4px 12px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  transition: border-color .15s;
}

.club-footer-drop:hover {
  background: var(--hover);
  border-color: var(--accent);
}

.fcf-word {
  position: relative;
  z-index: 1;
  display: block;
  left: 50%;
  width: max-content;
  margin: clamp(68px, 7.5vw, 112px) 0 0;
  padding: 0 .06em clamp(14px, 2vw, 24px) 0;
  transform: translateX(-50%);
  font-family: 'Inter Tight', Inter, sans-serif;
  font-size: 16vw;
  font-weight: 700;
  letter-spacing: -.055em;
  line-height: .84;
  white-space: nowrap;
  color: var(--text);
  opacity: .13;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

:root[data-theme=dark] .fcf-word {
  opacity: .16;
}

.fcf-ch {
  display: inline-block;
  transform-origin: 50% 0;
}

.fcf-stage {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s ease;
}

.fcf-stage.fcf-ready {
  opacity: 1;
}

.fcf-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  display: block;
}

.fcf-haze {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 120px;
  z-index: 2;
  pointer-events: none;
}

.fcf-haze i {
  position: absolute;
  inset: 0;
}

.fcf-haze i:nth-child(1) {
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  -webkit-mask-image: linear-gradient(#000 0%, #000 55%, transparent 100%);
  mask-image: linear-gradient(#000 0%, #000 55%, transparent 100%);
}

.fcf-haze i:nth-child(2) {
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  -webkit-mask-image: linear-gradient(#000 0%, #000 30%, transparent 70%);
  mask-image: linear-gradient(#000 0%, #000 30%, transparent 70%);
}

.fcf-haze i:nth-child(3) {
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(#000 0%, transparent 45%);
  mask-image: linear-gradient(#000 0%, transparent 45%);
}

.fcf-haze::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(var(--raised), transparent 45%);
}

@media (hover: hover) and (pointer: fine) {
  .club-footer.fcf-over {
    cursor: grab;
  }
}

.club-footer.fcf-grab,
.club-footer.fcf-grab * {
  cursor: grabbing !important;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

/* Settings Dialog */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 18, 24, .58);
  z-index: 30;
}

.settings-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  z-index: 31;
  width: min(440px, calc(100% - 32px));
  padding: 28px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 70px rgba(0, 0, 0, .25);
  display: grid;
  gap: 18px;
}

.settings-dialog h2 {
  font-size: 26px;
}

.settings-dialog>p {
  color: var(--muted);
  font-size: 14px;
}

.settings-dialog label {
  display: grid;
  gap: 8px;
  font-size: 14px;
}

/* Game Page Shell */
.breadcrumbs {
  font-size: 13px;
  color: var(--muted);
  padding: 18px 0 10px;
}

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

.game-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 4px 0 22px;
}

.game-title-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.game-heading h1 {
  font-size: clamp(32px, 3.6vw, 44px);
}

.game-heading p {
  color: var(--muted);
  margin-top: 8px;
}

.game-heading-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

#favorite[aria-pressed=true] {
  background: var(--accent);
  color: var(--on-accent);
}

.game-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 26px;
  align-items: start;
}

.play-area {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  min-width: 0;
}

.play-area:fullscreen {
  overflow: auto;
  background: var(--ground);
  padding: 28px;
}

.play-area:fullscreen .arcade-canvas {
  max-height: 74vh;
  width: auto;
  max-width: 100%;
}

.game-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.game-controls label {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}

.game-controls select,
.game-controls input {
  padding: 7px 10px;
  font-size: 13px;
  min-height: 40px;
}

.game-controls input[type=number] {
  width: 90px;
}

.game-controls button {
  font-size: 13px;
  min-height: 40px;
  padding: 8px 13px;
}

.custom-mines {
  display: flex;
  gap: 8px;
}

.game-score {
  margin: 0 0 14px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.game-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-height: 310px;
  justify-content: center;
  width: 100%;
}

.game-status {
  font-size: 14px;
  color: var(--muted);
  min-height: 28px;
  margin-top: 14px;
  max-width: none;
}

.share-bar {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--raised);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.share-copy-wrap {
  display: grid;
  gap: 2px;
}

.share-copy-wrap strong {
  font-size: 15px;
}

.share-copy-wrap span {
  font-size: 13px;
  color: var(--muted);
}

.share-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.share-next {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  min-height: 44px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
}

.share-next:hover {
  background: var(--hover);
  text-decoration: none;
}

.share-secondary {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  min-height: 44px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.share-secondary:hover {
  background: var(--hover);
}

.challenge-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--raised);
  border: 1.5px solid var(--accent);
}

.challenge-banner[data-state="won"] {
  border-color: #12B886;
  background: color-mix(in srgb, #12B886 12%, var(--surface));
}

.challenge-banner[data-state="missed"] {
  border-style: dashed;
}

.challenge-copy {
  display: grid;
  gap: 2px;
}

.challenge-copy strong {
  font-size: 14px;
  color: var(--text);
}

.challenge-copy span {
  font-size: 13px;
  color: var(--muted);
}

.challenge-clear {
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.challenge-clear:hover {
  border-color: var(--accent);
}

.game-aside {
  display: grid;
  gap: 18px;
}

.aside-card,
.controls-guide {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 20px;
  border-radius: 16px;
}

.game-aside h2 {
  font-size: 18px;
  margin-bottom: 10px;
}

.game-aside p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 12px;
}

.game-aside a {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.related {
  padding: 12px 0 40px;
}

.related-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.prose {
  max-width: 820px;
  padding: 48px 0 72px;
}

.prose p {
  color: var(--muted);
  margin: 20px 0;
  line-height: 1.8;
}

.prose .primary {
  margin: 20px 12px 0 0;
}

/* Game-specific canvases & boards */
.arcade-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  touch-action: none;
  background: #234e66;
}

.touch-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.touch-controls button {
  min-width: 55px;
}

.mine-viewport {
  width: 100%;
  max-height: 560px;
  overflow: auto;
  padding: 5px;
  overscroll-behavior: contain;
}

.mine-board {
  display: grid;
  gap: 3px;
  width: max-content;
  margin: auto;
}

.mine-cell {
  width: var(--mine-size);
  height: var(--mine-size);
  padding: 0;
  min-height: 0;
  border-radius: 5px;
  background: var(--raised);
  font-weight: 600;
  line-height: 1;
}

.mine-cell.revealed {
  background: var(--ground);
  color: var(--accent);
}

.mine-cell[data-number="2"] {
  color: var(--positive);
}

.mine-cell[data-number="3"] {
  color: var(--negative);
}

.mine-cell.exploded {
  background: #ffb5ac;
  color: #4c1922;
}

.mine-board[data-tiles=Classic] .mine-cell:not(.revealed) {
  border-bottom: 3px solid var(--line);
  border-right: 3px solid var(--line);
}

.mine-board[data-tiles="High Contrast"] .mine-cell {
  background: #080808;
  color: #fff;
  border: 1px solid #fff;
}

.mine-board[data-tiles="High Contrast"] .mine-cell.revealed {
  background: #fff;
  color: #000;
}

.memory-board {
  display: grid;
  gap: 9px;
  width: min(100%, 440px);
}

.memory-board button {
  aspect-ratio: 1;
  padding: 0;
  font-size: 30px;
  min-height: 0;
  border-radius: 10px;
}

.memory-board .matched {
  background: var(--accent);
  color: var(--on-accent);
  opacity: 1;
}

.extended-cards {
  overflow: auto;
  width: 100%;
  padding-bottom: 16px;
}

.card-reserves {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 7px;
  min-width: 600px;
  margin-bottom: 20px;
}

.card-reserves small {
  display: block;
  font-size: 11px;
  margin-bottom: 6px;
  color: var(--muted);
}

.card-columns {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 7px;
  min-width: 600px;
}

.spider .card-columns {
  grid-template-columns: repeat(10, 1fr);
  min-width: 680px;
}

.extended-column {
  position: relative;
  min-width: 0;
}

.extended-column>.playing-card {
  position: absolute;
  height: 96px;
  padding: 5px;
  font-size: 20px;
}

.column-label {
  font-size: 10px;
  padding: 0 2px;
  background: transparent;
  min-height: 30px;
  white-space: nowrap;
  width: 100%;
}

.extended-cards .playing-card {
  height: 96px;
}

.mahjong-viewport {
  width: 100%;
  overflow: auto;
}

.mahjong-board {
  position: relative;
  height: 320px;
  margin: auto;
  min-width: 310px;
}

.mahjong-tile {
  position: absolute;
  width: 45px;
  height: 57px;
  border-radius: 6px;
  padding: 0;
  background: #ece8d7;
  color: #245845;
  font-size: 25px;
  border-bottom: 5px solid #a0ad99;
  min-height: 0;
}

.mahjong-tile.blocked {
  background: #bbbeb2;
  color: #3d544a;
}

.mahjong-tile.selected {
  outline: 3px solid var(--accent);
  outline-offset: -2px;
  background: #d7efcf;
}

.mahjong-tile:hover {
  background: #f8f2d9;
}

/* Board surfaces & semantic contrast in both themes */
.board-2048 {
  background: var(--raised);
  border: 1px solid var(--line);
}

.tile {
  background: var(--hover);
  color: var(--text);
}

.tile-2,
.tile-4 {
  background: var(--surface);
  color: var(--text);
}

.tile-8,
.tile-16 {
  background: #F0C987;
  color: #2B1F09;
}

.tile-32,
.tile-64 {
  background: #E38B5B;
  color: #FFFFFF;
}

.tile-128,
.tile-256,
.tile-512,
.tile-1024,
.tile-2048 {
  background: var(--accent);
  color: var(--on-accent);
}

.tic-cell {
  background: var(--raised);
  color: var(--text);
}

.tic-cell.player-1 {
  color: var(--accent);
}

.four-board {
  background: var(--accent);
}

.disc {
  background: var(--ground);
}

.disc.player-1 {
  background: #F2B94B;
}

.disc.player-2 {
  background: #E56B55;
}

.sudoku-board {
  background: var(--line);
}

.sudoku-cell {
  background: var(--surface);
  color: var(--accent);
}

.sudoku-cell.given {
  background: var(--raised);
  color: var(--text);
}

.sudoku-cell.matching {
  background: var(--hover);
}

.sudoku-cell.selected {
  background: var(--accent);
  color: var(--on-accent);
}

.sudoku-cell.conflict {
  color: var(--negative);
  background: var(--raised);
}

.notes {
  color: inherit;
}

.word-board button {
  background: var(--raised);
  color: var(--text);
  padding: 0;
  min-width: 0;
}

.word-board button.found {
  background: var(--accent);
  color: var(--on-accent);
}

.word-board button.selected,
.word-board button.anchor {
  background: var(--hover);
  color: var(--text);
}

.word-list {
  color: var(--text);
}

.word-list .done {
  color: var(--accent);
}

.test-target {
  background: var(--raised);
  color: var(--text);
  border: 1px solid var(--line);
}

.test-target.go {
  background: #8CE0B0;
  color: #0F3522;
}

.rounds b {
  color: var(--text);
}

.playing-card.empty-pile {
  background: var(--raised);
  color: var(--muted);
  border-color: var(--line);
}

.playing-card.card-back {
  background: #264A5E;
  border-color: #7FAAC2;
}

.playing-card.selected {
  background: #D7ECF2;
}

@keyframes card-arrive {
  from {
    opacity: .65;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.game-card.arrived {
  animation: card-arrive .3s ease-out both;
}

/* Responsive Breakpoints */
@media (max-width: 1100px) {
  .container {
    width: min(1240px, calc(100% - 48px));
  }

  .site-header nav {
    gap: 15px;
  }

  .masthead-body {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .rail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .game-shell {
    grid-template-columns: minmax(0, 1fr) 210px;
    gap: 20px;
  }

  .club-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
  }
}

@media (max-width: 820px) {
  .container {
    width: calc(100% - 36px);
  }

  .header-inner {
    height: 68px;
    gap: 12px;
  }

  .site-header nav {
    display: none;
    position: absolute;
    left: 18px;
    right: 18px;
    top: 64px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .14);
  }

  .site-header nav.open {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .site-header nav a {
    display: block;
    padding: 10px 8px;
  }

  #mobile-toggle {
    display: inline-flex;
  }

  .masthead {
    padding: 22px;
  }

  .daily-grid {
    grid-template-columns: 1fr;
  }

  .library-head {
    flex-direction: column;
    align-items: stretch;
  }

  .search-field {
    width: 100%;
  }

  .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

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

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

  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .container {
    width: calc(100% - 28px);
  }

  .brand {
    font-size: 19px;
  }

  .masthead {
    padding: 18px;
    border-radius: 16px;
    margin: 18px 0 26px;
  }

  .club-stats {
    grid-template-columns: 1fr 1fr;
  }

  .club-stats>div:first-child {
    grid-column: 1 / -1;
  }

  .rail-grid {
    grid-template-columns: 1fr;
  }

  .game-grid {
    gap: 12px;
  }

  .game-caption {
    padding: 12px;
  }

  .game-caption h3 {
    font-size: 16px;
  }

  .card-arrow {
    display: none;
  }

  .play-area {
    padding: 14px;
    border-radius: 14px;
  }

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

  .club-footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    padding: 36px 0 28px;
  }

  .word-layout {
    grid-template-columns: 1fr;
  }

  .word-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
  }

  .solitaire-table {
    --card-height: 73px;
    --card-font: 17px;
  }

  .solitaire-top,
  .tableau {
    gap: 4px;
  }

  .waste .playing-card {
    left: 0 !important;
  }

  .test-target {
    min-height: 250px;
  }

  .test-target strong {
    font-size: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (hover: none) {
  .play-reveal {
    display: none;
  }

  .game-card:hover,
  .daily-card:hover,
  .mini-card:hover,
  .primary:hover {
    transform: none;
  }

  .game-card:hover img,
  .daily-card:hover img {
    transform: none;
  }
}