/* ============================================================
   BLACKWOOD MANOR — ui.css
   "Gothic Carousel": dark plum, bone cream, candle gold.
   Chunky skeuomorphic-cute buttons, springy overshoot motion.
   ============================================================ */
@font-face {
  font-family: 'Fredoka';
  src: url('../vendor/Fredoka-X7n64b87HvSqjb_WIi2yDCRwoQ_k7367_DWu89U.woff2') format('woff2');
  font-weight: 400 700; font-display: swap;
}
@font-face {
  font-family: 'Pixelify';
  src: url('../vendor/PixelifySans-CHylV-3HFUT7aC4iv1TxGDR9Jn0Eiw.woff2') format('woff2');
  font-weight: 400 700; font-display: swap;
}

:root {
  --plum-9: #140a1f;
  --plum-8: #1d1030;
  --plum-7: #2a1842;
  --plum-6: #372155;
  --plum-5: #472b6b;
  --cream: #f6e7c6;
  --cream-dim: #cbb894;
  --gold: #ffd166;
  --gold-deep: #e0a53a;
  --orange: #f4842e;
  --rose: #e11d48;
  --green: #57d38c;
  --ink: #1b1029;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-drop: 0 8px 0 rgba(0,0,0,.35), 0 16px 40px rgba(0,0,0,.45);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; }
body {
  background: var(--plum-9);
  color: var(--cream);
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 15px;
  user-select: none;
  overscroll-behavior: none;
}
#game { position: fixed; inset: 0; }
#game canvas { display: block; width: 100% !important; height: 100% !important; }

.ui-layer { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.ui-layer > * { pointer-events: auto; }

/* ============================================================
   TOP BAR
   ============================================================ */
#topbar {
  position: fixed; top: calc(8px + var(--safe-t)); left: 10px; right: 10px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  pointer-events: none; z-index: 60;
}
.chip {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(180deg, var(--plum-6), var(--plum-7));
  border: 2px solid #0d0616;
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 3px 0 rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.14);
  white-space: nowrap;
  transition: transform .18s var(--spring);
}
.chip .ic { font-size: 14px; line-height: 1; filter: saturate(1.2); }
.chip .pix { font-family: 'Pixelify', monospace; font-size: 14px; letter-spacing: .02em; }
#moneyChip { color: var(--gold); }
#money.bump { display: inline-block; animation: bump .4s var(--spring); }
@keyframes bump { 0%{transform:scale(1)} 35%{transform:scale(1.28)} 100%{transform:scale(1)} }
#tillWrap.full { animation: pulse 1.1s ease-in-out infinite; border-color: var(--gold-deep); }
@keyframes pulse { 0%,100%{ box-shadow: 0 3px 0 rgba(0,0,0,.45), 0 0 0 0 rgba(255,209,102,.5) } 50%{ box-shadow: 0 3px 0 rgba(0,0,0,.45), 0 0 0 8px rgba(255,209,102,0) } }
#stars { color: var(--gold); font-size: 13px; letter-spacing: 1px; }
#stars .dim { color: #6a558f; }
.chip.spacer { flex: 1; background: none; border: none; box-shadow: none; pointer-events: none; min-width: 0; }
#nightBtn { cursor: pointer; }
#nightBtn.live { color: var(--cream); border-color: var(--gold-deep); }
#nightBtn.live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: blink 1.6s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.35} }
#quotaWrap { width: 100%; order: 99; opacity: 0; transition: opacity .3s; pointer-events: none; margin-top: 4px; text-align: center; }
#quotaWrap.show { opacity: 1; }
#quotaBarBg { height: 6px; background: #1a0f2b; border: 2px solid #0d0616; border-radius: 999px; overflow: hidden; }
#quotaBar { height: 100%; width: 0; background: linear-gradient(90deg, #7a3bd6, var(--rose)); transition: width .4s var(--ease); }
#quotaTxt { font-family: 'Pixelify', monospace; font-size: 10px; margin-top: 4px; color: var(--cream); display: inline-block;
  background: rgba(13,6,22,.82); border-radius: 999px; padding: 2px 10px; text-shadow: 0 1px 0 #000; }

/* ============================================================
   BOTTOM DOCK
   ============================================================ */
#dock {
  position: fixed; bottom: calc(10px + var(--safe-b)); left: 50%; transform: translateX(-50%);
  display: flex; gap: 7px; z-index: 60;
  padding: 7px;
  background: linear-gradient(180deg, rgba(42,24,66,.92), rgba(29,16,48,.94));
  border: 2px solid #0d0616;
  border-radius: 24px;
  box-shadow: 0 6px 0 rgba(0,0,0,.4), 0 18px 40px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
}
.dock-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 58px; min-height: 52px;
  padding: 7px 9px 6px;
  background: linear-gradient(180deg, var(--plum-5), var(--plum-6));
  border: 2px solid #0d0616; border-radius: 16px;
  color: var(--cream); font-family: inherit; font-size: 10px; font-weight: 600;
  box-shadow: 0 4px 0 rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.16);
  cursor: pointer;
  transition: transform .14s var(--spring), box-shadow .14s;
}
.dock-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.4); }
.dock-btn .di { font-size: 20px; line-height: 1; }
.dock-btn.accent { background: linear-gradient(180deg, var(--gold), var(--gold-deep)); color: var(--ink); }
.dock-btn.wide { min-width: 74px; }

/* ============================================================
   SCRIM + SHEETS
   ============================================================ */
#scrim {
  position: fixed; inset: 0; background: rgba(9,4,18,.55);
  opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 70;
  backdrop-filter: blur(2px);
}
#scrim.open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translate(-50%, calc(100% + 20px));
  width: min(560px, 100vw); max-height: 74vh;
  background: linear-gradient(180deg, var(--plum-7), var(--plum-8));
  border: 2px solid #0d0616; border-bottom: none;
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -8px 0 rgba(0,0,0,.25), 0 -20px 60px rgba(0,0,0,.6);
  z-index: 80; display: flex; flex-direction: column;
  transition: transform .34s var(--spring);
  padding-bottom: var(--safe-b);
  overscroll-behavior: contain;
}
.sheet.open { transform: translate(-50%, 0); }
.sheet-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px 10px;
  border-bottom: 2px solid rgba(13,6,22,.6);
  flex: 0 0 auto;
}
.sheet-head h3 { font-size: 18px; font-weight: 600; letter-spacing: .01em; flex: 1; }
.sheet-head h3 em { color: var(--gold); font-style: normal; }
.sheet-close {
  width: 34px; height: 34px; border-radius: 12px;
  background: linear-gradient(180deg, var(--plum-5), var(--plum-6));
  border: 2px solid #0d0616; color: var(--cream);
  font-size: 16px; font-weight: 700; cursor: pointer;
  box-shadow: 0 3px 0 rgba(0,0,0,.4);
}
.sheet-close:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.4); }
.sheet-body { padding: 12px 14px 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet-hint { font-size: 12px; color: var(--cream-dim); margin: 10px 2px 0; line-height: 1.45; }
.empty { text-align: center; color: var(--cream-dim); font-size: 13px; padding: 26px 10px; line-height: 1.6; }

/* tabs */
#buildTabs { display: flex; gap: 6px; padding: 10px 14px 0; flex: 0 0 auto; }
.tab {
  flex: 1; padding: 9px 10px; border-radius: 14px 14px 0 0;
  background: var(--plum-8); border: 2px solid #0d0616; border-bottom: none;
  color: var(--cream-dim); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: transform .14s var(--spring);
}
.tab.on { background: linear-gradient(180deg, var(--plum-5), var(--plum-6)); color: var(--gold); transform: translateY(-2px); }

/* prop cards */
.cardrow { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; }
.cardrow::-webkit-scrollbar { height: 6px; }
.cardrow::-webkit-scrollbar-thumb { background: var(--plum-5); border-radius: 999px; }
.pcard {
  scroll-snap-align: start;
  flex: 0 0 132px; width: 132px;
  background: linear-gradient(180deg, var(--plum-6), var(--plum-7));
  border: 2px solid #0d0616; border-radius: 16px;
  padding: 9px; text-align: left; cursor: pointer; color: var(--cream);
  font-family: inherit;
  box-shadow: 0 4px 0 rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.13);
  transition: transform .16s var(--spring);
  position: relative; overflow: hidden;
}
.pcard:active { transform: translateY(3px) scale(.98); }
.pcard-ic { display: grid; place-items: center; height: 56px; background: rgba(13,6,22,.45); border-radius: 12px; margin-bottom: 7px; }
.pcard-ic img { width: 44px; height: 44px; image-rendering: pixelated; }
.pcard-nm { font-size: 12.5px; font-weight: 600; line-height: 1.2; margin-bottom: 5px; min-height: 30px; }
.pcard-stats { display: flex; justify-content: space-between; font-family: 'Pixelify', monospace; font-size: 11px; margin-bottom: 5px; }
.pcard-stats .fear { color: #ff9fb5; }
.pcard-stats .cost { color: var(--gold); }
.pcard-blurb { font-size: 10.5px; color: var(--cream-dim); line-height: 1.35; }
.pcard.locked { opacity: .5; filter: grayscale(.7); }
.pcard.poor .cost { color: var(--rose); }
.pcard.owned::after { content: 'OWNED'; position: absolute; top: 6px; right: -24px; transform: rotate(38deg); background: var(--green); color: var(--ink); font-size: 8px; font-weight: 700; padding: 2px 22px; }

/* expand cards */
.expcard {
  display: block; width: 100%; text-align: left; margin-bottom: 10px;
  background: linear-gradient(180deg, var(--plum-6), var(--plum-7));
  border: 2px solid #0d0616; border-radius: 16px; padding: 13px 14px; cursor: pointer;
  color: var(--cream); font-family: inherit;
  box-shadow: 0 4px 0 rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.12);
  position: relative;
}
.expcard:active { transform: translateY(3px); }
.expcard .exp-nm { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.expcard .exp-blurb { font-size: 12px; color: var(--cream-dim); line-height: 1.45; }
.expcard .exp-cost { position: absolute; top: 13px; right: 14px; font-family: 'Pixelify', monospace; font-size: 13px; color: var(--gold); }
.expcard.done { opacity: .6; }
.expcard.done .exp-cost { color: var(--green); }

/* ============================================================
   GUESTS / STAFF / LOG / GOALS
   ============================================================ */
.grow {
  display: block; width: 100%; text-align: left; margin-bottom: 8px;
  background: linear-gradient(180deg, var(--plum-6), var(--plum-7));
  border: 2px solid #0d0616; border-radius: 14px; padding: 10px 12px; cursor: pointer;
  color: var(--cream); font-family: inherit;
  box-shadow: 0 3px 0 rgba(0,0,0,.35);
}
.grow:active { transform: translateY(2px); }
.grow-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.grow-top b { font-size: 14px; }
.grow-niche { font-size: 11px; color: var(--cream-dim); }
.grow-fear { height: 8px; background: #150c24; border-radius: 999px; overflow: hidden; border: 1px solid #0d0616; }
.grow-fear i { display: block; height: 100%; transition: width .3s var(--ease); border-radius: 999px; }
.grow-fear i.low { background: #6f5bb8; }
.grow-fear i.mid { background: var(--gold); }
.grow-fear i.high { background: var(--orange); }
.grow-fear i.melt { background: var(--rose); animation: blink .7s infinite; }
.grow-meta { display: flex; gap: 12px; margin-top: 5px; font-family: 'Pixelify', monospace; font-size: 10px; color: var(--cream-dim); }

.srow { display: flex; gap: 11px; align-items: flex-start; padding: 11px; margin-bottom: 9px;
  background: linear-gradient(180deg, var(--plum-6), var(--plum-7)); border: 2px solid #0d0616; border-radius: 14px;
  box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.srow.hired { border-color: var(--gold-deep); }
.srow-ic { width: 40px; height: 60px; flex: 0 0 auto; display: grid; place-items: center; }
.srow-ic canvas { width: 40px; height: 60px; image-rendering: pixelated; }
.srow-main { flex: 1; min-width: 0; }
.srow-main b { font-size: 14px; display: block; margin-bottom: 2px; }
.srow-main span { font-size: 12px; color: var(--cream-dim); line-height: 1.4; display: block; }
.srow-main em { font-size: 11px; color: var(--gold); font-style: normal; display: block; margin-top: 5px; font-family: 'Pixelify', monospace; }
.btn { border: 2px solid #0d0616; border-radius: 12px; padding: 8px 13px; font-family: inherit; font-weight: 600; font-size: 12.5px; cursor: pointer;
  box-shadow: 0 3px 0 rgba(0,0,0,.4); transition: transform .14s var(--spring); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.4); }
.btn.gold { background: linear-gradient(180deg, var(--gold), var(--gold-deep)); color: var(--ink); }
.btn.ghost { background: linear-gradient(180deg, var(--plum-5), var(--plum-6)); color: var(--cream); }

.lrow { padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 12.5px; color: var(--cream-dim); }
.lrow:first-child { color: var(--cream); }
/* manor stats dashboard */
.dash { background: rgba(13,6,22,.45); border: 2px solid rgba(255,255,255,.09); border-radius: 15px; padding: 12px; margin-bottom: 12px; }
.dash-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 12.5px; border-bottom: 1px solid rgba(255,255,255,.05); }
.dash-row b { font-family: 'Pixelify', monospace; color: var(--gold); font-size: 11.5px; text-align: right; }
#tillSpark { display: block; width: 100%; height: 54px; margin-top: 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.08); image-rendering: pixelated; }
.dash-cap { font-family: 'Pixelify', monospace; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2, #6b7494); text-align: center; margin-top: 4px; }
.journal-box { background: rgba(255,209,102,.08); border: 2px dashed var(--gold-deep); border-radius: 14px; padding: 11px; margin-bottom: 12px; }
.journal-box h4 { font-size: 13px; color: var(--gold); margin-bottom: 7px; font-weight: 600; }
.journal-box .jp { font-size: 12px; padding: 3px 0; }

.quotabox { background: rgba(225,29,72,.1); border: 2px solid rgba(225,29,72,.45); border-radius: 14px; padding: 12px; margin-bottom: 12px; }
.quotabox.met { background: rgba(87,211,140,.1); border-color: rgba(87,211,140,.5); }
.qb-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.qb-top span { font-family: 'Pixelify', monospace; font-size: 11px; color: var(--cream-dim); }
.qb-bar { height: 9px; background: #150c24; border-radius: 999px; overflow: hidden; border: 1px solid #0d0616; }
.qb-bar i { display: block; height: 100%; background: linear-gradient(90deg, #7a3bd6, var(--rose)); transition: width .4s var(--ease); }
.quotabox.met .qb-bar i { background: linear-gradient(90deg, #2f9e63, var(--green)); }
.qb-note { font-size: 11.5px; color: var(--cream-dim); margin-top: 8px; line-height: 1.45; }

.goalrow { margin-bottom: 9px; padding: 10px 12px; background: rgba(255,255,255,.03); border-radius: 13px; border: 1px solid rgba(255,255,255,.07); }
.goalrow.done { background: rgba(87,211,140,.1); border-color: rgba(87,211,140,.35); }
.gr-top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 7px; }
.gr-top span { color: var(--gold); font-family: 'Pixelify', monospace; font-size: 11px; }
.gr-bar { height: 7px; background: #150c24; border-radius: 999px; overflow: hidden; }
.gr-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); transition: width .4s var(--ease); }

/* ============================================================
   MODALS
   ============================================================ */
.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 90; padding: 18px; }
.modal.open { display: flex; }
.modal-card {
  width: min(420px, 94vw); max-height: 86vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--plum-6), var(--plum-8));
  border: 2px solid #0d0616; border-radius: 22px; padding: 20px;
  box-shadow: var(--shadow-drop);
  animation: pop .34s var(--spring);
}
@keyframes pop { from { transform: scale(.9) translateY(14px); opacity: 0 } to { transform: none; opacity: 1 } }
.modal-card h2 { font-size: 21px; font-weight: 600; margin-bottom: 12px; }
.modal-card h2 em { font-style: normal; color: var(--gold); }
#nightBody .nrow { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.07); font-size: 13px; }
#nightBody .nrow b { font-family: 'Pixelify', monospace; color: var(--gold); }
#nightBody .nrow.good b { color: var(--green); }
#nightBody .nrow.bad b { color: var(--rose); }
.ngrid { margin-top: 12px; display: grid; gap: 6px; }
.ngoal { font-size: 12px; padding: 7px 9px; border-radius: 10px; background: rgba(255,255,255,.04); color: var(--cream-dim); }
.ngoal.done { background: rgba(87,211,140,.14); color: var(--cream); }
.ngoal em { color: var(--gold); font-style: normal; }
.modal-actions { display: flex; gap: 9px; margin-top: 16px; }
.modal-actions .btn { flex: 1; text-align: center; padding: 12px; font-size: 14px; }

#profArt canvas { width: 72px; height: 108px; image-rendering: pixelated; }
.prof-top { display: flex; gap: 14px; margin-bottom: 14px; }
.prof-name { font-size: 19px; font-weight: 600; }
.prof-niche { font-size: 12px; color: var(--gold); margin-bottom: 8px; }
.prof-thought { font-size: 12.5px; color: var(--cream-dim); font-style: italic; min-height: 34px; }
.prof-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 14px; margin: 12px 0; font-size: 12.5px; }
.prof-stats span { color: var(--cream-dim); }
.prof-stats b { font-family: 'Pixelify', monospace; color: var(--cream); float: right; }
.fearbar { height: 10px; background: #150c24; border-radius: 999px; overflow: hidden; border: 1px solid #0d0616; margin-top: 4px; }
.fearbar i { display: block; height: 100%; background: linear-gradient(90deg, #7a3bd6, var(--rose)); }

/* ============================================================
   FABs (guest / prop actions)
   ============================================================ */
.fab { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.6); opacity: 0;
  display: none; gap: 8px; z-index: 85; transition: transform .28s var(--spring), opacity .2s; }
.fab.open { display: flex; transform: translate(-50%, -50%) scale(1); opacity: 1; }
.fab-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 10px 13px; border-radius: 999px; border: 2px solid #0d0616;
  background: linear-gradient(180deg, var(--plum-5), var(--plum-6)); color: var(--cream);
  font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,.4);
}
.fab-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.4); }
.fab-btn.gold { background: linear-gradient(180deg, var(--gold), var(--gold-deep)); color: var(--ink); }
.fab-btn.rose { background: linear-gradient(180deg, #ff6b81, var(--rose)); color: #fff; }

/* ============================================================
   PLACEMENT MODE
   ============================================================ */
#dim { position: fixed; inset: 0; background: rgba(10,4,20,.34); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 65; }
#dim.open { opacity: 1; }
#placeBar {
  position: fixed; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translateX(-50%) translateY(30px);
  display: flex; align-items: center; gap: 10px; opacity: 0; pointer-events: none;
  background: linear-gradient(180deg, var(--plum-6), var(--plum-7));
  border: 2px solid #0d0616; border-radius: 18px; padding: 9px 12px; z-index: 86;
  box-shadow: var(--shadow-drop); transition: all .3s var(--spring);
}
#placeBar.open { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
#placeInfo { font-size: 12.5px; }
#placeName { font-weight: 600; display: block; }
#placeCost { font-family: 'Pixelify', monospace; color: var(--gold); font-size: 11px; }
.pbtn { width: 46px; height: 46px; border-radius: 14px; border: 2px solid #0d0616; font-size: 19px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,.4); transition: transform .14s var(--spring); }
.pbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.4); }
#placeOk { background: linear-gradient(180deg, #6ee7a5, var(--green)); color: var(--ink); }
#placeOk.bad { background: linear-gradient(180deg, #ff8fa3, var(--rose)); color: #fff; }
#placeNo { background: linear-gradient(180deg, var(--plum-4, #5a3682), var(--plum-6)); color: var(--cream); }

/* ============================================================
   FLOORS + STICK + MISC
   ============================================================ */
#floors { position: fixed; right: 10px; bottom: calc(92px + var(--safe-b)); display: flex; flex-direction: column; gap: 6px; z-index: 58; }
.fbtn {
  width: 42px; height: 42px; border-radius: 13px; border: 2px solid #0d0616;
  background: linear-gradient(180deg, var(--plum-5), var(--plum-6)); color: var(--cream);
  font-family: 'Pixelify', monospace; font-size: 12px; font-weight: 700; cursor: pointer;
  box-shadow: 0 3px 0 rgba(0,0,0,.4);
}
.fbtn.on { background: linear-gradient(180deg, var(--gold), var(--gold-deep)); color: var(--ink); }
.fbtn.locked { opacity: .45; }
.fbtn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.4); }

#stick {
  position: fixed; left: calc(14px + env(safe-area-inset-left, 0px)); bottom: calc(88px + var(--safe-b));
  width: 104px; height: 104px; border-radius: 50%; z-index: 62;
  background: radial-gradient(circle, rgba(42,24,66,.5), rgba(20,10,31,.28));
  border: 2px solid rgba(13,6,22,.85); touch-action: none; opacity: .32;
  transition: opacity .25s;
}
#stick.active, #stick:hover { opacity: .92; }
#nub { position: absolute; left: 50%; top: 50%; width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--plum-4, #5a3682), var(--plum-6)); border: 2px solid #0d0616;
  box-shadow: 0 3px 0 rgba(0,0,0,.4); pointer-events: none; }

#ticketPop {
  position: fixed; top: calc(48px + var(--safe-t)); right: 10px; z-index: 88;
  background: linear-gradient(180deg, var(--plum-6), var(--plum-7));
  border: 2px solid #0d0616; border-radius: 16px; padding: 12px 14px; width: 220px;
  box-shadow: var(--shadow-drop); display: none;
}
#ticketPop.open { display: block; animation: pop .3s var(--spring); }
#ticketPop label { font-size: 12px; color: var(--cream-dim); display: block; margin-bottom: 8px; }
#ticketSlider { width: 100%; accent-color: var(--gold); }
.ticket-scale { display: flex; justify-content: space-between; font-family: 'Pixelify', monospace; font-size: 10px; color: var(--cream-dim); margin-top: 4px; }

#toast {
  position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translateX(-50%) translateY(20px);
  background: linear-gradient(180deg, var(--plum-5), var(--plum-7));
  border: 2px solid #0d0616; border-radius: 999px; padding: 10px 18px;
  font-size: 13px; font-weight: 600; opacity: 0; pointer-events: none; z-index: 95;
  box-shadow: var(--shadow-drop); transition: all .28s var(--spring); max-width: 88vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
/* a sheet is open: float the toast up top so it never covers panel content */
body.sheet-open #toast { bottom: auto; top: calc(74px + var(--safe-t)); transform: translateX(-50%) translateY(-20px); }
body.sheet-open #toast.show { transform: translateX(-50%) translateY(0); }
#toast.good { border-color: var(--green); }
#toast.warn { border-color: var(--rose); }
#toast.info { border-color: var(--gold-deep); }

/* intro */
#intro { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 30%, rgba(74,53,115,.85), rgba(9,4,18,.97)); padding: 20px; }
#intro.open { display: flex; }
.intro-card { width: min(460px, 94vw); text-align: center; }
.intro-title { font-family: 'Pixelify', monospace; font-size: clamp(28px, 8vw, 46px); line-height: 1.05; color: var(--cream);
  text-shadow: 0 4px 0 #0d0616, 0 0 30px rgba(255,209,102,.3); margin-bottom: 10px; }
.intro-sub { font-size: 14px; color: var(--cream-dim); line-height: 1.6; margin-bottom: 22px; }
.intro-sub b { color: var(--gold); }
#introGo { width: 100%; padding: 16px; font-size: 17px; }

@media (max-width: 430px) {
  .chip.spacer { display: none; }
  #nightBtn { margin-left: auto; }
  #stars { font-size: 12px; }
}
@media (max-width: 400px) {
  .dock-btn { min-width: 50px; padding: 6px; font-size: 9px; }
  .dock-btn .di { font-size: 18px; }
  .chip { padding: 5px 9px; font-size: 12px; }
  #stick { width: 88px; height: 88px; }
  #stick { bottom: calc(84px + var(--safe-b)); }
}
@media (min-width: 900px) {
  #stick { opacity: .28; }
}

