/* Polly: playful, bright, big touch targets (SPEC §6). Portrait first; landscape moves tray + tabs into columns. */
:root {
  --bg1: #ffd9ec; --bg2: #e7ecff; --bg3: #fff3d6;
  --ink: #3b2a55; --ink-soft: #7a6896; --card: #fff;
  --accent: #ff5fa8; --accent2: #7b5cff; --mint: #3ad6b5; --gold: #ffc531; --ok: #2ecc71; --no: #ff5d5d;
  --radius: 22px;
  --shadow: 0 6px 18px rgba(110, 60, 170, .18);
  --shadow-sm: 0 3px 8px rgba(110, 60, 170, .16);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", "Quicksand", system-ui, sans-serif;
  --item: 64px;          /* tray item */
  --btn: 52px;           /* round buttons */
  --tab-h: 72px;
  --tray-h: 84px;
  --row-h: 62px;
  --gap: 8px;
  --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px);
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  font-family: var(--font); color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  overscroll-behavior: none; touch-action: manipulation;
}
body {
  background:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.9) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 8%, rgba(255,255,255,.9) 0 2px, transparent 3px),
    radial-gradient(circle at 92% 70%, rgba(255,255,255,.8) 0 2px, transparent 3px),
    linear-gradient(160deg, var(--bg1), var(--bg2) 60%, var(--bg3));
  background-color: var(--bg1);
}
button { font-family: inherit; color: inherit; cursor: pointer; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
button:focus { outline: none; }
button:focus-visible { outline: 4px solid var(--accent2); outline-offset: 2px; }
.hidden { display: none !important; }
.ic { display: block; width: 1em; height: 1em; flex: none; overflow: visible; }
.scroller { scrollbar-width: none; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; }
.scroller::-webkit-scrollbar { display: none; }

/* ---------- round buttons ---------- */
.btn-round {
  flex: none; position: relative;
  width: var(--btn); height: var(--btn);
  border: none; border-radius: 50%; padding: 0;
  background: var(--card); box-shadow: var(--shadow-sm);
  font-size: 30px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .12s ease, background .2s, opacity .2s;
}
.btn-round:active { transform: scale(.94); }
.btn-round:disabled { opacity: .45; box-shadow: none; }
.btn-round.off { background: #eee8f5; }
.btn-round.danger { background: #ffe1e1; }
.bounce { animation: bounce .38s cubic-bezier(.3,1.6,.5,1); }
@keyframes bounce { 0% { transform: scale(.82); } 55% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* ================================================================ layout */
#app {
  position: fixed; inset: 0;
  display: grid;
  grid-template-columns: 100%;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  grid-template-areas: "top" "stage" "row" "tray" "tabs";
}
#topbar {
  grid-area: top;
  display: flex; align-items: center; gap: var(--gap);
  padding: max(6px, var(--st)) max(10px, var(--sr)) 6px max(10px, var(--sl));
  min-height: calc(var(--btn) + 12px);
}
#friends-strip { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 6px; overflow: hidden; }
#online-slot { display: contents; }

#stage {
  grid-area: stage; position: relative; overflow: hidden; min-height: 0;
  margin: 0 max(8px, var(--sr)) 0 max(8px, var(--sl));
  border-radius: 28px;
  box-shadow: var(--shadow), inset 0 0 0 3px rgba(255,255,255,.7);
  background: #ffe3f0;
  isolation: isolate;
}
#stage > svg.nails-hand { z-index: 0; }
.morph-ghost { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; opacity: 1; transition: opacity .38s ease; }
#sel-rings { position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.sel-ring {
  position: absolute; left: 0; top: 0; width: 10px; height: 10px; opacity: 0;
  border-radius: 50% 50% 44% 44% / 34% 34% 22% 22%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px var(--accent2), 0 0 16px 5px rgba(123,92,255,.5);
  transition: opacity .2s;
}
/* The pulse animates only the opacity of a pre-drawn glow (::after) on its own compositor layer: animating
   box-shadow repainted the stage every frame (~2.3 ms native, Gemmy's selected-colour-pulse trap). */
.sel-ring::after {
  content: ""; position: absolute; inset: -3px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 26px 9px rgba(123,92,255,.35); opacity: 0; will-change: opacity;
}
.sel-ring.on { opacity: 1; }
.sel-ring.on::after { animation: ring-pulse 1.4s ease-in-out infinite; }
@keyframes ring-pulse { 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sel-ring.on::after { animation: none; } }
#stage.dragging .sel-ring { opacity: 0; }
#stage.drag-off { box-shadow: var(--shadow), inset 0 0 0 5px rgba(255,93,93,.75); }
.nails-fx { z-index: 2; }
.stage-btn {
  position: absolute; z-index: 3;
  width: 56px; height: 56px; border: none; border-radius: 50%; padding: 0;
  background: rgba(255,255,255,.92); box-shadow: var(--shadow-sm);
  font-size: 32px; display: flex; align-items: center; justify-content: center;
  transition: transform .12s ease, background .2s;
}
.stage-btn:active { transform: scale(.94); }
.stage-btn.on { background: var(--gold); }
#btn-hand { left: 10px; bottom: 10px; }
#btn-zoom { right: 10px; bottom: 10px; }
#btn-myhand { left: 10px; top: 10px; width: 64px; height: 64px; font-size: 36px; box-shadow: 0 0 0 4px var(--frame, var(--accent2)), var(--shadow); animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px); } }
body.external #btn-hand { display: none; }
.flash { position: absolute; inset: 0; background: #fff; z-index: 5; pointer-events: none; animation: flash .5s ease-out forwards; }
@keyframes flash { from { opacity: .95; } to { opacity: 0; } }

/* toasts (wordless) */
#toast-root { position: absolute; inset: 0; pointer-events: none; z-index: 4; display: flex; align-items: center; justify-content: center; }
.toast {
  position: absolute; width: 112px; height: 112px; border-radius: 50%;
  background: rgba(255,255,255,.95); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center; font-size: 64px;
  animation: toast-in .4s cubic-bezier(.2,1.6,.4,1) both;
  transition: opacity .3s, transform .3s;
}
.toast.out { opacity: 0; transform: scale(.7); }
@keyframes toast-in { from { transform: scale(.3); opacity: 0; } }

/* ---------- tool row: per-tab controls + theme chips / pattern colours ---------- */
#toolrow {
  grid-area: row;
  display: flex; align-items: center; gap: var(--gap);
  height: var(--row-h);
  padding: 6px max(10px, var(--sr)) 4px max(10px, var(--sl));
  min-width: 0;
}
#tool-fixed { display: flex; gap: 6px; flex: none; }
#tool-fixed:empty { display: none; }
#tool-scroll { display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; flex: 1; min-width: 0; padding: 7px 7px; margin: -4px 0; align-items: center; }
.tbtn {
  flex: none; position: relative;
  width: 48px; height: 48px; border: none; border-radius: 50%; padding: 0;
  background: var(--card); box-shadow: var(--shadow-sm);
  display: inline-flex; align-items: center; justify-content: center; font-size: 30px;
  transition: transform .12s ease, background .2s, box-shadow .2s;
}
.tbtn:active { transform: scale(.94); }
.tbtn.sel { box-shadow: 0 0 0 4px var(--accent2), var(--shadow-sm); }
.tbtn.all-toggle { width: 56px; border-radius: 18px; background: #f1ecf9; }
.tbtn.all-toggle.sel { background: var(--gold); box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--accent2), var(--shadow-sm); }
.tbtn.shaker { width: 64px; height: 52px; border-radius: 18px; background: #fff3c4; font-size: 38px; }
.tbtn.shaker.shaking .ic { animation: shake .5s ease; }
@keyframes shake { 20% { transform: rotate(-22deg) translateY(-4px); } 45% { transform: rotate(18deg); } 70% { transform: rotate(-12deg) translateY(-2px); } }
.tbtn.size0 { font-size: 18px; } .tbtn.size1 { font-size: 27px; } .tbtn.size2 { font-size: 38px; }
.tbtn.len { border-radius: 16px; width: 44px; }
.tbtn.len svg { height: 40px; width: auto; }
.tbtn.chip { width: 52px; height: 44px; border-radius: 22px; overflow: hidden; }
.tbtn.chip .ic { font-size: 28px; }
.chip-bg { position: absolute; inset: 0; opacity: .35; }
.chip-sym { position: relative; font-size: 30px; display: flex; }
.chip-sym svg { width: 1em; height: 1em; }
.chip-emoji { position: relative; font-size: 24px; line-height: 1; font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif; }
.tbtn.chip.sel { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--accent2), var(--shadow-sm); }
.tbtn.chip.sel .chip-bg { opacity: .8; }
.tbtn.dot-c { width: 44px; height: 44px; }
.cdot { width: 32px; height: 32px; border-radius: 50%; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12), inset 0 0 0 2px rgba(59,42,85,.15); }
.cdot.auto { background: conic-gradient(#ff5d5d, #ffb300, #ffe23f, #4cd964, #3fa9ff, #b07bff, #ff5d5d); }

/* ---------- tray ---------- */
#tray {
  grid-area: tray;
  display: flex; align-items: center; gap: var(--gap);
  height: var(--tray-h);
  margin: 0 max(8px, var(--sr)) 0 max(8px, var(--sl));
  padding: 0 12px;
  overflow-x: auto; overflow-y: hidden;
  background: rgba(255,255,255,.62);
  border-radius: 26px;
  box-shadow: inset 0 2px 6px rgba(110,60,170,.08);
}
.titem {
  flex: none; position: relative;
  width: var(--item); height: var(--item);
  border: none; border-radius: 20px; padding: 0;
  background: var(--card); box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center; font-size: 40px;
  transition: transform .12s ease, box-shadow .2s;
}
.titem:active { transform: scale(.94); }
.titem.sel { box-shadow: 0 0 0 4px var(--accent2), var(--shadow); transform: translateY(-2px); }
.titem.sel:active { transform: scale(.94); }
.titem svg { max-width: 92%; max-height: 92%; }
.titem.wide { width: calc(var(--item) * 1.25); }
.titem.tool { border-radius: 50%; font-size: 44px; }
.titem.tool.warn { background: #fff4e0; }
.titem.busy { opacity: .5; }
.titem.spin .ic { animation: spin .9s cubic-bezier(.3,.7,.4,1); }
@keyframes spin { to { transform: rotate(720deg); } }
.thead {
  flex: none; width: 30px; height: calc(var(--item) - 8px);
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  border-radius: 14px; background: rgba(255,255,255,.55);
  margin-left: 4px;
}
.thead:first-child { margin-left: 0; }
.tsep { flex: none; width: 4px; height: 70%; border-radius: 2px; background: rgba(123,92,255,.25); margin: 0 4px; }

/* ---------- tabs ---------- */
#tabs {
  grid-area: tabs;
  display: flex; align-items: stretch;
  height: calc(var(--tab-h) + var(--sb));
  padding: 6px max(6px, var(--sr)) var(--sb) max(6px, var(--sl));
}
.tab {
  flex: 1 1 0; min-width: 0; position: relative;
  border: none; background: none; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; border-radius: 20px;
  transition: transform .15s ease, background .2s;
}
.tab .ic { transition: transform .2s cubic-bezier(.3,1.6,.5,1); }
.tab:active .ic { transform: scale(.9); }
.tab .dot { position: absolute; bottom: 6px; left: 50%; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: transparent; }
.tab.sel { background: #fff; box-shadow: var(--shadow-sm); }
.tab.sel .ic { transform: translateY(-5px) scale(1.12); }
.tab.sel .dot { background: var(--accent); }

/* ================================================================ cards */
.modal-layer {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(59,42,85,.42);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade-in .2s ease both;
}
.modal-layer.clear { background: transparent; }
.modal-layer.center { align-items: center; padding: 16px; }
.modal-layer.closing { animation: fade-out .2s ease both; }
.modal-layer.closing .sheet { animation: slide-down .2s ease both; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
.sheet {
  position: relative;
  width: min(100%, 600px); max-height: 92%;
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--card);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -8px 40px rgba(60,30,90,.3);
  padding: 16px max(16px, var(--sr)) max(16px, var(--sb)) max(16px, var(--sl));
  animation: slide-up .32s cubic-bezier(.2,1.2,.4,1) both;
}
.modal-layer.center .sheet { border-radius: 28px; width: auto; max-width: 380px; padding: 20px 24px; animation: card-pop .35s cubic-bezier(.2,1.5,.4,1) both; }
@keyframes slide-up { from { transform: translateY(100%); } }
@keyframes slide-down { to { transform: translateY(100%); } }
@keyframes card-pop { from { transform: translateY(40px) scale(.7); opacity: 0; } }

.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-title { flex: 1; display: flex; justify-content: center; font-size: 44px; }
.card-head .spacer { width: var(--btn); flex: none; }
.card-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.big-btn {
  width: 78px; height: 72px; border: none; border-radius: 24px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; background: #f3eefb; box-shadow: var(--shadow);
  transition: transform .12s ease, background .2s;
}
.big-btn:active { transform: scale(.94); }
.big-btn.yes { background: var(--ok); }
.big-btn.no { background: var(--no); }
.big-btn.yes .ic, .big-btn.no .ic { stroke: #fff; stroke-width: 3; }
.big-btn.save { background: #ffe3f2; }
.big-btn.album { background: #efe9ff; }
.big-btn.album.done { background: var(--ok); }
.big-btn.album.done .ic { stroke: #fff; stroke-width: 3; }
.big-btn.load { background: #e2f7ef; }
.big-btn.del { background: #ffe8e8; }
.big-btn.cam { width: 120px; height: 100px; font-size: 64px; background: #e6f5ff; }

.confirm { text-align: center; }
.confirm-icon { font-size: 72px; display: flex; justify-content: center; margin: 4px 0 14px; }
.confirm-row { display: flex; gap: 18px; justify-content: center; }
.confirm-row .big-btn { width: 100px; height: 80px; font-size: 46px; }

/* photo */
.photo-frame {
  margin: 4px auto 0; width: fit-content; max-width: 100%;
  padding: 10px; background: #fff; border-radius: 22px;
  box-shadow: 0 8px 26px rgba(60,30,90,.25);
  transform: rotate(-1.5deg);
}
.photo-img { display: block; max-width: 100%; max-height: min(56vh, 620px); border-radius: 14px; }
.sheet.photo { text-align: center; padding-top: 22px; }

/* album */
.album-body { min-height: 180px; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
.album-thumb {
  border: none; padding: 5px; border-radius: 18px; background: #fff; box-shadow: var(--shadow-sm);
  aspect-ratio: 10 / 13; overflow: hidden; animation: card-pop .3s ease both;
}
.album-thumb:active { transform: scale(.95); }
.album-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 13px; display: block; }
.album-empty { display: flex; justify-content: center; align-items: center; padding: 30px 0; }
.album-big { text-align: center; }
.hold-btn { background: #f3eefb; }
.hold-ring { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); transform: rotate(-90deg); pointer-events: none; }
.hold-ring circle { fill: none; stroke: var(--accent2); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 120; stroke-dashoffset: 120; transition: stroke-dashoffset .2s; }
.hold-btn.holding .hold-ring circle { stroke-dashoffset: 0; transition: stroke-dashoffset 2s linear; }
.hold-btn.holding { transform: scale(.94); }

/* settings (grown-ups: a few words are fine) */
.set-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 2px solid #f3eefb; }
.set-ic { font-size: 30px; }
.set-label { flex: 1; font-size: 17px; font-weight: 800; }
.switch {
  width: 68px; height: 40px; border: none; border-radius: 20px; padding: 0; position: relative;
  background: #e2d9ef; transition: background .2s;
}
.switch::after { content: ""; position: absolute; left: 4px; top: 4px; width: 32px; height: 32px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s; }
.switch.on { background: var(--ok); }
.switch.on::after { transform: translateX(28px); }
.version { text-align: center; color: var(--ink-soft); font-size: 13px; font-weight: 700; margin: 14px 0 2px; }

/* hand card: a bottom sheet that leaves the hand visible (≤ 45 % of the height) */
.sheet.handcard { max-height: 45vh; max-height: 45dvh; padding-top: 14px; box-shadow: 0 -6px 30px rgba(60,30,90,.25); }
.skin-slider { position: relative; padding: 6px 26px; touch-action: none; cursor: pointer; }
.skin-track { position: relative; height: 34px; border-radius: 17px; box-shadow: inset 0 0 0 3px rgba(59,42,85,.12), inset 0 3px 6px rgba(0,0,0,.08); }
.skin-thumb {
  position: absolute; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%;
  border: 5px solid #fff; box-shadow: 0 0 0 3px var(--accent2), var(--shadow);
  transition: transform .15s;
}
.skin-slider.drag .skin-thumb { transform: scale(1.15); }
.preset-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 4px; }
.preset {
  border: none; padding: 4px 2px 3px; border-radius: 18px; background: #f7f3fc;
  display: flex; flex-direction: column; align-items: center; gap: 0;
  box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .2s;
}
.preset:active { transform: scale(.94); }
.preset.sel { box-shadow: 0 0 0 4px var(--accent2), var(--shadow); background: #fff; }
.preset-pic { width: 52px; height: 64px; display: flex; align-items: center; justify-content: center; }
.preset-pic svg { width: 100%; height: 100%; }
.preset-label { font-size: 12px; font-weight: 800; color: var(--ink-soft); line-height: 1.1; }
.hand-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px;
  position: sticky; bottom: calc(-1 * max(16px, var(--sb))); background: var(--card);
  padding-bottom: 2px; z-index: 1;
}
.hand-row .big-btn.done { width: 110px; height: 64px; }
.look-switch { display: flex; gap: 8px; flex: none; }
.look {
  border: none; padding: 2px; width: 56px; height: 64px; border-radius: 16px; background: #f7f3fc;
  box-shadow: var(--shadow-sm); display: flex; align-items: center; justify-content: center; transition: transform .12s, box-shadow .2s;
}
.look:active { transform: scale(.94); }
.look.sel { box-shadow: 0 0 0 4px var(--accent2), var(--shadow); background: #fff; }
.look-pic { width: 100%; height: 100%; display: flex; }
.look-pic svg { width: 100%; height: 100%; }
.side-btn { width: 60px; height: 60px; font-size: 34px; background: #f3eefb; }

/* ================================================================ bigger screens */
@media (min-width: 700px) and (min-height: 700px) {
  :root { --item: 76px; --btn: 60px; --tray-h: 100px; --row-h: 68px; --tab-h: 84px; --gap: 10px; }
  .tab { font-size: 42px; }
  .tbtn { width: 54px; height: 54px; }
  .tbtn.chip { width: 60px; height: 50px; }
  .preset-grid { grid-template-columns: repeat(7, 1fr); }
  .preset-pic { width: 64px; height: 80px; }
  .preset-label { font-size: 13px; }
  .stage-btn { width: 64px; height: 64px; font-size: 36px; }
}
/* small phones */
@media (max-height: 680px) and (orientation: portrait) {
  :root { --btn: 46px; --tray-h: 76px; --item: 58px; --row-h: 54px; --tab-h: 64px; --gap: 6px; }
  .tbtn { width: 44px; height: 44px; }
  .tab { font-size: 30px; }
  .stage-btn { width: 50px; height: 50px; font-size: 28px; }
  .preset-pic { height: 46px; width: 44px; }
  .preset-label { font-size: 11px; }
  .preset-grid { gap: 6px; margin-top: 8px; }
  .skin-slider { padding-top: 2px; padding-bottom: 2px; }
  .hand-row { margin-top: 6px; }
  .hand-row .big-btn.done { height: 56px; }
  .side-btn { width: 52px; height: 52px; }
  .look { width: 48px; height: 56px; }
}

/* ================================================================ landscape: tray and tabs become columns */
@media (min-aspect-ratio: 5/4) {
  :root { --trayw: calc(var(--item) * 2 + 3 * var(--gap) + 24px); --tabw: 80px; }
  #app {
    grid-template-columns: minmax(0, 1fr) var(--trayw) calc(var(--tabw) + var(--sr));
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas: "top row tabs" "stage row tabs" "stage tray tabs";
  }
  #topbar { padding-right: 6px; }
  #stage { margin: 0 6px max(8px, var(--sb)) max(8px, var(--sl)); }
  #toolrow { height: auto; flex-wrap: wrap; align-content: flex-start; padding: max(8px, var(--st)) 4px 6px; }
  #tool-fixed { flex-wrap: wrap; }
  #tool-scroll { flex: 1 1 100%; }
  #tray {
    height: auto; margin: 0 0 max(8px, var(--sb)); padding: 10px 8px;
    flex-wrap: wrap; align-content: flex-start; justify-content: center;
    overflow-x: hidden; overflow-y: auto;
  }
  .thead { width: 100%; height: 26px; margin: 2px 0 0; }
  .tsep { width: 80%; height: 4px; margin: 4px 0; }
  .titem.wide { width: var(--item); }
  #tabs {
    flex-direction: column; height: auto;
    padding: max(6px, var(--st)) max(6px, var(--sr)) max(6px, var(--sb)) 4px;
  }
  .tab .dot { bottom: auto; left: 6px; top: 50%; margin: -3.5px 0 0; }
  .tab.sel .ic { transform: translateX(-3px) scale(1.1); }
  .modal-layer:not(.center) { justify-content: flex-end; align-items: stretch; }
  .sheet { border-radius: 28px 0 0 28px; width: min(560px, 70vw); max-height: none; height: 100%;
    padding: max(16px, var(--st)) max(16px, var(--sr)) max(16px, var(--sb)) 16px;
    animation-name: slide-in; }
  .modal-layer.closing .sheet { animation-name: slide-out; }
  @keyframes slide-in { from { transform: translateX(100%); } }
  @keyframes slide-out { to { transform: translateX(100%); } }
  .sheet.handcard { width: min(400px, 46vw); max-height: none; }
  .sheet.handcard .preset-grid { grid-template-columns: repeat(4, 1fr); }
  .photo-img { max-height: 62vh; }
}
@media (min-aspect-ratio: 5/4) and (max-height: 500px) {
  :root { --item: 54px; --btn: 44px; --gap: 6px; --tabw: 64px; }
  .tab { font-size: 28px; }
  .tbtn { width: 42px; height: 42px; }
  .stage-btn { width: 48px; height: 48px; font-size: 26px; }
}

/* ---- online ---- (web/js/online.js: friends strip, friend view, Friends card, knock / help / salon cards) */
.ol-badge {
  --pc: var(--accent2);
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-size: 24px;
  background: #fff; box-shadow: 0 0 0 3px var(--pc), var(--shadow-sm);
}
.ol-badge.ring { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--pc), var(--shadow-sm); }
.ol-who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.ol-who.big .ol-badge { width: 52px; height: 52px; font-size: 36px; box-shadow: 0 0 0 4px var(--pc), var(--shadow-sm); }
.ol-nick-tag { font-weight: 800; font-size: 17px; max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-nick-tag:empty { display: none; }
.ol-code { display: flex; justify-content: center; gap: 12px; }
.ol-sym {
  width: 64px; height: 64px; border-radius: 20px; background: #fff; font-size: 48px;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm), inset 0 0 0 3px #f1ecf9;
}
.ol-code.big .ol-sym { width: 88px; height: 88px; font-size: 66px; border-radius: 26px; }
.ol-code.mid .ol-sym { width: 56px; height: 56px; font-size: 40px; }
.ol-code.mini { gap: 2px; }
.ol-code.mini .ol-sym { width: 26px; height: 26px; font-size: 20px; border-radius: 8px; box-shadow: none; background: transparent; }
.ol-code.pick .ol-sym.empty { background: #f6f2fc; box-shadow: inset 0 0 0 3px #e4dcf3; color: #b9a8d6; font-size: 26px; }
.ol-sym b { font-weight: 900; }

/* top bar: rejoin chip, friends strip */
.ol-chip {
  height: 48px; border: none; border-radius: 24px; padding: 0 10px 0 6px; background: #fff; box-shadow: var(--shadow-sm);
  display: inline-flex; align-items: center; gap: 6px; animation: ol-wiggle 2.4s ease-in-out infinite;
}
.ol-chip.busy { width: 64px; justify-content: center; font-size: 28px; animation: none; }
.ol-chip-ic { font-size: 26px; display: flex; }
@keyframes ol-wiggle { 0%, 80%, 100% { transform: none; } 85% { transform: rotate(-4deg); } 90% { transform: rotate(4deg); } 95% { transform: rotate(-2deg); } }
.ol-strip { display: flex; align-items: center; gap: 12px; min-width: 0; overflow-x: auto; overflow-y: hidden; padding: 11px 10px 9px 6px; scrollbar-width: none; }
.ol-strip::-webkit-scrollbar { display: none; }
.ol-mine { position: relative; flex: none; display: flex; align-items: center; }
.ol-me { border: none; background: none; padding: 4px; display: flex; }
.ol-hdots { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); display: flex; gap: 2px; }
.ol-hdot { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #fff; padding: 0; background: var(--pc); box-shadow: var(--shadow-sm); }
.ol-peer {
  --pc: var(--accent2);
  position: relative; flex: none; width: 54px; height: 66px; border: none; border-radius: 16px; padding: 0;
  background: rgba(255,255,255,.85); box-shadow: 0 0 0 3px var(--pc), var(--shadow-sm);
  transition: transform .12s ease;
}
.ol-peer:active { transform: scale(.94); }
.ol-peer.sel { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--pc), var(--shadow); }
.ol-thumb { position: absolute; inset: 0; overflow: hidden; border-radius: 16px; display: flex; align-items: center; justify-content: center; }
.ol-thumb-svg, .ol-thumb-svg svg { display: block; width: 50px; height: 65px; }
.ol-nick {
  position: absolute; left: 50%; top: -9px; transform: translateX(-50%); max-width: 64px;
  font-size: 11px; font-weight: 900; line-height: 1; padding: 2px 5px; border-radius: 8px;
  background: var(--pc); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ol-pbadge { position: absolute; right: -6px; bottom: -6px; }
.ol-pbadge .ol-badge { width: 24px; height: 24px; font-size: 17px; box-shadow: 0 0 0 2px var(--pc); }
.ol-pdots { position: absolute; left: 3px; bottom: 3px; display: flex; gap: 2px; }
.ol-pdots i { width: 9px; height: 9px; border-radius: 50%; border: 2px solid #fff; }
.ol-pbell { position: absolute; left: -6px; top: -6px; font-size: 20px; display: flex; }
.ol-pop { animation: ol-pop .6s cubic-bezier(.3,1.8,.4,1); }
@keyframes ol-pop { 0% { transform: scale(1); } 35% { transform: scale(1.3) rotate(-6deg); } 100% { transform: scale(1); } }
.ol-off { flex: none; font-size: 30px; display: flex; animation: ol-blink 1.4s ease-in-out infinite; }
@keyframes ol-blink { 50% { opacity: .35; } }
/* phones: in a room the strip gets its own row under the buttons */
@media (max-width: 640px) {
  body.ol-room #topbar { flex-wrap: wrap; row-gap: 0; }
  body.ol-room #friends-strip { order: 10; flex: 1 1 100%; justify-content: flex-start; }
  body.ol-room #btn-undo { margin-right: auto; }
}

/* on the stage: friend view, helpers, salon */
.ol-vtitle {
  --pc: var(--accent2);
  position: absolute; z-index: 3; top: 12px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 170px);
  display: flex; align-items: center; gap: 6px; padding: 5px 12px 5px 6px; border-radius: 30px;
  background: rgba(255,255,255,.92); box-shadow: 0 0 0 3px var(--pc), var(--shadow-sm); pointer-events: none;
}
.ol-vmode { font-size: 26px; display: flex; }
.ol-vactions { position: absolute; z-index: 3; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 10px; }
.ol-vactions .stage-btn { position: static; }
.ol-paint.asked { animation: ol-blink 1s ease-in-out infinite; background: var(--gold); }
.ol-reacts { position: absolute; z-index: 3; left: 10px; bottom: 10px; display: flex; gap: 6px; }
.ol-react {
  width: 46px; height: 46px; border: none; border-radius: 50%; padding: 0; font-size: 28px;
  display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.92); box-shadow: var(--shadow-sm);
  transition: transform .12s ease;
}
.ol-react:active { transform: scale(.88); }
.ol-helperbar { position: absolute; z-index: 3; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 10px; }
.ol-helper { position: relative; border: none; background: none; padding: 4px; display: flex; }
.ol-helper .ol-badge { width: 44px; height: 44px; font-size: 30px; }
.ol-x { position: absolute; right: -4px; top: -4px; width: 22px; height: 22px; border-radius: 50%; background: var(--no); font-size: 14px; display: flex; align-items: center; justify-content: center; }
.ol-x .ic { stroke: #fff; stroke-width: 3.5; }
.ol-wishbar {
  position: absolute; z-index: 3; top: 10px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 160px);
  display: flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 22px;
  background: rgba(255,255,255,.94); box-shadow: 0 0 0 3px var(--gold), var(--shadow-sm); pointer-events: none;
}
body.external .ol-wishbar { top: 68px; }
.ol-wb-bell, .ol-wb-wait { font-size: 26px; display: flex; }
.ol-wb-wait { animation: ol-blink 1.2s ease-in-out infinite; }
.ol-wi { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.ol-wi svg { display: block; }
.ol-wi.miss { opacity: .45; }
.ol-wi-ok { position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; background: var(--ok); font-size: 12px; display: flex; align-items: center; justify-content: center; }
.ol-wi-ok .ic { stroke: #fff; stroke-width: 3.5; }
.ol-done { position: absolute; z-index: 3; left: 50%; bottom: 12px; transform: translateX(-50%); width: 110px; height: 72px; animation: bob 1.6s ease-in-out infinite; }

/* Friends card */
.ol-body { display: flex; flex-direction: column; gap: 14px; }
.ol-busy { display: flex; justify-content: center; font-size: 64px; padding: 30px 0; animation: ol-blink 1s ease-in-out infinite; }
.ol-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ol-mode {
  border: none; border-radius: 24px; padding: 12px; background: #f3eefb; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center; transition: transform .12s ease;
}
.ol-mode:active { transform: scale(.95); }
.ol-start { background: #ffe3f2; }
.ol-join { background: #e2f1ff; }
.ol-mode-pic svg { display: block; width: 100%; max-width: 150px; height: auto; }
.ol-err { margin: 0; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; color: #c23a3a; }
.ol-err-ic { font-size: 22px; display: flex; }
.ol-err-ic .ic { stroke: var(--no); stroke-width: 3; }
.ol-nickrow { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 20px; background: #f6f2fc; }
.ol-nick-ic { font-size: 30px; display: flex; }
.ol-nick-input {
  flex: 1; min-width: 0; height: 48px; border: 3px solid #e4dcf3; border-radius: 16px; padding: 0 12px;
  font: 800 18px var(--font); color: var(--ink); background: #fff;
  -webkit-user-select: text; user-select: text;
}
.ol-nick-input:focus { outline: none; border-color: var(--accent2); }
.ol-nick-input::placeholder { color: #b9a8d6; }
.ol-codewrap { padding: 6px 0 2px; }
.ol-players { display: flex; flex-direction: column; gap: 8px; }
.ol-prow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px; border-radius: 20px; background: #faf7fe; }
.ol-prow.me { justify-content: flex-start; }
.ol-prow.me .ol-who { gap: 14px; padding-left: 4px; }
.ol-prow.me .ol-badge { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--pc), var(--shadow-sm); }
.ol-pacts { display: flex; gap: 8px; flex: none; }
.ol-pacts .btn-round { width: 48px; height: 48px; font-size: 28px; }
.ol-blocked { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ol-blocked-ic { font-size: 28px; display: flex; }
.ol-unblock { border: none; background: none; padding: 4px; opacity: .6; display: flex; }
.ol-leave { background: #ffe8e8; }
.ol-symtop { display: flex; align-items: center; gap: 10px; }
.ol-symtop .ol-code { flex: 1; }
.ol-pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ol-pad.busy { opacity: .55; }
.ol-symbtn {
  height: 68px; border: none; border-radius: 20px; background: #fff; font-size: 46px; padding: 0;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm), inset 0 0 0 3px #f1ecf9;
  transition: transform .12s ease;
}
.ol-symbtn:active { transform: scale(.92); }
.ol-symbtn.used { opacity: .3; }
.ol-shake { animation: ol-shake .45s ease; }
@keyframes ol-shake { 20% { transform: translateX(-12px); } 40% { transform: translateX(10px); } 60% { transform: translateX(-7px); } 80% { transform: translateX(4px); } }

/* knock / requests / help / salon cards */
.ol-knock { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ol-knock-door { font-size: 64px; display: flex; animation: ol-knock 1.2s ease-in-out infinite; transform-origin: 30% 90%; }
@keyframes ol-knock { 0%, 60%, 100% { transform: none; } 70% { transform: rotate(-6deg); } 80% { transform: rotate(4deg); } 90% { transform: rotate(-3deg); } }
.ol-knock-wait { font-size: 46px; display: flex; animation: ol-blink 1.2s ease-in-out infinite; }
.ol-reqlist { display: flex; flex-direction: column; gap: 14px; }
.ol-req { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }
.ol-req.busy { opacity: .5; pointer-events: none; }
.ol-req-door { font-size: 46px; display: flex; animation: ol-knock 1.2s ease-in-out infinite; }
.ol-req-btns { display: flex; gap: 12px; }
.ol-req-btns .big-btn, .ol-helpreq .big-btn { width: 96px; height: 76px; font-size: 46px; }
.ol-req-block {
  flex: 1 1 100%; display: flex; align-items: center; justify-content: center; gap: 8px; border: none; border-radius: 18px;
  padding: 8px 12px; background: #fff0f0; color: #c23a3a; font-weight: 800; font-size: 14px;
}
.ol-req-block .ic { font-size: 26px; }
.ol-helpreq-pic, .ol-confirm-pic { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 52px; }
.ol-confirm-pic .ol-badge { width: 56px; height: 56px; font-size: 38px; }
.ol-arrow { font-size: 44px; display: flex; animation: bob 1.4s ease-in-out infinite; }
.ol-wishes { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ol-wish-head { display: flex; align-items: center; gap: 10px; font-size: 44px; }
.ol-wishrow { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.ol-wish {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; min-height: 76px;
  border: none; border-radius: 22px; padding: 10px; background: #fff7fb; box-shadow: 0 0 0 3px #ffd1ec, var(--shadow-sm);
  transition: transform .12s ease;
}
.ol-wish:active { transform: scale(.95); }
.ol-love { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ol-bigheart {
  width: 132px; height: 132px; border: none; border-radius: 50%; padding: 0; font-size: 96px; background: #fff0f5;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); animation: ol-beat 1.1s ease-in-out infinite;
}
@keyframes ol-beat { 15% { transform: scale(1.12); } 30% { transform: scale(1); } 45% { transform: scale(1.08); } 60% { transform: scale(1); } }
.ol-stars { display: flex; gap: 8px; }
.ol-star { font-size: 48px; display: flex; filter: grayscale(1); opacity: .3; }
.ol-star.on { filter: none; opacity: 1; animation: card-pop .5s cubic-bezier(.2,1.5,.4,1) both; }
.ol-star.on:nth-child(2) { animation-delay: .15s; } .ol-star.on:nth-child(3) { animation-delay: .3s; }
.ol-wishline { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.ol-swap { background: #efe9ff; }
/* ---- end online ---- */

/* ---- tiers ---- (SPEC §9: quota note, Plus button, Polly Plus card, parental gate, code entry; js/paywall.js) */
.quota-note {
  display: flex; align-items: center; gap: 6px; margin: 0 auto 8px; width: fit-content; max-width: 100%;
  border: none; border-radius: 999px; padding: 4px 6px 4px 10px; min-height: 34px;
  background: #fff7d6; color: var(--ink); box-shadow: var(--shadow-sm);
  font: 800 14px/1.1 var(--font); white-space: nowrap; transition: transform .12s;
}
.quota-note:active { transform: scale(.95); }
.quota-note.none { background: #f1ecf8; color: var(--ink-soft); }
.quota-note.paid { background: #e2f7ef; padding-left: 12px; }
.quota-note .quota-ic { font-size: 18px; display: flex; }
.quota-note .plus-gem-ic { font-size: 24px; }
/* the hand card must leave the nails visible: a slimmer note tucked into the sheet's top padding */
.sheet.handcard .quota-note { min-height: 28px; margin: -6px auto 4px; padding: 2px 5px 2px 10px; font-size: 13px; }
.sheet.handcard .quota-note .plus-gem-ic { font-size: 21px; }
.plus-gem-ic { position: relative; display: inline-flex; }
.plus-check {
  position: absolute; right: -5px; bottom: -4px; width: 17px; height: 17px; border-radius: 50%;
  background: var(--ok); display: flex; align-items: center; justify-content: center; font-size: 12px;
  box-shadow: 0 0 0 2px #fff;
}
.plus-check .ic { stroke: #fff; stroke-width: 3.4; }
.plus-round { font-size: 32px; background: #eef9ff; }
.plus-round.paid { background: #e2f7ef; }

/* the Polly Plus card */
.sheet.plus { text-align: center; }
.plus-title { align-items: center; gap: 8px; font-size: 20px; font-weight: 900; }
.plus-title-ic { font-size: 34px; display: flex; }
.plus-body { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-bottom: 4px; }
.plus-hero { position: relative; width: 112px; height: 96px; display: flex; align-items: center; justify-content: center; }
.plus-hero.small { width: 84px; height: 70px; }
.plus-hero-gem { font-size: 78px; display: flex; animation: plus-bob 2.4s ease-in-out infinite; }
.plus-hero.small .plus-hero-gem { font-size: 56px; }
.plus-spark { position: absolute; font-size: 22px; display: flex; animation: plus-twinkle 1.8s ease-in-out infinite; }
.plus-spark.s1 { left: 0; top: 6px; }
.plus-spark.s2 { right: 2px; top: 0; font-size: 18px; animation-delay: .6s; }
.plus-spark.s3 { left: 12px; bottom: 0; font-size: 16px; animation-delay: 1.2s; }
@keyframes plus-bob { 50% { transform: translateY(-5px) rotate(-4deg); } }
@keyframes plus-twinkle { 50% { transform: scale(.6) rotate(20deg); opacity: .5; } }
.plus-text { margin: 0; max-width: 34ch; font-size: 18px; font-weight: 800; line-height: 1.3; }
.plus-sub { margin: -4px 0 0; max-width: 36ch; font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.plus-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; width: 100%; }
.plus-col { display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: min(100%, 320px); }
.plus-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 6px 18px;
  border: none; border-radius: 22px; background: #f3eefb; color: var(--ink); box-shadow: var(--shadow);
  font: 900 17px/1.15 var(--font); transition: transform .12s, opacity .2s;
}
.plus-btn:active { transform: scale(.95); }
.plus-btn:disabled { opacity: .45; box-shadow: none; }
.plus-btn-ic { font-size: 30px; display: flex; }
.plus-btn.grownup-btn { background: #efe9ff; }
.plus-btn.code-btn { background: #fff3c4; }
.plus-btn.coupon-redeem { background: var(--ok); color: #fff; min-width: 180px; }
.plus-btn.coupon-redeem .ic { stroke: #fff; stroke-width: 3; }
.plus-ok { width: 110px; height: 64px; }
.plus-note { margin: -2px 0 2px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.plus-small { margin: 4px 0 0; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.plus-links { margin: 0; }
.plus-link { border: none; background: none; padding: 4px 2px; font: inherit; color: var(--accent2); text-decoration: underline; }
.plus-account-id { font-family: ui-monospace, Menlo, Consolas, monospace; -webkit-user-select: all; user-select: all; }
.plus-done.yay .plus-hero-gem { animation: plus-yay .8s cubic-bezier(.2,1.6,.4,1) both, plus-bob 2.4s 1s ease-in-out infinite; }
@keyframes plus-yay { from { transform: scale(.3) rotate(-30deg); } }
.plus-shake { animation: plus-shake .4s ease; }
@keyframes plus-shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(7px); } 75% { transform: translateX(-4px); } }

/* parental gate */
.gate-hold { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0; }
.gate-hold-btn {
  position: relative; width: 132px; height: 132px; border: none; border-radius: 50%; padding: 0;
  background: #efe9ff; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center;
  touch-action: none; transition: transform .15s;
}
.gate-hold-btn.holding { transform: scale(.95); }
.gate-hold-ic { font-size: 64px; display: flex; }
.gate-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.gate-ring circle { fill: none; stroke-width: 8; stroke-linecap: round; }
.gate-ring-bg { stroke: #e2d9ef; }
.gate-ring-fg { stroke: var(--accent2); }
.gate-q { font-size: 24px; }
.gate-answer {
  min-width: 110px; min-height: 52px; padding: 4px 16px; border-radius: 16px; background: #f7f3fc;
  font: 900 34px/44px var(--font); letter-spacing: 2px;
}
.gate-pad { display: grid; grid-template-columns: repeat(3, 72px); gap: 8px; justify-content: center; }
.gate-key {
  height: 56px; border: none; border-radius: 18px; background: #f3eefb; box-shadow: var(--shadow-sm);
  font: 900 26px/1 var(--font); color: var(--ink); display: flex; align-items: center; justify-content: center;
}
.gate-key:active { transform: scale(.94); }
.gate-key .ic { font-size: 26px; }
.gate-key.ok { background: var(--ok); }
.gate-key.ok .ic { stroke: #fff; stroke-width: 3; }

/* code entry */
.coupon-top { display: flex; align-items: center; gap: 10px; width: min(100%, 360px); }
.coupon-back { width: 48px; height: 48px; font-size: 26px; background: #f3eefb; }
.coupon-input {
  flex: 1; min-width: 0; height: 60px; border: 3px solid #e2d9ef; border-radius: 18px; padding: 0 10px;
  font: 900 26px/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 2px; text-align: center; color: var(--ink);
  background: #fff; -webkit-user-select: text; user-select: text; text-transform: uppercase;
}
.coupon-input::placeholder { color: #cfc4e0; }
.coupon-input:focus { outline: none; border-color: var(--accent2); box-shadow: 0 0 0 4px rgba(123,92,255,.18); }
.coupon-msg { margin: 0; min-height: 20px; font-size: 15px; font-weight: 800; color: var(--ink-soft); }
.coupon-msg.warn { color: #d93a5a; }
.plus-coupon.sending .coupon-input { opacity: .6; }

@media (prefers-reduced-motion: reduce) {
  .plus-hero-gem, .plus-spark, .plus-done.yay .plus-hero-gem, .plus-shake { animation: none; }
}
/* ---- end tiers ---- */

/* ---- brush ---- (SPEC §10.3: the can | brush switch and the brush sizes in the Polish and Style tool row; js/tools.js) */
#toolrow { padding-top: 3px; padding-bottom: 3px; }   /* room for the 56 px switch inside --row-h (62 px) */
.bswitch {
  flex: none; display: inline-flex; align-items: stretch; gap: 0; padding: 0;
  height: 56px; border-radius: 20px; background: #f1ecf9; box-shadow: var(--shadow-sm);
}
.tbtn.bseg {
  width: 56px; height: 56px; border-radius: 20px; background: transparent; box-shadow: none; font-size: 36px;
}
.tbtn.bseg.sel { background: var(--gold); box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--accent2), var(--shadow-sm); z-index: 1; }
.tbtn.bseg:not(.sel) .ic { opacity: .6; }
.tbtn.bsize { width: 48px; height: 56px; border-radius: 18px; }
.bdot { display: block; border-radius: 50%; background: var(--accent); box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); }
.tbtn.bsize0 .bdot { width: 10px; height: 10px; }
.tbtn.bsize1 .bdot { width: 19px; height: 19px; }
.tbtn.bsize2 .bdot { width: 30px; height: 30px; }
@media (max-height: 680px) and (orientation: portrait) { #toolrow { height: 62px; } }   /* --row-h is 54 there */
@media (max-width: 400px) and (orientation: portrait) {
  .tbtn.bseg { width: 52px; }
  .tbtn.bsize { width: 40px; }
}
/* ---- end brush ---- */
