/* Lantern Hearth website — shared theme: night sky, parchment panels, lantern amber.
   Panels and buttons use the game's own UI skin (img/skin, 2x pieces drawn with border-image). */

:root {
  --night-950: #0b111d;
  --night-900: #0f1626;
  --night-800: #16213a;
  --night-700: #20304f;
  --teal: #1f4a59;
  --parchment: #f0e3c4;
  --parchment-light: #faf1dd;
  --parchment-dark: #e2d1a8;
  --parchment-deep: #d4bf8f;
  --cocoa: #302c24;
  --cocoa-soft: #5d5040;
  --cocoa-mute: #7d6d55;
  --forest: #566745;
  --forest-dark: #3f4d33;
  --forest-light: #7d9364;
  --amber: #bd863b;
  --amber-bright: #f2b84b;
  --amber-glow: #ffd27a;
  --ember: #e0743a;
  --hp: #c25f50;
  --mp: #5e99a6;
  --exp: #e0a43c;
  --job: #5f86b5;
  --common: #8f8167;
  --uncommon: #5f8a3a;
  --rare: #3f78b5;
  --epic: #8a4fb5;
  --shadow-hard: 3px 3px 0 rgba(48, 44, 36, 0.35);
  --shadow-soft: 0 10px 30px rgba(5, 8, 16, 0.45);
  --font: 'Nunito Sans', 'Noto Sans Thai', system-ui, sans-serif;
  --title: 'Alegreya', 'Noto Sans Thai', Georgia, serif;
  --radius: 10px;
  --header-h: 68px;
  --max: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--cocoa);
  background: var(--night-900);
  cursor: url('../img/skin/cursors/default-32.png') 4 2, auto;
  -webkit-font-smoothing: antialiased;
}
a, button, [role='button'], summary, label { cursor: url('../img/skin/cursors/interact-32.png') 6 2, pointer; }
html[lang='th'] body { line-height: 1.75; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--title); line-height: 1.15; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--amber-bright); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(var(--max), 100% - 32px); margin-inline: auto; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: linear-gradient(180deg, rgba(11, 17, 29, 0.96), rgba(15, 22, 38, 0.9));
  border-bottom: 2px solid rgba(189, 134, 59, 0.55);
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
.site-header .wrap { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand img { height: 48px; width: auto; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5)); }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
  color: var(--parchment);
  text-decoration: none;
  font-weight: 800;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.nav a:hover, .nav a[aria-current='page'] { color: var(--amber-glow); background: rgba(242, 184, 75, 0.12); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.lang-toggle {
  display: inline-flex;
  border: 2px solid rgba(189, 134, 59, 0.7);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
}
.lang-toggle button {
  font: 800 13px var(--font);
  color: var(--parchment-dark);
  background: none;
  border: 0;
  padding: 5px 10px;
}
.lang-toggle button[aria-pressed='true'] { background: var(--amber); color: var(--night-950); }
.menu-btn { display: none; background: none; border: 0; color: var(--parchment); padding: 8px; }
.menu-btn svg { width: 28px; height: 28px; }

@media (max-width: 960px) {
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 16px 16px;
    background: var(--night-900);
    border-bottom: 2px solid var(--amber);
    transform: translateY(-120%);
    transition: transform 0.25s ease;
    margin: 0;
  }
  .nav.open { transform: none; }
  .nav a { padding: 12px; font-size: 17px; }
  .menu-btn { display: block; margin-left: auto; }
  .header-actions .btn-play-small { display: none; }
}

/* ---------------------------------------------------------------- game-skin buttons */
.btn {
  --h: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: var(--h);
  padding: 0 26px;
  font: 800 16px var(--font);
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  border-style: solid;
  border-width: 0 8px;
  border-image-slice: 0 16 0 16 fill;
  border-image-repeat: stretch;
  background: none;
  transition: transform 0.08s, filter 0.15s;
  user-select: none;
}
.btn:active { transform: translateY(2px); }
.btn img, .btn svg { width: 24px; height: 24px; flex: none; }
.btn-primary { color: #fff8e6; text-shadow: 0 2px 0 rgba(30, 40, 22, 0.55); border-image-source: url('../img/skin/buttons/primary-normal.png'); }
.btn-primary:hover { border-image-source: url('../img/skin/buttons/primary-hover.png'); }
.btn-primary:active { border-image-source: url('../img/skin/buttons/primary-pressed.png'); }
.btn-secondary { color: var(--cocoa); border-width: 0 7px; border-image-slice: 0 15 0 14 fill; border-image-source: url('../img/skin/buttons/secondary-normal.png'); }
.btn-secondary:hover { border-image-source: url('../img/skin/buttons/secondary-hover.png'); }
.btn-secondary:active { border-image-source: url('../img/skin/buttons/secondary-pressed.png'); }
.btn-accent { color: var(--cocoa); border-width: 0 6.5px; border-image-slice: 0 13 0 13 fill; border-image-source: url('../img/skin/buttons/accent-normal.png'); }
.btn-accent:hover { border-image-source: url('../img/skin/buttons/accent-hover.png'); }
.btn-accent:active { border-image-source: url('../img/skin/buttons/accent-pressed.png'); }
.btn-lg { --h: 66px; padding: 0 38px; font-size: 20px; }
.btn-sm { --h: 40px; padding: 0 16px; font-size: 14px; }

/* Store / platform badges: dark lacquered plates with a brass rim. */
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
  height: 56px;
  padding: 0 16px 0 12px;
  text-align: left;
  text-decoration: none;
  color: #f6ecd6;
  background: linear-gradient(180deg, #24324f, #141d31);
  border: 2px solid #9a7238;
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.25), 0 4px 0 #0a0f1a, 0 8px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.1s, border-color 0.15s, box-shadow 0.15s;
  font-family: var(--font);
}
.store-btn:hover { border-color: var(--amber-bright); transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.3), 0 6px 0 #0a0f1a, 0 0 24px rgba(242, 184, 75, 0.35); }
.store-btn:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.25), 0 2px 0 #0a0f1a; }
.store-btn svg { width: 30px; height: 30px; flex: none; }
.store-btn small { display: block; font-size: 11px; font-weight: 700; opacity: 0.75; line-height: 1.1; letter-spacing: 0.02em; }
.store-btn strong { display: block; font-size: 17px; font-weight: 800; line-height: 1.15; }

/* ---------------------------------------------------------------- parchment panels */
.panel {
  position: relative;
  border-style: solid;
  border-width: 5.5px 6.5px 7px 5.5px;
  border-image: url('../img/skin/panels/window.png') 11 13 14 11 fill / 5.5px 6.5px 7px 5.5px stretch;
  padding: 22px 24px;
  color: var(--cocoa);
  filter: drop-shadow(0 8px 18px rgba(5, 8, 16, 0.35));
}
.inset {
  border-style: solid;
  border-image: url('../img/skin/panels/inset.png') 10 10 8 10 fill / 5px 5px 4px 5px stretch;
  padding: 10px 14px;
}
.lantern-title {
  display: flex;
  align-items: center;
  height: 51px;
  padding: 0 18px 0 46px;
  margin: 0 0 18px -10px;
  border-style: solid;
  border-width: 0 6px 0 38px;
  border-image: url('../img/skin/panels/header-lantern.png') 0 12 0 76 fill / 0 6px 0 38px stretch;
  color: #fbf0d6;
  font: 700 22px var(--title);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  width: fit-content;
  min-width: 260px;
  padding-left: 12px;
}
.divider { height: 9px; background: url('../img/skin/panels/divider-ornament.png') center / auto 100% no-repeat; margin: 18px auto; max-width: 260px; }

/* Item / skill slot frames from the game. */
.slot {
  --s: 56px;
  position: relative;
  width: var(--s);
  height: var(--s);
  flex: none;
  display: grid;
  place-items: center;
  background: url('../img/skin/slots/slot-normal.png') center / 100% 100% no-repeat;
}
.slot img { width: 76%; height: 76%; object-fit: contain; }
.slot.common { background-image: url('../img/skin/slots/slot-common.png'); }
.slot.uncommon { background-image: url('../img/skin/slots/slot-uncommon.png'); }
.slot.rare { background-image: url('../img/skin/slots/slot-rare.png'); }
.slot.epic { background-image: url('../img/skin/slots/slot-epic.png'); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  background: var(--parchment-dark);
  border: 1.5px solid var(--parchment-deep);
  color: var(--cocoa-soft);
  white-space: nowrap;
}
.chip img { width: 18px; height: 18px; }
.chip.green { background: #dfe8cf; border-color: #a9bb8c; color: var(--forest-dark); }
.chip.amber { background: #f7e0ad; border-color: #e1b663; color: #7a531c; }
.chip.red { background: #f1d2c8; border-color: #d99a8a; color: #8a3a2c; }
.chip.blue { background: #d5e3ea; border-color: #9dbbc8; color: #2f5a68; }
.chip.dark { background: rgba(0, 0, 0, 0.35); border-color: rgba(242, 184, 75, 0.5); color: var(--amber-glow); }
.rarity-common { color: var(--common); }
.rarity-uncommon { color: var(--uncommon); }
.rarity-rare { color: var(--rare); }
.rarity-epic { color: var(--epic); }

/* ---------------------------------------------------------------- modal + toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(5, 8, 16, 0.7);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  width: min(480px, 100%);
  transform: translateY(14px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  text-align: center;
  padding: 0 0 22px;
  overflow: hidden;
}
.modal-backdrop.open .modal { transform: none; }
.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--forest);
  border-bottom: 2px solid var(--amber);
  color: #fbf0d6;
  font: 700 20px var(--title);
  text-align: left;
}
.modal-head img { width: 26px; }
.modal-head button { margin-left: auto; width: 30px; height: 30px; border: 0; background: url('../img/skin/buttons/close-x.png') center / contain no-repeat; }
.modal-body { padding: 22px 26px 4px; }
.modal-icon { width: 84px; height: 84px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, rgba(242, 184, 75, 0.35), transparent 70%); }
.modal-icon svg, .modal-icon img { width: 56px; height: 56px; }
.modal h3 { font-size: 26px; margin-bottom: 6px; }
.modal p { color: var(--cocoa-soft); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 120;
  transform: translate(-50%, 30px);
  opacity: 0;
  padding: 12px 22px 12px 54px;
  min-width: 260px;
  border-style: solid;
  border-image: url('../img/skin/panels/toast.png') 10 14 10 32 fill / 5px 7px 5px 16px stretch;
  font-weight: 800;
  color: var(--cocoa);
  transition: transform 0.25s, opacity 0.25s;
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------------------------------------------------------------- footer */
.site-footer {
  position: relative;
  background: var(--night-950);
  color: var(--parchment-dark);
  padding: 56px 0 28px;
  border-top: 3px solid var(--amber);
  font-size: 15px;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.footer-grid img { width: 200px; margin-bottom: 10px; }
.footer-grid h4 { color: var(--amber-bright); font-size: 18px; margin-bottom: 10px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-grid a { text-decoration: none; opacity: 0.85; }
.footer-grid a:hover { opacity: 1; color: var(--amber-glow); }
/* The studio's social accounts (Mendoka's, shared by every game): a row of icons under the blurb. */
.footer-socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.footer-grid .footer-socials a { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(242, 184, 75, 0.1); transition: transform 0.15s, background 0.15s; }
.footer-grid .footer-socials a:hover { transform: translateY(-2px); background: rgba(242, 184, 75, 0.22); }
.footer-socials svg { width: 18px; height: 18px; }
.footer-bottom { margin-top: 36px; padding-top: 18px; border-top: 1px solid rgba(242, 184, 75, 0.2); display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font-size: 13px; opacity: 0.7; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* Canvas sprite stage (animated idle loops). */
.sprite-stage { position: relative; display: grid; place-items: end center; }
.sprite-stage canvas { image-rendering: auto; }
.sprite-stage::after {
  content: '';
  position: absolute;
  bottom: 4%;
  left: 50%;
  width: 46%;
  height: 9%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(20, 14, 6, 0.35), transparent 70%);
  z-index: -1;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------- Steam wishlist (the store buttons' navy and gold) */
.btn-steam {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  color: #f6ecd6;
  font-family: var(--font);
  background: linear-gradient(180deg, #24324f, #141d31);
  border: 2px solid #9a7238;
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.25), 0 4px 0 #0a0f1a, 0 8px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.1s, border-color 0.15s, box-shadow 0.15s;
}
.btn-steam:hover { border-color: var(--amber-bright); transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.3), 0 6px 0 #0a0f1a, 0 0 24px rgba(242, 184, 75, 0.35); }
.btn-steam:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.25), 0 2px 0 #0a0f1a; }
.btn-steam:focus-visible { outline: 3px solid var(--amber-bright); outline-offset: 3px; }
.btn-steam svg { flex: none; }
.btn-steam small { display: block; font-size: 12px; font-weight: 700; opacity: 0.75; line-height: 1.1; letter-spacing: 0.02em; }
.btn-steam strong { display: block; font-weight: 800; line-height: 1.15; }
.btn-steam-lg { height: 72px; padding: 0 30px 0 22px; margin-bottom: 18px; }
.btn-steam-lg svg { width: 38px; height: 38px; }
.btn-steam-lg strong { font-size: 23px; }
.btn-steam-sm { height: 40px; padding: 0 14px 0 10px; gap: 8px; font: 800 14px var(--font); box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.25), 0 3px 0 #0a0f1a; }
.btn-steam-sm svg { width: 22px; height: 22px; }
@media (max-width: 900px) {
  .btn-steam-lg { width: 100%; justify-content: center; }
}

/* ---------------------------------------------------------------- buttons switched off until launch (common.js) */
.is-off,
.is-off:hover,
.is-off:active {
  opacity: 0.45;
  filter: grayscale(0.85);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* The Close Beta strip (js/cbt-banner.js): along the bottom of every page while the CBT runs. */
.cbt-site {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
  border-top: 2px solid rgba(189, 134, 59, 0.75);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2px 14px;
  padding: 8px 16px;
  background: #4a2a10;
  color: #ffe9b8;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  text-decoration: none;
}
.cbt-site b {
  color: #ffb08a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cbt-site span::before {
  content: '· ';
  opacity: 0.6;
}
.cbt-site em {
  font-style: normal;
  text-decoration: underline;
}
body.has-cbt {
  padding-bottom: 56px;
}
