/* Panda Social Online Casino: Jade Zen Garden design system.
   Light theme, locked by brief. Type: Fraunces display / Karla body (brief-named).
   Shape rule (documented): surfaces 18px, small reel cells 12px, interactive controls pill.
   Accent rule: jade is the interactive accent; gold appears only on coins and win feedback. */

:root {
  --cream: #F4EDDC;
  --cream-raised: #FAF5E8;
  --cream-deep: #EAE1C9;
  --paper: #FFFDF4;
  --ink: #1F2A24;
  --ink-70: rgba(31, 42, 36, 0.72);
  --ink-12: rgba(31, 42, 36, 0.14);
  --ink-08: rgba(31, 42, 36, 0.08);
  --jade: #3E8E6D;
  --jade-deep: #2F6F55;
  --jade-wash: #E5EFE5;
  --gold: #D9A441;
  --gold-deep: #A87B22;
  --r-surface: 18px;
  --r-cell: 12px;
  --r-pill: 999px;
  --shadow-lift: 0 22px 44px -26px rgba(47, 111, 85, 0.45);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Karla", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 400 17px/1.7 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--jade-deep); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; margin: 0; }
button { font-family: var(--font-body); }

.frame { max-width: 1180px; margin: 0 auto; padding: 0 28px; }

/* ---------- buttons ---------- */

.leaf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--jade);
  color: var(--paper);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.01em;
  padding: 14px 32px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.25s, box-shadow 0.25s;
}
.leaf-btn:hover { background: var(--jade-deep); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.leaf-btn:active { transform: translateY(0) scale(0.98); }
.leaf-btn:disabled { background: var(--ink-12); color: var(--ink-70); cursor: default; transform: none; box-shadow: none; }
.leaf-btn--big { font-size: 19px; padding: 17px 42px; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(244, 237, 220, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ink-12);
}
.topbar__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 68px;
}
.crest {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.crest__mark { width: 42px; height: 38px; flex: none; }
.crest__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  line-height: 1.05;
  display: flex;
  flex-direction: column;
}
.crest__name em {
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--jade-deep);
}
.topbar__menu { display: flex; gap: 6px; margin-left: auto; }
.topbar__menu a {
  text-decoration: none;
  color: var(--ink-70);
  font-weight: 700;
  font-size: 15.5px;
  padding: 10px 12px;
  border-radius: var(--r-pill);
  transition: color 0.2s, background 0.2s;
}
.topbar__menu a:hover { color: var(--ink); background: var(--ink-08); }
.topbar__status { display: flex; align-items: center; gap: 12px; }
.purse {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border: 1px solid var(--ink-12);
  border-radius: var(--r-pill);
  padding: 7px 14px;
  font-weight: 700;
  font-size: 15px;
}
.purse__coin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #F2CF85, var(--gold) 55%, var(--gold-deep));
  flex: none;
}
.age-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.6px solid var(--ink);
  border-radius: var(--r-pill);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 4px 9px;
}

/* ---------- hero ---------- */

.welcome { position: relative; overflow: hidden; }
.welcome__scene {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.16;
}
.welcome::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 140px;
  background: linear-gradient(180deg, rgba(244, 237, 220, 0), var(--cream));
  pointer-events: none;
}
.welcome__inner {
  position: relative;
  display: grid;
  grid-template-columns: 7fr 5fr;
  align-items: center;
  gap: 48px;
  padding-top: 72px;
  padding-bottom: 56px;
}
.welcome__copy h1 {
  font-size: clamp(44px, 6vw, 72px);
  font-weight: 640;
  letter-spacing: -0.015em;
}
.welcome__lead {
  font-size: 19px;
  max-width: 46ch;
  color: var(--ink-70);
  margin: 22px 0 30px;
}
.welcome__vow {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-70);
  margin: 22px 0 0;
}
.welcome__copy > * { animation: rise-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }
.welcome__copy > *:nth-child(2) { animation-delay: 0.08s; }
.welcome__copy > *:nth-child(3) { animation-delay: 0.16s; }
.welcome__copy > *:nth-child(4) { animation-delay: 0.24s; }
.welcome__art { margin: 0; position: relative; }
.welcome__art::before {
  content: "";
  position: absolute;
  inset: 8% 4%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(62, 142, 109, 0.22), rgba(62, 142, 109, 0));
}
.welcome__art img { position: relative; animation: drift 7s ease-in-out infinite; }
@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes drift { 50% { transform: translateY(-12px); } }

/* ---------- slot garden (lobby) ---------- */

.pavilion { padding: 96px 0 88px; }
.pavilion__title { font-size: clamp(34px, 4vw, 48px); }
.pavilion__intro { color: var(--ink-70); max-width: 52ch; margin: 14px 0 44px; }
.pavilion__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: auto;
  gap: 22px;
}
.slot-tile {
  display: flex;
  flex-direction: column;
  background: var(--cream-raised);
  border: 1px solid var(--ink-12);
  border-radius: var(--r-surface);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s;
}
.slot-tile:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); }
.slot-tile--featured { grid-column: 1 / span 2; grid-row: 1 / span 2; }
.slot-tile__cover {
  display: block;
  aspect-ratio: 16 / 10;
  background-color: var(--jade-wash);
  background-size: cover;
  background-position: center;
}
.slot-tile--featured .slot-tile__cover { aspect-ratio: auto; flex: 1; min-height: 320px; }
.slot-tile__label { display: flex; flex-direction: column; gap: 2px; padding: 16px 20px 18px; }
.slot-tile__name { font-family: var(--font-display); font-weight: 640; font-size: 21px; }
.slot-tile--featured .slot-tile__name { font-size: 27px; }
.slot-tile__line { font-size: 14.5px; color: var(--ink-70); }

/* ---------- virtues ---------- */

.virtues { padding: 8px 0 96px; }
.virtues h2 { font-size: clamp(30px, 3.6vw, 42px); max-width: 18ch; }
.virtues__list { list-style: none; margin: 44px 0 0; padding: 0; }
.virtue {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 36px;
  padding: 36px 0;
  border-top: 1px solid var(--ink-12);
}
.virtue h3 { font-size: 25px; font-weight: 600; }
.virtue p { margin: 0; color: var(--ink-70); max-width: 56ch; }

/* ---------- tea house (daily bonus) ---------- */

.tea-house { background: var(--jade-wash); }
.tea-house__inner {
  display: grid;
  grid-template-columns: 5fr 7fr;
  align-items: center;
  gap: 48px;
  padding-top: 72px;
  padding-bottom: 72px;
}
.tea-house__art { max-width: 360px; margin: 0 auto; }
.tea-house__copy h2 { font-size: clamp(30px, 3.6vw, 42px); }
.tea-house__copy p { color: var(--ink-70); max-width: 52ch; margin: 16px 0 26px; }
.tea-house__note { font-weight: 700; font-size: 15px; color: var(--jade-deep); min-height: 1.5em; margin: 18px 0 0; }

/* ---------- footer ---------- */

.groundwork {
  background: var(--cream-deep);
  border-top: 1px solid var(--ink-12);
  padding: 56px 0 40px;
  font-size: 15.5px;
}
.age-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--ink);
  color: var(--cream);
  border-radius: var(--r-surface);
  padding: 18px 26px;
}
.age-banner p { margin: 0; font-weight: 500; }
.age-seal--big { border-color: var(--gold); color: var(--gold); font-size: 14px; padding: 6px 12px; flex: none; }
.groundwork__cols {
  display: grid;
  grid-template-columns: 6fr 3fr 3fr;
  gap: 40px;
  padding: 44px 0 36px;
}
.groundwork h3 { font-size: 18px; margin-bottom: 12px; }
.groundwork__about p { margin: 0; color: var(--ink-70); }
.groundwork ul { list-style: none; margin: 0; padding: 0; }
.groundwork ul a {
  display: inline-block;
  padding: 6px 0;
  color: var(--ink-70);
  text-decoration: none;
  font-weight: 700;
}
.groundwork ul a:hover { color: var(--jade-deep); }
.groundwork__close { margin: 0; padding-top: 24px; border-top: 1px solid var(--ink-12); color: var(--ink-70); }
.groundwork__close a { color: var(--ink-70); font-weight: 700; padding: 6px 4px; display: inline-block; }
.groundwork--slim { padding-top: 40px; }
.groundwork--slim .groundwork__close { margin-top: 28px; }

/* ---------- whispers (toasts) ---------- */

.whispers {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 60;
  pointer-events: none;
  width: max-content;
  max-width: 90vw;
}
.whisper {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-weight: 700;
  font-size: 15px;
  padding: 12px 24px;
  border-radius: var(--r-pill);
  box-shadow: 0 14px 30px -14px rgba(31, 42, 36, 0.55);
  animation: rise-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
  max-width: 100%;
}
.whisper--fading { opacity: 0; transition: opacity 0.5s; }

/* ---------- legal pages ---------- */

.scroll-page { max-width: 780px; margin: 0 auto; padding: 64px 28px 104px; }
.scroll-page h1 { font-size: clamp(36px, 4.4vw, 52px); }
.scroll-page .updated { color: var(--ink-70); font-size: 15px; margin: 14px 0 36px; }
.scroll-page h2 { font-size: 24px; margin: 44px 0 12px; }
.scroll-page p, .scroll-page li { color: var(--ink-70); }
.scroll-page ul { padding-left: 22px; }
.scroll-page li { margin: 8px 0; }

/* ---------- slot den (game page) ---------- */

.den__main { padding: 40px 0 96px; }
.den__path a {
  display: inline-block;
  color: var(--jade-deep);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  padding: 8px 0;
}
.den__path a:hover { text-decoration: underline; }
.den__title { font-size: clamp(36px, 4.6vw, 56px); margin-top: 6px; }
.den__line { color: var(--ink-70); margin: 10px 0 36px; }

.machine {
  background: var(--cream-raised);
  border: 1px solid var(--ink-12);
  border-radius: var(--r-surface);
  padding: 26px;
  box-shadow: var(--shadow-lift);
}
.machine__window {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  background: var(--jade-wash);
  border-radius: var(--r-cell);
  padding: 14px;
}
.machine__col { display: grid; grid-template-rows: repeat(3, 1fr); gap: 12px; }
.glyph {
  aspect-ratio: 1 / 1;
  background: var(--paper);
  border: 1px solid var(--ink-08);
  border-radius: var(--r-cell);
  display: flex;
  align-items: center;
  justify-content: center;
}
.glyph img { width: 76%; height: 76%; object-fit: contain; }

.machine__bench {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.wager {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--paper);
  border: 1px solid var(--ink-12);
  border-radius: var(--r-pill);
  padding: 8px 12px;
}
.wager__label {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-70);
  padding-left: 6px;
}
.wager__step {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--jade-wash);
  color: var(--jade-deep);
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.wager__step:hover { background: var(--jade); color: var(--paper); }
.wager__step:active { transform: scale(0.94); }
.wager__amount { min-width: 64px; text-align: center; font-weight: 800; font-size: 17px; }
.machine__message {
  flex: 1;
  text-align: center;
  margin: 0;
  font-weight: 800;
  font-size: 19px;
  min-height: 1.4em;
}
.machine__message--win { color: var(--gold-deep); animation: win-pop 0.45s cubic-bezier(0.16, 1, 0.3, 1.4); }
@keyframes win-pop {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* spin states */
.machine__col--spinning { animation: col-hum 0.16s linear infinite; }
.machine__col--spinning .glyph img { filter: blur(3px); }
@keyframes col-hum { 50% { transform: translateY(3px); } }
.glyph--landed img { animation: glyph-land 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
@keyframes glyph-land {
  from { transform: translateY(-12px); opacity: 0.4; }
  to { transform: translateY(0); opacity: 1; }
}
.glyph--hit {
  border-color: var(--gold);
  box-shadow: 0 0 0 2.5px var(--gold), 0 0 26px rgba(217, 164, 65, 0.5);
  animation: hit-pulse 0.9s ease-in-out 2;
}
@keyframes hit-pulse { 50% { transform: scale(1.05); } }

/* ---------- paytable ---------- */

.payouts { margin-top: 64px; }
.payouts h2 { font-size: clamp(28px, 3.2vw, 36px); }
.payouts__how { color: var(--ink-70); max-width: 64ch; margin: 12px 0 28px; }
.payouts__legend,
.payouts__row {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) 1fr 1fr 1fr;
  gap: 14px;
  align-items: center;
}
.payouts__legend {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-70);
  padding: 0 18px 10px;
}
.payouts__legend span:not(:first-child) { text-align: center; }
.payouts__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.payouts__row {
  background: var(--cream-raised);
  border: 1px solid var(--ink-12);
  border-radius: var(--r-cell);
  padding: 10px 18px;
}
.payouts__symbol { display: flex; align-items: center; gap: 14px; font-weight: 700; }
.payouts__icon { width: 46px; height: 46px; object-fit: contain; flex: none; }
.payouts__pay { text-align: center; font-weight: 800; font-size: 17px; color: var(--jade-deep); }
.payouts__note { color: var(--ink-70); font-size: 14.5px; margin: 26px 0 0; }

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .machine__col--spinning .glyph img { filter: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .welcome__inner { grid-template-columns: 1fr; gap: 16px; padding-top: 48px; }
  .welcome__art { max-width: 380px; margin: 0 auto; }
  .pavilion__grid { grid-template-columns: 1fr 1fr; }
  .slot-tile--featured { grid-column: 1 / span 2; grid-row: auto; }
  .slot-tile--featured .slot-tile__cover { aspect-ratio: 16 / 9; flex: none; min-height: 0; }
  .virtue { grid-template-columns: 1fr; gap: 10px; padding: 30px 0; }
  .tea-house__inner { grid-template-columns: 1fr; gap: 24px; }
  .tea-house__art { max-width: 280px; }
  .groundwork__cols { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 640px) {
  .topbar__inner { gap: 12px; }
  .topbar__menu a { padding: 10px 8px; font-size: 14px; }
  .crest__name { font-size: 18px; }
  .purse { font-size: 13.5px; padding: 6px 11px; }
  .pavilion { padding: 64px 0 56px; }
  .pavilion__grid { grid-template-columns: 1fr; }
  .slot-tile--featured { grid-column: auto; }
  .virtues { padding-bottom: 64px; }
  .machine { padding: 14px; }
  .machine__window { gap: 6px; padding: 8px; }
  .machine__col { gap: 6px; }
  .machine__bench { flex-direction: column; align-items: stretch; text-align: center; }
  .wager { justify-content: center; }
  .payouts__legend, .payouts__row { grid-template-columns: minmax(0, 1.8fr) 1fr 1fr 1fr; gap: 8px; padding-left: 10px; padding-right: 10px; }
  .payouts__icon { width: 34px; height: 34px; }
  .payouts__symbol { font-size: 14px; gap: 8px; }
  .age-banner { flex-direction: column; text-align: center; gap: 10px; }
}

/* language switcher (injected) */
.lang-switch { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 22px; font-weight: 800; font-size: 0.8rem; letter-spacing: 1px; }
.lang-switch a, .lang-switch .current { display: inline-block; padding: 8px 10px; color: inherit; opacity: 0.65; text-decoration: none; }
.lang-switch a:hover { opacity: 1; }
.lang-switch .current { opacity: 1; font-weight: 900; border-bottom: 2px solid currentColor; }
