:root {
  --paper: #f5f0e6;
  --paper-deep: #e8dfcf;
  --white: #fffdf8;
  --navy: #17324d;
  --teal: #2b7a78;
  --mustard: #e2ad36;
  --coral: #d96955;
  --ink: #203241;
  --muted: #64727b;
  --line: #c9c0b2;
  font-family: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); }
a { color: inherit; }
.skip-link { position: fixed; top: .5rem; left: .5rem; z-index: 100; padding: .65rem 1rem; background: var(--navy); color: white; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.catalog { width: min(96rem, calc(100% - 2rem)); margin: auto; padding-bottom: 3rem; }
header { min-height: 5.25rem; display: flex; align-items: center; justify-content: space-between; gap: 2rem; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--navy); font-size: 1.08rem; font-weight: 650; text-decoration: none; }
.brand strong { font-weight: 850; }
.brand-mark { width: 2.75rem; height: 2.75rem; display: grid; place-items: center; overflow: hidden; border: 2px solid var(--navy); border-radius: 8px; background: white; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; padding: .14rem; }
.domain-brand { display: inline-flex; align-items: baseline; color: var(--navy); font: 800 1rem/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; letter-spacing: -.07em; }
.domain-brand::before, .domain-brand::after { color: var(--coral); font-weight: 900; letter-spacing: 0; }
.domain-brand::before { content: "["; margin-right: .45rem; }
.domain-brand::after { content: "]"; margin-left: .45rem; }
.domain-brand i { color: var(--teal); font-style: normal; }
.domain-brand strong { color: var(--navy); font-weight: 900; }
.home-link { color: var(--navy); font-size: .9rem; font-weight: 750; text-underline-offset: .25rem; white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: .8rem; }
.install-button, .install-dialog-close {
  min-height: 2.75rem;
  padding: .6rem .9rem;
  border: 2px solid var(--navy);
  border-radius: 8px;
  background: var(--mustard);
  color: var(--navy);
  font: 850 .84rem/1 "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
  box-shadow: 3px 3px 0 rgba(23, 50, 77, .14);
  cursor: pointer;
}
.install-button[hidden] { display: none; }
.install-button span { display: inline-block; margin-right: .25rem; font-size: 1rem; transform: translateY(-.05rem); }
.install-button:hover, .install-dialog-close:hover { transform: translate(-1px, -2px); box-shadow: 5px 5px 0 rgba(23, 50, 77, .17); }
.install-button:focus-visible, .install-dialog-close:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
.install-dialog {
  width: min(calc(100% - 2rem), 28rem);
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
}
.install-dialog::backdrop { background: rgba(23, 50, 77, .72); backdrop-filter: blur(5px); }
.install-dialog-card {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1rem;
  padding: 1.35rem;
  border: 2px solid var(--navy);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 7px 7px 0 rgba(0, 0, 0, .2);
}
.install-dialog-card img { border-radius: 15px; }
.install-dialog-card .eyebrow { margin: .25rem 0 .3rem; }
.install-dialog-card h2 { margin: 0; font: 750 1.4rem/1.15 Georgia, "Times New Roman", serif; }
.install-dialog-card ol { grid-column: 1 / -1; margin: .25rem 0; padding-left: 1.35rem; color: var(--muted); line-height: 1.55; }
.install-dialog-card li + li { margin-top: .55rem; }
.install-dialog-close { grid-column: 1 / -1; justify-self: end; min-width: 6.5rem; }
.hero { display: block; padding: clamp(2.5rem, 6vw, 4.5rem) clamp(0rem, 3vw, 2rem) clamp(1.5rem, 3vw, 2.5rem); }
.eyebrow { margin: 0 0 .8rem; color: var(--teal); font-size: .74rem; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--navy); }
h1 { margin-bottom: 1.3rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(3rem, 7vw, 5.3rem); line-height: .98; letter-spacing: -.045em; }
.hero p:last-child { max-width: 42rem; margin: 0; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.22rem); line-height: 1.6; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: clamp(2rem, 5vw, 4rem) 0 1.2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.section-title { display: flex; align-items: baseline; gap: 1rem; }
h2, .section-heading h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.1; letter-spacing: -.025em; }
.section-heading span { color: var(--muted); font-size: .85rem; }
.section-jump { color: var(--teal); font-size: .85rem; font-weight: 750; text-underline-offset: .25rem; white-space: nowrap; }
#multiplayer-games, .game-card[id] { scroll-margin-top: 1rem; }
.game-card[id]:target { outline: 3px solid var(--coral); outline-offset: 4px; }
.game-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(.7rem, 1.5vw, 1.25rem); }
.game-card { position: relative; min-width: 0; min-height: 0; padding: 1rem; display: flex; flex-direction: column; justify-content: flex-start; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--white); color: var(--ink); text-decoration: none; box-shadow: 4px 4px 0 var(--paper-deep); transition: transform .2s ease, box-shadow .2s ease; }
.game-card::before { content: ""; position: absolute; width: 7rem; height: .45rem; top: 0; left: 0; background: var(--card-accent); }
.game-card:hover { transform: translate(-2px, -4px); box-shadow: 8px 9px 0 var(--paper-deep); }
.game-card:hover .game-art { transform: scale(1.025); filter: saturate(1.08); }
.game-card:focus-visible, .home-link:focus-visible, .brand:focus-visible, .section-jump:focus-visible, footer a:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
.game-art { width: 100%; height: auto; aspect-ratio: 1; margin: 0 0 .8rem; display: block; border-radius: 8px; object-fit: contain; transition: transform .28s ease, filter .28s ease; }
.euchre-art {
  position: relative; overflow: hidden; display: grid; place-items: end center; padding-bottom: 14%;
  background:
    radial-gradient(circle at 50% 42%, rgba(255,255,255,.12), transparent 34%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.025) 0 2px, transparent 2px 7px),
    #123f36;
}
.euchre-art::after { content: ""; position: absolute; inset: 7%; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; }
.euchre-art b { z-index: 3; color: #fff6db; font: 900 clamp(1rem, 3vw, 1.45rem)/1 Georgia, serif; letter-spacing: .12em; }
.spades-art {
  background:
    radial-gradient(circle at 50% 42%, rgba(255,255,255,.12), transparent 34%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 2px, transparent 2px 7px),
    #182f4b;
}
.spades-art .e-one, .spades-art .e-three { color: #182f4b; }
.hearts-art {
  background:
    radial-gradient(circle at 50% 42%, rgba(255,255,255,.12), transparent 34%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 2px, transparent 2px 7px),
    #681f35;
}
.hearts-art .e-two { color: #182f4b; }
.hearts-art .e-three { color: #b93c43; }
.e-card {
  position: absolute; z-index: 2; top: 18%; left: 50%; width: 25%; aspect-ratio: .7; padding: 5%;
  border: 2px solid #17324d; border-radius: 7%; background: #fffaf0; color: #17324d;
  box-shadow: 3px 5px 0 rgba(0,0,0,.22); font: 900 clamp(.8rem, 3vw, 1.2rem)/1 Georgia, serif;
}
.e-card i { display: block; font-size: 1.2em; font-style: normal; }
.e-one { transform: translateX(-105%) rotate(-12deg); }
.e-two { z-index: 3; color: #b93c43; transform: translateX(-50%) translateY(-6%) rotate(1deg); }
.e-three { transform: translateX(5%) rotate(13deg); }
.game-kind { margin-bottom: .35rem !important; color: var(--teal) !important; font-size: .68rem !important; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.game-card h3 { margin: 0 0 .45rem; font-size: 1.35rem; line-height: 1.15; }
.game-card p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.play { margin-top: .65rem; color: var(--navy); font-size: .88rem; font-weight: 850; }
.game-card h3, .game-card p, .play { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
footer { margin-top: 5rem; padding-top: 1.5rem; display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
footer a { color: var(--navy); font-weight: 750; }
footer .domain-brand { font-size: .92rem; }

@media (max-width: 790px) {
  .hero { padding: 2rem .25rem .75rem; }
  .section-heading { margin-top: 1.5rem; }
}

@media (min-width: 700px) {
  .game-grid { grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr)); }
}

@media (max-width: 560px) {
  .catalog { width: calc(100% - 1rem); }
  header { min-height: 4.5rem; gap: .75rem; }
  .home-link { font-size: .78rem; }
  .header-actions { gap: .45rem; }
  .header-actions:has(.install-button:not([hidden])) .home-link { display: none; }
  .install-button { min-height: 2.5rem; padding: .5rem .65rem; font-size: .75rem; }
  .eyebrow { font-size: .68rem; letter-spacing: .1em; white-space: nowrap; }
  .hero p:last-child { text-wrap: pretty; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .game-card { min-height: 0; padding: .6rem; border-radius: 9px; box-shadow: 2px 3px 0 var(--paper-deep); }
  .game-art { margin-bottom: .65rem; border-radius: 6px; }
  .game-card h3 { font-size: 1.05rem; }
  .game-card p { font-size: .78rem; line-height: 1.4; }
  .game-kind { font-size: .58rem !important; letter-spacing: .09em; }
  .play { margin-top: .55rem; font-size: .76rem; }
  .section-heading { align-items: start; flex-direction: column; }
  .section-title { width: 100%; justify-content: space-between; gap: .5rem; }
  .section-heading h1 { font-size: 2rem; white-space: nowrap; }
  .section-jump { font-size: .76rem; }
  footer { flex-direction: column; }
}

@media (max-width: 340px) {
  header { gap: .5rem; }
  .domain-brand { font-size: .78rem; }
  .domain-brand::before { margin-right: .25rem; }
  .domain-brand::after { margin-left: .25rem; }
  .home-link { font-size: .68rem; }
  .install-button { width: 2.5rem; padding: .4rem; overflow: hidden; color: transparent; white-space: nowrap; }
  .install-button span { margin: 0; color: var(--navy); }
  .eyebrow { font-size: .6rem; letter-spacing: .06em; }
  .section-title { align-items: flex-start; flex-direction: column; gap: .35rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
