@font-face { font-family: 'Lilita One'; src: url('assets/fonts/LilitaOne-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Nunito'; src: url('assets/fonts/Nunito-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url('assets/fonts/Nunito-ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: swap; }

/* Tokens match the game's src/style.css :root. */
:root {
  --ink: #2A1B3D; --cream: #FFF3D6; --cream-2: #F1D9A8; --gold: #FFC83D; --gold-2: #E09A1F;
  --berry: #FF4D6D; --leaf: #7BD389; --leaf-2: #3FA66B; --sky: #4DA3FF; --ice: #BFE6FF; --ember: #FF7A2F;
  --night-0: #150E29; --night-1: #1E1538; --night-2: #2B1F4F; --night-3: #4B2E6F; --dusk: #8A3E6E;
  --soft: #D9CCEA;
  --display: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --body: 'Nunito', system-ui, sans-serif;
  --gutter: 20px;
}
@media (max-width: 600px) { :root { --gutter: 16px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--body); font-weight: 700; font-size: 18px; line-height: 1.55; color: var(--cream);
  background:
    radial-gradient(70% 700px at 85% 0, rgba(142, 107, 255, .28), transparent 70%),
    radial-gradient(80% 600px at 20% 760px, rgba(255, 122, 47, .16), transparent 70%),
    linear-gradient(180deg, var(--night-2) 0, var(--night-1) 900px, var(--night-0) 100%);
  background-color: var(--night-0);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 var(--gutter); }

/* The game's logo treatment: ink stroke painted under the fill, plus a solid drop. */
.display {
  font-family: var(--display); font-weight: 400; letter-spacing: .3px; line-height: 1.02; color: var(--cream);
  -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; text-shadow: 0 5px 0 var(--ink);
}
h2.display { font-size: clamp(34px, 5.2vw, 54px); }
.section-lede { color: var(--soft); max-width: 58ch; margin-top: 14px; }

/* ---------- chunky buttons, as in the game ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px;
  font-family: var(--display); font-size: 22px; letter-spacing: .4px; color: var(--ink); text-decoration: none; text-align: center;
  background: var(--gold); border: 3px solid var(--ink); border-radius: 18px; padding: 10px 24px;
  box-shadow: 0 6px 0 var(--ink); transition: transform .08s, box-shadow .08s; cursor: pointer;
}
.btn:hover { background: #FFD45E; }
.btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--ink); }
.btn-small { min-height: 44px; font-size: 18px; padding: 6px 16px; border-radius: 14px; box-shadow: 0 4px 0 var(--ink); }
body[data-launch="soon"] .store { background: var(--cream-2); cursor: default; }
body[data-launch="soon"] .store:active { transform: none; box-shadow: 0 6px 0 var(--ink); }
body[data-launch="soon"] .btn-small.store:active { box-shadow: 0 4px 0 var(--ink); }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-tile {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 11px; background: var(--cream); color: var(--ink);
  border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); transform: rotate(-6deg);
  font-family: var(--display); font-size: 30px; line-height: 1; padding-bottom: 2px;
}
.brand-name { font-family: var(--display); font-size: 30px; color: var(--gold); -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink); transform: rotate(-2deg); }
@media (max-width: 420px) { .top .btn-small { font-size: 16px; padding: 6px 12px; } .brand-name { font-size: 26px; } }
@media (max-width: 370px) { .top .btn-small { display: none; } .btn { font-size: 19px; padding: 10px 16px; } }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.25fr 1fr; gap: 40px; align-items: center; padding-top: 40px; padding-bottom: 96px; }
.hero h1 { font-size: clamp(44px, 5.2vw, 72px); -webkit-text-stroke-width: 8px; text-shadow: 0 7px 0 var(--ink); }
.lede { font-size: 21px; color: var(--soft); max-width: 34ch; margin-top: 26px; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: 32px; }
.cta-note { color: var(--soft); font-size: 17px; }
@media (min-width: 500px) { .hero h1 span { white-space: nowrap; } }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding-top: 24px; padding-bottom: 72px; }
  .lede { font-size: 19px; margin-top: 18px; }
  .cta-row { margin-top: 24px; }
}

/* ---------- playable arena ---------- */
.arena {
  position: relative; width: 100%; max-width: 410px; justify-self: center; padding: 16px 16px 18px; border-radius: 30px;
  background:
    radial-gradient(120% 50% at 50% 110%, rgba(255, 122, 47, .22), transparent 60%),
    linear-gradient(180deg, var(--night-1), var(--night-3));
  border: 4px solid var(--ink); box-shadow: 0 10px 0 var(--ink), 0 30px 60px rgba(10, 5, 25, .5);
}
.monster { text-align: center; }
.mon-art { width: 150px; height: 150px; margin: 0 auto; position: relative; }
.mon-art img { width: 100%; height: 100%; object-fit: contain; animation: bob 2.6s ease-in-out infinite; }
.monster.hurt .mon-art img { animation: hurt .4s ease-out; }
.monster.gone .mon-art img { animation: poof .6s ease-in forwards; }
.mon-name { font-family: var(--display); font-size: 20px; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; margin-top: 2px; }
.hp { position: relative; height: 24px; width: min(260px, 80%); margin: 6px auto 0; border-radius: 12px; background: var(--night-0); border: 3px solid var(--ink); overflow: hidden; }
.hp i { position: absolute; inset: 0 auto 0 0; width: 100%; background: linear-gradient(180deg, #FF7C95, var(--berry)); transition: width .5s cubic-bezier(.2, .9, .3, 1); }
.hp span { position: relative; display: block; text-align: center; font-family: var(--display); font-size: 15px; line-height: 18px; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
.dmg { position: absolute; left: 50%; top: 30%; font-family: var(--display); font-size: 34px; color: var(--gold); -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; pointer-events: none; animation: rise 1s ease-out forwards; }

.wordbar { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; margin: 12px 0 10px; text-align: center; }
.word-letters { font-family: var(--display); font-size: 28px; letter-spacing: 1px; -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; }
.word-letters.ok { color: var(--leaf); }
.word-score:not(:empty) { font-family: var(--display); font-size: 17px; color: var(--ink); background: var(--leaf); border: 2px solid var(--ink); border-radius: 9px; padding: 0 8px; }
.word-msg { color: var(--soft); font-size: 16px; }
.word-msg.bad { color: #FF9BAE; }
.word-letters:not(:empty) ~ .word-msg { display: none; }
.word-actions { display: none; gap: 6px; }
.arena.tapping .word-actions { display: inline-flex; }
.chip-btn { font: inherit; font-family: var(--display); font-size: 16px; color: var(--ink); background: var(--cream); border: 2px solid var(--ink); border-radius: 10px; padding: 3px 10px; box-shadow: 0 3px 0 var(--ink); cursor: pointer; }
.chip-btn.cast { background: var(--leaf); }

.board { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 10px; border-radius: 20px; background: var(--night-0); border: 3px solid var(--ink); touch-action: none; user-select: none; -webkit-user-select: none; }
.board svg.trace { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; overflow: visible; }
.board svg.trace polyline { fill: none; stroke: rgba(63, 166, 107, .85); stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; }
.board svg.trace.ghost polyline { stroke: rgba(255, 200, 61, .7); }
.tile {
  position: relative; aspect-ratio: 1; display: grid; place-items: center; padding: 0; margin: 0;
  font-family: var(--display); font-size: clamp(30px, 9vw, 40px); line-height: 1; color: var(--ink);
  background: var(--cream); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 5px 0 var(--ink);
  cursor: pointer; transition: transform .12s, background-color .12s; -webkit-tap-highlight-color: transparent;
}
.tile sub { position: absolute; right: 7px; bottom: 3px; font-family: var(--body); font-weight: 800; font-size: 13px; opacity: .6; }
.tile.on { background: var(--leaf); transform: scale(.94); z-index: 3; }
.tile.ghost { background: var(--gold); }
.tile.hit { animation: pop .45s ease-out; }
.arena.shake .board { animation: shake .35s; }
.cast-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 12px; }
.cast-list:empty { display: none; }
.cast-list li { font-family: var(--display); font-size: 15px; color: var(--ink); background: var(--cream-2); border: 2px solid var(--ink); border-radius: 9px; padding: 1px 8px; }
.cast-list li span { opacity: .6; margin-left: 4px; }

.win {
  position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 28px; text-align: center; border-radius: 26px; background: rgba(21, 14, 41, .96); animation: fadein .35s ease-out;
}
.win[hidden] { display: none; }
.win img { width: 116px; }
.win h2 { font-size: 46px; color: var(--gold); }
.win-text { color: var(--cream); max-width: 30ch; }
.linkish { font: inherit; color: var(--soft); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 8px; }

@keyframes bob { 50% { transform: translateY(-7px); } }
@keyframes hurt { 20% { transform: translateX(-10px) rotate(-6deg); filter: brightness(1.8); } 50% { transform: translateX(8px) rotate(4deg); } }
@keyframes poof { to { transform: scale(.2) rotate(20deg); opacity: 0; } }
@keyframes rise { from { transform: translate(-50%, 0) scale(.8); opacity: 1; } to { transform: translate(-50%, -60px) scale(1.1); opacity: 0; } }
@keyframes pop { 40% { transform: scale(1.12); background: var(--gold); } }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@keyframes fadein { from { opacity: 0; } }

/* ---------- level types: phones ---------- */
.modes { padding: 24px 0 110px; }
.phones { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; margin-top: 44px; }
.phones li:nth-child(odd) .phone { transform: rotate(-2deg); }
.phones li:nth-child(even) .phone { transform: rotate(1.5deg) translateY(18px); }
.phones li:nth-child(even) h3 { margin-top: 42px; }
.phone { margin: 0; border-radius: 34px; border: 5px solid var(--ink); background: var(--ink); box-shadow: 0 8px 0 var(--ink), 0 24px 44px rgba(10, 5, 25, .45); overflow: hidden; }
.phone img { width: 100%; aspect-ratio: 393 / 852; object-fit: cover; }
.phones h3 { font-family: var(--display); font-weight: 400; font-size: 26px; margin-top: 24px; }
.phones p { color: var(--soft); font-size: 17px; margin-top: 6px; }
@media (max-width: 900px) {
  .phones {
    display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 24px; padding-top: 6px;
    scrollbar-width: none; margin-top: 32px;
  }
  .phones::-webkit-scrollbar { display: none; }
  .phones li { flex: 0 0 min(64vw, 260px); scroll-snap-align: center; }
  .phones li:nth-child(even) .phone { transform: rotate(1.5deg); }
  .phones li:nth-child(even) h3 { margin-top: 24px; }
}

/* ---------- regions: the saga-map trail ---------- */
.regions { padding-bottom: 110px; }
.trail { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 56px; }
/* The dotted road from the map screen, running through the three region nodes. */
.trail::before {
  content: ''; position: absolute; left: 16%; right: 16%; top: 86px; height: 14px; border-radius: 7px; z-index: 0;
  background: var(--night-0) radial-gradient(circle, var(--cream-2) 2.5px, transparent 3px) 0 50% / 18px 14px repeat-x;
  border: 3px solid var(--ink);
}
.stop { position: relative; z-index: 1; text-align: center; display: flex; flex-direction: column; align-items: center; }
.node {
  width: 190px; height: 190px; border-radius: 50%; border: 5px solid var(--ink); box-shadow: 0 7px 0 var(--ink);
  display: grid; place-items: center; overflow: hidden;
}
.node img { width: 88%; }
.woods .node { background: radial-gradient(circle at 50% 40%, #A5E8B0, var(--leaf-2)); }
.caverns .node { background: radial-gradient(circle at 50% 40%, #C7B6FF, #6A4FD8); }
.peaks .node { background: radial-gradient(circle at 50% 40%, #E6F5FF, #7FC4F0); }
.banner {
  margin-top: -18px; font-family: var(--display); font-size: 24px; padding: 4px 16px; border: 3px solid var(--ink); border-radius: 13px; box-shadow: 0 4px 0 var(--ink);
  transform: rotate(-2deg); white-space: nowrap;
}
.woods .banner { background: var(--leaf-2); }
.caverns .banner { background: var(--sky); }
.peaks .banner { background: var(--cream); color: var(--ink); }
.stop-meta { margin-top: 16px; font-family: var(--display); font-size: 19px; color: var(--cream-2); display: flex; align-items: center; gap: 8px; }
.tag { font-size: 15px; color: var(--ink); background: var(--gold); border: 2px solid var(--ink); border-radius: 8px; padding: 0 8px; }
.stop > p:last-child { color: var(--soft); font-size: 17px; margin-top: 8px; max-width: 30ch; }
@media (max-width: 800px) {
  .trail { grid-template-columns: 1fr; gap: 44px; margin-top: 40px; }
  .trail::before { left: 50%; right: auto; top: 90px; bottom: 90px; width: 14px; height: auto; margin-left: -7px; background-position: 50% 0; background-size: 14px 18px; background-repeat: repeat-y; }
  .stop > p:last-child { background: var(--night-0); padding: 4px 8px; border-radius: 10px; }
  .node { width: 164px; height: 164px; }
}

/* ---------- spells ---------- */
.spells { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: center; padding-bottom: 110px; }
.spell-list { display: grid; gap: 16px; }
.spell-list li { display: flex; gap: 18px; align-items: center; padding: 16px 18px; border-radius: 20px; background: var(--night-2); border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); }
.spell-ic { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 16px; background: var(--night-3); border: 3px solid var(--ink); }
.spell-ic svg { width: 40px; height: 40px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.spell-list h3 { font-family: var(--display); font-weight: 400; font-size: 23px; }
.spell-list p { color: var(--soft); font-size: 17px; }
@media (max-width: 860px) { .spells { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- price ---------- */
.price { padding-bottom: 110px; }
.price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 40px; }
.plan { padding: 26px 28px 28px; border-radius: 26px; border: 4px solid var(--ink); box-shadow: 0 8px 0 var(--ink); color: var(--ink); }
.plan-free { background: var(--cream); }
.plan-full { background: var(--gold); }
.plan-name { font-family: var(--display); font-size: 24px; }
.plan-price { font-family: var(--display); font-size: 54px; line-height: 1.1; }
.plan-price span { font-size: 20px; }
.plan ul { margin-top: 14px; display: grid; gap: 8px; }
.plan li { position: relative; padding-left: 30px; font-weight: 800; }
.plan li::before { content: ''; position: absolute; left: 0; top: 5px; width: 18px; height: 18px; border-radius: 6px; background: var(--leaf) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%232A1B3D' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; border: 2px solid var(--ink); }
.pledges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 44px; }
.pledges li { color: var(--soft); font-size: 17px; border-top: 3px dotted rgba(241, 217, 168, .35); padding-top: 14px; }
.pledges strong { display: block; font-family: var(--display); font-weight: 400; font-size: 21px; color: var(--cream); }
.fine { color: var(--soft); opacity: .8; font-size: 15px; margin-top: 30px; max-width: 70ch; }
@media (max-width: 860px) {
  .price-grid { grid-template-columns: 1fr; }
  .pledges { grid-template-columns: 1fr 1fr; gap: 20px; }
}
@media (max-width: 480px) { .pledges { grid-template-columns: 1fr; } .plan { padding: 22px 20px 24px; } }

/* ---------- FAQ ---------- */
.faq { padding-bottom: 110px; }
.faq > * { max-width: 860px; }
.faq h2 { margin-bottom: 26px; }
.faq details { border-bottom: 3px dotted rgba(241, 217, 168, .3); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 40px 18px 0; position: relative; font-family: var(--display); font-size: 22px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-size: 30px; color: var(--gold); }
.faq details[open] summary::after { content: '–'; }
.faq details p { color: var(--soft); padding-bottom: 20px; max-width: 64ch; }

/* ---------- final CTA ---------- */
.final { padding: 20px 0 110px; }
.final-inner { display: flex; align-items: center; gap: 40px; }
.final-inner img { width: 240px; flex: none; transform: rotate(-4deg); }
.final-inner .btn { margin-top: 26px; }
@media (max-width: 700px) { .final-inner { flex-direction: column; text-align: center; gap: 16px; } .final-inner img { width: 180px; } .final .section-lede { margin-left: auto; margin-right: auto; } }

/* ---------- footer ---------- */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-top: 28px; padding-bottom: 40px; border-top: 3px dotted rgba(241, 217, 168, .25); color: var(--soft); font-size: 16px; }
.foot nav { display: flex; gap: 22px; }
.foot a { color: var(--soft); }
.foot .langs-nav { flex-basis: 100%; flex-wrap: wrap; gap: 6px 18px; }
.langs-nav a { text-decoration: none; }
.langs-nav a:hover { text-decoration: underline; }
.langs-nav a[aria-current] { color: var(--gold); }

/* ---------- plain document pages (privacy, support) ---------- */
.doc { max-width: 760px; padding-top: 28px; padding-bottom: 90px; }
.doc h1 { font-size: clamp(40px, 6vw, 60px); margin-bottom: 18px; }
.doc h2 { font-family: var(--display); font-weight: 400; font-size: 26px; margin: 36px 0 8px; }
.doc p, .doc li { color: var(--soft); }
.doc p + p { margin-top: 12px; }
.doc ul { list-style: disc; padding-left: 22px; }
.doc .meta { font-size: 15px; opacity: .85; }

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