@font-face {
  font-family: Cormorant;
  src: url("assets/CormorantGaramond.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Game Thai";
  src: url("assets/NotoSansThai.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Game Hebrew";
  src: url("assets/NotoSansHebrew.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  color-scheme: light;
  --pine: #112f27;
  --night: #081e19;
  --cream: #f7f4e9;
  --yellow: #f1cc84;
  --ink: #15382d;
  --serif: Cormorant, Georgia, "Game Hebrew", "Game Thai", serif;
  --ui: "Segoe UI", "Game Thai", "Game Hebrew", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--cream); font: 1rem/1.5 var(--ui); }
button, select { font: inherit; }
button, select, a { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, select:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #dc9b37;
  outline-offset: 4px;
}
[hidden] { display: none !important; }
.shell { width: min(88.3%, 1370px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; inset-inline-start: 1rem; top: -100px; z-index: 30; padding: .7rem 1rem; background: white; color: var(--ink); }
.skip-link:focus { top: .7rem; }

/* The garden image is the backdrop used by the game's Garden Sala. */
.opening { position: relative; isolation: isolate; color: var(--cream); background: #142d25; overflow: clip; }
.garden { position: absolute; z-index: -2; inset: 0; background: #284136 url("assets/garden-wide.jpg") center 55% / cover no-repeat; }
.opening::before, .opening::after { content: ""; pointer-events: none; position: absolute; inset: 0; z-index: -1; }
.opening::before {
  background: linear-gradient(90deg, rgba(5,28,23,.98) 0%, rgba(7,30,24,.94) 20%, rgba(8,31,26,.76) 35%, rgba(10,35,28,.21) 61%, rgba(8,25,20,.06) 83%, rgba(9,28,22,.2) 100%);
}
.opening::after {
  background: linear-gradient(180deg, rgba(8,25,22,.55) 0%, transparent 25%, transparent 60%, rgba(5,26,21,.56) 84%, #0b251e 100%);
}
.mast { position: relative; display: flex; justify-content: space-between; align-items: center; min-height: 78px; border-bottom: 1px solid #f8ecd735; }
.publisher, .mast-right, .mast nav, .language, .hero-actions, .action, .turn-hint, .place, .deck-picker, .swatches, .frame-action { display: inline-flex; align-items: center; }
.publisher { gap: 10px; font-size: 1.23rem; font-weight: 600; letter-spacing: -.055em; }
.publisher-mark { direction: ltr; position: relative; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #e7ebd789; border-radius: 8px; color: #fff5d7; font-size: .77rem; letter-spacing: -.07em; line-height: 1; }
.publisher-mark i { position: absolute; top: -2px; right: -2px; width: 6px; height: 6px; background: #e7c480; border-radius: 50%; }
.mast-right { gap: clamp(20px, 3.8vw, 62px); }
.mast nav { gap: clamp(22px, 2.7vw, 43px); }
.mast nav a, .language { font-size: .91rem; font-weight: 500; }
.mast nav a:hover, .text-link:hover, .footer a:hover { text-decoration: underline; text-underline-offset: 5px; }
.language { position: relative; gap: 8px; }
.language::after { content: ""; position: absolute; inset-inline-end: 2px; top: 44%; width: 5px; height: 5px; border-inline-end: 1px solid; border-bottom: 1px solid; transform: rotate(45deg); pointer-events: none; }
.language select { appearance: none; border: 0; background: transparent; color: inherit; padding: 9px 0; padding-inline-end: 17px; cursor: pointer; font-size: inherit; }
.language option { color: var(--ink); background: white; }
.globe { width: 15px; height: 15px; border: 1px solid currentColor; border-radius: 50%; position: relative; }
.globe::before, .globe::after { content: ""; position: absolute; }
.globe::before { inset: 0 3px; border-inline: 1px solid; border-radius: 50%; }
.globe::after { inset: 6px 1px auto; border-top: 1px solid; }

.hero { display: grid; grid-template-columns: .88fr 1.12fr; align-items: center; min-height: clamp(510px, 40.2vw, 640px); padding-block: 32px 36px; }
.hero-copy { position: relative; z-index: 2; padding-block: 8px; }
.native-name { margin: 0 0 18px; display: flex; align-items: center; gap: 12px; color: #efd89e; }
.native-name span { width: 36px; height: 1px; background: currentColor; }
.native-name b { font: 500 1.05rem/1.4 "Game Thai", var(--ui); }
h1, h2, p, figure { margin: 0; }
h1 { font: 500 clamp(6rem, 9.65vw, 10.3rem)/.77 var(--serif); letter-spacing: -.061em; }
h1 span, h1 em { display: block; }
h1 em { font-weight: 500; font-style: italic; color: #f5d89c; padding-bottom: .13em; }
.lead { max-width: 34ch; margin-top: 19px; font-size: clamp(1.03rem, 1.35vw, 1.28rem); line-height: 1.47; color: #f2f2e7; text-wrap: pretty; }
.hero-actions { gap: 28px; margin-top: 27px; flex-wrap: wrap; }
.action { justify-content: center; gap: 11px; min-height: 47px; border: 0; border-radius: 5px; padding: 10px 21px; font-size: .96rem; font-weight: 650; }
.gold { background: var(--yellow); color: #122d23; box-shadow: 0 3px 12px #05191230; }
.gold:hover { background: #ffe1a7; }
.text-link { font-size: .96rem; font-weight: 600; border-bottom: 1px solid #f5eed480; padding-block: 3px; }
.orbit { position: relative; width: 21px; height: 13px; border: 1.4px solid; border-radius: 50%; transform: rotate(-25deg); display: inline-block; }
.orbit::before { content: ""; position: absolute; border: 1px solid; border-radius: 50%; inset: -3px 6px; }
.orbit::after { content: ""; position: absolute; top: 0; right: 1px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }

.hand-art { min-width: 0; display: grid; justify-items: center; align-content: center; position: relative; }
.fan-stage { width: min(100%, 660px); aspect-ratio: 1.56; position: relative; container-type: inline-size; direction: ltr; isolation: isolate; }
.fan { position: absolute; inset: 0; transform: perspective(1100px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)); transition: transform .22s ease-out; pointer-events: none; }
.card-position { position: absolute; width: 35.8cqw; height: 51.8cqw; transform-origin: 50% 83%; }
.card-seven { z-index: 1; left: 13%; top: 18%; transform: rotateZ(-22deg) rotateY(7deg); }
.card-eight { z-index: 2; left: 32%; top: 9%; transform: rotateZ(-6deg) rotateY(3deg); }
.card-nine { z-index: 3; left: 52%; top: 8%; perspective: 1100px; transform: rotateZ(14deg) rotateY(-9deg); }
.card-surface { position: absolute; inset: 0; border-radius: 2cqw; backface-visibility: hidden; overflow: hidden; box-shadow: 1px 2px 0 #bcac8d, 2px 4px 0 #796f5e, 0 10px 13px #161a1435, 1px 25px 34px #00130f60; }
.playing { background: linear-gradient(125deg,#fffaf0 8%,#f7eedb 63%,#e5d8bf 100%); color: #a9333b; border: 1px solid #fbf6e5; }
.playing::after { content: ""; position: absolute; inset: 2.7%; border: 1px solid #b69e7429; border-radius: 1.5cqw; pointer-events: none; }
.turning-card { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .72s cubic-bezier(.2,.73,.25,1); }
.turning-card.turned { transform: rotateY(180deg); }
.illustrated { padding: 1.1cqw; background: linear-gradient(120deg,#fcf4ce,#ecdeb6 55%,#d1bb8e); }
.illustrated img { display: block; width: 100%; height: 100%; object-fit: fill; border-radius: 1.25cqw; box-shadow: 0 0 0 1px #695b39; }
.reverse { transform: rotateY(180deg); }
.rank { position: absolute; top: 5%; left: 7%; display: grid; justify-items: center; font: 500 7.1cqw/.82 Georgia, serif; }
.rank small { margin-top: .5cqw; font: 400 3.6cqw/.9 Georgia, serif; }
.rank.lower { inset: auto 7% 5% auto; transform: rotate(180deg); }
.pips { position: absolute; inset: 13% 18%; }
.pip { position: absolute; font: 400 6.5cqw/1 Georgia, serif; transform: translate(-50%,-50%); }
.pip.flipped { transform: translate(-50%,-50%) rotate(180deg); }
.turn-hit { position: absolute; width: 37%; height: 80%; left: 51%; top: 7%; background: transparent; border: 0; border-radius: 2cqw; transform: rotate(14deg); }
.turn-hint { gap: 8px; color: #fff6da; background: #0b251ed9; border: 1px solid #f4dfa642; border-radius: 100px; padding: 7px 13px; font-size: .84rem; margin-top: 8px; }
.turn-hint:hover { border-color: #f3ddac; }
.flip-sign { position: relative; width: 14px; height: 15px; }
.flip-sign::before, .flip-sign::after { content: ""; position: absolute; width: 7px; height: 10px; border: 1px solid; border-radius: 2px; top: 1px; }
.flip-sign::before { left: 1px; transform: rotate(-13deg); }
.flip-sign::after { right: 0; transform: rotate(13deg); background: #193f32; }

.hero-bar { border-top: 1px solid #eddfb838; background: #102c24c7; }
.bar-inner { min-height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.place { gap: 14px; }
.pin { position: relative; border: 1px solid #e5cf96; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); width: 17px; height: 17px; margin-inline: 3px; }
.pin::before { content: ""; position: absolute; border: 1px solid #e5cf96; width: 5px; height: 5px; border-radius: 50%; left: 4px; top: 4px; }
.bar-inner small { display: block; color: #cfdbcd; font-size: .78rem; line-height: 1.5; }
.bar-inner strong { display: block; font: 600 1.04rem/1.4 var(--ui); }
.deck-picker { gap: 18px; }
.deck-label { min-width: 96px; text-align: end; }
.swatches { gap: 7px; }
.swatches button { width: 38px; height: 45px; display: grid; place-items: center; background: transparent; border: 1px solid transparent; border-radius: 5px; padding: 3px; }
.swatches img { display: block; width: 23px; height: 33px; border-radius: 2px; }
.swatches button:hover { background: #f2e3b71c; }
.swatches button[aria-pressed="true"] { border-color: var(--yellow); }

.experience { padding-block: clamp(40px, 4.8vw, 78px) clamp(42px, 4.8vw, 76px); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 25px; }
h2 { font: 550 clamp(2.7rem, 4.7vw, 5rem)/1.03 var(--serif); letter-spacing: -.055em; }
.segmented { display: inline-flex; align-items: center; gap: 2px; background: #eae9dd; border: 1px solid #d8d9ca; padding: 3px; border-radius: 100px; }
.segmented button { background: none; border: 0; padding: 8px 17px; border-radius: 100px; font-size: .9rem; font-weight: 600; white-space: nowrap; }
.segmented button[aria-pressed="true"] { background: var(--pine); color: var(--cream); }
.segmented button:hover:not([aria-pressed="true"]) { background: #dfe1d3; }
.frame { position: relative; background: var(--night); aspect-ratio: 2.45; overflow: hidden; border-radius: 8px; }
.frame img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 56%; }
.frame.board img { object-fit: contain; }
.frame-action { position: absolute; inset-inline-end: 22px; bottom: 19px; gap: 10px; background: #102d25ef; color: var(--cream); border: 1px solid #efe8cc6b; border-radius: 5px; padding: 9px 15px; font-weight: 600; font-size: .92rem; }
.frame-action:hover, .viewer-controls button:hover { background: #245441; }
.game-figure figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 13px; }
.game-figure figcaption strong { font: 600 1.3rem/1.4 var(--serif); }
.game-figure figcaption span { color: #496052; font-size: .9rem; }

.rules { background: #163e31; color: var(--cream); overflow: hidden; position: relative; }
.rules::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 75% 75%,#38624c 0,transparent 56%); pointer-events: none; }
.rules-inner { display: grid; position: relative; grid-template-columns: 1fr 1fr; align-items: center; gap: 32px; min-height: 306px; padding-block: 43px; }
.rule-description { max-width: 39ch; margin: 14px 0 22px; font-size: 1.06rem; color: #e5ede1; }
.rule-switch, .viewer-controls div { display: flex; gap: 9px; flex-wrap: wrap; }
.rule-switch button, .viewer-controls button { border: 1px solid #dbdfc788; color: #faf5e6; background: transparent; min-height: 41px; padding: 6px 17px; border-radius: 5px; font-size: .92rem; }
.rule-switch button[aria-pressed="true"] { background: var(--cream); border-color: var(--cream); color: var(--pine); }
.meld-hand { display: flex; justify-content: center; gap: clamp(7px,1vw,15px); align-items: center; transform: rotate(-5deg); }
.mini-card { position: relative; display: grid; place-items: center; width: clamp(66px,7.8vw,125px); aspect-ratio: .7; background: linear-gradient(135deg,#fffaeb,#f1e4c6); color: #a2343d; border: 1px solid #e7d3aa; border-radius: 8px; box-shadow: 1px 2px 0 #a59477,0 9px 17px #14251c59; font: 400 clamp(1.7rem,3.3vw,3.8rem)/1 Georgia, serif; }
.mini-card b { position: absolute; font: 400 .62em/1 Georgia, serif; top: 8%; left: 10%; }
.mini-card b:last-child { inset: auto 10% 8% auto; transform: rotate(180deg); }
.mini-card.dark-suit { color: var(--ink); }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-block: 28px; }
.footer-game { font: 650 1.55rem/1.2 var(--serif); letter-spacing: -.035em; }
.footer div:last-child { display: flex; gap: clamp(15px,2.5vw,38px); font-size: .9rem; }

dialog { border: 1px solid #a5b49a; border-radius: 10px; margin: auto; width: min(1120px, 93vw); max-height: 94svh; padding: 0; background: var(--night); color: #f8f3df; box-shadow: 0 35px 120px #00120fd9; overflow: auto; }
dialog::backdrop { background: #001811dc; }
body:has(dialog[open]) { overflow: hidden; }
.viewer-top, .viewer-controls { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 18px; }
.viewer-top h2 { font-size: clamp(1.6rem,2.5vw,2.6rem); letter-spacing: -.035em; }
.close { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #a9bdad70; border-radius: 50%; background: transparent; color: white; }
.close i { position: relative; width: 16px; height: 16px; }
.close i::before, .close i::after { content: ""; position: absolute; inset: 7px 0 auto; height: 1.5px; background: currentColor; transform: rotate(45deg); }
.close i::after { transform: rotate(-45deg); }
.tour-viewport { height: min(55vw, 64svh); position: relative; overflow: hidden; background: #153b2e; touch-action: none; cursor: grab; direction: ltr; }
.tour-viewport:active { cursor: grabbing; }
.tour-poster, .board-large { display: block; width: 100%; height: 100%; object-fit: cover; }
.board-large { max-height: 73svh; object-fit: contain; }
#room-canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.viewer-controls { color: #dce6d9; font-size: .94rem; }
.viewer-controls button { white-space: nowrap; min-height: 36px; }
.viewer-controls div { max-width: 100%; flex-wrap: wrap; }

html[dir="rtl"] .opening::before { background: linear-gradient(270deg,#061e18fa 0%,#061e18ed 24%,#08231ba9 43%,#0b211820 72%); }
html[dir="rtl"] .language::after { transform: rotate(-45deg); }
html[lang="he"] h1, html[lang="th"] h1 { font-family: var(--ui); letter-spacing: -.055em; font-size: clamp(4.4rem,6.6vw,7.1rem); line-height: 1.08; font-weight: 550; }
html[lang="th"] h1 { font-family: "Game Thai", sans-serif; line-height: 1.16; }
html[lang="he"] h1 em, html[lang="th"] h1 em { font-style: normal; font-weight: 550; padding-bottom: 0; }
html:lang(ja) { --ui: "Yu Gothic UI", "Hiragino Sans", "Noto Sans CJK JP", "Meiryo", sans-serif; }
html:lang(ko) { --ui: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans CJK KR", sans-serif; }
html[lang="zh-Hans"] { --ui: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif; }
html[lang="zh-Hant"] { --ui: "Microsoft JhengHei", "PingFang TC", "Noto Sans CJK TC", sans-serif; }
html:is(:lang(he),:lang(th),:lang(ja),:lang(ko),:lang(zh)) h2 { font-family: var(--ui); font-weight: 550; font-size: clamp(2.2rem,3.5vw,4rem); letter-spacing: -.035em; line-height: 1.34; }
html:is(:lang(he),:lang(th),:lang(ja),:lang(ko),:lang(zh)) .viewer-top h2 { font-size: 1.6rem; }
.native-name b:lang(en) { font-family: var(--serif); font-weight: 600; font-size: 1.4rem; }
html:is(:lang(ja),:lang(ko),:lang(zh)) .game-figure figcaption strong { font-family: var(--ui); }
html:is(:lang(ja),:lang(ko),:lang(zh)) .lead { line-height: 1.65; }

@media (min-width: 1650px) { .garden { background-position: center 57%; } }
@media (max-width: 1000px) {
  .shell { width: 90%; }
  .hero { grid-template-columns: .94fr 1.06fr; min-height: 481px; }
  h1 { font-size: clamp(5.8rem,11.8vw,7.8rem); }
  .hero-actions { gap: 18px; }
  .turn-hint { margin-top: 17px; }
}
@media (max-width: 720px) {
  .shell { width: 89%; }
  .mast { min-height: 61px; }
  .publisher { font-size: 1.12rem; }
  .publisher-mark { width: 29px; height: 29px; }
  .mast-right { gap: 0; }
  .mast nav { display: none; }
  .garden { background-position: 63% 50%; }
  .opening::before, html[dir="rtl"] .opening::before { background: linear-gradient(115deg,#061e19ed 0%,#102b20a8 45%,#122a2026 75%); }
  .opening::after { background: linear-gradient(180deg,#0c241f36,transparent 50%,#0a281f36 70%,#0b261f 99%); }
  .hero { grid-template-columns: 1fr; min-height: auto; gap: 0; padding-block: 27px 15px; }
  .hero-copy { padding-block: 0; }
  .native-name { margin-bottom: 10px; }
  .native-name b { font-size: .92rem; }
  .native-name span { width: 24px; }
  h1 { font-size: clamp(3.9rem,13.7vw,6.2rem); line-height: 1.02; letter-spacing: -.076em; }
  h1 span, h1 em { display: inline; }
  h1 em { padding: 0; }
  html[lang="en"] h1 em { margin-inline-start: .05em; }
  html:is(:lang(he),:lang(th)) h1 { font-size: clamp(2.65rem,9.9vw,4.8rem); line-height: 1.38; }
  .lead { margin-top: 8px; max-width: 34ch; font-size: 1rem; }
  .hero-actions { margin-top: 17px; gap: 22px; }
  .action { min-height: 44px; padding: 8px 16px; }
  .hand-art { width: min(100%,460px); justify-self: center; margin-top: 9px; }
  .fan-stage { width: 95%; aspect-ratio: 1.83; }
  .turn-hint { margin-top: 10px; font-size: .78rem; padding: 5px 10px; }
  .card-seven { top: 14%; }
  .card-eight { top: 4%; }
  .card-nine { top: 2%; }
  .bar-inner { gap: 10px; min-height: 69px; }
  .place { gap: 5px; }
  .pin { width: 13px; height: 13px; }
  .pin::before { width: 3px; height: 3px; top: 3px; left: 3px; }
  .bar-inner small { font-size: .75rem; }
  .bar-inner strong { font-size: .9rem; }
  .deck-picker { gap: 5px; }
  .deck-label { min-width: auto; }
  .swatches { gap: 0; }
  .swatches button { width: 29px; height: 38px; padding: 1px; }
  .swatches img { width: 19px; height: 28px; }
  .section-heading { align-items: start; flex-direction: column; gap: 13px; margin-bottom: 17px; }
  .experience { padding-block: 31px 35px; }
  h2 { font-size: 2.85rem; }
  .segmented button { padding: 7px 13px; font-size: .86rem; }
  .frame { aspect-ratio: 1.55; }
  .frame-action { inset-inline-end: 10px; bottom: 10px; padding: 6px 10px; font-size: .83rem; }
  .game-figure figcaption { flex-wrap: wrap; gap: 0 12px; }
  .game-figure figcaption span { font-size: .82rem; }
  .rules-inner { grid-template-columns: 1fr; gap: 22px; padding-block: 32px 37px; }
  .rule-description { margin: 10px 0 15px; }
  .meld-hand { margin: 3px auto; }
  .mini-card { width: clamp(64px,18vw,91px); font-size: 2rem; }
  .footer { padding-block: 21px; }
  .footer div:last-child { font-size: .82rem; gap: 13px; }
  .footer-game { font-size: 1.28rem; }
  .tour-viewport { height: clamp(235px,49svh,470px); }
  .viewer-top, .viewer-controls { padding: 10px 12px; }
  .viewer-controls { align-items: start; flex-direction: column; gap: 9px; font-size: .85rem; }
}
@media (max-width: 359px) {
  .shell { width: 92%; }
  .pin { display: none; }
  .hero-actions { gap: 13px; }
  .bar-inner { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; }
  .fan { transform: none; }
}
