@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-latin.woff") format("woff");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}
:root {
  color-scheme: light;
  --ink: #352636;
  --muted: #655767;
  --line: #d7c4b3;
  --paper: #fff9ed;
  --berry: #70314e;
  --display: "Bricolage Grotesque", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-family: "DM Sans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; background-image: radial-gradient(#b08c6523 .8px, transparent 1px); background-size: 12px 12px; }
a { color: inherit; text-decoration: none; }
button, select, input, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #723c76; outline-offset: 4px; }
.frame { width: min(1160px, calc(100% - 64px)); margin-inline: auto; }
.skip { position: absolute; left: 1rem; top: -80px; z-index: 3; background: white; padding: 12px; }
.skip:focus { top: 8px; }
header, nav, .brand, .section-title, .metadata, footer, .dialog-title { display: flex; align-items: center; }
header, .section-title, footer, .dialog-title { justify-content: space-between; }
header { min-height: 86px; gap: 24px; }
.brand { gap: 9px; font: 800 2.1rem/1 var(--display); letter-spacing: -.055em; }
.brand img { width: 46px; height: 46px; object-fit: contain; }
html:lang(zh-CN) .brand { font-size: 1.65rem; letter-spacing: .03em; }
.language-picker { display: inline-flex; margin-left: auto; padding: 3px; border-radius: 99px; background: #f3eadb; border: 1px solid var(--line); }
.language-picker button { padding: 6px 10px; min-height: 30px; border: 0; border-radius: 99px; background: transparent; font-size: .83rem; font-weight: 650; white-space: nowrap; }
.language-picker button[aria-pressed="true"] { background: #fffefa; box-shadow: 0 1px 3px #53304c30; }
nav { gap: clamp(10px, 1.6vw, 24px); font-size: .9rem; font-weight: 650; }
nav a:hover, footer a:hover { text-decoration: underline; text-underline-offset: 4px; }
nav button, .browse, .go, #pick-for-me { border: 1.5px solid var(--ink); border-radius: 99px; background: #fffaf2; padding: 9px 16px; font-weight: 750; }
nav button:hover, #pick-for-me:hover { background: #ffeed7; }
#open-account, .browse, .go { background: var(--berry); color: #fffaf4; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); }
.hero { display: grid; position: relative; grid-template-columns: 47% 53%; isolation: isolate; overflow: hidden; border: 2px solid var(--ink); border-radius: 30px; box-shadow: 0 5px 0 #553343; background: #ffe6cc; }
.hero-copy { align-self: center; position: relative; z-index: 1; padding: clamp(32px, 4vw, 62px) 0 clamp(32px, 4vw, 62px) clamp(24px, 4vw, 60px); }
h1 { font-weight: 800; font-size: clamp(3.8rem, 6vw, 5.65rem); letter-spacing: -.07em; line-height: .97; }
h1 span, h1 em { display: block; }
h1 em { font-family: Georgia, "Songti SC", "Microsoft YaHei", serif; color: #a53b47; font-weight: 700; }
html:lang(zh-CN) h1 { font-size: clamp(2.6rem, 5.3vw, 4.75rem); letter-spacing: -.055em; line-height: 1.14; }
html:lang(zh-CN) h1 em { font-family: inherit; font-style: normal; }
.intro { margin-top: 18px; max-width: 37ch; font-size: clamp(.95rem, 1.4vw, 1.08rem); line-height: 1.55; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero-actions > * { display: inline-flex; gap: 9px; justify-content: center; align-items: center; min-height: 45px; padding: 9px 17px; font-size: .93rem; }
.browse { box-shadow: 0 3px 0 var(--ink); }
.browse:hover, .go:hover, #open-account:hover { background: #55263f; }
.lucky-die { font: 1.5rem/1 Georgia, serif; color: #804766; transform: rotate(-12deg); }
.hero-art { display: block; position: relative; min-height: 300px; align-self: stretch; }
.hero-art::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 13%; background: linear-gradient(90deg,#ffe6cc,transparent); pointer-events: none; }
.hero-photo { display: block; width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; }
.library { padding-top: 46px; scroll-margin-top: 15px; }
.section-title { justify-content: flex-start; gap: 14px; margin-bottom: 20px; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); font-weight: 800; letter-spacing: -.045em; line-height: 1.15; }
.section-title > span { padding: 4px 11px; border-radius: 99px; color: #57415a; background: #eddfec; font-size: .83rem; font-weight: 700; white-space: nowrap; }
.section-title::after { content: ""; flex: 1; margin-left: 5px; border-top: 2px dashed #d8c6b4; }
.games { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 22px; }
.game { --card-radius: 19px; --tag: #fae6a9; display: block; position: relative; border: 1.5px solid #604c54; border-radius: var(--card-radius); background: #fffdfa; box-shadow: 0 3px 0 #d8c8b9; overflow: hidden; scroll-margin: 20px; }
.game:nth-child(3n+2) { --tag: #e9dced; }
.game:nth-child(3n) { --tag: #d5e8d6; }
.game.picked { border-color: #a5415d; outline: 0; box-shadow: none; }
.game.picked::after { content: ""; position: absolute; inset: 0; border: 3px solid #a5415d; border-radius: calc(var(--card-radius) - 1.5px); pointer-events: none; }
@media (forced-colors: active) { .game.picked::after { border-color: Highlight; } }
.cover { aspect-ratio: 2.5; position: relative; background: #51785c; border-bottom: 1px solid #624e54; overflow: hidden; }
.scene { width: 100%; height: 100%; object-fit: cover; object-position: center 48%; }
.pieces { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; }
.playing-card { position: relative; display: flex; flex-direction: column; width: 54px; height: 73px; padding: 3px 6px; border-radius: 5px; border: 1px solid #b8af94; background: #fffae9; color: #182d2b; box-shadow: 2px 6px 7px #12261d55; font-family: Georgia,serif; transform: translate(7px,4px) rotate(-19deg); }
.playing-card + .playing-card { margin-left: -13px; transform: translate(-1px,-1px) rotate(13deg); }
.playing-card b { font-size: 1.25rem; line-height: 1; }
.playing-card i { text-align: center; font: normal 2rem/1.2 Georgia,serif; }
.red { color: #ae3829; }
.sprite { width: 78px; height: 78px; image-rendering: pixelated; filter: drop-shadow(2px 6px 3px #25362c50); }
.details { padding: 16px 19px 19px; }
.metadata { flex-wrap: wrap; gap: 6px 10px; color: var(--muted); font-size: .78rem; font-weight: 600; }
.metadata span:first-child { color: var(--ink); padding: 3px 9px; background: var(--tag); border-radius: 99px; }
.details h3 { margin-top: 9px; font-size: 1.6rem; line-height: 1.12; letter-spacing: -.04em; }
.details p { margin-top: 6px; font-size: .92rem; line-height: 1.55; color: #594e55; }
footer { border-top: 2px dashed #d8c6b4; padding-block: 18px 26px; margin-top: 40px; color: var(--muted); font-size: .86rem; }
dialog { width: min(380px,calc(100% - 32px)); padding: 24px; color: var(--ink); background: #fffbf3; border: 2px solid #614358; border-radius: 20px; box-shadow: 0 5px 0 #503b4a; }
dialog h2 { font-size: 1.55rem; }
dialog::backdrop { background: #30202fd1; }
.dialog-title button { border: 0; background: transparent; font-size: 1.6rem; width: 40px; height: 40px; }
form label { display: block; margin: 19px 0 7px; font-size: .95rem; }
form select, form input { width: 100%; border: 1px solid #ac999c; border-radius: 7px; padding: 10px; background: white; min-height: 44px; }
#room-code { text-transform: uppercase; letter-spacing: .08em; }
.go { width: 100%; margin-top: 24px; min-height: 44px; }
.text-action { background: transparent; border: 0; text-decoration: underline; text-underline-offset: 4px; margin-top: 12px; min-height: 36px; }
#account-message:not(:empty), #signed-in { margin-top: 15px; color: var(--muted); font-size: .95rem; }
@media (hover:hover) and (prefers-reduced-motion:no-preference) {
  .game, .lucky-die { transition: transform .18s ease, box-shadow .18s ease; }
  .game:not(.picked):hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: 0 6px 0 #d8c8b9; }
  #pick-for-me:hover .lucky-die { transform: rotate(18deg); }
}
@media (max-width: 900px) {
  .frame { width: calc(100% - 36px); }
  header { gap: 14px; }
  .games { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
  h1 { font-size: clamp(3rem,6.4vw,4rem); }
  .hero-copy { padding-left: 25px; }
  .hero-actions { gap: 8px; }
}
@media (max-width: 730px) {
  header.frame { display: grid; grid-template-columns: 1fr auto; gap: 5px 8px; padding-block: 10px 12px; }
  header nav { grid-column: 1/-1; justify-content: flex-end; flex-wrap: wrap; gap: 6px 12px; }
  header nav a:first-child { margin-right: auto; }
  .brand { font-size: 1.8rem; }
  .brand img { width: 38px; height: 38px; }
  nav button { padding: 7px 12px; }
}
@media (max-width: 620px) {
  .frame { width: calc(100% - 28px); }
  .hero { display: flex; flex-direction: column-reverse; border-radius: 23px; }
  .hero-art { width: 100%; min-height: 0; }
  .hero-art::after { inset: auto 0 0; width: auto; height: 12%; background: linear-gradient(0deg,#ffe6cc,transparent); }
  .hero-photo { position: static; width: 100%; height: auto; }
  .hero-copy { align-self: stretch; padding: 10px 20px 22px; }
  h1, html:lang(zh-CN) h1 { font-size: clamp(2.2rem,7.6vw,3.25rem); line-height: 1.03; }
  h1 span, h1 em { display: inline-block; }
  html:lang(en) h1 em { margin-left: .14em; }
  .intro { margin-top: 10px; max-width: 40ch; font-size: .94rem; }
  .hero-actions { margin-top: 15px; }
  .hero-actions > * { min-height: 40px; padding: 7px 13px; font-size: .85rem; }
  .library { padding-top: 28px; }
  .section-title { gap: 10px; margin-bottom: 13px; }
  .games { grid-template-columns: 1fr; gap: 14px; }
  .game { display: grid; grid-template-columns: 32% 1fr; --card-radius: 15px; }
  .cover { aspect-ratio: auto; min-height: 118px; border-bottom: 0; border-right: 1px solid #624e54; }
  .scene { position: absolute; }
  .details { padding: 12px 13px; }
  .details h3 { font-size: 1.32rem; margin-top: 6px; }
  .details p { font-size: .86rem; line-height: 1.45; }
  .playing-card { width: 39px; height: 55px; padding: 3px; }
  .playing-card b { font-size: .95rem; }
  .playing-card i { font-size: 1.4rem; }
  .sprite { width: 58px; height: 58px; }
  footer { gap: 8px; flex-wrap: wrap; }
}

#feedback { width: min(460px, calc(100% - 28px)); max-height: 90dvh; }
#feedback fieldset { min-inline-size: 0; padding: 0; margin: 0; border: 0; }
.feedback-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.feedback-picks > div { min-width: 0; }
#feedback select, #feedback textarea { width: 100%; }
#feedback textarea { display: block; resize: vertical; min-height: 7rem; border: 1px solid #a2afa5; border-radius: 6px; padding: 10px 12px; background: white; color: var(--ink); font: inherit; }
#feedback .feedback-trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; }
#feedback-sent p, .feedback-note:not(:empty) { margin-top: 14px; line-height: 1.5; color: var(--muted); }
#feedback button:disabled { opacity: .65; cursor: wait; }
footer a { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 420px) {
  header nav { flex-wrap: wrap; gap: 6px 10px; }
  header nav button { padding-inline: 9px; }
}

#diagnostic-option { margin-top: 14px; font-size: .82rem; color: var(--muted); }
#diagnostic-option label { display: flex; gap: 8px; align-items: center; color: var(--ink); margin: 0 0 4px; }
#diagnostic-option input { width: 18px; min-height: 18px; accent-color: var(--berry); }
#diagnostic-option p { line-height: 1.45; }

#account .account-mascot { float: left; width: 44px; height: 44px; object-fit: contain; margin: 0 10px 8px 0; }
#account .dialog-title { min-height: 44px; }
#account form, #account-details { clear: both; }
#account-details #signed-in { font-weight: 700; overflow-wrap: anywhere; }
#open-account { max-width: min(36vw, 16ch); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
