@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,500;1,600&display=swap');

:root {
  --paper: #fffdfa;
  --white: #ffffff;
  --ink: #271c1e;
  --muted: #615355;
  --accent: #aa283d;
  --accent-hover: #861d30;
  --rule: #e5c5ca;
  --blush: #fae7e9;
  --soft-blush: #fdf3f3;
  --control-border: #b58a92;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'DM Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 1rem/1.6 var(--sans); }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.07; }
h2 { font-size: clamp(2.1rem, 4.7vw, 3.55rem); letter-spacing: -.045em; }
h3 { font-size: 1.55rem; letter-spacing: -.025em; }
.wrap { width: min(100% - 3rem, 76rem); margin-inline: auto; }
.skip { position: absolute; top: .5rem; left: .5rem; z-index: 10; background: var(--white); padding: .5rem 1rem; transform: translateY(-160%); }
.skip:focus { transform: none; }
.masthead { border-bottom: 1px solid var(--rule); }
.mast-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 76px; }
.wordmark { display: inline-flex; align-items: center; gap: .28em; font: 700 1.48rem/1 var(--serif); letter-spacing: -.045em; text-decoration: none; white-space: nowrap; }
.wordmark i { color: var(--accent); font-weight: 600; }
.mark { display: grid; place-items: center; width: 32px; height: 32px; margin-right: .22em; border-radius: 50%; background: var(--accent); color: var(--white); font: 1.2rem/1 Georgia, serif; }
nav { display: flex; gap: clamp(.8rem, 4vw, 2.5rem); }
nav a { text-decoration: none; font-weight: 600; }
nav a:hover, nav a[aria-current] { text-decoration: underline; text-underline-offset: .28em; }
.hero { border-bottom: 1px solid var(--rule); }
.hero-inner { display: grid; grid-template-columns: .95fr 1.05fr; align-items: center; gap: clamp(1.6rem, 6vw, 6rem); padding-block: clamp(2.4rem, 6.3vw, 6.2rem); }
.kicker { font-size: .875rem; font-weight: 700; line-height: 1.35; text-transform: uppercase; letter-spacing: .1em; }
.kicker span { padding-inline: .16em; }
.hero-kicker { color: var(--accent); margin-bottom: 1.3rem; }
.hero h1 { font-size: clamp(4.3rem, 8.5vw, 8rem); font-weight: 600; letter-spacing: -.077em; line-height: .94; }
.hero h1 em { color: var(--accent); font-weight: 500; }
.lede { max-width: 29rem; margin-top: 1.65rem; font-size: clamp(1.05rem, 2vw, 1.28rem); line-height: 1.55; color: var(--muted); }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .9rem 1.45rem; margin-top: 1.7rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .64rem 1.15rem; border-radius: 4px; text-decoration: none; font-weight: 700; }
.primary { background: var(--accent); color: var(--white); }
.primary:hover { background: var(--accent-hover); }
.text-link { font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: .26em; }
.text-link:hover { color: var(--accent); }

.hero-art {
  position: relative; isolation: isolate; overflow: hidden; aspect-ratio: 1.13;
  border-radius: 5px; background: var(--blush);
}
.card-table-outline { position: absolute; inset: 12% 8%; border: 1px solid #dc9ca6; border-radius: 50%; }
.playing-card { position: relative; display: grid; place-items: center; aspect-ratio: 5/7; color: var(--ink); border: 1px solid #dc9ca6; border-radius: 7%; background: var(--paper); font-family: Georgia, serif; box-shadow: 0 .35em .7em #43242f26; }
.playing-card::after { content: ''; position: absolute; inset: 7%; border: 1px solid #a9637048; border-radius: 6%; pointer-events: none; }
.red-ink { color: var(--accent); }
.card-index { position: absolute; top: 9%; left: 10%; font-size: .77em; font-weight: bold; line-height: .95; text-align: center; }
.card-index small { display: block; font-size: .7em; line-height: 1; }
.card-index.reverse { inset: auto 10% 9% auto; transform: rotate(180deg); }
.card-pip { font-size: 2em; line-height: 1; text-shadow: 0 1px #fff7; }
.hero-card { position: absolute; width: 31%; font-size: clamp(1.3rem, 4.65vw, 4.2rem); }
.card-ace { left: 29%; top: 16%; rotate: -12deg; }
.card-seven { left: 52%; top: 29%; rotate: 14deg; }
.deck-back {
  position: absolute; width: 31%; left: 18%; top: 24%; rotate: -29deg; aspect-ratio: 5/7;
  display: grid; place-items: center; border: 1px solid #dc9ca6; border-radius: 7%;
  color: var(--paper); background: repeating-linear-gradient(45deg, #fff2 0 1px, transparent 1px 7px), var(--accent);
  box-shadow: 0 9px 18px #43242f26; font: clamp(1.2rem, 5vw, 4.6rem)/1 Georgia, serif;
}

.catalogue { padding-block: clamp(2.8rem, 7vw, 6.2rem); }
.section-head { display: flex; justify-content: space-between; gap: .75rem 2rem; align-items: baseline; flex-wrap: wrap; margin-bottom: 1.55rem; }
.section-head p, .game-count { color: var(--muted); }
.filters { display: grid; grid-template-columns: 1.45fr 1fr 1fr auto; align-items: end; gap: .75rem; padding: 1rem; border: 1px solid var(--rule); border-radius: 5px; background: var(--soft-blush); }
.filters label { display: grid; gap: .3rem; font-weight: 700; font-size: .875rem; min-width: 0; }
.filters input, .filters select, .reset { min-height: 44px; border: 1px solid var(--control-border); border-radius: 4px; padding: .5rem .7rem; background: var(--white); width: 100%; font-size: 1rem; font-weight: 500; }
.filters select { appearance: none; padding-right: 2rem; background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%); background-position: calc(100% - 16px) 51%, calc(100% - 11px) 51%; background-size: 5px 5px; background-repeat: no-repeat; }
.reset { white-space: nowrap; padding-inline: 1.05rem; font-weight: 700; }
.reset:hover { background: var(--blush); }
.game-count { margin-block: 1.05rem .65rem; font-size: .875rem; font-weight: 600; }
.tile-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.game-tile { display: flex; min-width: 0; border: 1px solid var(--rule); border-radius: 5px; background: var(--white); }
.tile-link { display: flex; flex-direction: column; width: 100%; text-decoration: none; border-radius: inherit; }
.tile-link:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .13em; }
.tile-art { position: relative; isolation: isolate; overflow: hidden; display: grid; place-items: center; height: 8.1rem; border-radius: 4px 4px 0 0; background-color: var(--tone); background-image: repeating-linear-gradient(135deg, #ffffff26 0 1px, transparent 1px 8px); }
.tone-rose { --tone: var(--blush); --tone-ink: var(--accent); }
.tone-plum { --tone: #f2e8f0; --tone-ink: #792447; }
.tone-peach { --tone: #f8e9e1; --tone-ink: #8e3e29; }
.tile-card { z-index: 1; width: 3.5rem; rotate: -13deg; font-size: 1.4rem; transition: rotate 160ms; }
.tile-link:hover .tile-card { rotate: -6deg; }
.art-symbol { position: absolute; inset: auto .04em -.18em auto; font: 8.4rem/1 Georgia, serif; color: var(--tone-ink); opacity: .15; }
.tile-copy { flex: 1; display: flex; flex-direction: column; padding: 1rem; }
.tile-copy .kicker { font-size: .78rem; color: var(--tone-ink, var(--accent)); }
.tile-copy h3 { margin-top: .5rem; }
.tile-copy > p:not(.kicker) { margin-top: .65rem; color: var(--muted); line-height: 1.48; }
.tile-meta { display: flex; flex-wrap: wrap; gap: .35rem .8rem; margin-top: auto; padding-top: 1rem; color: var(--muted); font-size: .875rem; }
.tile-meta span + span::before { content: '•'; margin-right: .8rem; }
.empty { padding: 2rem 0; color: var(--muted); }
.about { background: var(--soft-blush); color: var(--ink); }
.about-inner { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 2rem; padding-block: clamp(2.6rem, 6vw, 4.5rem); }
.about .kicker { color: var(--accent); margin-bottom: .7rem; }
.about p:not(.kicker) { max-width: 35rem; margin-bottom: 1rem; }
.about .text-link:hover { color: var(--accent); }
.site-footer { border-top: 1px solid var(--rule); }
.footer-inner > a:last-child { font-weight: 600; }
.guide-top { background: var(--tone); border-bottom: 1px solid var(--rule); }
.guide-head { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 2rem; padding-block: clamp(1.8rem, 5vw, 4.75rem); }
.crumb { display: inline-block; margin-bottom: 1.1rem; font-weight: 600; text-underline-offset: .25em; }
.guide-head .kicker { color: var(--tone-ink); }
.guide-head h1 { margin-top: .45rem; font-size: clamp(3.3rem, 8vw, 7rem); letter-spacing: -.07em; }
.guide-head .lede { margin-top: .8rem; }
.facts { display: flex; gap: .45rem; flex-wrap: wrap; list-style: none; padding: 0; margin: 1.15rem 0 0; }
.facts li { border: 1px solid #874b564d; border-radius: 2rem; padding: .25rem .75rem; font-size: .875rem; font-weight: 600; background: #ffffff80; }
.guide-art { position: relative; isolation: isolate; display: grid; overflow: hidden; place-items: center; min-height: 16rem; border: 1px solid #874b564d; border-radius: 5px; background: repeating-linear-gradient(135deg, #ffffff2b 0 1px, transparent 1px 10px); }
.guide-art > .playing-card { width: 6.8rem; rotate: -12deg; font-size: 2.65rem; z-index: 1; }
.guide-art > span:last-child { position: absolute; bottom: -.25em; right: .045em; font: 16rem/1 Georgia, serif; color: var(--tone-ink); opacity: .16; }
.guide-layout { display: grid; grid-template-columns: minmax(8rem, 13rem) minmax(0, 48rem); gap: clamp(1.25rem, 5vw, 4.5rem); padding-block: 2.6rem; }
.contents { align-self: start; position: sticky; top: 1rem; display: grid; gap: .28rem; border-left: 1px solid var(--rule); padding-left: .85rem; }
.contents .kicker { margin-bottom: .25rem; color: var(--muted); }
.contents a { font-weight: 600; text-underline-offset: .2em; }
.guide-content section { scroll-margin-top: 1rem; }
.guide-content h2 { margin-bottom: .8rem; }
.guide-content h3 { margin: 1.25rem 0 .35rem; }
.guide-content p { max-width: 67ch; }
.tip { margin-top: 1.25rem; padding: .75rem 1rem; border-left: 3px solid var(--accent); background: var(--soft-blush); }
.tip h3 { margin-top: 0; }
.practice { margin-block: 2rem; padding: clamp(.9rem, 3vw, 1.8rem); background: var(--blush); border: 1px solid var(--rule); border-radius: 5px; }
.hand { display: flex; flex-wrap: wrap; gap: .7rem 1.35rem; margin-top: .9rem; }
.hand-group p { margin-bottom: .35rem; font-size: .875rem; font-weight: 700; }
.hand-cards { display: flex; flex-wrap: wrap; gap: .34rem; }
.hand-cards .playing-card { width: 3rem; font-size: 1.05rem; }
.choices { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.1rem; }
.choices button { min-height: 44px; padding: .4rem .8rem; border: 1px solid var(--control-border); border-radius: 4px; background: var(--white); text-align: left; font-weight: 600; }
.choices button:hover { border-color: var(--accent); }
.choices button[aria-pressed="true"] { color: white; background: var(--accent); }
.feedback:not(:empty) { margin-top: .8rem; font-weight: 700; }
.feedback[data-correct="false"] { color: var(--accent); }
.practice details { margin-top: .75rem; }
.practice summary { font-weight: 700; cursor: pointer; }
.practice details p { margin-top: .3rem; }
.guide-links { display: flex; flex-wrap: wrap; gap: .45rem 1.35rem; margin-top: .9rem; }
.related { padding-block: .8rem 3rem; }
.related h2 { margin-bottom: 1rem; }
.related .tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 960px) { .tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 740px) {
  .wrap { width: calc(100% - 2rem); }
  .hero-inner { grid-template-columns: 1fr; gap: 1.6rem; }
  .hero h1 { font-size: clamp(3.7rem, 11vw, 6rem); }
  .hero-art { aspect-ratio: 1.3; }
  .hero-card { font-size: clamp(1.5rem, 7vw, 3.5rem); }
  .filters { grid-template-columns: 1fr 1fr; }
  .tile-grid, .related .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-inner { grid-template-columns: 1fr; gap: 1rem; }
  .guide-head { grid-template-columns: minmax(0, 1fr) .48fr; gap: .8rem; }
  .guide-art { min-height: 10rem; }
  .guide-art > .playing-card { width: 53%; font-size: 1.35rem; }
  .guide-art > span:last-child { font-size: 8rem; }
  .guide-layout { grid-template-columns: 1fr; }
  .contents { position: static; display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
  .contents .kicker { flex-basis: 100%; }
}
@media (max-width: 470px) {
  .mast-inner, .footer-inner { min-height: 65px; }
  nav { gap: .65rem; font-size: .875rem; }
  .wordmark { font-size: 1.2rem; }
  .mark { width: 25px; height: 25px; font-size: .98rem; }
  .filters label:first-child { grid-column: 1 / -1; }
  .filters .reset { width: fit-content; }
  .tile-grid, .related .tile-grid { grid-template-columns: 1fr; }
  .tile-art { height: 6.25rem; }
  .tile-card { width: 2.85rem; font-size: 1.1rem; }
  .footer-inner > a:last-child { font-size: .875rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.guide-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; margin-top: 1.15rem; }
.store-button { background: var(--white); border: 1px solid var(--control-border); }
.store-button:hover { background: var(--soft-blush); }
.tile-copy > p.tile-play { color: var(--accent); font-size: .875rem; font-weight: 700; }
