:root {
  --ocean-950: #052f37;
  --ocean-900: #083f48;
  --ocean-800: #0d5963;
  --ocean-700: #19717b;
  --ocean-500: #58aeb0;
  --paper: #f1e8d8;
  --paper-light: #fffaf0;
  --ink: #142421;
  --muted: #a9c3c0;
  --coral: #ec6957;
  --yellow: #efb847;
  --sans: "DM Sans", sans-serif;
  --serif: "DM Serif Display", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
.skip-link { position: fixed; z-index: 100; top: -5rem; left: 1rem; padding: .8rem 1rem; background: var(--yellow); color: var(--ink); }
.skip-link:focus { top: 0; }

.site-header { height: 96px; display: flex; align-items: center; justify-content: space-between; width: min(1440px, calc(100% - 96px)); margin: 0 auto; border-bottom: 1px solid rgba(20,36,33,.18); }
.brand { display: inline-flex; align-items: center; gap: .75rem; }
.brand-mark { display: grid; grid-template-columns: 1fr 1fr; place-items: center; width: 44px; height: 44px; border: 1px solid currentColor; border-radius: 50%; font-size: .85rem; transform: rotate(-7deg); }
.brand-mark span:last-child { color: var(--coral); }
.brand-name { font-size: .72rem; font-weight: 700; line-height: 1.05; letter-spacing: .12em; text-transform: uppercase; }
.site-header nav { display: flex; gap: 2rem; font-size: .82rem; }
.site-header nav a { border-bottom: 1px solid transparent; }
.site-header nav a:hover { border-color: currentColor; }

.game-intro { display: flex; align-items: end; justify-content: space-between; gap: 4rem; width: min(1440px, calc(100% - 96px)); margin: 0 auto; padding: 72px 0 42px; }
.eyebrow { display: flex; align-items: center; gap: .65rem; margin: 0 0 1rem; color: #5d6963; font-size: .68rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow span { width: 26px; height: 1px; background: var(--coral); }
.game-intro h1 { margin: 0; font-family: var(--serif); font-size: clamp(4rem, 7vw, 7.5rem); font-weight: 400; line-height: .8; letter-spacing: -.04em; }
.game-intro h1 em { color: var(--ocean-700); font-weight: 400; }
.game-intro > p { max-width: 440px; margin: 0; color: #5d6963; line-height: 1.7; }

.game-shell { position: relative; background: var(--ocean-950); color: var(--paper-light); }
.game-topbar { min-height: 82px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 2rem; padding: 0 max(48px, calc((100vw - 1440px) / 2)); border-bottom: 1px solid rgba(255,255,255,.13); }
.score-strip { display: flex; align-items: center; gap: .8rem; color: #abc5c2; font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; }
.score-strip > span { color: var(--yellow); font-weight: 700; }
.score-strip strong { font-weight: 500; }
.score-strip b { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: .2rem; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; }
.deck-status { color: #a8c0bd; font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; }
.deck-status strong { color: #fff; }
.quiet-button { justify-self: end; padding: .6rem .9rem; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; background: transparent; color: #c0d0cd; font-size: .72rem; cursor: pointer; }
.quiet-button:hover { background: rgba(255,255,255,.08); color: #fff; }

.table-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; min-height: 750px; }
.water-table { position: relative; min-height: 750px; overflow: hidden; background: var(--ocean-800); }
.water-table::before { content: ""; position: absolute; width: 720px; height: 720px; left: 50%; top: 48%; border: 1px solid rgba(255,255,255,.11); border-radius: 50%; transform: translate(-50%,-50%); box-shadow: inset 0 0 0 90px rgba(5,47,55,.07), inset 0 0 0 91px rgba(255,255,255,.05); }
.water-table::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .2; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.13'/%3E%3C/svg%3E"); }
.bubble { position: absolute; z-index: 1; border: 1px solid rgba(255,255,255,.17); border-radius: 50%; }
.bubble-one { width: 48px; height: 48px; left: 20%; top: 25%; }
.bubble-two { width: 20px; height: 20px; left: 24%; top: 20%; }
.bubble-three { width: 82px; height: 82px; right: 14%; bottom: 18%; }

.player-seat { position: absolute; z-index: 5; display: flex; align-items: center; gap: .65rem; padding: .45rem .85rem .45rem .45rem; border: 1px solid transparent; border-radius: 999px; background: transparent; color: #fff; text-align: left; transition: 160ms ease; }
button.player-seat { cursor: pointer; }
button.player-seat:disabled { cursor: default; }
.player-seat.is-turn { border-color: var(--yellow); background: rgba(239,184,71,.1); box-shadow: 0 0 0 4px rgba(239,184,71,.07); }
button.player-seat.is-target { border-color: rgba(255,255,255,.48); background: rgba(255,255,255,.08); }
button.player-seat.is-target:hover, button.player-seat.is-target:focus-visible { outline: 0; border-color: var(--yellow); background: var(--yellow); color: var(--ink); transform: scale(1.05); }
button.player-seat.is-target:hover small, button.player-seat.is-target:focus-visible small { color: #4e5c55; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--coral); font-family: var(--serif); }
.avatar.north { background: var(--yellow); color: var(--ink); }
.avatar.west { background: #a87cbb; }
.avatar.east { background: #e57564; }
.avatar.you { background: var(--paper); color: var(--ink); }
.player-details { display: flex; flex-direction: column; }
.player-details strong { font-size: .76rem; }
.player-details small { color: #b4cbc7; font-size: .59rem; letter-spacing: .05em; text-transform: uppercase; }
.player-details b { font-weight: 700; color: #fff; }
.seat-north { left: 50%; top: 27px; transform: translateX(-50%); }
.seat-south { left: 50%; bottom: 178px; transform: translateX(-50%); }
.seat-west { left: 24px; top: 43%; transform: translateY(-50%); }
.seat-east { right: 24px; top: 43%; transform: translateY(-50%); }

.pond { position: absolute; z-index: 3; left: 50%; top: 42%; width: 185px; height: 185px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; background: rgba(5,47,55,.25); color: inherit; font: inherit; transform: translate(-50%,-50%); transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease; }
.pond:disabled { opacity: 1; }
.pond.is-ready { border-color: var(--yellow); background: rgba(239,184,71,.1); box-shadow: 0 0 0 8px rgba(239,184,71,.09), 0 0 45px rgba(239,184,71,.18); cursor: pointer; animation: pond-pulse 1.5s ease-in-out infinite; }
.pond.is-ready:hover, .pond.is-ready:focus-visible { outline: 3px solid var(--yellow); outline-offset: 5px; background: rgba(239,184,71,.18); }
.pond-label { position: absolute; bottom: 31px; color: #a8c7c3; font-size: .56rem; font-weight: 700; letter-spacing: .16em; }
.pond > strong { position: absolute; bottom: 14px; color: #fff; font-size: .7rem; }
.fish-mark { position: absolute; left: 27px; top: 39px; color: rgba(239,184,71,.35); font-size: 4.7rem; transform: rotate(90deg); }
.deck-stack { position: relative; z-index: 2; width: 60px; height: 84px; }
.deck-stack i { position: absolute; inset: 0; border: 4px solid var(--paper-light); border-radius: 6px; background: var(--coral); box-shadow: 0 8px 18px rgba(0,0,0,.25); }
.deck-stack i::after { content: "✦"; position: absolute; inset: 4px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.7); color: #fff; font-style: normal; }
.deck-stack i:nth-child(1) { transform: translate(-8px,5px) rotate(-7deg); }
.deck-stack i:nth-child(2) { transform: translate(7px,4px) rotate(6deg); }
@keyframes pond-pulse { 0%,100% { transform: translate(-50%,-50%) scale(1); } 50% { transform: translate(-50%,-50%) scale(1.025); } }

.turn-status { position: absolute; z-index: 4; left: 50%; top: 58%; width: min(520px,80%); text-align: center; transform: translateX(-50%); }
.turn-label { color: var(--yellow); font-size: .6rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.turn-status p { margin: .45rem 0 0; color: #e3edeb; font-size: .8rem; }

.human-hand { position: absolute; z-index: 6; left: 50%; bottom: 20px; display: flex; justify-content: center; width: min(850px, calc(100% - 60px)); min-height: 132px; transform: translateX(-50%); }
.playing-card { position: relative; width: 72px; height: 105px; flex: 0 0 auto; margin-left: -12px; border: 0; border-radius: 8px; background: var(--paper-light); color: var(--ink); box-shadow: 0 9px 18px rgba(0,0,0,.22); cursor: pointer; transition: 150ms ease; }
.playing-card:first-child { margin-left: 0; }
.playing-card.red { color: var(--coral); }
.playing-card:disabled { cursor: default; opacity: .58; }
.playing-card:hover:not(:disabled), .playing-card:focus-visible:not(:disabled), .playing-card.is-selected { z-index: 10; outline: 3px solid var(--yellow); outline-offset: 2px; transform: translateY(-15px); }
.card-rank { position: absolute; left: 8px; top: 7px; font-family: var(--serif); font-size: 1.25rem; line-height: .78; text-align: center; }
.card-rank small { font-size: .72rem; }
.card-pip { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2rem; }

.game-panel { display: flex; flex-direction: column; gap: 1.2rem; padding: 30px 25px; background: #073741; border-left: 1px solid rgba(255,255,255,.12); }
.panel-kicker { color: var(--yellow); font-size: .59rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.instruction-card { padding: 1.25rem; background: var(--paper); color: var(--ink); }
.instruction-card strong { display: block; margin-top: .75rem; font-family: var(--serif); font-size: 1.65rem; font-weight: 400; }
.instruction-card p { margin: .45rem 0 0; color: #67736c; font-size: .72rem; line-height: 1.55; }
.panel-title { display: flex; justify-content: space-between; align-items: center; padding-bottom: .75rem; border-bottom: 1px solid rgba(255,255,255,.12); color: #d7e4e1; font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.panel-title b { color: var(--yellow); }
.book-list { display: flex; flex-wrap: wrap; gap: .45rem; padding-top: .8rem; min-height: 38px; }
.book-badge { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--yellow); color: var(--ink); font-family: var(--serif); font-size: .85rem; }
.empty-books { color: #83a39f; font-size: .69rem; }
.activity-panel { min-height: 190px; }
.activity-panel ol { display: flex; flex-direction: column; gap: .65rem; margin: .8rem 0 0; padding: 0; list-style: none; }
.activity-panel li { color: #a8c0bd; font-size: .68rem; line-height: 1.45; }
.activity-panel li span { color: var(--yellow); margin-right: .45rem; font-size: .56rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.fair-play { margin: auto 0 0; padding: 1rem; border: 1px solid rgba(239,184,71,.22); background: rgba(239,184,71,.06); color: #9ab5b1; font-size: .68rem; line-height: 1.5; }
.fair-play > span { float: left; margin-right: .65rem; color: var(--yellow); font-size: 1.2rem; }
.fair-play strong { display: block; color: #e9f0ee; font-size: .7rem; }

.result-dialog { position: absolute; z-index: 20; inset: 82px 0 0; display: grid; place-items: center; padding: 2rem; background: rgba(3,32,37,.84); backdrop-filter: blur(8px); }
.result-dialog[hidden] { display: none; }
.result-card { width: min(520px,100%); padding: 3rem; background: var(--paper); color: var(--ink); text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.result-card .eyebrow { justify-content: center; }
.result-card h2 { margin: .7rem 0 1rem; font-family: var(--serif); font-size: 3.1rem; font-weight: 400; line-height: 1; }
.result-card > p:not(.eyebrow) { color: #657169; line-height: 1.6; }
.final-scores { display: grid; grid-template-columns: repeat(4,1fr); gap: .5rem; margin: 1.5rem 0; }
.final-scores span { padding: .7rem .3rem; background: #e6dccb; color: #677169; font-size: .65rem; text-transform: uppercase; }
.final-scores b { display: block; color: var(--ink); font-family: var(--serif); font-size: 1.5rem; }
.primary-button { display: inline-flex; align-items: center; justify-content: space-between; gap: 2.5rem; min-width: 190px; padding: .95rem 1.1rem; border: 0; border-radius: 999px; background: var(--coral); color: #fff; font-weight: 700; cursor: pointer; }

.ad-section { padding: 54px max(48px, calc((100vw - 1440px) / 2)); background: #e7ddcc; border-bottom: 1px solid rgba(20,36,33,.13); }
.ad-slot { width: min(970px,100%); min-height: 120px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-content: center; gap: .25rem 2rem; margin: 0 auto; padding: 1.4rem 2rem; border: 1px dashed rgba(20,36,33,.28); background: rgba(255,250,240,.42); color: #68736c; }
.ad-slot span { grid-column: 1/-1; font-size: .6rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.ad-slot strong { align-self: end; color: #46524b; font-family: var(--serif); font-size: 1.35rem; font-weight: 400; }
.ad-slot small { align-self: end; color: #7c867f; font-size: .66rem; letter-spacing: .1em; }

.rules { display: grid; grid-template-columns: .9fr 2fr; gap: 7rem; padding: 130px max(48px, calc((100vw - 1440px) / 2)); }
.section-label { font-size: .7rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.section-label span { color: var(--coral); margin-right: .7rem; }
.rules-heading h2 { margin: 1.5rem 0 2rem; font-family: var(--serif); font-size: clamp(3rem,5vw,5rem); font-weight: 400; line-height: .94; letter-spacing: -.035em; }
.rules-heading h2 em { color: var(--ocean-700); font-weight: 400; }
.rules-heading > p { max-width: 430px; color: #5f6b64; line-height: 1.75; }
.rules-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid rgba(20,36,33,.2); }
.rules-grid article { min-height: 220px; padding: 2rem; border-right: 1px solid rgba(20,36,33,.2); border-bottom: 1px solid rgba(20,36,33,.2); }
.rules-grid article:nth-child(even) { border-right: 0; }
.rule-number { color: var(--coral); font-size: .68rem; font-weight: 700; letter-spacing: .1em; }
.rules-grid h3 { margin: 1.7rem 0 .7rem; font-family: var(--serif); font-size: 1.65rem; font-weight: 400; }
.rules-grid p { margin: 0; color: #657169; font-size: .88rem; line-height: 1.7; }
footer { display: flex; justify-content: space-between; gap: 2rem; padding: 32px max(48px, calc((100vw - 1440px) / 2)); background: var(--ocean-950); color: #a8bbb7; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }

@media (max-width: 1080px) {
  .table-layout { grid-template-columns: 1fr; }
  .game-panel { display: grid; grid-template-columns: 1.2fr 1fr 1.3fr; min-height: auto; border-left: 0; border-top: 1px solid rgba(255,255,255,.12); }
  .fair-play { grid-column: 1/-1; margin: 0; }
  .rules { grid-template-columns: 1fr; gap: 4rem; }
}

@media (max-width: 760px) {
  .site-header { width: calc(100% - 36px); height: 78px; }
  .site-header nav { gap: 1rem; font-size: .72rem; }
  .site-header nav a:first-child { display: none; }
  .game-intro { align-items: flex-start; flex-direction: column; gap: 1.5rem; width: calc(100% - 36px); padding: 55px 0 32px; }
  .game-topbar { grid-template-columns: 1fr auto; padding: .8rem 18px; }
  .score-strip { grid-column: 1/-1; flex-wrap: wrap; justify-content: center; }
  .deck-status { grid-row: 1; }
  .quiet-button { grid-column: 2; grid-row: 1; }
  .table-layout, .water-table { min-height: 660px; }
  .water-table::before { width: 510px; height: 510px; }
  .seat-west { left: 4px; }
  .seat-east { right: 4px; }
  .seat-west .player-details, .seat-east .player-details { display: none; }
  .pond { width: 150px; height: 150px; }
  .turn-status { top: 60%; }
  .seat-south { bottom: 154px; }
  .human-hand { bottom: 13px; width: calc(100% - 10px); min-height: 120px; }
  .playing-card { width: 62px; height: 91px; margin-left: -25px; }
  .playing-card:first-child { margin-left: 0; }
  .game-panel { grid-template-columns: 1fr; padding: 24px 18px; }
  .ad-section { padding: 34px 22px; }
  .ad-slot { min-height: 100px; padding: 1.15rem; }
  .rules { padding: 84px 22px; }
  .rules-grid { grid-template-columns: 1fr; }
  .rules-grid article { min-height: auto; padding: 1.5rem 0; border-right: 0; }
  footer { align-items: flex-start; flex-direction: column; padding: 32px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
