:root {
  --ink: #2a2118;
  --ink-soft: #5c5146;
  --paper: #f6efe3;
  --paper-2: #efe4d2;
  --cream: #fffaf2;
  --rule: #e2d3bc;
  --gold: #c9892c;
  --terracotta: #c45c32;
  --sage: #5d7a4a;
  --sky: #7ea4b8;
  --brown: #8b5a3c;
  --blue: #6a8aa3;
  --pink: #c47a86;
  --orange: #d07a3a;
  --red: #b94a3a;
  --shadow: 0 18px 40px rgba(60, 40, 20, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #e8dcc8;
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100dvh; }

#app {
  height: 100dvh;
  max-width: 430px;
  margin: 0 auto;
  position: relative;
  background: var(--paper);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
}
.screen.active { display: flex; }

#title { background: #f3ead8; }
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}
.title-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(246,239,227,0.08) 28%, rgba(246,239,227,0.72) 62%, #f6efe3 100%);
}
.title-copy {
  position: absolute;
  left: 22px; right: 22px; bottom: 28px;
  padding-bottom: env(safe-area-inset-bottom);
}
.eyebrow {
  letter-spacing: .22em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--gold);
  margin-bottom: 10px;
}
h1 {
  font-size: 54px;
  line-height: .9;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--ink);
}
h1 em { font-style: italic; color: var(--terracotta); }
h2 {
  font-size: 30px;
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.lede, .sheet p {
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink-soft);
  margin-bottom: 16px;
}
.fine { font-size: 15px !important; color: var(--ink-soft); }

.btn {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 16px 18px;
  font: inherit;
  font-size: 18px;
  cursor: pointer;
  margin-top: 10px;
}
.btn.primary { background: var(--ink); color: var(--cream); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--rule); }
.text-btn {
  background: none; border: 0; font: inherit; color: var(--terracotta);
  font-size: 15px; cursor: pointer;
}

.paper-screen { background: var(--paper); overflow: auto; }
.sheet {
  padding: 28px 22px calc(28px + env(safe-area-inset-bottom));
}
.sheet.slim { margin-top: auto; padding-top: 80px; }
.sheet-top { display: flex; justify-content: space-between; align-items: baseline; }
.sheet-art {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 16px;
  margin: 8px 0 16px;
}
.sheet-art.tall { height: 210px; object-position: center 20%; }
.why { list-style: none; display: grid; gap: 12px; margin: 8px 0 20px; }
.why li {
  background: var(--cream);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink-soft);
}
.why strong { color: var(--ink); }

.hud {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 8px;
  padding: 12px 12px 8px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: var(--cream);
  border-bottom: 1px solid var(--rule);
}
.stat {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 8px 10px;
}
.stat .k { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.stat strong { font-size: 20px; font-weight: 600; }
.bar { height: 6px; background: var(--rule); border-radius: 99px; margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--sage); border-radius: 99px; transition: width .35s ease; }

.board-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  min-height: 0;
}
.board {
  width: min(100%, 92vw);
  aspect-ratio: 1;
  max-height: 100%;
  position: relative;
  background: #e7d7b8;
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.center {
  position: absolute;
  inset: 18.2%;
  border-radius: 8px;
  overflow: hidden;
  background: #d9c7a4;
}
.center img { width: 100%; height: 100%; object-fit: cover; }
.center-copy {
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  background: rgba(255,250,242,.88);
  border-radius: 10px;
  padding: 8px 10px;
}
.center-copy span { display: block; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }
.center-copy em { font-style: italic; font-size: 18px; color: var(--ink); }

.tile {
  position: absolute;
  background: var(--cream);
  border: 1px solid #d7c6a6;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3px 4px 2px;
  overflow: hidden;
}
.tile .swatch { height: 6px; border-radius: 2px; }
.tile .name {
  font-size: 8px;
  line-height: 1.1;
  color: var(--ink);
  font-weight: 600;
}
.tile .meta { font-size: 8px; color: var(--ink-soft); }
.tile.on {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
  z-index: 2;
}
.token {
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #c9892c;
  box-shadow: 0 0 0 3px #fffaf2, 0 2px 6px rgba(0,0,0,.2);
  z-index: 4;
  transform: translate(-50%, -50%);
  transition: left .45s cubic-bezier(.2,.8,.2,1), top .45s cubic-bezier(.2,.8,.2,1);
}

.houses { display: flex; gap: 1px; height: 5px; }
.houses i { flex: 1; background: var(--sage); border-radius: 1px; opacity: .85; }

.tray {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px calc(14px + env(safe-area-inset-bottom));
  background: var(--cream);
  border-top: 1px solid var(--rule);
}
.mult { display: flex; flex-direction: column; gap: 6px; }
.chip {
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  border-radius: 10px;
  padding: 6px 10px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.chip.on { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.roll {
  height: 72px;
  border: 0;
  border-radius: 18px;
  background: var(--ink);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: inherit;
  font-size: 18px;
  cursor: pointer;
}
.roll:disabled { opacity: .45; }
.diceface {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--cream);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 16px;
  letter-spacing: 1px;
}
.tray-actions { display: flex; flex-direction: column; gap: 6px; }
.icon {
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  border-radius: 10px;
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.toast {
  position: absolute;
  left: 16px; right: 16px;
  bottom: 118px;
  background: var(--ink);
  color: var(--cream);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.35;
  z-index: 6;
}

.cards { display: grid; gap: 10px; }
.card {
  background: var(--cream);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.card h3 { font-size: 18px; font-weight: 600; }
.card p { font-size: 14px; color: var(--ink-soft); margin: 0; }
.card button {
  grid-column: 1 / -1;
  border: 0;
  background: var(--ink);
  color: var(--cream);
  border-radius: 12px;
  padding: 10px;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}
.card button:disabled { background: var(--rule); color: var(--ink-soft); }
.lvl { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--sage); }

.crates {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0;
}
.crate {
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1px solid var(--rule);
  background: var(--cream);
  font-size: 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.crate.open { background: #fff; }
.crate.gone { visibility: hidden; }

.album-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.stamp {
  aspect-ratio: .72;
  border-radius: 12px;
  border: 1px dashed var(--rule);
  background: var(--paper-2);
  display: flex;
  align-items: flex-end;
  padding: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}
.stamp.have {
  border-style: solid;
  background: var(--cream);
  color: var(--ink);
  background-image: linear-gradient(180deg, rgba(255,250,242,.2), rgba(246,239,227,.9));
}

/* Web additions */
.studio-line { margin-top: 14px; font-size: 12px; color: #7a7468; text-align: center; }
.studio-line a { color: inherit; }
.studio-line.light { color: rgba(255,250,242,.85); }
.soft-pay { margin-top: 16px; padding: 14px; border-radius: 16px; background: #fbf6ec; border: 1px solid rgba(60,50,30,.14); }
.soft-pay strong { display: block; font-size: 15px; }
.soft-pay span { display: block; font-size: 13.5px; margin-top: 4px; line-height: 1.4; color: #6a645a; }
.soft-pay .btn { margin-top: 10px; width: 100%; }
.soft-note { display: block; font-style: normal; font-size: 12px; margin-top: 8px; color: #6a645a; }
@media (min-width: 700px) { body { background: #e9e1d2; } #app { box-shadow: 0 30px 80px rgba(60,50,30,.18); } }
.studio-line.light { color: #6a645a; } .studio-line.light a { color: #3a3a36; }
