/* BIS Date, dressed the way the game is: Theme.swift's colours, the game's own typefaces
   (Copperplate Bold and Optima, which every iPhone and Mac already has), and its UI kit art. */

:root {
  --ground: #211f30;
  --ground-deep: #171421;
  --panel: #332b45;
  --panel-line: #6b5c85;
  --leather: #5c3d29;
  --leather-dark: #3d261a;
  --brass: #d9a640;
  --text: #f5f0e0;
  --muted: #a8a1b8;
  --keep: #33d959;
  --drop: #f24040;

  /* Ink for text on the parchment loot cards, and each rarity's ink. */
  --ink: #1c120a;
  --ink-muted: #574229;
  --ink-green: #0d5717;
  --ink-poor: #6b6b6b;
  --ink-common: #141210;
  --ink-uncommon: #146120;
  --ink-rare: #1a3d9e;
  --ink-epic: #662194;
  --ink-legendary: #c76105;

  --title: Copperplate, "Copperplate Gothic Bold", "Copperplate Gothic", "Palatino Linotype", Georgia, serif;
  --body: Optima, "Optima Nova", Candara, "Segoe UI", "Noto Sans", sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--ground); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  color: var(--text);
  font: 400 1.125rem/1.55 var(--body);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
.px { image-rendering: pixelated; }
a { color: var(--brass); }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { margin: 0; font-family: var(--title); font-weight: 700; line-height: 1.1; text-wrap: balance; }
p, ul { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--text); color: var(--ground); font-weight: 700; border-radius: 6px; }
.skip:focus { top: 12px; }

/* ---- Top bar ---- */

.topbar { position: sticky; top: 0; z-index: 40; background: var(--ground-deep); border-bottom: 1px solid var(--panel-line); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--brass); text-decoration: none; font: 700 1.35rem/1 var(--title); }
.wordmark img { width: 40px; height: 40px; }
.nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 28px); }
.nav a:not(.btn) { color: var(--text); text-decoration: none; font: 700 1.05rem/1 var(--body); padding-block: 12px; }
.nav a:not(.btn):hover, .nav a[aria-current="page"] { color: var(--brass); }
@media (max-width: 480px) { .wordmark span { display: none; } }

/* ---- Buttons: the game's button art, pressed on touch ---- */

.btn {
  --art: url("../img/kit/button_primary.webp");
  --art-pressed: url("../img/kit/button_primary_pressed.webp");
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 58px; padding: 0 .9em;
  border: 16px solid transparent;
  border-image: var(--art) 48 fill / 16px stretch;
  background: none; color: var(--text); text-decoration: none;
  font: 700 1.1rem/1 var(--title);
  cursor: pointer;
  transition: transform .08s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active, .btn.is-pressed { --art: var(--art-pressed); transform: translateY(2px); }
.btn:disabled { filter: grayscale(.8) brightness(.7); cursor: not-allowed; transform: none; }
.btn-confirm { --art: url("../img/kit/button_confirm.webp"); --art-pressed: url("../img/kit/button_confirm_pressed.webp"); }
.btn-danger { --art: url("../img/kit/button_danger.webp"); --art-pressed: url("../img/kit/button_danger_pressed.webp"); }
.btn-small { min-height: 52px; border-width: 13px; border-image-width: 13px; font-size: 1rem; padding: 0 .55em; }
.btn .soon { font: 700 .95rem/1 var(--body); color: var(--brass); }

/* ---- The game's panels ---- */

.leather { border: 36px solid transparent; border-image: url("../img/kit/panel_leather.webp") 108 fill / 36px stretch; }
.slot { display: grid; place-items: center; border: 13px solid transparent; border-image: url("../img/kit/slot_frame.webp") 39 fill / 13px stretch; }
.framed { border: 16px solid transparent; border-image: url("../img/kit/slot_frame.webp") 39 fill / 16px stretch; }
@media (max-width: 640px) {
  .leather { border-width: 24px; border-image-width: 24px; }
  .framed { border-width: 12px; border-image-width: 12px; }
}

/* ---- Sections ---- */

.section { padding-block: clamp(56px, 9vw, 104px); scroll-margin-top: 64px; border-top: 1px solid rgba(107, 92, 133, .4); }
.section h2 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); color: var(--brass); }
.section-lead { max-width: 58ch; margin-top: 14px; font-size: clamp(1.1rem, 1.6vw, 1.25rem); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---- Bis ---- */

.bis { position: relative; width: var(--bis-size, 216px); }
.bis-body {
  position: relative; z-index: 2; display: block; width: 100%;
  padding: 0; border: 0; background: none; cursor: pointer;
  transform-origin: 50% 100%;
  -webkit-tap-highlight-color: transparent;
}
.bis-body img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.bis-shadow { position: absolute; z-index: 1; left: 18%; right: 18%; bottom: -3%; height: 8%; background: radial-gradient(closest-side, rgba(0, 0, 0, .45), transparent); }
.bis-body.is-hopping { animation: bis-hop .36s cubic-bezier(.3, .7, .4, 1) var(--hops, 3); }
.bis-body.is-giggling { animation: bis-giggle .82s linear; }
@keyframes bis-hop {
  0%, 100% { transform: none; }
  18% { transform: scale(1.08, .92); }
  50% { transform: translateY(var(--hop-height, -16%)) scale(.94, 1.07); }
  82% { transform: scale(1.06, .94); }
}
@keyframes bis-giggle {
  0% { transform: none; }
  8%, 24%, 40% { transform: scale(1.1, .9) rotate(4deg); }
  16%, 32%, 48% { transform: scale(.94, 1.08) rotate(-4deg); }
  60% { transform: scale(1.05, .95) rotate(1.5deg); }
  72%, 100% { transform: none; }
}

/* The game's speech bubble: cream parchment, a brown stroke, the words typed out. */
.bis-bubble {
  position: absolute; z-index: 5; bottom: calc(100% + 18px); left: 50%;
  width: max-content; max-width: min(300px, 74vw);
  padding: 12px 16px 13px;
  background: #f7ebcc; color: #38240f;
  border: 3px solid #5c3d21; border-radius: 14px;
  font: 700 1.05rem/1.4 var(--body);
  transform: translateX(-50%);
  transform-origin: 50% 100%;
}
.bis-bubble::before, .bis-bubble::after { content: ""; position: absolute; top: 100%; left: 50%; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.bis-bubble::before { width: 28px; height: 18px; margin-left: -14px; background: #5c3d21; }
.bis-bubble::after { width: 20px; height: 13px; margin-left: -10px; margin-top: -3px; background: #f7ebcc; }
.bis-bubble.is-popping { animation: bubble-pop .28s cubic-bezier(.2, 1.6, .5, 1); }
@keyframes bubble-pop { from { opacity: 0; scale: .6; } to { opacity: 1; scale: 1; } }
.bis-line { display: grid; }
.bis-line > span { grid-area: 1 / 1; }
.bis-line .ghost { visibility: hidden; }

.buddy {
  position: fixed; z-index: 50;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  --bis-size: 116px;
  transition: transform .5s cubic-bezier(.2, 1.35, .4, 1), opacity .3s ease;
}
.buddy.is-away { transform: translateY(170%); opacity: 0; pointer-events: none; }
.buddy .bis-bubble { left: auto; right: 36%; transform: none; transform-origin: 90% 100%; }
.buddy .bis-bubble::before { left: auto; right: 20px; margin-left: 0; }
.buddy .bis-bubble::after { left: auto; right: 24px; margin-left: 0; }
@media (max-width: 560px) { .buddy { --bis-size: 88px; } }

/* ---- Home: the shop ---- */

.hero { padding-block: clamp(28px, 5vw, 64px) clamp(52px, 8vw, 96px); }
.hero-in { display: grid; grid-template-columns: minmax(280px, 420px) minmax(0, 1fr); gap: clamp(28px, 6vw, 80px); align-items: center; }
.shop-window { position: relative; aspect-ratio: 900 / 1300; overflow: hidden; }
.shop-art { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.bis-hero { position: absolute; left: 50.4%; bottom: 17.6%; --bis-size: 22%; width: 22%; transform: translateX(-50%); }

.sign-rig { --hang: 7.5%; position: absolute; z-index: 3; left: 9%; right: 9%; top: 0; transform-origin: 50% 0; cursor: pointer; }
.sign-chain {
  position: absolute; top: 0; width: 8px; height: var(--hang);
  background: repeating-linear-gradient(180deg, #4a3924 0 8px, #957548 8px 14px);
  border-radius: 3px;
}
.sign-chain.left { left: 14%; }
.sign-chain.right { right: 14%; }
.sign {
  position: relative; margin-top: 12%;
  border: 24px solid transparent;
  border-image: url("../img/kit/panel_leather.webp") 108 fill / 24px stretch;
  text-align: center;
}
.sign h1 { font: 700 clamp(1.8rem, 3.4vw, 2.6rem)/1 var(--title); color: var(--brass); }
.sign p { margin-top: 6px; font: 700 1rem/1.25 var(--body); color: var(--text); }
.sign-rig.is-dropping { animation: sign-drop 1.05s cubic-bezier(.3, .75, .35, 1) both; }
.sign-rig.is-swaying { animation: sign-sway 6.5s ease-in-out infinite; }
.sign-rig.is-rocking { animation: sign-rock 1.6s cubic-bezier(.3, .6, .4, 1); }
@keyframes sign-drop {
  0% { transform: translateY(-120%) rotate(6deg); }
  52% { transform: translateY(7%) rotate(-3deg); }
  70% { transform: translateY(-3%) rotate(2deg); }
  86% { transform: translateY(1.2%) rotate(-.9deg); }
  100% { transform: none; }
}
@keyframes sign-sway { 0%, 100% { transform: rotate(-.7deg); } 50% { transform: rotate(.7deg); } }
@keyframes sign-rock {
  0% { transform: rotate(0); } 12% { transform: rotate(6deg); } 30% { transform: rotate(-4.2deg); }
  48% { transform: rotate(2.6deg); } 66% { transform: rotate(-1.4deg); } 82% { transform: rotate(.7deg); } 100% { transform: rotate(0); }
}

.hero-copy { display: grid; gap: 24px; }
.hero-title { font: 700 clamp(2.5rem, 5.8vw, 4.4rem)/1.02 var(--title); color: var(--text); text-wrap: balance; }
.hero-title em { font-style: normal; color: var(--brass); }
.lead { max-width: 50ch; font-size: clamp(1.15rem, 1.7vw, 1.3rem); }
@media (max-width: 860px) {
  .hero-in { grid-template-columns: 1fr; }
  .shop { width: 100%; max-width: 400px; margin-inline: auto; }
}

/* ---- Home: the loot cards ---- */

.play { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); gap: clamp(28px, 5vw, 64px); align-items: center; }
.counter {
  display: grid; justify-items: center; gap: 22px;
  padding: clamp(30px, 4vw, 46px) clamp(16px, 3vw, 32px) clamp(22px, 3vw, 30px);
  background: url("../img/scenes/desk.webp") center 30% / cover;
  border-radius: 6px;
}
.deck { position: relative; width: min(280px, 72vw); aspect-ratio: 840 / 984; margin-top: 34px; touch-action: pan-y; outline-offset: 10px; }
.loot-card {
  --i: 0; --keep-o: 0; --drop-o: 0;
  position: absolute; inset: 0;
  display: grid; grid-template-rows: auto auto 1fr auto; align-content: start;
  /* Deep enough at the top and sides to clear the legendary frame's corner medallions. */
  padding: 23% 16% 10%;
  background: var(--frame) center / 100% 100% no-repeat;
  color: var(--ink); text-align: center;
  transform: translateY(calc(var(--i) * 8px)) rotate(calc(var(--i) * -2.4deg)) scale(calc(1 - var(--i) * .035));
  transform-origin: 50% 92%;
  transition: transform .28s ease;
  user-select: none; -webkit-user-select: none;
}
.loot-card.is-top { cursor: grab; }
.loot-card.is-top:active { cursor: grabbing; }
/* As in the game, the item's slot sits on the card's top edge, half above it. Only the top card shows one. */
.loot-medallion { position: absolute; z-index: 2; top: 0; left: 50%; width: 76px; height: 76px; transform: translate(-50%, -48%); }
.loot-card:not(.is-top) .loot-medallion { visibility: hidden; }
.loot-medallion img { width: 50px; height: 50px; }
.loot-name { font: 700 1rem/1.15 var(--title); }
.rarity-poor .loot-name { color: var(--ink-poor); }
.rarity-common .loot-name { color: var(--ink-common); }
.rarity-uncommon .loot-name { color: var(--ink-uncommon); }
.rarity-rare .loot-name { color: var(--ink-rare); }
.rarity-epic .loot-name { color: var(--ink-epic); }
.rarity-legendary .loot-name { color: var(--ink-legendary); }
.loot-meta { margin-top: 4px; font: 700 .88rem/1.25 var(--body); color: var(--ink-muted); }
.loot-stats { list-style: none; padding: 0; margin-top: 6px; font: 700 .92rem/1.25 var(--body); color: var(--ink-green); }
.loot-stats li:first-child { color: var(--ink); }
.loot-sell { display: flex; align-items: center; justify-content: center; gap: 6px; padding-top: 6px; border-top: 2px solid rgba(89, 66, 42, .35); font: 700 .95rem/1 var(--body); color: var(--ink-muted); }
.loot-sell b { font: 700 1.05rem/1 var(--title); color: var(--ink); }
.loot-sell img { width: 20px; height: 20px; }
.stamp { position: absolute; top: 16%; padding: 4px 12px; border: 4px solid; border-radius: 8px; font: 700 1.5rem/1 var(--title); background: rgba(255, 250, 235, .75); pointer-events: none; }
.stamp-keep { left: 12%; color: #1b7a33; transform: rotate(-14deg); opacity: var(--keep-o); }
.stamp-drop { right: 12%; color: #b3261e; transform: rotate(14deg); opacity: var(--drop-o); }
.deck-actions { display: flex; gap: 14px; }
.deck-actions .btn { min-width: 124px; }
@media (max-width: 860px) { .play { grid-template-columns: 1fr; } }

/* ---- Home: classes ---- */

.classes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 2vw, 24px); margin-top: 36px; }
.class-card { display: grid; grid-template-rows: auto auto 1fr auto auto; gap: 12px; justify-items: start; }
.class-card .slot { width: 98px; height: 98px; }
.class-card .slot img { width: 72px; height: 72px; }
.class-card h3 { font-size: 1.8rem; color: var(--brass); }
.class-card .trees b { color: var(--brass); }
@media (max-width: 960px) { .classes { grid-template-columns: 1fr; max-width: 560px; } }

/* ---- Home: the Long Road ---- */

.road { display: grid; grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); gap: clamp(26px, 5vw, 64px); align-items: start; margin-top: 36px; }
.map-window { position: relative; aspect-ratio: 3 / 4.3; overflow: hidden; background: #1d2a1a; }
.map-strip {
  --travel: 0px;
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column-reverse;
  animation: map-pan 80s ease-in-out infinite alternate;
}
.map-strip img { display: block; width: 100%; height: auto; }
.map-strip img + img { margin-bottom: -14.3%; }
.map:hover .map-strip { animation-play-state: paused; }
@keyframes map-pan { from { transform: translateY(0); } to { transform: translateY(var(--travel)); } }
.regions { display: grid; gap: 20px; padding: 0; list-style: none; }
.region { display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: start; }
.region .slot { width: 64px; height: 64px; }
.region .slot img { width: 40px; height: 40px; }
.region h3 { font-size: 1.35rem; color: var(--brass); }
.region-stops { font-weight: 700; }
.region-lore { color: var(--muted); }
@media (max-width: 860px) { .road { grid-template-columns: 1fr; } .map { width: 100%; max-width: 380px; } }

/* ---- Home: achievements ---- */

.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 26px 12px; margin-top: 36px; padding: 0; list-style: none; }
.badge { display: grid; justify-items: center; gap: 6px; text-align: center; }
.badge img { width: 88px; height: 88px; transition: transform .2s ease; }
.badge:hover img { transform: translateY(-4px) rotate(-3deg); }
.badge-name { font: 700 1rem/1.2 var(--body); }
.badge-points { font: 700 .95rem/1 var(--title); color: var(--brass); }
.secret { display: flex; align-items: center; gap: 14px; margin-top: 34px; color: var(--muted); font-weight: 700; }
.secret img { width: 40px; height: 40px; flex: none; }

/* ---- Home: the way out ---- */

.download { display: grid; gap: 16px; justify-items: start; max-width: 760px; }
.download p { max-width: 50ch; }
.footer { padding-block: 30px 120px; border-top: 1px solid var(--panel-line); background: var(--ground-deep); }
.footer-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-weight: 700; }

/* ---- Talent planner ---- */

.planner { display: grid; gap: 24px; padding-block: clamp(28px, 5vw, 52px) 120px; }
.planner-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 36px; }
.planner-top h1 { font-size: clamp(2rem, 4.4vw, 2.9rem); color: var(--brass); }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.class-picks { display: flex; gap: 10px; }
.class-pick { display: grid; justify-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--text); font: 700 .95rem/1 var(--title); cursor: pointer; }
.class-pick .slot { width: 70px; height: 70px; border-width: 11px; border-image-width: 11px; border-radius: 6px; }
.class-pick .slot img { width: 48px; height: 48px; transition: opacity .15s ease; }
.class-pick[aria-pressed="false"] .slot img { opacity: .5; }
.class-pick[aria-pressed="true"] { color: var(--brass); }
.class-pick[aria-pressed="true"] .slot { box-shadow: 0 0 0 3px var(--brass); }
.level { display: flex; align-items: center; gap: 8px; }
.level label { margin-right: 4px; font: 700 1.1rem/1 var(--title); }
.step { width: 52px; height: 52px; border-radius: 8px; border: 2px solid var(--panel-line); background: var(--panel); color: var(--text); font: 700 1.5rem/1 var(--title); cursor: pointer; }
.step:active { transform: translateY(2px); }
.level input {
  width: 70px; height: 52px; border-radius: 8px; border: 2px solid var(--panel-line);
  background: var(--ground-deep); color: var(--brass); text-align: center;
  font: 700 1.6rem/1 var(--title); font-variant-numeric: tabular-nums;
  appearance: textfield; -moz-appearance: textfield;
}
.level input::-webkit-inner-spin-button, .level input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.points { min-width: 12ch; font: 700 1.3rem/1.1 var(--title); color: var(--brass); font-variant-numeric: tabular-nums; }
.points.is-empty { color: var(--text); }
.reset { padding: 12px 4px; border: 0; background: none; color: var(--muted); font: 700 1.05rem/1 var(--body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.reset:hover { color: var(--text); }
.over { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--drop); font-weight: 700; }
.over button { min-height: 44px; padding: 0 14px; border-radius: 8px; border: 2px solid var(--brass); background: var(--ground-deep); color: var(--brass); font: 700 1rem/1 var(--body); cursor: pointer; }

.book { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 2vw, 24px); }
.tree-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; margin-bottom: 20px; }
.tree-name { font-size: clamp(1.5rem, 2.4vw, 1.9rem); color: var(--brass); }
.tree-points { font-weight: 700; font-variant-numeric: tabular-nums; }
.tree-rows { position: relative; display: grid; grid-template-columns: 4.4rem repeat(3, minmax(0, 1fr)); gap: 20px 4px; align-items: start; }
.tree-lines { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.tree-lines path { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.tree-lines .met path { stroke: var(--brass); }
.tree-lines .unmet path { stroke: rgba(168, 161, 184, .45); stroke-dasharray: 5 6; }
.tree-lines .met polygon { fill: var(--brass); }
.tree-lines .unmet polygon { fill: rgba(168, 161, 184, .45); }
.row-label { grid-column: 1; padding-top: 18px; font: 700 1rem/1.15 var(--title); color: var(--brass); }
.row-label small { display: block; margin-top: 4px; font: 700 .88rem/1.2 var(--body); color: var(--text); }
.row-label.is-closed { color: var(--muted); }

.talent {
  position: relative; z-index: 1; justify-self: center;
  display: grid; justify-items: center; gap: 7px; width: 100%; max-width: 112px;
  padding: 0; border: 0; background: none; color: var(--text); cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.talent-icon {
  position: relative; display: grid; place-items: center; width: 64px; height: 64px;
  border: 11px solid transparent; border-image: url("../img/kit/slot_frame.webp") 39 fill / 11px stretch;
  border-radius: 6px;
  transition: transform .12s ease, box-shadow .2s ease;
}
.talent-icon img { width: 44px; height: 44px; }
.talent-name { font: 700 .9rem/1.15 var(--body); text-align: center; }
.talent:hover .talent-icon, .talent.is-selected .talent-icon { transform: translateY(-2px); }
.talent.is-dim .talent-icon img { opacity: .35; }
.talent.is-dim .talent-name { color: var(--muted); }
.talent.is-open .talent-icon { box-shadow: 0 0 0 3px var(--keep); }
.talent.is-open .talent-icon img { animation: breathe 1.4s ease-in-out infinite; }
.talent.is-max .talent-icon { box-shadow: 0 0 0 3px var(--brass); }
.rank {
  position: absolute; right: -14px; bottom: -12px;
  min-width: 2.5em; padding: 2px 5px; border-radius: 6px;
  background: var(--ground-deep); border: 1px solid var(--panel-line);
  font: 700 .82rem/1.15 var(--title); color: var(--text); text-align: center; font-variant-numeric: tabular-nums;
}
.talent.is-partial .rank { color: var(--keep); }
.talent.is-max .rank { color: var(--brass); border-color: var(--brass); }
.talent.pop .talent-icon { animation: talent-pop .3s cubic-bezier(.2, 1.7, .4, 1); }
.talent.nope .talent-icon { animation: talent-nope .36s ease; }
@keyframes breathe { 0%, 100% { transform: none; } 50% { transform: scale(1.05); } }
@keyframes talent-pop { 40% { transform: scale(1.16); } }
@keyframes talent-nope { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
@media (max-width: 1060px) and (min-width: 881px), (max-width: 440px) {
  .tree-rows { grid-template-columns: 3.3rem repeat(3, minmax(0, 1fr)); gap: 18px 2px; }
  .talent-icon { width: 56px; height: 56px; border-width: 10px; border-image-width: 10px; }
  .talent-icon img { width: 36px; height: 36px; }
  .talent-name { font-size: .82rem; }
  .row-label { padding-top: 14px; font-size: .9rem; }
  .row-label small { font-size: .82rem; }
}
@media (max-width: 880px) { .book { grid-template-columns: 1fr; } }

.talent-card {
  position: absolute; z-index: 60; width: min(320px, calc(100vw - 24px));
  padding: 16px 18px;
  background: var(--ground-deep); border: 2px solid var(--panel-line); border-radius: 10px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, .5);
  pointer-events: none;
}
.talent-card.is-sheet {
  position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); top: auto !important;
  width: auto; max-width: 560px; margin-inline: auto; pointer-events: auto;
  animation: sheet-up .26s cubic-bezier(.2, 1.3, .4, 1);
}
@keyframes sheet-up { from { transform: translateY(40%); opacity: 0; } to { transform: none; opacity: 1; } }
.card-top { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; }
.card-top img { width: 52px; height: 52px; border-radius: 6px; }
.card-title { font: 700 1.3rem/1.15 var(--title); color: var(--brass); }
.card-meta { margin-top: 3px; font-weight: 700; color: var(--muted); }
.card-effect { margin-top: 12px; line-height: 1.45; }
.card-max { margin-top: 8px; font-weight: 700; color: var(--keep); }
.card-need { margin-top: 10px; font-weight: 700; color: var(--drop); }
.card-actions { display: none; gap: 10px; margin-top: 14px; }
.is-sheet .card-actions { display: grid; grid-template-columns: 1fr 1fr auto; }
.card-close { min-width: 56px; padding: 0 12px; border-radius: 8px; border: 2px solid var(--panel-line); background: var(--panel); color: var(--text); font: 700 1rem/1 var(--body); cursor: pointer; }

.share { display: grid; gap: 10px; max-width: 760px; }
.share label { font: 700 1.2rem/1 var(--title); color: var(--brass); }
.share-row { display: flex; gap: 10px; }
.share-row input {
  flex: 1; min-width: 0; height: 52px; padding: 0 14px;
  border-radius: 8px; border: 2px solid var(--panel-line); background: var(--ground-deep); color: var(--text);
  font: 600 .95rem/1 ui-monospace, "SF Mono", Menlo, monospace;
}

/* ---- 404 ---- */

.lost { display: grid; justify-items: start; gap: 20px; padding-block: 90px 140px; }
.lost h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); color: var(--brass); }
.lost p { max-width: 46ch; font-size: 1.2rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .map-strip, .sign-rig.is-swaying, .talent.is-open .talent-icon img { animation: none; }
}

/* The privacy page: one readable column of plain answers. */
.policy { max-width: 68ch; padding-block: clamp(40px, 7vw, 88px); }
.policy h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); color: var(--brass); }
.policy .updated { margin: 10px 0 0; color: var(--muted); font-size: 1rem; }
.policy .lead { margin: 22px 0 8px; }
.policy h2 { margin: 40px 0 10px; font-size: clamp(1.35rem, 2.4vw, 1.6rem); }
.policy p { margin: 0 0 14px; }

/* The support page: questions that open in place. */
.faq h2 { margin: 44px 0 4px; }
.faq details { border-bottom: 1px solid rgba(107, 92, 133, .45); }
.faq summary { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; font-weight: 700; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; color: var(--brass); font-family: var(--title); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: "\2013"; }
.faq summary:focus-visible { outline: 2px solid var(--brass); outline-offset: 4px; }
.faq details p { margin: 0 0 18px; }
