@font-face {
  font-family: "Jacquard";
  src: url("../assets/fonts/Jacquard12-Regular.ttf");
}
@font-face {
  font-family: "Jersey";
  src: url("../assets/fonts/Jersey10-Regular.ttf");
}

:root {
  --ink: #f3ead8;
  --muted: #b8a890;
  --gold: #f0c040;
  --hp: #c8423a;
  --block: #4a86d8;
  --paper: #e8d8b0;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #050403;
  color: var(--ink);
  font-family: "Jersey", monospace;
  font-size: 22px;
  letter-spacing: 0.5px;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

h1,
h2 {
  font-family: "Jacquard", serif;
  font-weight: normal;
  margin: 0 0 8px;
}
h1 {
  font-size: 72px;
}
h2 {
  font-size: 34px;
}

.panel {
  background: #1a130ee6;
  border: 3px solid #4a3622;
  box-shadow: 0 0 0 3px #0a0705, 0 8px 24px #000c;
  border-radius: 4px;
  padding: 10px 14px;
}

/* ================================================================ room */

#table3d {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
}
#app {
  position: relative;
  z-index: 1;
}
#fx {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
#fx .float {
  transform: translate(-50%, -50%);
  animation-name: float-up-fx;
}
@keyframes float-up-fx {
  to {
    transform: translate(-50%, calc(-50% - 70px));
    opacity: 0;
  }
}
#fx .float.dice {
  font-family: "Jacquard", serif;
  font-size: 64px;
  color: var(--gold);
  animation-duration: 2.2s;
}
#fx .float.wave {
  font-family: "Jacquard", serif;
  font-size: 96px;
  color: #ff5a48;
  animation-duration: 2.4s;
}
#fx .float.coins {
  color: var(--gold);
}

/* The room is transparent: the 3D table shows through. Clicks on it are raycast. */
.room {
  position: relative;
  height: 100vh;
  overflow: hidden;
}
.room.pointer {
  cursor: pointer;
}

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 55%, #000000b0 100%);
}

/* Labels pinned to points of the 3D table (see UI.placeLabels) */
.table-label {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 28px;
  color: #e8d8b0c0;
  text-shadow: 2px 2px 0 #000;
  pointer-events: none;
  white-space: nowrap;
}
.coins-label {
  color: var(--gold);
}
.enemy-label {
  color: #ff8a78c0;
}
.table-label.hidden {
  display: none;
}

/* Film grain */
.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* -------------------------------------------------------------- top bar */

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 24px;
  color: var(--muted);
  text-shadow: 2px 2px 0 #000;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.btn.mute {
  padding: 2px 10px;
  font-size: 20px;
}
.topbar .phase {
  font-family: "Jacquard", serif;
  font-size: 44px;
  line-height: 1;
  color: var(--gold);
}

/* ================================================================ cards */

.card img {
  display: block;
  width: 100%;
  border-radius: 8px;
  image-rendering: auto; /* the tabletop's pixelated setting is inherited */
}
/* ---------------------------------------------------------- hand area */

.hand-area {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: 260px 1fr 220px;
  align-items: end;
  gap: 16px;
  padding: 0 24px 12px;
  pointer-events: none; /* only the children below catch input */
}
.hand-area > * {
  pointer-events: auto;
}

/* The player's health flask stands along the left edge of the screen */
.player {
  position: absolute;
  left: 22px;
  top: 96px;
  bottom: 20px;
  width: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
/* At the start of a fight the flask slides in from the left edge, with a small overshoot */
.player[data-slide] {
  animation: flask-in 1500ms both;
}
@keyframes flask-in {
  0%, 25% { transform: translateX(-180px); animation-timing-function: cubic-bezier(0.2, 0.9, 0.3, 1.25); }
  100% { transform: none; }
}
.player .flask {
  flex: 1;
  min-height: 0;
  max-height: 600px;
  aspect-ratio: 30 / 168;
  image-rendering: pixelated;
  filter: drop-shadow(0 8px 10px #000c) drop-shadow(0 0 18px #ff40300f);
}
.player-info {
  display: flex;
  flex-direction: column;
  align-items: center;
}
/* Pixel art: canvases are drawn at unit size and must not be smoothed */
.pixel-bar,
.stat canvas {
  image-rendering: pixelated;
  display: block;
}
.stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 30px;
  line-height: 1.1;
  text-shadow: 2px 2px 0 #000;
}
.stat.hp {
  color: #ff8a78;
}
.stat.block {
  color: #8ab8ff;
}
.stat.block.zero {
  opacity: 0.35;
}
.stat.mana {
  color: #7ab8ff;
}
.stat.mana.zero {
  opacity: 0.35;
}
/* Damage coming when the turn ends (enemy attacks after block, plus Poison in hand) */
.stat.incoming {
  color: #ffd0c0;
  animation: incoming-pulse 1s ease-in-out infinite alternate;
}
.stat.incoming.zero {
  opacity: 0.35;
  animation: none;
}
@keyframes incoming-pulse {
  to { color: #ff6a5a; }
}

.hand {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 220px;
  padding-bottom: 20px; /* room for the lowered, tilted cards at the fan's edges */
  transition: transform 0.3s;
}
.hand-card {
  position: relative;
  width: 150px;
  margin: 0 -6px;
  transform-origin: 50% 100%;
  transition:
    transform 0.15s,
    rotate 0.15s,
    translate 0.15s;
  filter: brightness(0.7) drop-shadow(0 10px 8px #000c);
  cursor: default;
  user-select: none;
  touch-action: none;
}
.hand-card.playable {
  filter: drop-shadow(0 10px 8px #000c);
  cursor: grab;
}
/* !important overrides the inline fan rotation */
.hand-card.playable:hover {
  transform: translateY(-28px) scale(1.1);
  rotate: 0deg !important;
  translate: 0 0 !important;
  z-index: 1;
}
.hand-card.dragging,
.hand-card.dragging:hover {
  z-index: 20;
  rotate: 0deg !important;
  translate: 0 0 !important;
  transition: none;
  pointer-events: none;
  filter: drop-shadow(0 24px 16px #000c);
  cursor: grabbing;
}

/* Temporary copy of a card flying to the discard pile */
.card-ghost {
  position: fixed;
  z-index: 30;
  border-radius: 8px;
  pointer-events: none;
}

.side {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 16px;
}

.btn {
  padding: 8px 14px;
  font-size: 24px;
  background: #4a3426;
  border: 3px solid #0a0705;
  border-radius: 6px;
  box-shadow: inset 0 -4px 0 #2e2018, 0 6px 12px #000a;
}
.btn:hover {
  background: #5e4430;
}
.btn.end {
  background: #7a2e26;
  box-shadow: inset 0 -4px 0 #4e1c16, 0 6px 12px #000a;
}
.btn.end:hover {
  background: #94382e;
}

/* ---------------------------------------------------------------- log */

.log {
  position: absolute;
  top: 56px;
  right: 16px;
  width: 260px;
  max-height: 300px;
  overflow-y: auto;
  font-size: 17px;
  color: var(--muted);
  opacity: 0.85;
}
.log ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.log li {
  padding: 2px 0;
  border-bottom: 1px solid #ffffff10;
}
.log li:last-child {
  color: var(--ink);
}

/* ------------------------------------------------------------ overlay */

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050403cc;
  z-index: 10;
}
.overlay.end {
  animation: overlay-in 0.5s 1.3s both;
}
@keyframes overlay-in {
  from {
    opacity: 0;
    pointer-events: none;
  }
}
.dialog {
  max-width: 900px;
  max-height: 85vh;
  overflow-y: auto;
  text-align: center;
  padding: 24px 40px;
}
.pile-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 16px;
}
.mini-card {
  width: 96px;
  border-radius: 6px;
}

/* --------------------------------------------------------- animations */

/* Animate `translate`, not `transform`, so standing enemies keep their rotation. */
.hit {
  animation: shake 0.35s;
}
.lunge {
  animation: lunge 0.3s;
}
@keyframes shake {
  0%, 100% { translate: 0; }
  25% { translate: -8px; }
  75% { translate: 8px; }
}
@keyframes lunge {
  50% { translate: 0 24px; }
}

.float {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 44px;
  text-shadow: 2px 2px 0 #000;
  pointer-events: none;
  animation: float-up 1s ease-out forwards;
  white-space: nowrap;
}
.float.damage { color: #ff6a5a; }
.float.block { color: #8ab8ff; }
.float.wound { color: #d4a0ff; }
.float.poison { color: #9ae05a; }
.float.blood { color: #c0182a; }
.float.mana { color: #7ab8ff; }
#fx .float.stun { color: #f0c830; }

/* A cleared level: play it again or go endless */
.level-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 420px;
}
.level-choice small {
  text-align: center;
  opacity: 0.8;
  margin-bottom: 8px;
}
.map-tip .endless {
  color: #ff8a78;
  margin-top: 4px;
}
@keyframes float-up {
  to {
    transform: translate(-50%, -60px);
    opacity: 0;
  }
}

/* Tooltip for overworld map nodes */
.map-tip {
  position: fixed;
  min-width: 170px;
  font-size: 20px;
  line-height: 1.3;
  pointer-events: none;
}
.map-tip h2 {
  font-size: 28px;
  color: var(--gold);
  margin-bottom: 4px;
}
.map-tip small {
  color: var(--muted);
}
.map-tip .hint {
  margin-top: 6px;
  font-size: 16px;
  color: var(--muted);
}
.map-tip .difficulty {
  color: #ff6a5a;
  letter-spacing: 2px;
}
.map-tip .difficulty span {
  color: #ffffff30;
}
.map-tip b {
  color: var(--ink);
}
.map-tip .done {
  margin-top: 4px;
  color: var(--gold);
}

/* Shop deck label on the level select */
.deck-label {
  transform: translate(0, -50%); /* left-aligned, next to the deck */
  font-size: 26px;
  color: var(--gold);
  line-height: 1.15;
}
.deck-label small {
  display: block;
  font-size: 18px;
  color: #e8d8b090;
}
.deck-label .new {
  display: block;
  font-size: 18px;
  color: #8affa0;
}
.trader-label {
  font-size: 26px;
  color: var(--gold);
  text-align: center;
  line-height: 1.15;
}
.trader-label small {
  display: block;
  font-size: 18px;
  color: #e8d8b090;
}
.trader .reward-card.chosen {
  outline: 4px solid var(--gold);
  transform: translateY(-6px);
}
.trader .reward-card .price {
  display: block;
  color: var(--gold);
  font-size: 20px;
}
.map-tip .deck-list {
  margin: 6px 0;
  font-size: 19px;
}
.map-tip .count {
  display: inline-block;
  width: 30px;
  color: var(--gold);
}

/* On the level select the hand is empty: let clicks through to the shop decks on the table */
.hand-area.phase-map .hand {
  pointer-events: none;
}

/* Shop deck editor */
.dialog.editor {
  max-width: 1080px;
  width: 92vw;
}
.ed-summary {
  margin: 6px 0 12px;
  font-size: 24px;
}
.ed-summary.short b {
  color: #ff6a5a;
}
.ed-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.ed-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 6px;
  border-radius: 8px;
  background: #0c080660;
  border: 2px solid #ffffff10;
}
.ed-card.in {
  border-color: #f0c04080;
  background: #f0c04012;
}
.ed-card img {
  width: 120px;
  border-radius: 6px;
  cursor: pointer;
  filter: drop-shadow(0 6px 6px #000a);
}
.ed-card:not(.in) img {
  filter: grayscale(0.6) brightness(0.7);
}
.ed-card.locked .ed-back {
  width: 120px;
  height: 160px;
  border-radius: 6px;
  border: 4px solid #3a3030;
  background: repeating-linear-gradient(45deg, #2a2020 0 8px, #201818 8px 16px);
}
.ed-card.locked {
  opacity: 0.6;
}
.ed-name {
  font-size: 20px;
}
.ed-name small,
.reward-card small {
  color: var(--muted);
  font-size: 15px;
}
.ed-count {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  color: var(--muted);
}
.ed-count b {
  color: var(--ink);
  font-size: 24px;
}
.btn.small {
  padding: 0 10px;
  font-size: 22px;
  line-height: 1.2;
}
.btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.ed-new {
  position: absolute;
  top: 4px;
  right: 6px;
  z-index: 1;
  padding: 0 6px;
  border-radius: 4px;
  background: #3a8a4a;
  font-size: 15px;
}
.ed-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* Level rewards */
.reward-row {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin: 10px 0 6px;
}
.reward-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 20px;
  transition: transform 0.15s;
}
.reward-card img {
  width: 150px;
  border-radius: 8px;
  filter: drop-shadow(0 8px 8px #000c);
}
.reward-card.rare img {
  box-shadow: 0 0 0 3px #f0c040, 0 0 24px #f0c04080;
}
.reward-card.uncommon img {
  box-shadow: 0 0 0 3px #8ab8ff;
}
.reward-card:hover {
  transform: translateY(-8px) scale(1.04);
}
.reward-done b {
  color: var(--gold);
}
.dialog.editor {
  padding: 14px 28px 18px;
}
.dialog.editor h1 {
  font-size: 48px;
  margin: 0;
}
.dialog.editor p {
  margin: 2px 0;
  font-size: 19px;
}
.ed-card img,
.ed-card.locked .ed-back {
  width: 92px;
  height: auto;
}
.ed-card.locked .ed-back {
  height: 123px;
}
.ed-grid {
  gap: 10px;
}
.ed-card {
  padding: 6px 4px;
}

/* Tutorial coach marks */
.tutorial {
  position: fixed;
  z-index: 8;
  width: 340px;
  font-size: 20px;
  line-height: 1.3;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px #0a0705, 0 0 30px #f0c04040, 0 8px 24px #000c;
}
.tutorial h2 {
  font-size: 32px;
  color: var(--gold);
  margin: 0 0 4px;
}
.tutorial p {
  margin: 0 0 10px;
}
.tut-count {
  font-size: 15px;
  color: var(--muted);
}
.tut-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.tut-buttons .btn.small {
  font-size: 16px;
  background: none;
  box-shadow: none;
  color: var(--muted);
}
.tutorial-ring {
  position: fixed;
  z-index: 7;
  width: 90px;
  height: 90px;
  margin: -45px 0 0 -45px;
  border: 4px solid var(--gold);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 18px #f0c040a0, inset 0 0 18px #f0c04060;
  animation: tut-pulse 1.2s ease-in-out infinite;
}
@keyframes tut-pulse {
  0%, 100% { transform: scale(0.85); opacity: 0.6; }
  50% { transform: scale(1.1); opacity: 1; }
}

/* Travelling between tables */
.btn.travel {
  background: #3a4a5a;
  box-shadow: inset 0 -4px 0 #24303c, 0 6px 12px #000a, 0 0 16px #8ab8ff40;
  animation: travel-glow 2.4s ease-in-out infinite;
}
.btn.travel:hover {
  background: #4a5e72;
}
@keyframes travel-glow {
  50% { box-shadow: inset 0 -4px 0 #24303c, 0 6px 12px #000a, 0 0 26px #8ab8ff90; }
}
.travel-locked {
  text-align: center;
  font-size: 20px;
  color: #e8d8b070;
}
.travel-locked small {
  display: block;
  font-size: 15px;
}
.overlay .unlocked {
  color: #8ab8ff;
  font-size: 24px;
}
.veil {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}
.veil.dark {
  opacity: 1;
}

/* ------------------------------------------------ Bandit and Angel cards */

/* An Angel card after a Bandit card was played: grey, with a stamp */
.hand-card.powerless img {
  filter: grayscale(1) brightness(0.6);
}
.powerless-tag {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  padding: 2px 10px;
  border: 3px solid #b8281e;
  border-radius: 4px;
  background: #1a0d0bcc;
  color: #ff6a5a;
  font-size: 22px;
  pointer-events: none;
}
.float.heal { color: #7ae08a; }
.float.forsaken {
  color: #d4a0ff;
  font-family: Jacquard, serif;
  font-size: 56px;
  animation-duration: 2.2s;
}
.table-label.lasting-label {
  color: #f0e6c0;
  font-size: 20px;
}

/* ------------------------------------------------- save slots and menus */

.mini-icon {
  width: 18px;
  height: 18px;
  vertical-align: -3px;
  margin-right: 2px;
  image-rendering: pixelated;
}
.slot-dialog {
  width: 620px;
}
.slot-dialog h1 {
  margin: 0;
  font-size: 64px;
  color: var(--gold);
}
.slot-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}
.slot {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 2px solid #f0c04040;
  border-radius: 8px;
  background: #0c080660;
  text-align: left;
}
.slot.empty {
  border-color: #ffffff14;
}
.slot-name {
  font-size: 26px;
  color: var(--gold);
}
.slot-info {
  font-size: 19px;
}
.slot-info.empty {
  color: var(--muted);
}
.slot-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}
.slot-confirm {
  grid-column: 1 / -1;
  font-size: 18px;
  color: #ff9a8a;
}
.slot:has(.slot-confirm) .slot-buttons {
  display: contents;
}
.dialog.menu {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 360px;
}
.dialog.menu h1 {
  margin: 0 0 4px;
  font-size: 56px;
}
.dialog.menu small {
  margin-top: -4px;
  font-size: 15px;
  color: var(--muted);
}

/* Compendium */
.dialog.compendium {
  width: 92vw;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 28px 18px;
}
.dialog.compendium h1 {
  margin: 0;
  font-size: 52px;
}
.cp-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
}
.cp-tabs .btn.active {
  background: #7a5a2a;
  box-shadow: inset 0 -4px 0 #4e3a1a, 0 0 0 2px var(--gold);
}
.cp-body {
  overflow-y: auto;
  max-height: 62vh;
  padding: 0 6px;
}
.cp-body h2 {
  margin: 14px 0 2px;
  color: var(--gold);
}
.cp-body h3 {
  margin: 8px 0 6px;
  font-size: 22px;
  color: var(--muted);
}
.cp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.cp-grid.cards {
  grid-template-columns: repeat(6, 1fr);
}
.cp-monster,
.cp-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 6px;
  border-radius: 8px;
  border: 2px solid #ffffff10;
  background: #0c080660;
}
.cp-monster.boss {
  border-color: #f0c04060;
}
.cp-monster img {
  width: 96px;
  height: 96px;
  image-rendering: pixelated;
}
.cp-monster.unknown img {
  filter: brightness(0) opacity(0.55);
}
.cp-card img {
  width: 120px;
  border-radius: 6px;
  filter: drop-shadow(0 6px 6px #000a);
  transition: transform 0.15s;
}
.cp-card img:hover {
  transform: scale(1.6);
  position: relative;
  z-index: 2;
}
.cp-card .ed-back {
  width: 120px;
  height: 160px;
  border-radius: 6px;
  border: 4px solid #3a3030;
  background: repeating-linear-gradient(45deg, #2a2020 0 8px, #201818 8px 16px);
}
.cp-card.unknown,
.cp-monster.unknown {
  opacity: 0.6;
}
.cp-name {
  font-size: 20px;
}
.cp-boss {
  padding: 0 5px;
  border-radius: 3px;
  background: #7a2e26;
  font-size: 14px;
}
.cp-hint {
  font-size: 15px;
  color: var(--muted);
}
.cp-stats {
  font-size: 19px;
}
.cp-moves {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 6px;
  font-size: 17px;
}
.cp-moves .then {
  color: var(--muted);
}
.cp-rules {
  font-size: 18px;
  line-height: 1.3;
  text-align: left;
  margin-bottom: 10px;
}
.cp-rules p {
  margin: 4px 0;
}
.cp-rules .bandit {
  color: #8ad08a;
}
.cp-rules .angel {
  color: #f0e6a0;
}

.cp-body {
  scrollbar-color: #6a4e32 #0c0806;
}

/* Link to the privacy page (start dialog and Esc menu). */
.privacy-link {
  align-self: center;
  margin-top: 8px;
  font-size: 15px;
  color: var(--muted);
}
.privacy-link:hover {
  color: var(--gold);
}

/* Level tooltip: a box locked until the one to its left is cleared */
.map-tip .locked {
  margin-top: 6px;
  color: #e89a6a;
}

/* ------------------------------------- shop deck editor and trader on the table */

/* Counts and −/+ under each card spread on the table */
.table-label.spread-label {
  transform: translate(-50%, 0);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 1px 4px;
  font-size: 18px;
  color: #e8d8b0;
  background: #120c08c0;
  border-radius: 4px;
  pointer-events: auto;
}
.spread-label .btn.small {
  min-width: 22px;
  padding: 0 4px;
  font-size: 16px;
  line-height: 20px;
}
.spread-label small {
  font-size: 14px;
  color: var(--muted);
}
.spread-label.in b {
  color: var(--gold);
}
.spread-label.locked {
  color: #8a7a68;
  background: none;
}
.spread-label.offer {
  font-size: 19px;
}
.spread-label .ed-new {
  position: static;
  font-size: 13px;
  padding: 0 3px;
}

/* The bar under the spread cards: title, status and the buttons */
.spread-bar {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 28px;
  width: min(1100px, calc(100vw - 48px));
  padding: 10px 22px;
}
.spread-info {
  flex: 1;
  line-height: 1.2;
}
.spread-info h2 {
  display: inline;
  margin: 0 12px 0 0;
  font-family: "Jacquard", serif;
  font-weight: normal;
  font-size: 32px;
  color: var(--gold);
}
.spread-info > div {
  display: inline;
  font-size: 22px;
}
.spread-info > div.short {
  color: #ff8a78;
}
.spread-info small {
  display: block;
  font-size: 16px;
  color: var(--muted);
}
.spread-actions {
  display: flex;
  gap: 10px;
}

/* Start screen: the privacy link under the scroll */
.privacy-link.start-privacy {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 6;
}

/* ------------------------------------------------------------- achievements */

.achievement-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 340px;
  padding: 10px 20px;
  border-color: #8a6a20;
  transform: translateX(-50%);
  animation: toast-in 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
  transition: opacity 0.5s, transform 0.5s;
}
.achievement-toast.leave {
  opacity: 0;
  transform: translate(-50%, -30px);
}
.achievement-toast small {
  display: block;
  font-size: 15px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.achievement-toast b {
  display: block;
  font-size: 26px;
  color: var(--gold);
}
.achievement-toast span {
  font-size: 17px;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, -40px); }
}

.cp-achievements {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
  text-align: left;
}
.cp-achievement {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 2px solid #3a2a1a;
  border-radius: 4px;
  opacity: 0.55;
}
.cp-achievement.earned {
  border-color: #8a6a20;
  background: #3a2a1022;
  opacity: 1;
}
/* Achievement icons: crisp pixels; grey until earned */
.ach-icon {
  flex: none;
  width: 52px;
  height: 52px;
  image-rendering: pixelated;
}
.cp-achievement .ach-icon {
  filter: grayscale(1) brightness(0.6);
}
.cp-achievement.earned .ach-icon {
  filter: drop-shadow(0 0 6px #f0c04060);
}
.achievement-toast .ach-icon {
  filter: drop-shadow(0 0 8px #f0c04080);
}

/* ------------------------------------------------------------------ options */

.dialog.options {
  min-width: 520px;
}
.vol-grid {
  display: grid;
  grid-template-columns: auto 1fr 56px 64px;
  align-items: center;
  gap: 12px 14px;
  margin: 6px 0 10px;
  text-align: left;
}
.vol-row {
  display: contents;
}
.vol-row.off label,
.vol-row.off .vol-value {
  color: var(--muted);
}
.vol-row input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
  cursor: pointer;
}
.vol-value {
  text-align: right;
  color: var(--gold);
}
