/* The menus: the Index binder, Upgrades, Stats, the Licenses tablet and Settings.
   Each one is laid out on the mockup's 1600 x 900 stage (ui-mockups/source/menus/menu.html), scaled to the room by
   --k (five stage px to the art px). Inside the stage --a is 5px, so anything sized in art px works there too.
   One chrome for all of them: the shop dimmed 45% behind, the walnut frame (p-frame.png), the brass title plate
   (p-plate.png), the gold ✕ at the top-right corner, a 0.2 s pop in and the same motion backwards out. */

/* ---------- the gear on the bookcase glows while settings are open ---------- */
.sobj.on {
  filter: drop-shadow(0 0 calc(var(--a) * 0.5) rgb(255 214 107 / 0.95))
    drop-shadow(0 0 calc(var(--a) * 1.2) rgb(255 170 60 / 0.45));
}

/* ---------- the stage and the shared chrome ---------- */
.m-dim {
  position: absolute;
  inset: 0;
  background: rgb(14 8 6 / 0.45);
}
.m-catch {
  position: absolute;
  inset: 0;
}
/* the stage keeps to the middle of the room, however wide or tall the window is */
.mstage {
  --a: 5px;
  position: absolute;
  left: calc(50% - 800px * var(--k));
  top: calc(50% - 450px * var(--k));
  width: 1600px;
  height: 900px;
  transform: scale(var(--k));
  transform-origin: 0 0;
  pointer-events: none;
  color: #23201c;
  font-family: var(--font);
}
.mbody {
  position: absolute;
  inset: 0;
}
.mbody > * {
  pointer-events: auto;
}
:where(.mstage) button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.mstage img {
  image-rendering: pixelated;
}
.mstage .num,
.mstage b.num {
  font-family: var(--pixel);
  font-weight: 400;
}

/* the gold ✕: every menu's way out (Esc does the same); sized in art px so the buy stand uses it too */
.gx {
  position: absolute;
  z-index: 10;
  width: calc(var(--a) * 11.2);
  height: calc(var(--a) * 11.2);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, #ffd66b 0 30%, #c48a2a 60%, #8e5a1e 100%);
  box-shadow:
    0 0 0 calc(var(--a) * 0.8) #23201c,
    0 calc(var(--a) * 1) 0 calc(var(--a) * 0.8) rgb(0 0 0 / 0.35);
  font: 700 calc(var(--a) * 6) / 1 var(--font);
  color: #5c3016;
  display: grid;
  place-items: center;
  cursor: pointer;
  pointer-events: auto;
}
.gx:hover {
  filter: brightness(1.12);
}
.gx:active {
  translate: 0 calc(var(--a) * 0.6);
}

/* the walnut frame and its brass plate */
.pnl {
  position: absolute;
  left: 800px;
  translate: -50% -50%;
  border: 50px solid transparent;
  border-image: url(art/menus/p-frame.png) 10 fill / 50px stretch;
  image-rendering: pixelated;
  filter: drop-shadow(0 14px 0 rgb(0 0 0 / 0.35));
  padding: 8px 6px 12px;
}
.pnl > .plate {
  position: absolute;
  top: -74px;
  left: 50%;
  translate: -50% 0;
  border: 25px solid transparent;
  border-image: url(art/menus/p-plate.png) 5 fill / 25px stretch;
  padding: 0 34px;
  height: 70px;
  line-height: 20px;
  font: 700 34px var(--font);
  letter-spacing: 4px;
  color: #5c3016;
  text-shadow: 0 2px 0 #fff2b0;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

/* open: a 0.2 s pop; close: the same backwards, ~0.3 s */
#scene.opening .m-dim {
  animation: m-fade 0.2s both;
}
#scene.closing .m-dim {
  animation: m-fade 0.3s reverse both;
}
#scene.opening .pnl {
  animation: m-pop 0.2s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
#scene.closing .pnl,
#scene.closing.m-index .mbody {
  animation: m-pop 0.3s cubic-bezier(0.5, 0, 0.8, 0.4) reverse both;
}
#scene.closing .mstage {
  pointer-events: none;
}
#scene.closing .mbody > * {
  pointer-events: none;
}
@keyframes m-fade {
  from {
    opacity: 0;
  }
}
@keyframes m-pop {
  from {
    opacity: 0;
    scale: 0.9;
    transform: translateY(30px);
  }
}
#scene.calm *,
#scene.calm {
  animation: none !important;
}

/* ---------- upgrades: one grid, every row tagged with its part of the shop ---------- */
.ugrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-flow: column;
  grid-template-rows: repeat(8, 58px);
  gap: 8px 26px;
  padding: 6px 4px 4px;
}
.ur {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 14px;
  background: #fffaf0;
  border-left: 12px solid var(--c);
  box-shadow:
    0 0 0 3px #23201c,
    4px 4px 0 3px rgb(60 40 20 / 0.18);
}
.ur b {
  display: block;
  font: 700 19px/1.1 var(--font);
}
.ur i {
  font: 400 calc(15px * (1 + (var(--tb, 1) - 1) / 2)) / 1.2 var(--font);
  font-style: normal;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #3f372f;
}
.ur.lock {
  background: #ece4d0;
}
.ur.lock b,
.ur.lock i {
  opacity: 0.55;
}
.ut {
  display: inline-block;
  font: 700 calc(12px * var(--tb, 1)) var(--font);
  letter-spacing: 1px;
  color: #fff;
  background: var(--c);
  padding: 0 6px;
  margin-bottom: 2px;
}
.ub {
  flex: none;
  min-width: 132px;
  height: 40px;
  padding: 0 6px;
  border: 20px solid transparent;
  border-image: url(art/menus/p-btn-buy.png) 4 fill / 20px stretch;
  image-rendering: pixelated;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 400 20px var(--pixel);
  color: #fff;
  text-shadow: 0 2px 0 rgb(0 0 0 / 0.4);
  white-space: nowrap;
}
.ub:hover:not(:disabled) {
  filter: brightness(1.1);
}
.ub:active:not(:disabled) {
  translate: 0 2px;
}
.ub.no,
.ub.lock {
  border-image-source: url(art/menus/p-btn-no.png);
}
.ub.lock {
  opacity: 0.8;
  cursor: default;
}
.ub.max {
  border-image-source: url(art/menus/p-btn-max.png);
  font-family: var(--font);
  font-weight: 700;
  cursor: default;
}
.ugrid .unext {
  grid-row: span 2;
  text-align: left;
  cursor: pointer;
  --c: #ffd66b;
  background: #2a2c33;
  color: #f4efe2;
  padding: 14px 18px;
}
.unext > div {
  flex: 1;
  display: grid;
  gap: 8px;
  justify-items: start;
}
.unext .ut {
  color: #23201c;
  font-size: calc(15px * var(--tb, 1));
  padding: 2px 8px;
}
.unext b {
  font-size: 20px;
  line-height: 1.2;
  color: #ffd66b;
}
.unext i {
  color: #9cf0a0;
  font-size: 17px;
}
.xbs {
  justify-self: stretch;
  height: 12px;
  background: #4a4d57;
  box-shadow: 0 0 0 2px #111;
}
.xbs i,
.xpb i,
.tbar i,
.cbar i {
  display: block;
  height: 100%;
}
.xbs i,
.xpb i {
  background: linear-gradient(#8ee07a 0 50%, #4a9c52 50%);
}

/* ---------- stats: a profile, then eight numbers ---------- */
.prof {
  display: grid;
  grid-template-columns: 130px 1fr 300px;
  gap: 22px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 3px dashed #d0c3a0;
  margin-bottom: 18px;
}
.av {
  width: 130px;
  height: 130px;
  position: relative;
  background: radial-gradient(#fff6d0, #f2c95a);
  box-shadow:
    0 0 0 4px #23201c,
    inset 0 0 0 6px #c48a2a;
  overflow: hidden;
}
.av i {
  position: absolute;
  left: -15px;
  top: -38px;
  image-rendering: pixelated;
  background-repeat: no-repeat;
}
.pn b {
  display: block;
  font: 700 34px var(--font);
}
.pn > i {
  font: 400 19px var(--font);
  color: #3f372f;
  font-style: normal;
}
.lvl {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.lb {
  /* the bottom bar's level star, at the stage's 5px pixel */
  position: relative;
  flex: none;
  width: 55px;
  height: 55px;
}
.lb img {
  display: block;
  width: 100%;
  image-rendering: pixelated;
}
.lb b {
  position: absolute;
  left: 50%;
  top: 17px;
  translate: -50% 0;
  font: 400 17px/1 var(--pixel);
  color: #fff;
  text-shadow:
    -3px 0 0 #1a1018,
    3px 0 0 #1a1018,
    0 -3px 0 #1a1018,
    0 3px 0 #1a1018,
    -2px -2px 0 #1a1018,
    2px 2px 0 #1a1018,
    -2px 2px 0 #1a1018,
    2px -2px 0 #1a1018;
}
.xpb {
  flex: 1;
  height: 18px;
  background: #e6dfcc;
  box-shadow: 0 0 0 3px #23201c;
}
.xt {
  font-size: 17px;
  color: #3f372f;
  white-space: nowrap;
}
.pbest {
  display: flex;
  gap: 14px;
  align-items: center;
  background: #fffaf0;
  box-shadow: 0 0 0 3px #23201c;
  padding: 10px 12px;
  min-width: 0;
}
.pbest .bc {
  flex: none;
  width: 76px;
  aspect-ratio: 367 / 512;
  background: #ddd center / cover;
  border-radius: 4px;
  box-shadow:
    0 0 0 2px #23201c,
    0 0 14px 3px rgb(255 200 90 / 0.7);
}
.pbest .bc.empty {
  background: #e6dfcc;
  box-shadow: 0 0 0 2px #23201c;
}
.pbest > div:last-child {
  min-width: 0;
}
.pbest > div > span {
  font: 700 17px var(--font);
  color: #8a293d;
  display: block;
}
.pbest b {
  display: block;
  font: 700 22px var(--font);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* the card's name wraps to two lines rather than losing its end */
.pbest b:not(.num) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  white-space: normal;
  line-height: 1.1;
}
.pbest i {
  display: block;
  font: 400 15px var(--font);
  color: #3f372f;
  font-style: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pbest .g {
  color: #2f7a3a;
  font-size: 22px;
  margin-top: 4px;
}
.sgrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.sk2 {
  background: #fffaf0;
  box-shadow:
    0 0 0 3px #23201c,
    4px 4px 0 3px rgb(60 40 20 / 0.18);
  padding: 10px 14px;
  min-width: 0;
}
.sk2 > span {
  font: 700 calc(17px * var(--tb, 1)) var(--font);
  color: #8a293d;
  display: block;
}
.sk2 b {
  display: block;
  font-size: 32px;
  margin: 4px 0 2px;
  white-space: nowrap;
}
.sk2 i {
  font: 400 calc(17px * var(--tb, 1)) var(--font);
  color: #1f6a2c;
  font-style: normal;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- the index: a ring binder ---------- */
.binder {
  position: absolute;
  z-index: 2;
}
.bpage {
  position: absolute;
  top: 0;
  overflow: hidden;
}
.bpage > img {
  position: absolute;
  top: 0;
  max-width: none;
}
.ribbon {
  position: absolute;
  z-index: 1;
  width: 42px;
  height: 132px;
  cursor: pointer;
  transition: translate 0.15s;
}
.ribbon:hover {
  translate: 0 6px;
}
.pocket {
  position: absolute;
  width: 138px;
  height: 192px;
  background: center / cover;
  border-radius: 6px;
  box-shadow: 0 0 0 2px #1a1018;
  transition:
    translate 0.12s,
    box-shadow 0.12s;
}
button.pocket:hover {
  translate: 0 -4px;
  box-shadow:
    0 0 0 2px #1a1018,
    0 0 0 5px #ffd66b;
}
.pocket.on {
  box-shadow:
    0 0 0 2px #1a1018,
    0 0 0 6px #ffd66b,
    0 0 18px 6px rgb(255 214 107 / 0.6);
}
.pocket.miss::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: url(art/card-back.webp) center / cover;
  filter: grayscale(1) brightness(0.28);
}
.pocket .n {
  position: absolute;
  inset: auto 0 6px;
  text-align: center;
  font-size: 18px;
  color: #9aa0c0;
}
.pocket .cnt {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 1px 6px;
  font-size: 18px;
  line-height: 1.2;
  color: #fff2b0;
  background: #23201c;
  box-shadow: 0 0 0 2px #fff2b0;
}
.pocket .new2 {
  position: absolute;
  left: -6px;
  top: -8px;
  padding: 2px 6px;
  font: 700 calc(15px * var(--tb, 1)) var(--font);
  color: #5c3016;
  background: linear-gradient(#ffe48a 0 50%, #e5a62f 50%);
  box-shadow: 0 0 0 2px #23201c;
  rotate: -8deg;
}
.sheet {
  position: absolute;
  background: #f7f0dc;
  box-shadow:
    0 0 0 3px #23201c,
    inset 0 0 0 6px #efe4c6;
  color: #23201c;
  padding: 20px 22px;
}
.sheet .ch {
  font: 700 30px var(--font);
  letter-spacing: 2px;
  color: #8a293d;
  border-bottom: 3px solid #8a293d;
  margin-bottom: 6px;
  height: 42px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.sheet .ch span {
  font: 400 17px var(--font);
  letter-spacing: 0;
  color: #4a4038;
}
.crow {
  display: flex;
  gap: 14px;
  align-items: center;
  width: 100%;
  height: 118px;
  padding: 0 4px;
  border-bottom: 2px dashed #c9bd9c !important;
  text-align: left;
}
.crow:hover {
  background: #fff5c8;
  box-shadow: 0 0 0 3px #dfab42;
}
.crow .pk {
  width: 48px;
}
.crow.soon > * {
  opacity: 0.5;
}
.crow.soon .pk {
  filter: grayscale(0.8);
}
.crow > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.cn {
  font: 700 26px var(--font);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cm {
  font: 400 19px var(--font);
  color: #3f372f;
  margin: 4px 0 8px;
}
.cm b {
  color: #2f7a3a;
}
.cbar {
  height: 10px;
  background: #d9d2bf;
  box-shadow: 0 0 0 2px #23201c;
}
.cbar i,
.tbar i {
  background: #4a9c52;
}
.cgo {
  font: 400 18px var(--font);
  color: #3f372f;
  align-self: flex-start;
  margin-top: 26px;
}
.sheet .div {
  position: absolute;
  inset: 0;
  color: #fff;
  text-align: center;
  padding: 0 20px;
}
.div .dt {
  font: 700 56px/1.05 var(--font);
  margin-top: 40px;
  text-shadow: 0 4px 0 rgb(0 0 0 / 0.3);
}
.div .dm {
  font: 400 22px var(--font);
  color: rgb(255 255 255 / 0.88);
  margin-top: 6px;
}
.div .pk {
  position: absolute;
  width: 180px;
  left: 50%;
  top: 180px;
  translate: -50% 0;
  filter: drop-shadow(6px 8px 0 rgb(0 0 0 / 0.25));
}
.div .dk {
  position: absolute;
  bottom: 26px;
  left: 0;
  right: 0;
}
.tip {
  position: absolute;
  z-index: 6;
  width: 380px;
  padding: 12px 16px 14px;
  background: #fffaf0;
  box-shadow:
    0 0 0 3px #23201c,
    6px 6px 0 3px rgb(0 0 0 / 0.25);
  font: 400 19px/1.45 var(--font);
}
.tip .g {
  color: #2f7a3a;
}
.tip .tbtns {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}
/* the page arrows sit on the binder's bottom edge, either side of the page hint, clear of the shelf and the
   bottom strip. On the first or last spread the arrow goes dark iron. */
.arrow {
  position: absolute;
  width: 104px;
}
.arrow i {
  display: block;
  width: 104px;
  height: 88px;
  background: url(art/menus/w-arrow-r.png) 0 0 / 100% 100%;
  image-rendering: pixelated;
  filter: drop-shadow(0 7px 0 rgb(0 0 0 / 0.45));
  transition: translate 0.12s;
}
.arrow.l i {
  background-image: url(art/menus/w-arrow-l.png);
}
.arrow:hover:not(.off) i {
  filter: brightness(1.12) drop-shadow(0 7px 0 rgb(0 0 0 / 0.45));
  translate: 8px 0;
}
.arrow.l:hover:not(.off) i {
  translate: -8px 0;
}
.arrow:active:not(.off) i {
  translate: 0 4px;
}
.arrow {
  z-index: 2;
}
.arrow.off {
  cursor: default;
}
.arrow.off i {
  filter: grayscale(1) brightness(0.5) contrast(1.2) drop-shadow(0 7px 0 rgb(0 0 0 / 0.45));
}
.hint {
  position: absolute;
  left: 800px;
  translate: -50% 0;
  font: 700 22px var(--font);
  color: #fff2b0;
  text-shadow: 0 3px 0 #23201c;
  white-space: nowrap;
  pointer-events: none !important;
}
.dots {
  position: absolute;
  left: 800px;
  translate: -50% 0;
  display: flex;
  gap: 12px;
}
.dots button {
  width: 16px;
  height: 16px;
  background: #5c3016 !important;
  box-shadow: 0 0 0 3px #23201c;
}
.dots button.on {
  background: #ffd66b !important;
}
/* the turning page: strips hinged one to the next (see turnTo), and the cover: two faces about the rings */
.mstage .turning {
  position: absolute;
  z-index: 3;
  perspective: 2600px;
  transform-style: preserve-3d;
}
.mstage .strip {
  position: absolute;
  top: 0;
  transform-style: preserve-3d;
  pointer-events: none;
}
.strip > .front,
.strip > .back {
  position: absolute;
  inset: 0;
  overflow: hidden;
  backface-visibility: hidden;
}
.strip > .back {
  transform: rotateY(180deg);
}
.strip .shade {
  position: absolute;
  inset: 0;
  background: #1a1018;
  opacity: 0;
}
.mstage .leaf {
  position: absolute;
  z-index: 4;
  transform-style: preserve-3d;
  pointer-events: none;
}
.leaf > div {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  overflow: hidden;
}
.leaf > .back {
  transform: rotateY(180deg);
}
#scene.m-index.opening .mbody {
  animation: m-rise 0.24s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
@keyframes m-rise {
  from {
    transform: translateY(900px);
  }
}

/* ---------- licenses: the shop tablet, PokéMart Wholesale ---------- */
.tablet {
  position: absolute;
  left: 70px;
  top: 48px;
  width: 1460px;
  height: 840px;
  transform-origin: 50% 100%;
}
.tablet > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.scr {
  position: absolute;
  left: 70px;
  top: 65px;
  width: 1320px;
  height: 710px;
  overflow: hidden;
  background: #0c1210;
}
.web {
  position: absolute;
  inset: 0;
  background: #f4efe2;
  color: #23201c;
  font: 400 17px var(--font);
}
#scene.opening .tablet {
  animation: m-slide 0.36s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
#scene.opening .web {
  animation: m-wake 0.28s 0.24s ease-out both;
}
#scene.closing .tablet {
  animation: m-slide 0.3s cubic-bezier(0.5, 0, 0.8, 0.4) reverse both;
}
@keyframes m-slide {
  from {
    transform: translateY(900px) perspective(2400px) rotateX(14deg);
  }
}
@keyframes m-wake {
  from {
    opacity: 0;
    scale: 0.97;
  }
}
.web .head {
  height: 62px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  background: #c0323b;
}
.web .logo {
  white-space: nowrap;
  font: 700 26px var(--font);
  color: #fff;
  margin-right: 12px;
  text-shadow: 0 2px 0 #6e1626;
}
.web .logo b {
  color: #ffd66b;
}
.ec {
  white-space: nowrap;
  font: 700 16px var(--font) !important;
  color: #fff !important;
  padding: 6px 10px !important;
  background: #94232f !important;
  box-shadow: 0 0 0 2px #6e1626;
}
.ec:hover {
  background: #a82b38 !important;
}
.ec.on {
  background: #ffd66b !important;
  color: #5c3016 !important;
}
.web .lic {
  white-space: nowrap;
  margin-left: auto;
  color: #ffd66b;
  font: 700 18px var(--font);
}
.web .pane {
  position: absolute;
  left: 0;
  right: 0;
  top: 62px;
  bottom: 44px;
  overflow: hidden;
}
.web .grid {
  position: absolute;
  inset: 8px 10px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 8px;
}
.web .grid.slider {
  animation: m-from-r 0.28s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.web .grid.slidel {
  animation: m-from-l 0.28s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes m-from-r {
  from {
    transform: translateX(120px);
    opacity: 0;
  }
}
@keyframes m-from-l {
  from {
    transform: translateX(-120px);
    opacity: 0;
  }
}
.tile {
  position: relative;
  min-width: 0;
  background: #fffaf0;
  box-shadow:
    0 0 0 2px #23201c,
    3px 3px 0 2px rgb(0 0 0 / 0.15);
  padding: 8px 8px 8px 72px;
  overflow: hidden;
}
.tile.own {
  background: #eef7e6;
}
.tile.next {
  background: #fff5c8;
  box-shadow:
    0 0 0 2px #23201c,
    0 0 0 5px #dfab42,
    3px 3px 0 5px rgb(0 0 0 / 0.15);
  z-index: 1;
}
.tile.lock > :not(.tb) {
  opacity: 0.55;
}
.tile .pk {
  position: absolute;
  left: 8px;
  top: 50%;
  translate: 0 -50%;
  width: 56px;
}
.tile .tn {
  font: 700 18px/1.1 var(--font);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.tile .tm {
  font: 400 17px var(--font);
  line-height: 1.4;
  white-space: nowrap;
  color: #1f1a16;
}
.tile .tm.ok {
  display: flex;
  justify-content: space-between;
  color: #2f7a3a;
  font-weight: 700;
  font-size: 15px;
}
.tbar {
  height: 6px;
  background: #d9d2bf;
  margin: 4px 0 2px;
}
.tile .tb {
  position: absolute;
  left: 72px;
  right: 6px;
  bottom: 6px;
  text-align: center;
  font: 700 calc(14px * var(--tb, 1)) var(--font);
  padding: 4px 0;
  color: #5c3016;
  background: linear-gradient(#ffe48a 0 50%, #e5a62f 50%);
  box-shadow: 0 0 0 2px #23201c;
}
.tile .tb:hover:not(:disabled) {
  filter: brightness(1.08);
}
/* licensed: on the shelf already, or a tap puts it there */
.tile .tb.on {
  background: #cfe8c8;
  color: #2f6a35;
  cursor: default;
}
/* the next set, once all three gates are met */
.tile .tb.buy {
  color: #fff;
  background: linear-gradient(#6ed06a 0 50%, #3f9a45 50%);
  text-shadow: 0 1px 0 rgb(0 0 0 / 0.35);
  animation: tb-glow 1.2s ease-in-out infinite alternate;
}
@keyframes tb-glow {
  to {
    box-shadow:
      0 0 0 2px #23201c,
      0 0 12px 3px rgb(255 214 107 / 0.9);
  }
}
/* the next set's three gates: level, Index, coins; green once met */
.tile .gts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 6px;
  margin-top: 4px;
}
.tile .gt {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 1px 5px;
  font: 700 calc(14px * var(--tb, 1)) var(--font);
  background: #e6dfcc;
  color: #6f665a;
  box-shadow: 0 0 0 2px #23201c;
  white-space: nowrap;
}
.tile .gt.ok {
  background: #cfe8c4;
  color: #2f7a3a;
}
.tile .gt .ico {
  height: 14px;
  image-rendering: pixelated;
}
.tile .tb.off {
  background: #d9d2bf;
  color: #6f665a;
  cursor: default;
}
.web .foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #e6dfcc;
}
.web .pg {
  font: 400 18px var(--pixel);
  min-width: 30px;
  padding: 2px 9px;
  background: #fffaf0;
  box-shadow: 0 0 0 2px #23201c;
}
.web .pg.on {
  background: #c0323b;
  color: #fff;
}
.web .pg:disabled {
  opacity: 0.4;
  cursor: default;
}
.web .gap {
  padding: 0 2px;
}
.web .show {
  margin-left: 18px;
  font-size: 17px;
  color: #3f372f;
}

/* ---------- settings: a framed card in the middle of the room, one row a setting ---------- */
/* Every row is the same: the setting and a line about it on the left, and on the right one bar of fixed size with
   every choice on it, the chosen one lit green. */
.setp {
  padding: 6px 10px 0;
  color: #23201c;
}
.setp .tg {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  height: 84px;
  border-bottom: 3px dashed #d9cba6;
}
.setp .tg > span {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.setp .tg b {
  font: 700 26px var(--font);
  white-space: nowrap;
}
.setp .tg i {
  font: 400 calc(17px * var(--tb, 1)) var(--font);
  font-style: normal;
  color: #7a6a52;
}
.setp .seg {
  flex: none;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  width: 384px;
  height: 46px;
  background: #23201c;
  gap: 3px;
  padding: 3px;
}
.setp .seg button {
  font: 400 15px var(--pixel);
  color: #5a4c38;
  background: #efe6cf !important;
  white-space: nowrap;
}
.setp .seg button:hover:not(:disabled):not(.on) {
  background: #fff8e2 !important;
  color: #23201c;
}
.setp .seg button.on {
  color: #f4efe2;
  background: #4a9c52 !important;
  text-shadow: 0 2px 0 rgb(0 0 0 / 0.35);
  cursor: default;
}
.setp .seg.off button {
  opacity: 0.45;
  cursor: not-allowed;
}
.setp .credit {
  margin: 12px 0 4px;
  font: 400 calc(14px * var(--tb, 1))/1.35 var(--font);
  color: #8f7a5c;
}

/* ---------- level rewards: where you are, then the levels round it, what each pays and unlocks ---------- */
.lvhead {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: center;
  padding: 4px 6px 18px;
  border-bottom: 3px dashed #d0c3a0;
}
.lvhead > div {
  display: grid;
  gap: 8px;
}
.lvhead b {
  font: 700 28px var(--font);
}
.lvhead i {
  font: 400 calc(17px * var(--tb, 1)) var(--font);
  font-style: normal;
  color: #5c4a36;
}
.lvb {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  min-width: 92px;
  padding: 8px 10px 5px;
  background: linear-gradient(#ffe48a 0 45%, #f0b93f 45% 85%, #c98a2a 85%);
  box-shadow:
    0 0 0 3px #23201c,
    inset 0 3px 0 #fff6c8;
}
.lvb i {
  font: 700 16px var(--font);
  font-style: normal;
  color: #5c3016;
}
.lvb b {
  font: 400 28px var(--pixel) !important;
  color: #3a1d0c;
}
.lv.got .lvb {
  filter: saturate(0.4) brightness(0.92);
}
.lvb.big {
  min-width: 120px;
  padding: 14px 14px 10px;
}
.lvb.big b {
  font-size: 44px !important;
}
.lvlist {
  display: grid;
  gap: 8px;
  padding: 16px 4px 4px;
}
.lv {
  display: grid;
  grid-template-columns: 92px 120px 1fr 150px;
  gap: 18px;
  align-items: center;
  min-height: 54px;
  padding: 0 14px 0 8px;
  background: #fffaf0;
  box-shadow:
    0 0 0 3px #23201c,
    4px 4px 0 3px rgb(60 40 20 / 0.18);
}
.lv.got {
  background: #ece4d0;
}
.lv.got .lvu,
.lv.got .lvc {
  opacity: 0.55;
}
.lv.next {
  background: #fff2b0;
  box-shadow:
    0 0 0 3px #23201c,
    0 0 0 7px #ffd66b;
}
.lvc {
  font: 400 21px var(--pixel);
  color: #2f7a3a;
}
.lvu {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.lvu em,
.lvkey em {
  font: 700 17px var(--font);
  font-style: normal;
  padding: 3px 8px;
  color: #fff;
  box-shadow: 0 0 0 2px #23201c;
}
/* new upgrades in orange with a ▲, new set licenses in blue with a pack icon's ▣ */
.lvu em.upgrade,
.lvkey em.upgrade {
  background: #d9701f;
}
.lvu em.upgrade::before,
.lvkey em.upgrade::before {
  content: "▲ ";
  font-size: 13px;
}
.lvu em.license,
.lvkey em.license {
  background: #2c6fd1;
}
.lvu em.license::before,
.lvkey em.license::before {
  content: "▣ ";
  font-size: 14px;
}
.lvkey {
  display: flex;
  gap: 12px;
}
.lvkey em {
  font-size: 15px;
  padding: 2px 8px;
}
.lvu em.k {
  color: #8f7a5c;
  background: none;
  box-shadow: none;
  font-weight: 400;
  padding: 3px 0;
}
.lvs {
  justify-self: end;
  font: 700 18px var(--font);
  color: #5c4a36;
  white-space: nowrap;
}
.lv.got .lvs {
  font-size: 26px;
  color: #4a9c52;
}

/* only the paper turns: the binder's cover art stays behind */
.strip .bpage > img {
  visibility: hidden;
}
