:root {
  --cream: #fff8ee;
  --cream-2: #ffeeda;
  --brown: #7a4634;
  --brown-soft: #a8705a;
  --gold-1: #fff0bf;
  --gold-2: #f3bd58;
  --gold-3: #dd9632;
  --pink: #ff8fb8;
  --mint: #7ed192;
  --shadow: rgba(132, 66, 40, .28);
  --font: 'Fredoka', ui-rounded, 'SF Pro Rounded', 'Arial Rounded MT Bold', 'Nunito', system-ui, sans-serif;
  --fw-med: 500;
  --fw-semi: 600;
  --fw-bold: 700;
  /* Notch / home-indicator insets. tools/iphone.html overrides these to preview an iPhone on desktop. */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}
/* Fredoka has no Cyrillic: Russian uses Nunito, one step heavier so it reads just as chunky. */
html[lang="ru"] {
  --font: 'Nunito', ui-rounded, 'SF Pro Rounded', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --fw-med: 700;
  --fw-semi: 800;
  --fw-bold: 900;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #f3c3ad;
  color: var(--brown);
  font-family: var(--font);
  font-weight: var(--fw-semi);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  overscroll-behavior: none;
}

body { position: fixed; inset: 0; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
img { -webkit-user-drag: none; user-select: none; }

/* Invisible element whose padding lets JS read the safe-area insets in px. */
#safe-probe {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  visibility: hidden;
  pointer-events: none;
}

#bg, #fx { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#bg { z-index: 0; }
#fx { z-index: 5; pointer-events: none; }
#field, #fly { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#field { z-index: 3; }
#fly { z-index: 4; }

/* ───────────────────────── HUD layout ───────────────────────── */

#hud {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template:
    "coins tools" auto
    "orders orders" auto
    "stage stage" 1fr
    "shop shop" auto / 1fr auto;
  gap: .55rem;
  padding:
    calc(.65rem + var(--safe-top))
    calc(.65rem + var(--safe-right))
    calc(.8rem + var(--safe-bottom))
    calc(.65rem + var(--safe-left));
  pointer-events: none;
}
#hud > * { pointer-events: auto; min-width: 0; }
#coins { grid-area: coins; justify-self: start; }
#tools { grid-area: tools; display: flex; gap: .45rem; align-items: center; justify-self: end; }
#orders { grid-area: orders; }
#stage { grid-area: stage; pointer-events: none !important; position: relative; }
#shop { grid-area: shop; }

body.landscape #hud {
  grid-template:
    "coins stage tools" auto
    "orders stage shop" 1fr / 8.4rem 1fr 10.4rem;
  column-gap: .6rem;
}

/* ───────────────────────── Coins ───────────────────────── */

.coin {
  display: inline-block;
  width: 1.9rem;
  height: 1.9rem;
  flex: none;
  background: url(../img/coin.svg) center / contain no-repeat;
  filter: drop-shadow(0 .08rem .08rem rgba(120, 60, 10, .35));
}
.coin.sm { width: 1.15rem; height: 1.15rem; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  height: 2.6rem;
  min-width: 6.2rem;
  padding: 0 1rem 0 .3rem;
  border: .18rem solid transparent;
  border-radius: 99rem;
  background:
    linear-gradient(#fffdf8, #ffe9cf) padding-box,
    linear-gradient(var(--gold-1), var(--gold-3)) border-box;
  box-shadow: 0 .22rem .6rem var(--shadow), inset 0 .12rem 0 #fff;
  font-size: 1.4rem;
  font-weight: var(--fw-bold);
  line-height: 1;
}

/* ───────────────────────── Tool buttons ───────────────────────── */

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  height: 2.6rem;
  padding: 0 .75rem 0 .5rem;
  border: .18rem solid transparent;
  border-radius: 99rem;
  background:
    linear-gradient(#ffa9c9, #f77fae) padding-box,
    linear-gradient(#fff, #ffd3e3) border-box;
  box-shadow: 0 .22rem .6rem var(--shadow), inset 0 .14rem .1rem rgba(255, 255, 255, .55), inset 0 -.2rem .3rem rgba(180, 40, 100, .18);
  color: #fff;
  font-size: 1rem;
  font-weight: var(--fw-bold);
  text-shadow: 0 .08rem 0 rgba(170, 50, 100, .55);
  transition: transform .12s;
}
.tool-btn:active { transform: scale(.94); }
.tool-btn svg { width: 1.5rem; height: 1.5rem; flex: none; }
.tool-btn b { font-size: .78rem; padding: .16rem .42rem; border-radius: 99rem; background: rgba(255, 255, 255, .9); color: #e2578f; text-shadow: none; }
.tool-btn.round { width: 2.6rem; padding: 0; justify-content: center; background: linear-gradient(#c8b3f2, #a88be6) padding-box, linear-gradient(#fff, #e2d6ff) border-box; text-shadow: none; }
body.landscape .tool-label { display: none; }

/* ───────────────────────── Order (single shared card) ───────────────────────── */

#orders { display: flex; align-items: flex-start; padding-top: .35rem; }

.order {
  position: relative;
  width: 100%;
  min-height: 5.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .7rem .8rem .5rem;
  border: .16rem solid #f6d3ab;
  border-radius: 1.1rem;
  background: linear-gradient(#fffcf6, #ffeeda);
  box-shadow: 0 .22rem .6rem var(--shadow), inset 0 .12rem 0 #fff;
}
.order.locked, .order.waiting { min-height: 3.1rem; background: linear-gradient(rgba(255, 252, 246, .88), rgba(255, 238, 218, .88)); }
body.landscape .order { flex-direction: column; align-items: stretch; gap: .45rem; padding: .85rem .5rem .55rem; }

.order-tag {
  position: absolute;
  left: .8rem;
  top: -.6rem;
  padding: .12rem .6rem;
  border-radius: 99rem;
  background: linear-gradient(#ffa9c9, #f77fae);
  box-shadow: 0 .1rem .25rem rgba(190, 60, 110, .35), inset 0 .08rem 0 rgba(255, 255, 255, .5);
  color: #fff;
  font-size: .7rem;
  font-weight: var(--fw-bold);
  letter-spacing: .07em;
  line-height: 1.2;
  text-transform: uppercase;
}

.order-msg { flex: 1; display: flex; align-items: center; justify-content: center; gap: .45rem; color: var(--brown-soft); font-size: .95rem; font-weight: var(--fw-semi); text-align: center; line-height: 1.15; }
.order-msg svg { width: 1.3rem; height: 1.3rem; flex: none; opacity: .75; }
.order-msg b { color: var(--brown); font-variant-numeric: tabular-nums; }

.order-goals { display: flex; align-items: center; gap: .55rem; min-width: 0; padding-bottom: .45rem; }
body.landscape .order-goals { flex-direction: column; gap: .85rem; }
.goal {
  position: relative;
  flex: none;
  width: 3.7rem;
  height: 3.7rem;
  display: grid;
  place-items: center;
  border-radius: 1.05rem;
  background: #fbe1cb;
  box-shadow: inset 0 .08rem .14rem rgba(150, 80, 50, .22);
  transition: background .2s, box-shadow .2s;
}
.goal img { width: 3.35rem; height: 3.35rem; object-fit: contain; filter: drop-shadow(0 .1rem .1rem rgba(90, 40, 20, .28)); }
.goal-count {
  position: absolute;
  left: 50%;
  bottom: -.5rem;
  transform: translateX(-50%);
  padding: .08rem .45rem;
  border-radius: 99rem;
  background: #fff;
  box-shadow: 0 .08rem .22rem rgba(120, 60, 40, .35);
  font-size: .78rem;
  font-weight: var(--fw-semi);
  line-height: 1.15;
  white-space: nowrap;
  transition: background .2s, color .2s;
}
.goal-count b { font-size: .95rem; font-weight: var(--fw-bold); }
.goal.done { background: #d5f2d3; box-shadow: inset 0 0 0 .12rem #7ed192; }
.goal.done .goal-count { background: #4fbf6c; color: #fff; }
.goal.done::after {
  content: '';
  position: absolute;
  right: -.28rem;
  top: -.28rem;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: #4fbf6c url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 8.4 2.7 2.6L12 5.4' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat;
  box-shadow: 0 0 0 .1rem #fff;
}

.order-side { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; min-width: 4.4rem; }
.order-reward { display: flex; align-items: center; gap: .22rem; font-size: 1.05rem; font-weight: var(--fw-bold); line-height: 1; }

.claim {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .18rem;
  min-width: 6.6rem;
  height: 4.1rem;
  padding: 0 1rem;
  border: .2rem solid transparent;
  border-radius: 1.4rem;
  background:
    linear-gradient(#9be3a6 0%, #66c47e 48%, #4aa866 100%) padding-box,
    linear-gradient(#fff3c8, var(--gold-2) 55%, var(--gold-3)) border-box;
  box-shadow: 0 .25rem .5rem rgba(60, 110, 60, .4), 0 .1rem 0 #c98a36, inset 0 .22rem .18rem rgba(255, 255, 255, .55), inset 0 -.4rem .5rem rgba(20, 90, 40, .18);
  color: #fff;
  line-height: 1;
  text-shadow: 0 .1rem 0 rgba(38, 105, 58, .75);
  animation: claimBounce .7s ease-in-out infinite alternate;
}
.claim-label { font-size: 1.2rem; font-weight: var(--fw-bold); }
.claim-reward { display: flex; align-items: center; gap: .25rem; font-size: 1.3rem; font-weight: var(--fw-bold); }
.claim-reward .coin { width: 1.4rem; height: 1.4rem; }
body.landscape .claim { width: 100%; min-width: 0; padding: 0 .4rem; }
.order.ready { border-color: #ffc94d; animation: readyGlow .8s ease-in-out infinite alternate; }
.order.ready .claim { display: flex; }
.order.ready .order-reward { display: none; }

@keyframes readyGlow {
  from { box-shadow: 0 .22rem .6rem var(--shadow), 0 0 0 0 rgba(255, 201, 77, 0), inset 0 .12rem 0 #fff; background: linear-gradient(#fffcf6, #ffeeda); }
  to { box-shadow: 0 .22rem .6rem var(--shadow), 0 0 1rem .25rem rgba(255, 201, 77, .9), inset 0 .12rem 0 #fff; background: linear-gradient(#fffdf2, #fff0bf); }
}
@keyframes claimBounce { from { transform: scale(1); } to { transform: scale(1.07); } }

/* ───────────────────────── Shop buttons ───────────────────────── */

#shop { display: flex; gap: .9rem; justify-content: center; align-items: flex-end; padding-top: 4.3rem; }
body.landscape #shop { flex-direction: column; align-items: stretch; align-self: end; gap: 4.4rem; padding-top: 4.3rem; }

.shop-btn {
  position: relative;
  flex: 1 1 0;
  max-width: 13rem;
  height: 5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .12rem;
  padding-top: .35rem;
  border: .32rem solid transparent;
  border-radius: 99rem;
  box-shadow:
    0 .5rem 1rem rgba(120, 58, 30, .32),
    0 .12rem 0 #c98a36,
    inset 0 .3rem .25rem rgba(255, 255, 255, .5),
    inset 0 -.55rem .7rem rgba(0, 0, 0, .13);
  color: #fff;
  line-height: 1;
  transition: transform .1s, filter .2s;
}
body.landscape .shop-btn { flex: none; max-width: none; width: 100%; }
.shop-btn.green { background: linear-gradient(#9be3a6 0%, #66c47e 48%, #4aa866 100%) padding-box, linear-gradient(#fff3c8, var(--gold-2) 55%, var(--gold-3)) border-box; --ink: rgba(38, 105, 58, .75); }
.shop-btn.purple { background: linear-gradient(#d9b8f3 0%, #b78be4 48%, #9c6ed3 100%) padding-box, linear-gradient(#fff3c8, var(--gold-2) 55%, var(--gold-3)) border-box; --ink: rgba(96, 52, 150, .75); }
.shop-btn::before {
  content: '';
  position: absolute;
  left: 7%;
  right: 7%;
  top: 5%;
  height: 40%;
  border-radius: 99rem;
  background: linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.shop-btn:active { transform: translateY(.14rem) scale(.97); }
.shop-btn.disabled { filter: saturate(.25) brightness(1.02); }
.shop-btn.shake, .pill.shake { animation: shake .36s; }
@keyframes shake { 20% { transform: translateX(-.4rem); } 45% { transform: translateX(.35rem); } 70% { transform: translateX(-.2rem); } 90% { transform: translateX(.1rem); } }

.shop-char { position: absolute; left: 50%; bottom: calc(100% - 1rem); width: 5.2rem; height: 5.2rem; margin-left: -2.6rem; pointer-events: none; }
.shop-char img { width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; transform-origin: 50% 100%; filter: drop-shadow(0 .22rem .2rem rgba(90, 40, 20, .35)); }
.shop-main { position: relative; display: flex; align-items: center; gap: .4rem; font-size: 1.9rem; font-weight: var(--fw-bold); text-shadow: 0 .12rem 0 var(--ink), 0 .1rem .4rem rgba(0, 0, 0, .18); }
.shop-main .coin { width: 2rem; height: 2rem; }
.shop-main .film { width: 2.3rem; height: 1.8rem; filter: drop-shadow(0 .08rem .08rem rgba(60, 20, 110, .4)); }
.shop-sub { position: relative; font-size: 1.02rem; font-weight: var(--fw-semi); text-shadow: 0 .09rem 0 var(--ink); }
html[lang="ru"] #btn-ad .shop-main { font-size: 1.3rem; gap: .3rem; }
html[lang="ru"] #btn-ad .film { width: 2rem; height: 1.55rem; }
html[lang="ru"] body.landscape #btn-ad .shop-main { font-size: 1.05rem; }
html[lang="ru"] body.landscape #btn-ad .film { width: 1.7rem; height: 1.3rem; }
.shop-btn.attention { animation: attention 1.1s ease-in-out infinite; }
@keyframes attention { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.055); } }

/* ───────────────────────── Field items ───────────────────────── */

.item { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform; }
.item-body {
  position: absolute;
  left: calc(var(--s) / -2);
  top: calc(var(--s) * -1);
  width: var(--s);
  height: var(--s);
  transform-origin: 50% 100%;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
}
.item-body img { width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; transform-origin: 50% 100%; pointer-events: none; display: block; }
.item-shadow {
  position: absolute;
  left: calc(var(--s) * -.38);
  top: calc(var(--s) * -.1);
  width: calc(var(--s) * .76);
  height: calc(var(--s) * .2);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(126, 64, 48, .42), rgba(126, 64, 48, .16) 60%, rgba(126, 64, 48, 0));
  pointer-events: none;
}
.item.dragging .item-body { cursor: grabbing; }
.item.dragging img { filter: drop-shadow(0 .5rem .45rem rgba(90, 40, 20, .28)); }
.item.candidate img { animation: candidate .7s ease-in-out infinite alternate; }
.item.hover img { animation: none; filter: drop-shadow(0 0 .25rem #fff) drop-shadow(0 0 .8rem #ffb52e) brightness(1.08); }
@keyframes candidate {
  from { filter: drop-shadow(0 0 .12rem #fff) drop-shadow(0 0 .25rem #ffd66b); }
  to { filter: drop-shadow(0 0 .28rem #fff) drop-shadow(0 0 .8rem #ffb52e); }
}

.flyer { position: absolute; left: 0; top: 0; object-fit: contain; object-position: 50% 100%; pointer-events: none; will-change: transform; }
.float {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: .15rem;
  color: #fff;
  font-size: 1.3rem;
  font-weight: var(--fw-bold);
  line-height: 1;
  white-space: nowrap;
  -webkit-text-stroke: .28rem #b3701c;
  paint-order: stroke fill;
  text-shadow: 0 .12rem 0 #94590f;
  pointer-events: none;
  will-change: transform;
}
.coin.fly { position: absolute; left: 0; top: 0; width: 1.7rem; height: 1.7rem; margin: -.85rem 0 0 -.85rem; pointer-events: none; will-change: transform; }

#toast {
  position: absolute;
  left: 50%;
  bottom: .2rem;
  transform: translateX(-50%);
  padding: .45rem 1rem;
  border-radius: 99rem;
  background: rgba(122, 70, 52, .9);
  color: #fff;
  font-size: 1rem;
  white-space: nowrap;
  box-shadow: 0 .25rem .7rem rgba(90, 40, 20, .35);
  opacity: 0;
  visibility: hidden;
  z-index: 9;
}

/* ───────────────────────── Overlays ───────────────────────── */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(1rem + var(--safe-top))
    calc(1rem + var(--safe-right))
    calc(1rem + var(--safe-bottom))
    calc(1rem + var(--safe-left));
  background: rgba(86, 44, 58, .55);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}
.overlay[hidden], #reveal[hidden] { display: none; }

.panel {
  width: min(100%, 46rem);
  height: min(100%, 52rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: .28rem solid #fff;
  border-radius: 1.7rem;
  background: linear-gradient(#fff9f0, #ffeedb);
  box-shadow: 0 1rem 3rem rgba(70, 30, 40, .45), inset 0 0 0 .14rem #f8d9b7;
}
.panel-head { display: flex; align-items: center; gap: .8rem; padding: .9rem 1rem .7rem 1.2rem; }
.panel-head h2 { margin: 0; font-size: 1.6rem; font-weight: var(--fw-bold); }
.panel-head b { font-size: 1rem; white-space: nowrap; }
.progress { flex: 1; height: .95rem; border-radius: 99rem; background: #f6dcc6; overflow: hidden; box-shadow: inset 0 .1rem .16rem rgba(150, 80, 50, .25); }
.progress i { display: block; height: 100%; min-width: .95rem; border-radius: 99rem; background: linear-gradient(90deg, #ff9ec4, #ffc56e); }
.close { width: 2.5rem; height: 2.5rem; flex: none; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(#ff9dbf, #f2709f); box-shadow: 0 .18rem .4rem rgba(190, 60, 110, .4), inset 0 .12rem .1rem rgba(255, 255, 255, .5); }
.close svg { width: 1.3rem; height: 1.3rem; }
.close:active { transform: scale(.92); }

.grid {
  flex: 1;
  overflow-y: auto;
  padding: .3rem 1rem 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.7rem, 1fr));
  gap: .6rem;
  align-content: start;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.card {
  position: relative;
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: .3rem;
  border: .17rem solid transparent;
  border-radius: 1rem;
  background:
    linear-gradient(165deg, var(--c2), #fff 62%) padding-box,
    linear-gradient(165deg, var(--c1), var(--c2)) border-box;
  box-shadow: 0 .18rem .4rem rgba(140, 70, 40, .2);
}
.card img { position: absolute; left: 10%; top: 17%; width: 80%; height: 58%; object-fit: contain; filter: drop-shadow(0 .14rem .14rem rgba(90, 40, 20, .25)); }
.card .num { position: absolute; top: .22rem; left: .32rem; padding: .08rem .34rem; border-radius: 99rem; background: var(--c1); color: #fff; font-size: .68rem; font-weight: var(--fw-bold); }
.card .nm { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .74rem; font-weight: var(--fw-semi); }
.card.locked { background: #f5e3d3; border-color: #ecd2bc; box-shadow: none; }
.card.locked img { filter: brightness(0); opacity: .2; }
.card.locked .num { background: #dcbfa8; }
.card.locked .nm { opacity: .5; }
.panel.small { width: min(100%, 23rem); height: auto; }
.spacer { flex: 1; }
.settings-list { display: flex; flex-direction: column; gap: .6rem; padding: .2rem 1rem 1.2rem; }
.setting {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: 100%;
  min-height: 3.5rem;
  padding: .55rem .8rem;
  border-radius: 1.1rem;
  background: #fff;
  box-shadow: inset 0 0 0 .12rem #f8d9b7, 0 .15rem .3rem rgba(140, 70, 40, .12);
  color: var(--brown);
  font-size: 1.2rem;
  font-weight: var(--fw-semi);
  text-align: left;
}
.setting > svg { width: 1.9rem; height: 1.9rem; flex: none; color: #f2709f; }
.setting > span { flex: 1; min-width: 0; }
.setting[aria-checked="false"] > svg { color: #d9bfae; }
.switch { position: relative; flex: none; width: 3.4rem; height: 1.9rem; border-radius: 99rem; background: #e3cbb9; box-shadow: inset 0 .1rem .2rem rgba(120, 60, 40, .3); transition: background .2s; }
.switch::after { content: ''; position: absolute; left: .2rem; top: .2rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #fff; box-shadow: 0 .1rem .25rem rgba(90, 40, 20, .35); transition: transform .22s cubic-bezier(.3, 1.5, .6, 1); }
.setting[aria-checked="true"] .switch { background: linear-gradient(#93e0a0, #4fb46c); }
.setting[aria-checked="true"] .switch::after { transform: translateX(1.5rem); }
.segmented { flex: none; display: flex; padding: .16rem; border-radius: 99rem; background: #f6dcc6; box-shadow: inset 0 .1rem .2rem rgba(120, 60, 40, .22); }
.segmented button { padding: .34rem .6rem; border-radius: 99rem; color: var(--brown-soft); font-size: .9rem; font-weight: var(--fw-semi); line-height: 1.1; white-space: nowrap; transition: background .2s, color .2s; }
.segmented button[aria-checked="true"] { background: linear-gradient(#ffa9c9, #f77fae); color: #fff; box-shadow: 0 .1rem .25rem rgba(190, 60, 110, .35); }

.setting.danger { color: #c9414f; }
.setting.danger > svg { color: #e5606d; }
.panel.confirm { padding: 1.4rem 1.2rem 1.2rem; text-align: center; }
.confirm h2 { margin: 0 0 .5rem; font-size: 1.5rem; font-weight: var(--fw-bold); }
.confirm p { margin: 0 0 1.2rem; color: var(--brown-soft); font-size: 1rem; font-weight: var(--fw-med); line-height: 1.3; }
.confirm-actions { display: flex; gap: .7rem; }
.btn {
  flex: 1 1 0;
  height: 3.1rem;
  border: .18rem solid transparent;
  border-radius: 99rem;
  background: linear-gradient(#fffdf8, #ffe9cf) padding-box, linear-gradient(var(--gold-1), var(--gold-3)) border-box;
  box-shadow: 0 .2rem .45rem var(--shadow), inset 0 .12rem 0 #fff;
  color: var(--brown);
  font-size: 1.15rem;
  font-weight: var(--fw-bold);
  transition: transform .1s;
}
.btn:active { transform: scale(.95); }
.btn.danger {
  background: linear-gradient(#ff9b9b, #ea5567) padding-box, linear-gradient(#fff, #ffd0d0) border-box;
  box-shadow: 0 .2rem .45rem rgba(190, 50, 70, .4), inset 0 .14rem .1rem rgba(255, 255, 255, .5);
  color: #fff;
  text-shadow: 0 .08rem 0 rgba(160, 30, 50, .6);
}

.ad-card { width: min(100%, 22rem); padding: 1.6rem 1.4rem; border-radius: 1.5rem; border: .25rem solid #fff; background: linear-gradient(#fff9f0, #ffeedb); text-align: center; box-shadow: 0 1rem 3rem rgba(70, 30, 40, .45); }
.ad-title { font-size: 1.6rem; font-weight: var(--fw-bold); }
.ad-note { margin: .4rem 0 1.1rem; font-size: .95rem; font-weight: var(--fw-med); color: var(--brown-soft); }
.ad-bar { height: 1rem; border-radius: 99rem; background: #f6dcc6; overflow: hidden; }
.ad-bar i { display: block; height: 100%; border-radius: 99rem; background: linear-gradient(90deg, #c8a3f0, #9c6ed3); transform-origin: 0 50%; }

/* ───────────────────────── Discovery reveal ───────────────────────── */

#reveal { position: absolute; inset: 0; z-index: 20; overflow: hidden; cursor: pointer; }
#rv-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rv-top, .rv-bottom { position: absolute; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; pointer-events: none; padding: 0 1rem; }
.rv-bottom { gap: .55rem; }

.rv-ribbon {
  padding: .5rem 1.5rem;
  border: .2rem solid transparent;
  border-radius: 99rem;
  background: linear-gradient(#ff9fc5, #f2659b) padding-box, linear-gradient(#fff6cf, #f3bd58) border-box;
  box-shadow: 0 .3rem 1rem rgba(60, 10, 50, .5), inset 0 .16rem .1rem rgba(255, 255, 255, .55);
  color: #fff;
  font-size: 1.25rem;
  font-weight: var(--fw-bold);
  letter-spacing: .08em;
  text-transform: uppercase;
  text-shadow: 0 .1rem 0 rgba(170, 40, 100, .7);
  white-space: nowrap;
}
.rv-name {
  display: flex;
  color: #fff;
  font-size: 2.9rem;
  font-weight: var(--fw-bold);
  line-height: 1.05;
  -webkit-text-stroke: .38rem #a13a82;
  paint-order: stroke fill;
  text-shadow: 0 .22rem 0 #7b2a66, 0 .3rem 1.2rem rgba(255, 170, 220, .75);
}
.rv-name span { display: inline-block; }
.rv-meta { display: flex; gap: .5rem; }
.chip { padding: .28rem .85rem; border-radius: 99rem; background: rgba(255, 255, 255, .92); color: #8a3a78; font-size: 1rem; font-weight: var(--fw-bold); box-shadow: 0 .2rem .6rem rgba(40, 10, 40, .35); }
.chip.rarity { color: #fff; background: var(--c1, #6ec6ff); text-shadow: 0 .06rem 0 rgba(0, 0, 0, .22); }
.rv-continue { margin-top: .5rem; color: rgba(255, 255, 255, .85); font-size: 1.05rem; font-weight: var(--fw-med); letter-spacing: .04em; text-shadow: 0 .1rem .5rem rgba(40, 10, 40, .8); }
