:root {
  --ink: #3b2f4a;
  --ink2: #7a6f8a;
  --cream: #fff8ec;
  --card: #fffdf8;
  --line: #efe3cf;
  --accent: #ffad1f;
  --green: #3ccf8e;
  --red: #ff5c6c;
  --gold: #ffcf3f;
  --shadow: 0 10px 30px rgba(59, 47, 74, .18);
  --accent-dark: color-mix(in srgb, var(--accent) 72%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 14%, #fff);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #5cc7ee; color: var(--ink);
  font-family: 'Fredoka', system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
}
input, select { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
kbd {
  display: inline-block; min-width: 20px; padding: 0 5px; margin: 0 1px;
  border-radius: 6px; background: #fff; border: 1.5px solid var(--line); border-bottom-width: 3px;
  font: 600 12px/18px 'Fredoka', system-ui, sans-serif; text-align: center; color: var(--ink);
}
#world { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* ------------------------------------------------ buttons */
.btn {
  border: 0; border-radius: 16px; padding: 10px 16px; font-weight: 600;
  background: var(--card); box-shadow: 0 4px 0 rgba(59, 47, 74, .14);
  transition: transform .08s, box-shadow .08s, opacity .2s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(59, 47, 74, .14); }
.btn.primary { background: var(--accent); color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .15); box-shadow: 0 5px 0 var(--accent-dark); }
.btn.primary:active { box-shadow: 0 2px 0 var(--accent-dark); }
.btn.big { width: 100%; padding: 15px 20px; font-size: 18px; border-radius: 20px; margin-top: 8px; }
.btn.sm { padding: 7px 11px; font-size: 13px; border-radius: 12px; }
.btn.ghost { background: #f4ecdf; box-shadow: none; }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: .4; pointer-events: none; }

/* ------------------------------------------------ HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud > * { pointer-events: auto; }
.world-chip {
  position: absolute; top: max(14px, env(safe-area-inset-top)); left: 14px;
  background: var(--card); border-radius: 18px; padding: 8px 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; max-width: 230px;
}
#hud-world { font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#hud-saved { font-size: 13px; color: var(--ink2); }
#hud-mission {
  position: absolute; top: max(14px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  width: min(360px, calc(100% - 520px)); min-width: 260px;
  background: var(--card); border-radius: 18px; padding: 10px 14px; box-shadow: var(--shadow); cursor: pointer;
  transition: transform .15s;
}
#hud-mission:active { transform: translateX(-50%) scale(.98); }
.m-top { display: flex; gap: 8px; align-items: baseline; font-size: 13px; color: var(--ink2); white-space: nowrap; }
.m-top b { color: var(--ink); font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
.m-sub { font-size: 12px; color: var(--ink2); }
.bar { height: 12px; background: #efe6d6; border-radius: 99px; overflow: hidden; margin: 6px 0 3px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #fff)); border-radius: 99px; transition: width .9s cubic-bezier(.3, 1.3, .5, 1); }
.bar.big { height: 18px; }

.hud-buttons { position: absolute; right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.hb {
  width: 66px; height: 66px; border-radius: 22px; border: 0; background: var(--card); position: relative;
  box-shadow: 0 5px 0 rgba(59, 47, 74, .16), var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  transition: transform .1s;
}
.hb span { font-size: 25px; line-height: 1; }
.hb small { font-size: 11px; font-weight: 600; }
.hb:active { transform: translateY(3px); }
.hb.on { background: var(--accent); color: #fff; }
.hb .badge {
  position: absolute; top: -5px; right: -5px; min-width: 22px; height: 22px; padding: 0 6px;
  background: var(--red); color: #fff; border-radius: 99px; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
}
.pulse { animation: pulse 1.3s infinite; z-index: 2; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 80%, transparent), var(--shadow); }
  100% { box-shadow: 0 0 0 20px transparent, var(--shadow); }
}
#interact-btn {
  position: absolute; left: 50%; bottom: max(28px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  border: 0; background: var(--card); border-radius: 99px; padding: 10px 18px 10px 12px; font-weight: 600; font-size: 16px;
  box-shadow: 0 5px 0 rgba(59, 47, 74, .16), var(--shadow); display: flex; gap: 10px; align-items: center;
  max-width: calc(100% - 200px); white-space: nowrap; animation: popin .3s cubic-bezier(.3, 1.6, .5, 1);
}
#interact-btn span { overflow: hidden; text-overflow: ellipsis; }
#interact-btn kbd { background: var(--accent); color: #fff; border-color: var(--accent-dark); font-size: 14px; min-width: 26px; line-height: 22px; }
@keyframes popin { from { transform: translateX(-50%) scale(.6); opacity: 0; } }
#place-bar {
  position: absolute; left: 50%; bottom: max(28px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--card); border-radius: 22px; padding: 10px 10px 10px 16px; box-shadow: var(--shadow);
  display: flex; gap: 8px; align-items: center; width: max-content; max-width: calc(100% - 24px);
}
#place-text { font-size: 15px; margin-right: 4px; }

/* ------------------------------------------------ tutorial */
#tutorial {
  position: fixed; left: 14px; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 6;
  width: min(380px, calc(100% - 110px));
  background: var(--card); border-radius: 24px; padding: 14px 16px 12px 14px; box-shadow: var(--shadow);
  display: flex; gap: 12px; border: 3px solid transparent; transition: border-color .3s;
}
body.placing #tutorial { display: none; }
#tutorial.pop { animation: tutpop .45s cubic-bezier(.3, 1.6, .5, 1); }
#tutorial.ok { border-color: var(--green); }
@keyframes tutpop { from { transform: translateY(20px) scale(.92); opacity: 0; } }
.pip { width: 46px; height: 46px; flex: none; border-radius: 50%; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 26px; animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px) rotate(-6deg); } }
.tut-title { font-weight: 700; font-size: 17px; margin-bottom: 2px; }
.tut-text { font-size: 14.5px; line-height: 1.4; color: #5a4f6a; }
.tut-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.tut-dots { display: flex; gap: 4px; flex: 1; }
.tut-dots i { width: 7px; height: 7px; border-radius: 99px; background: #e6dccb; }
.tut-dots i.done { background: var(--green); }
.tut-dots i.on { width: 18px; background: var(--accent); }
.tut-skip { border: 0; background: none; color: var(--ink2); font-size: 13px; padding: 4px; }

/* ------------------------------------------------ modals */
.modal-wrap { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; }
.backdrop { position: absolute; inset: 0; background: rgba(40, 30, 60, .35); opacity: 0; transition: opacity .25s; }
.sheet {
  position: relative; width: min(520px, calc(100% - 24px)); max-height: calc(100% - 40px);
  background: var(--cream); border-radius: 30px; box-shadow: 0 20px 60px rgba(40, 30, 60, .3);
  display: flex; flex-direction: column; transform: translateY(40px) scale(.95); opacity: 0;
  transition: transform .3s cubic-bezier(.3, 1.4, .5, 1), opacity .2s;
}
.sheet.tall { height: min(760px, calc(100% - 40px)); }
.modal-wrap.in .sheet { transform: none; opacity: 1; }
.modal-wrap.in .backdrop { opacity: 1; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 18px 6px 22px; }
.sheet-head h2 { margin: 0; font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x { border: 0; background: #f1e7d6; width: 38px; height: 38px; border-radius: 13px; flex: none; font-size: 15px; }
.sheet-body { overflow: auto; padding: 8px 20px 22px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.panel h3 { font-size: 16px; margin: 18px 0 8px; }
.panel h3 small { color: var(--ink2); font-weight: 500; }
.explain { font-size: 13.5px; line-height: 1.45; background: var(--accent-soft); border-radius: 16px; padding: 10px 12px; color: #5a4f6a; }
.bank { margin-top: 10px; font-size: 14px; background: #ffe9f0; border-radius: 16px; padding: 10px 12px; }
.quest { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.quest li { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 14px; padding: 8px 10px; box-shadow: 0 2px 0 var(--line); }
.quest li.now { outline: 2.5px solid var(--accent); }
.qn { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; flex: none; }
.qi { flex: 1; min-width: 0; }
.qi b { font-size: 14px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qi .bar { height: 7px; margin: 4px 0 0; }
.ib { border: 0; background: #f4ecdf; border-radius: 10px; width: 30px; height: 30px; flex: none; }
.ib:disabled { opacity: .3; }
.cards { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.card { display: flex; gap: 12px; background: var(--card); border-radius: 20px; padding: 10px; box-shadow: 0 3px 0 var(--line); }
.card.done { box-shadow: 0 3px 0 var(--green); }
.thumb { width: 84px; height: 84px; border-radius: 16px; background: #f4ecdf; flex: none; overflow: hidden; position: relative; display: flex; align-items: center; justify-content: center; }
.thumb[data-act] { cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb canvas { width: 84px; height: 84px; }
.thumb canvas.mini { position: absolute; right: 3px; bottom: 3px; width: 34px; height: 34px; background: rgba(255, 255, 255, .9); border-radius: 10px; }
.thumb-ico { font-size: 34px; }
.info { flex: 1; min-width: 0; }
.name { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.name[data-act] { cursor: pointer; }
.price { font-size: 13px; color: var(--ink2); }
.row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.row.center { justify-content: center; }
.col { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.chips { margin-top: 4px; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: #f1e7d6; }
.chip.acc { background: var(--accent-soft); color: var(--accent-dark); }
.chip.green { background: #dcf8eb; color: #1f9a63; }
.chip.gold { background: #fff1c2; color: #a87b00; }
.chip.center { display: block; text-align: center; padding: 10px; font-size: 14px; }
.empty { text-align: center; padding: 22px 10px; color: var(--ink2); background: var(--card); border-radius: 20px; border: 2px dashed var(--line); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats div { background: var(--card); border-radius: 16px; padding: 10px; text-align: center; box-shadow: 0 2px 0 var(--line); }
.stats b { display: block; font-size: 18px; }
.stats span { font-size: 12px; color: var(--ink2); }
.sold { margin-top: 16px; background: var(--card); border-radius: 16px; padding: 10px 14px; }
.sold summary { font-weight: 600; cursor: pointer; }
.sold-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.sold-row span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted { color: var(--ink2); font-size: 13px; }
.center { text-align: center; }

/* forms */
.form .fld { display: block; margin: 14px 0; }
.fld > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.form input, .fld select {
  width: 100%; font: inherit; font-size: 17px; padding: 12px 14px; border-radius: 14px;
  border: 2.5px solid var(--line); background: #fff; color: var(--ink); outline: none; transition: border-color .2s;
}
.form input:focus, .fld select:focus { border-color: var(--accent); }
.form input::placeholder, .ob-input::placeholder { color: #cbbfae; }
.money { display: flex; align-items: center; gap: 8px; }
.money b { font-size: 18px; color: var(--ink2); }
.money.big input { font-size: 30px; font-weight: 600; text-align: center; }
.photo-pick { display: block; cursor: pointer; }
.ph { border: 3px dashed #e3d5bd; border-radius: 22px; height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ink2); gap: 4px; background: #fffdf8; transition: background .2s; }
.ph:hover { background: var(--accent-soft); }
.ph-ico { font-size: 32px; }
.photo-pick img { width: 100%; height: 180px; object-fit: cover; border-radius: 22px; display: block; }
.cos-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cos { border: 3px solid transparent; background: #fff; border-radius: 16px; padding: 4px 2px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; box-shadow: 0 2px 0 var(--line); transition: transform .15s; }
.cos:active { transform: scale(.95); }
.cos.on { border-color: var(--accent); background: var(--accent-soft); }
.cos canvas { width: 64px; height: 64px; }
.sell-photo img { width: 100%; height: 170px; object-fit: cover; border-radius: 22px; }
.sell-ico { font-size: 64px; text-align: center; }
.sell-form p { font-size: 17px; margin: 12px 0; }
.sell-form p.muted { font-size: 13.5px; }
.want-hero { position: relative; border-radius: 24px; overflow: hidden; background: #f4ecdf; height: 200px; display: flex; align-items: center; justify-content: center; }
.want-hero img { width: 100%; height: 100%; object-fit: cover; }
.want-hero canvas { width: 150px; height: 150px; }
.want-hero canvas.mini { position: absolute; right: 8px; bottom: 8px; width: 64px; height: 64px; background: rgba(255, 255, 255, .9); border-radius: 16px; }
.want-price { font-size: 28px; font-weight: 700; margin-top: 12px; }
.want-price span { font-size: 16px; color: var(--ink2); font-weight: 500; }
.want-hint { font-size: 14.5px; color: #5a4f6a; margin: 6px 0 4px; }
.who { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 20px; padding: 10px; }
.who canvas { width: 90px; height: 100px; }
.who b { display: block; font-size: 20px; }
.who span { display: block; color: var(--ink2); }
.who small { display: block; font-size: 12.5px; margin-top: 4px; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* toasts + celebration */
#toasts { position: fixed; top: 104px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(440px, calc(100% - 24px)); }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 16px; font-size: 14.5px; box-shadow: var(--shadow); text-align: center; animation: toastin .35s cubic-bezier(.3, 1.5, .5, 1); transition: opacity .35s, transform .35s; }
.toast.out { opacity: 0; transform: translateY(-10px); }
@keyframes toastin { from { opacity: 0; transform: translateY(-14px) scale(.9); } }
.celebrate { position: fixed; inset: 0; z-index: 45; display: flex; align-items: center; justify-content: center; background: rgba(40, 30, 60, .25); opacity: 0; transition: opacity .3s; }
.celebrate.in { opacity: 1; }
.celebrate.out { opacity: 0; }
.cele-card { background: var(--cream); border-radius: 32px; padding: 26px 28px; text-align: center; width: min(360px, calc(100% - 32px)); box-shadow: 0 20px 60px rgba(40, 30, 60, .35); animation: celepop .6s cubic-bezier(.3, 1.6, .5, 1); }
.cele-burst { font-size: 64px; animation: bob 1s ease-in-out infinite; }
.cele-card h2 { margin: 6px 0; font-size: 28px; color: var(--accent-dark); letter-spacing: .5px; }
.cele-card p { font-size: 17px; margin: 0 0 10px; }
@keyframes celepop { from { transform: scale(.5) rotate(-6deg); opacity: 0; } }

/* ------------------------------------------------ onboarding */
#onboarding { position: fixed; inset: 0; z-index: 30; overflow: auto; --sky1: #9fdcff; --sky2: #fff3c9; }
.ob-sky { position: fixed; inset: 0; background: linear-gradient(180deg, var(--sky1), var(--sky2)); overflow: hidden; }
.cloud { position: absolute; background: #fff; border-radius: 99px; opacity: .85; animation: drift linear infinite; }
.cloud::before, .cloud::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 46%; height: 140%; left: 14%; top: -70%; }
.cloud::after { width: 34%; height: 110%; left: 50%; top: -48%; }
.c1 { top: 10%; width: 170px; height: 50px; animation-duration: 46s; animation-delay: -10s; }
.c2 { top: 32%; width: 120px; height: 36px; animation-duration: 60s; animation-delay: -35s; opacity: .7; }
.c3 { top: 66%; width: 210px; height: 60px; animation-duration: 54s; animation-delay: -5s; opacity: .75; }
.c4 { top: 84%; width: 140px; height: 42px; animation-duration: 40s; animation-delay: -24s; opacity: .6; }
#onboarding.dark .cloud { opacity: .14; }
@keyframes drift { from { transform: translateX(-30vw); } to { transform: translateX(130vw); } }
.ob-stage { position: relative; min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px 14px; }
.ob-card {
  width: min(560px, 100%); background: rgba(255, 253, 248, .93); border-radius: 36px; padding: 28px 24px 24px;
  box-shadow: 0 20px 60px rgba(59, 47, 74, .25); text-align: center;
  transform: translateY(26px) scale(.97); opacity: 0; transition: transform .45s cubic-bezier(.3, 1.4, .5, 1), opacity .3s;
}
.ob-card.in { transform: none; opacity: 1; }
.ob-card.ob-design, .ob-card.ob-atmo, .ob-card.ob-plot { width: min(860px, 100%); }
.ob-card h2 { font-size: 28px; margin: 4px 0 8px; }
.ob-logo { font-size: 46px; font-weight: 700; letter-spacing: 2px; }
.ob-logo span { color: var(--accent); }
.ob-badge { display: inline-block; background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; padding: 6px 14px; border-radius: 99px; margin: 6px 0 4px; }
.ob-small { font-size: 18px; color: var(--ink2); font-weight: 500; }
.ob-title { font-size: clamp(64px, 16vw, 104px); margin: 0 0 6px; line-height: 1; font-weight: 700; letter-spacing: 2px; }
.ob-title span { display: inline-block; animation: hop 1.8s ease-in-out infinite; animation-delay: calc(var(--i) * .12s); text-shadow: 0 6px 0 rgba(59, 47, 74, .14); }
.ob-title span:nth-child(1) { color: #ff6b6b; }
.ob-title span:nth-child(2) { color: #ffad1f; }
.ob-title span:nth-child(3) { color: #3ccf8e; }
.ob-title span:nth-child(4) { color: #5aa9e6; }
.ob-title span:nth-child(5) { color: #b07cff; }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-14px) rotate(-5deg); } }
.ob-sub { font-size: 17px; color: #5a4f6a; line-height: 1.45; margin: 6px auto 12px; max-width: 420px; }
.ob-foot { margin-top: 14px; font-size: 12px; color: var(--ink2); letter-spacing: 1px; }
.ob-emoji { font-size: 52px; animation: bob 2s ease-in-out infinite; }
.ob-input {
  display: block; width: 100%; text-align: center; font: inherit; font-size: 26px; font-weight: 600; padding: 14px;
  border-radius: 20px; border: 3px solid var(--line); background: #fff; color: var(--ink); outline: none; margin: 14px 0 10px;
  transition: border-color .2s; letter-spacing: .5px;
}
.ob-input:focus { border-color: var(--accent); }
.ob-err { color: var(--red); font-weight: 500; margin-bottom: 6px; }
.ob-nav { display: flex; gap: 10px; margin-top: 16px; }
.ob-nav .btn { margin-top: 0; }
.ob-nav .back { flex: none; width: 64px; font-size: 20px; }
.ob-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 14px; }
.ob-dots i { width: 8px; height: 8px; border-radius: 99px; background: #e6dccb; transition: all .3s; }
.ob-dots i.done { background: color-mix(in srgb, var(--accent) 50%, #fff); }
.ob-dots i.on { width: 24px; background: var(--accent); }
.ob-card canvas { max-width: 100%; height: auto; }
.ob-choices { display: grid; gap: 12px; margin: 16px 0 4px; }
.ob-choices.three { grid-template-columns: repeat(3, 1fr); }
.ob-choices.grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.ob-choices.plots { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.choice {
  border: 3px solid transparent; background: #fff; border-radius: 24px; padding: 10px 8px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 600; font-size: 15px;
  box-shadow: 0 4px 0 var(--line); transition: transform .15s, border-color .15s;
}
.choice:hover { transform: translateY(-3px); }
.choice.on { border-color: var(--accent); box-shadow: 0 4px 0 var(--accent-dark); background: var(--accent-soft); }
.choice canvas { border-radius: 16px; }
.choice small { font-weight: 400; color: var(--ink2); font-size: 13px; }
.designer { display: grid; grid-template-columns: 220px 1fr; gap: 20px; text-align: left; margin-top: 10px; }
.d-preview { background: radial-gradient(circle at 50% 75%, #fff, var(--accent-soft)); border-radius: 26px; display: flex; flex-direction: column; align-items: center; padding: 10px 10px 14px; align-self: start; position: sticky; top: 0; }
.d-turn { display: flex; gap: 8px; }
.d-turn button { border: 0; background: #fff; border-radius: 14px; width: 48px; height: 42px; font-size: 19px; box-shadow: 0 3px 0 var(--line); }
.opt-row { margin-bottom: 14px; }
.opt-row > span { font-weight: 600; font-size: 14px; display: block; margin-bottom: 7px; }
.sws, .chips-row { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; background: var(--c); box-shadow: 0 0 0 2px var(--line); transition: transform .15s, box-shadow .15s; padding: 0; }
.sw.on { box-shadow: 0 0 0 3px var(--accent); transform: scale(1.12); }
.chip-opt { border: 0; background: #fff; border-radius: 99px; padding: 7px 13px; font-weight: 600; font-size: 13.5px; box-shadow: 0 2px 0 var(--line); }
.chip-opt.on { background: var(--accent); color: #fff; box-shadow: 0 2px 0 var(--accent-dark); }
#onboarding.leaving .ob-card { transform: scale(.6) rotate(12deg); opacity: 0; transition: all .5s ease-in; }
#swirl { position: fixed; inset: 0; z-index: 40; width: 100%; height: 100%; transition: opacity .6s; }
#swirl.fade { opacity: 0; }

/* ------------------------------------------------ radio */
#radio {
  position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; width: 232px;
  background: var(--card); border-radius: 20px; padding: 9px 11px 9px; box-shadow: var(--shadow);
}
.rd-top { display: flex; align-items: center; gap: 9px; }
.rd-label { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.rd-label small { font-size: 10.5px; font-weight: 600; letter-spacing: .6px; color: var(--ink2); }
.rd-name { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-eq { display: flex; align-items: flex-end; gap: 2.5px; width: 26px; height: 22px; flex: none; padding: 3px 4px; border-radius: 9px; background: var(--accent-soft); box-sizing: content-box; }
.rd-eq i { flex: 1; height: 25%; background: var(--accent); border-radius: 2px; transition: height .3s; }
#radio.on .rd-eq i { animation: eq .9s ease-in-out infinite alternate; }
#radio.on .rd-eq i:nth-child(2) { animation-delay: -.3s; animation-duration: .7s; }
#radio.on .rd-eq i:nth-child(3) { animation-delay: -.6s; animation-duration: 1.1s; }
#radio.on .rd-eq i:nth-child(4) { animation-delay: -.15s; animation-duration: .8s; }
@keyframes eq { from { height: 20%; } to { height: 100%; } }
#radio.tuning .rd-name { animation: tune .12s steps(2) infinite; }
#radio.tuning .rd-eq i { animation: none; height: 15%; }
@keyframes tune { 50% { opacity: .25; transform: translateX(1.5px); } }
.rd-dots { display: flex; gap: 3px; flex: none; }
.rd-dots i { width: 6px; height: 6px; border-radius: 99px; background: #e6dccb; transition: all .25s; }
.rd-dots i.on { width: 14px; background: var(--accent); }
.rd-ctrl { display: flex; align-items: center; gap: 4px; margin-top: 7px; }
.rd-ctrl button { border: 0; background: #f4ecdf; width: 30px; height: 30px; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 0; flex: none; transition: transform .08s; }
.rd-ctrl button:active { transform: scale(.9); }
.rd-ctrl svg { width: 16px; height: 16px; fill: var(--ink); }
.rd-ctrl .rd-play { background: var(--accent); width: 36px; height: 34px; border-radius: 12px; box-shadow: 0 3px 0 var(--accent-dark); }
.rd-ctrl .rd-play svg { fill: #fff; width: 18px; height: 18px; }
.rd-sep { width: 1.5px; height: 20px; background: var(--line); margin: 0 3px; flex: none; }
.rd-vol { flex: 1; display: flex; align-items: flex-end; gap: 1.5px; height: 16px; min-width: 0; }
.rd-vol i { flex: 1; background: #e6dccb; border-radius: 1.5px; }
.rd-vol i:nth-child(1) { height: 25%; } .rd-vol i:nth-child(2) { height: 33%; } .rd-vol i:nth-child(3) { height: 41%; } .rd-vol i:nth-child(4) { height: 50%; } .rd-vol i:nth-child(5) { height: 58%; }
.rd-vol i:nth-child(6) { height: 66%; } .rd-vol i:nth-child(7) { height: 75%; } .rd-vol i:nth-child(8) { height: 83%; } .rd-vol i:nth-child(9) { height: 91%; } .rd-vol i:nth-child(10) { height: 100%; }
.rd-vol i.f { background: var(--accent); }

/* ------------------------------------------------ phones */
@media (max-width: 760px) {
  #hud-mission { width: auto; min-width: 0; left: 12px; right: 12px; transform: none; top: max(10px, env(safe-area-inset-top)); }
  #hud-mission:active { transform: scale(.98); }
  #radio { top: calc(max(10px, env(safe-area-inset-top)) + 84px); right: 12px; width: 206px; padding: 7px 9px; border-radius: 16px; }
  .rd-ctrl button { width: 27px; height: 27px; }
  .rd-ctrl .rd-play { width: 32px; height: 30px; }
  .rd-name { font-size: 13.5px; }
  #radio .rd-dots { display: none; }
  .world-chip { max-width: calc(100% - 238px); top: calc(max(10px, env(safe-area-inset-top)) + 84px); left: 12px; padding: 6px 12px; border-radius: 14px; }
  #hud-world { font-size: 14px; }
  #hud-saved { font-size: 11.5px; }
  .hud-buttons { flex-direction: row; right: auto; left: 50%; transform: translateX(-50%); bottom: max(12px, env(safe-area-inset-bottom)); gap: 8px; }
  .hb { width: 62px; height: 60px; border-radius: 20px; }
  #interact-btn, #place-bar { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 76px); }
  #interact-btn { max-width: calc(100% - 24px); }
  #tutorial { left: 12px; right: 12px; width: auto; bottom: auto; top: calc(max(10px, env(safe-area-inset-top)) + 160px); }
  #toasts { top: auto; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 140px); }
  .modal-wrap { align-items: flex-end; }
  .sheet { width: 100%; max-height: 92%; border-radius: 30px 30px 0 0; }
  .sheet.tall { height: 92%; }
  .designer { grid-template-columns: 1fr; }
  .d-preview { position: relative; }
  .ob-card { padding: 22px 16px 18px; border-radius: 30px; }
  .ob-card h2 { font-size: 24px; }
  .ob-choices.three { gap: 8px; }
  .ob-choices.grid { grid-template-columns: repeat(2, 1fr); }
}

/* in-app confirm */
.ask-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(40, 30, 60, .35); opacity: 0; transition: opacity .2s; padding: 16px; }
.ask-wrap.in { opacity: 1; }
.ask { background: var(--cream); border-radius: 26px; padding: 20px; width: min(360px, 100%); text-align: center; box-shadow: 0 20px 60px rgba(40, 30, 60, .3); animation: celepop .35s cubic-bezier(.3, 1.6, .5, 1); }
.ask p { font-size: 16.5px; line-height: 1.4; margin: 4px 0 14px; }
.ask .row .btn { flex: 1; margin: 0; }
.btn.primary.red { background: var(--red); box-shadow: 0 5px 0 #c9404e; }

/* menu */
.menu-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 4px; }
.menu-item { display: flex; align-items: center; gap: 12px; border: 0; background: var(--card); border-radius: 18px; padding: 11px 14px; text-align: left; box-shadow: 0 3px 0 var(--line); transition: transform .1s; }
.menu-item:active { transform: translateY(2px); }
.mi-ico { width: 40px; height: 40px; border-radius: 13px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 21px; flex: none; }
.mi-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mi-txt b { font-size: 15.5px; }
.mi-txt small { font-size: 12.5px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mi-go { font-size: 24px; color: var(--ink2); }
.sheet.wide { width: min(760px, calc(100% - 24px)); }
.char-edit .designer { margin-top: 0; grid-template-columns: 200px 1fr; }
.char-edit .fld { margin-top: 0; }
@media (max-width: 760px) { .sheet.wide { width: 100%; } .char-edit .designer { grid-template-columns: 1fr; } }

/* login / create account */
.auth-tabs { display: flex; gap: 4px; background: #f1e7d6; border-radius: 16px; padding: 4px; margin: 14px 0 6px; }
.auth-tabs button { flex: 1; border: 0; background: none; border-radius: 12px; padding: 10px; font-weight: 600; font-size: 15px; color: var(--ink2); transition: background .2s, color .2s; }
.auth-tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 0 var(--line); }
.auth-form .ob-input.sm { font-size: 18px; padding: 12px 14px; margin: 8px 0; border-radius: 16px; }
.auth-note { font-size: 14px; color: #5a4f6a; background: var(--accent-soft); border-radius: 14px; padding: 9px 12px; margin: 8px 0 4px; }
.auth-form .muted { margin: 10px 0 0; line-height: 1.45; }
.ob-err { margin-top: 4px; }

/* starter looks strip in the character designer */
.presets { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.preset { flex: none; width: 50px; height: 58px; border: 2.5px solid transparent; border-radius: 14px; background: #fff; box-shadow: 0 2px 0 var(--line); padding: 1px; display: flex; align-items: flex-end; justify-content: center; }
.preset:hover { border-color: var(--accent); }
.preset canvas { width: 44px; height: 52px; }
.designer > * { min-width: 0; }

/* colour choice under the structure grid (vending machine) */
.cos-var { margin-top: 10px; background: #fff; border-radius: 16px; padding: 10px 12px; box-shadow: 0 2px 0 var(--line); }
.cos-var > span { display: block; font-weight: 600; font-size: 13px; margin-bottom: 7px; }

/* ------------------------------------------------ 3D world */
#world3d { position: fixed; inset: 0; width: 100%; height: 100%; display: none; touch-action: none; }
#labels3d { position: fixed; inset: 0; pointer-events: none; z-index: 4; overflow: hidden; }
.lbl3d { position: absolute; left: 0; top: 0; background: rgba(255, 248, 236, .95); border-radius: 13px; padding: 6px 10px 7px; min-width: 104px; box-shadow: 0 4px 14px rgba(40, 30, 60, .16); will-change: transform; }
.lbl3d .lr { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; white-space: nowrap; }
.lbl3d b { font-size: 13px; }
.lbl3d small { font-size: 11px; color: var(--ink2); }
.lbl3d .lb { height: 6px; background: #e8dcc8; border-radius: 3px; margin-top: 4px; overflow: hidden; }
.lbl3d .lb i { display: block; height: 100%; border-radius: 3px; }
.lbl3d .tgt { position: absolute; left: 50%; top: -26px; transform: translateX(-50%); font-size: 20px; animation: bob 1.4s ease-in-out infinite; }
.emote3d { position: absolute; left: 0; top: 0; background: #fff; border-radius: 12px; padding: 3px 8px; font-size: 18px; box-shadow: 0 4px 12px rgba(40, 30, 60, .18); }
.emote3d::after { content: ''; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-top-color: #fff; border-bottom: 0; }
body::after { content: ''; position: fixed; inset: 0; background: #fff; opacity: var(--flash, 0); pointer-events: none; z-index: 3; }

/* ------------------------------------------------ social */
.home-pill { margin-top: 6px; border: 0; background: var(--accent); color: #fff; font-weight: 600; font-size: 13px; border-radius: 99px; padding: 5px 10px; box-shadow: 0 3px 0 var(--accent-dark); }
.world-chip.visiting { outline: 3px solid #d93a3a; }
.tabs { display: flex; gap: 4px; background: #f1e7d6; border-radius: 16px; padding: 4px; margin-bottom: 8px; position: sticky; top: 0; z-index: 2; }
.tabs button { flex: 1; border: 0; background: none; border-radius: 12px; padding: 9px 4px; font-weight: 600; font-size: 14px; color: var(--ink2); }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 0 var(--line); }
.prow { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 18px; padding: 6px 12px 6px 6px; margin: 6px 0; box-shadow: 0 2px 0 var(--line); cursor: pointer; }
.prow canvas { flex: none; border-radius: 14px; background: radial-gradient(circle at 50% 80%, #fff, var(--accent-soft)); }
.pinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pinfo b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pinfo small { font-size: 12.5px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tags { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.tag { font-style: normal; font-size: 11px; font-weight: 600; background: #f1e7d6; border-radius: 99px; padding: 2px 8px; }
.tag.red { background: #ffe1e1; color: #c22f2f; }
.online { font-style: normal; font-size: 11px; color: #1f9a63; font-weight: 600; }
.req { background: #fffaf0; border: 2px dashed #f0dcb8; border-radius: 18px; padding: 4px 8px 8px; margin: 8px 0; }
.req .prow { box-shadow: none; background: none; margin: 0; padding-left: 0; }
.req .row { margin-top: 2px; }
.update { font-size: 13.5px; background: var(--card); border-radius: 14px; padding: 8px 12px; margin: 6px 0; }
.update[data-act] { cursor: pointer; }
.ago { font-size: 11px; color: var(--ink2); flex: none; display: flex; align-items: center; gap: 6px; }
.dot { font-style: normal; background: var(--red); color: #fff; border-radius: 99px; min-width: 18px; height: 18px; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.chat-row.unread b::after { content: ' •'; color: var(--red); }
.search-row { display: flex; flex-direction: column; gap: 8px; }
.sinput { font: inherit; font-size: 17px; padding: 12px 14px; border-radius: 14px; border: 2.5px solid var(--line); background: #fff; outline: none; color: var(--ink); }
.sinput:focus { border-color: var(--accent); }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; border: 0; border-radius: 12px; padding: 8px; font-weight: 600; background: #fff; box-shadow: 0 2px 0 var(--line); }
.seg button.on { background: var(--accent); color: #fff; box-shadow: 0 2px 0 var(--accent-dark); }
.pro-head { display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: 22px; padding: 10px; }
.pro-av { border-radius: 20px; background: radial-gradient(circle at 50% 80%, #fff, var(--accent-soft)); }
.pro-head h3 { margin: 0; font-size: 22px; }
.pro-head small { color: var(--ink2); }
.pro-world { margin-top: 4px; font-weight: 600; font-size: 14px; }
.linkbox { background: #fff0f0; border: 2px solid #f7c4c4; border-radius: 18px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.chipbtn { border: 0; background: #fff; border-radius: 99px; padding: 3px 10px; font-weight: 600; font-size: 13px; box-shadow: 0 2px 0 #f0caca; }
.btn.red { background: #d93a3a; color: #fff; box-shadow: 0 5px 0 #a82a2a; text-shadow: 0 1px 0 rgba(0,0,0,.15); }
.btn.red:active { box-shadow: 0 2px 0 #a82a2a; }
.chat { display: flex; flex-direction: column; height: 100%; min-height: 50vh; }
.msgs { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 6px; padding: 4px 2px 10px; }
.bubble { align-self: flex-start; max-width: 78%; background: #fff; border-radius: 18px 18px 18px 6px; padding: 8px 12px; font-size: 15px; box-shadow: 0 2px 0 var(--line); word-wrap: break-word; }
.bubble span { display: block; font-size: 10.5px; color: var(--ink2); margin-top: 2px; }
.bubble.me { align-self: flex-end; background: var(--accent); color: #fff; border-radius: 18px 18px 6px 18px; box-shadow: 0 2px 0 var(--accent-dark); }
.bubble.me span { color: rgba(255,255,255,.8); }
.bubble.sys { align-self: center; background: #f1e7d6; font-size: 12.5px; box-shadow: none; }
.chat-send { display: flex; gap: 8px; position: sticky; bottom: 0; background: var(--cream); padding-top: 6px; }
.chat-send input { flex: 1; font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 14px; border: 2.5px solid var(--line); outline: none; }
.chat-send .btn { margin: 0; }
.perm-ask { text-align: left; display: flex; flex-direction: column; gap: 8px; }
.perm-ask p { text-align: center; }
.perm-opt { border: 2.5px solid transparent; background: #fff; border-radius: 16px; padding: 10px 12px; text-align: left; display: grid; grid-template-columns: 34px 1fr; gap: 0 8px; box-shadow: 0 2px 0 var(--line); }
.perm-opt span { grid-row: span 2; font-size: 24px; }
.perm-opt small { color: var(--ink2); font-size: 12.5px; }
.perm-opt.on { border-color: var(--accent); }

/* the doodle contract */
.paper { position: relative; background: #fffaf0 repeating-linear-gradient(transparent 0 29px, #eadcc2 29px 30px); border: 3px solid #2b2233; border-radius: 255px 18px 225px 18px / 18px 225px 18px 255px; padding: 18px 18px 22px; font-family: 'Patrick Hand', 'Fredoka', cursive; font-size: 19px; line-height: 1.45; color: #2b2233; transform: rotate(-0.4deg); box-shadow: 4px 6px 0 rgba(43,34,51,.12); }
.doodle { width: 100%; height: auto; display: block; margin-bottom: 2px; }
.c-title { font-family: 'Patrick Hand', cursive; font-size: 30px; text-align: center; margin: 0 0 6px; letter-spacing: .5px; }
.c-intro { margin: 4px 0 10px; }
.red { color: #d93a3a; font-weight: 700; }
.clause { display: flex; gap: 10px; align-items: flex-start; background: rgba(255,255,255,.7); border: 2px dashed #2b2233; border-radius: 14px; padding: 8px 10px; margin: 8px 0; }
.ci { font-size: 26px; line-height: 1; }
.perm-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; font-family: 'Fredoka', sans-serif; }
.pill { border: 2px solid #2b2233; background: #fff; border-radius: 99px; padding: 3px 10px; font-size: 13px; font-weight: 600; font-family: inherit; }
.pill.on { background: #ffd166; }
.c-small { font-size: 16px; margin: 4px 0; }
.c-rules { margin: 8px 0; padding-left: 22px; font-size: 17px; }
.c-note { font-style: italic; }
.c-noteinput { width: 100%; font-family: 'Patrick Hand', cursive; font-size: 19px; border: 0; border-bottom: 2px dashed #2b2233; background: transparent; padding: 4px 2px; outline: none; margin: 4px 0 10px; }
.sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.sig { display: flex; flex-direction: column; align-items: center; }
.sig b { border-top: 2px solid #2b2233; width: 100%; text-align: center; margin-top: 2px; font-size: 18px; }
.sig small { font-size: 14px; color: #6b5f7a; }
.sig-slot { width: 100%; min-height: 96px; display: flex; align-items: flex-end; justify-content: center; }
.sig-slot img { max-width: 100%; max-height: 110px; }
.waiting { font-size: 15px; color: #8a7f99; margin-bottom: 8px; }
.sigpad { position: relative; width: 100%; }
.sigpad canvas { width: 100%; height: 120px; display: block; background: rgba(255,214,102,.18); border-radius: 12px; touch-action: none; cursor: crosshair; }
.sig-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #b7a37c; pointer-events: none; font-size: 20px; }
.sig-clear { position: absolute; right: 4px; top: 4px; border: 0; background: #fff; border-radius: 8px; font-size: 12px; padding: 2px 8px; font-family: 'Fredoka', sans-serif; }
.stamp { position: absolute; right: 14px; top: 46%; transform: rotate(-14deg); border: 4px solid #d93a3a; color: #d93a3a; font-size: 26px; font-weight: 700; padding: 2px 12px; border-radius: 10px; opacity: .85; font-family: 'Fredoka', sans-serif; }
.stamp.grey { border-color: #9a93a6; color: #9a93a6; }
.contract-wrap .col { margin-top: 16px; }

/* guests without full access: hide anything that changes the island */
.sheet.readonly [data-act]:not([data-act="open"]):not([data-act="locate"]), .sheet.readonly .btn.big.primary { display: none !important; }
.sheet.readonly .sheet-head h2::after { content: ' 👀'; }

/* name tags over other players */
.name3d { position: absolute; left: 0; top: 0; background: #d93a3a; color: #fff; font-weight: 600; font-size: 12.5px; border-radius: 99px; padding: 2px 9px; white-space: nowrap; box-shadow: 0 3px 8px rgba(0,0,0,.15); }

@media (max-width: 760px) {
  .hb { width: 54px; height: 56px; border-radius: 18px; }
  .hb small { font-size: 10px; }
  .hb span { font-size: 22px; }
  .paper { font-size: 17px; padding: 14px 12px 18px; }
  .c-title { font-size: 25px; }
}

/* ---- travel loading card (crossing a bridge) ---- */
#travel { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 50% 40%, #8fdcf5, #3fa9d6 70%, #2b88b8); opacity: 0; pointer-events: none; transition: opacity .45s ease; }
#travel.on { opacity: 1; pointer-events: auto; }
.tv-card { text-align: center; color: #fff; font-family: 'Fredoka', system-ui, sans-serif; transform: translateY(10px) scale(.96); transition: transform .5s cubic-bezier(.2,1.4,.4,1); max-width: 100%; }
#travel.on .tv-card { transform: none; }
.tv-head { font-size: 18px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; opacity: .9; margin-top: 18px; }
.tv-world { font-size: clamp(30px, 8vw, 52px); font-weight: 700; line-height: 1.1; margin: 6px 0 4px; text-shadow: 0 3px 0 rgba(0,0,0,.15); overflow-wrap: anywhere; }
.tv-owner { font-family: 'Patrick Hand', 'Fredoka', sans-serif; font-size: 22px; opacity: .95; }
.tv-owner b { color: #ffe27a; }
.tv-bridge { display: flex; gap: 5px; justify-content: center; align-items: flex-end; height: 34px; }
.tv-bridge i { width: 16px; height: 10px; border-radius: 3px; background: #e2453c; box-shadow: 0 3px 0 #a92d27; animation: tvPlank 1.2s ease-in-out infinite; }
.tv-bridge i:nth-child(2) { animation-delay: .1s; margin-bottom: 8px; } .tv-bridge i:nth-child(3) { animation-delay: .2s; margin-bottom: 12px; }
.tv-bridge i:nth-child(4) { animation-delay: .3s; margin-bottom: 8px; } .tv-bridge i:nth-child(5) { animation-delay: .4s; }
@keyframes tvPlank { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.tv-dots { margin-top: 18px; display: flex; gap: 8px; justify-content: center; }
.tv-dots span { width: 9px; height: 9px; border-radius: 50%; background: #fff; opacity: .4; animation: tvDot 1s infinite; }
.tv-dots span:nth-child(2) { animation-delay: .15s; } .tv-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes tvDot { 50% { opacity: 1; transform: translateY(-4px); } }

/* ---- levels, XP, pocket, sidekicks ---- */
.lvl-pill { display: flex; align-items: center; gap: 7px; margin-top: 5px; border: 0; padding: 3px 8px 3px 3px; background: #fff3d6; border-radius: 99px; cursor: pointer; font: inherit; color: var(--ink); align-self: flex-start; }
.lvl-pill b { background: linear-gradient(180deg, #ffd23f, #f5a623); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 99px; text-shadow: 0 1px 0 rgba(0,0,0,.18); white-space: nowrap; }
.lvl-pill .xpbar { width: 74px; height: 8px; background: #f1e2bf; border-radius: 99px; overflow: hidden; }
.lvl-pill .xpbar i { display: block; height: 100%; background: linear-gradient(90deg, #ffb800, #ffe17a); border-radius: 99px; transition: width .8s cubic-bezier(.3, 1.3, .5, 1); }
.lvl-pill.bump { animation: lvlbump .5s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes lvlbump { 40% { transform: scale(1.12); } }
.xp-pop { position: fixed; z-index: 30; transform: translateX(-50%); pointer-events: none; font-weight: 700; color: #e09a00; background: #fffbea; border-radius: 99px; padding: 3px 10px; font-size: 14px; box-shadow: var(--shadow); white-space: nowrap; animation: xppop 1.6s ease-out forwards; }
.xp-pop small { color: var(--ink2); font-weight: 500; }
@keyframes xppop { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.7); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.05); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, 18px); } }
.hb .badge.soft { background: #8f7bff; }
#interact-btn.sky { background: linear-gradient(90deg, #fff6c8, #ffe1f0); animation: popin .3s cubic-bezier(.3, 1.6, .5, 1), skyglow 1.6s ease-in-out infinite; }
@keyframes skyglow { 50% { box-shadow: 0 5px 0 rgba(59, 47, 74, .16), 0 0 26px 6px rgba(255, 220, 120, .7); } }

.lvl-badge { width: 92px; height: 92px; margin: 0 auto 4px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe98a, #f5a623 70%); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 6px 0 #c7820f, 0 10px 30px rgba(245, 166, 35, .5); text-shadow: 0 2px 0 rgba(0,0,0,.15); animation: bob 2s ease-in-out infinite; }
.lvl-badge span { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; }
.lvl-badge b { font-size: 40px; line-height: 1; }
.lvl-badge.sm { width: 70px; height: 70px; margin: 0; flex: none; animation: none; }
.lvl-badge.sm b { font-size: 30px; }
.unlock { display: flex; gap: 12px; align-items: center; text-align: left; background: #fff; border-radius: 18px; padding: 10px 12px; margin: 8px 0; box-shadow: 0 2px 0 var(--line); }
.unlock > span { font-size: 34px; }
.unlock b { display: block; font-size: 16px; }
.unlock small { color: var(--ink2); font-size: 13px; line-height: 1.35; display: block; }
.lvlup .cele-card { padding-top: 22px; }
.lvlup .btn { margin-top: 8px; width: 100%; }

.lvl-head { display: flex; gap: 14px; align-items: center; }
.lvl-prog { flex: 1; }
.lvl-prog small { color: var(--ink2); }
.road { display: flex; flex-direction: column; gap: 8px; }
.road-step { display: flex; gap: 10px; align-items: center; background: var(--card); border-radius: 16px; padding: 9px 12px; opacity: .72; }
.road-step.done { opacity: 1; background: #fff6dc; }
.road-step.soon { border: 2px dashed var(--line); background: transparent; }
.rs-lvl { width: 30px; height: 30px; flex: none; border-radius: 50%; background: #efe6d6; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.road-step.done .rs-lvl { background: #f5a623; color: #fff; }
.rs-ico { font-size: 24px; width: 30px; text-align: center; flex: none; }
.road-step b { display: block; font-size: 15px; }
.road-step small { color: var(--ink2); font-size: 12.5px; line-height: 1.3; display: block; }
.xp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.xp-grid div { display: flex; align-items: center; gap: 7px; background: var(--card); border-radius: 12px; padding: 7px 9px; font-size: 13px; }
.xp-grid b { flex: 1; font-weight: 500; }
.xp-grid i { font-style: normal; font-weight: 700; color: #e09a00; white-space: nowrap; }

.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.tool { display: flex; gap: 9px; align-items: center; background: #fff6dc; border-radius: 16px; padding: 9px 11px; }
.tool.locked { background: var(--card); opacity: .7; }
.tool > span { font-size: 26px; }
.tool b { display: block; font-size: 14px; }
.tool small { color: var(--ink2); font-size: 12px; }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.pk { position: relative; border: 2.5px solid transparent; background: var(--card); border-radius: 18px; padding: 6px 4px 7px; display: flex; flex-direction: column; align-items: center; font: inherit; color: var(--ink); cursor: pointer; }
.pk.on { border-color: var(--accent); background: var(--accent-soft); }
.pk img, .pk .emo { width: 56px; height: 56px; object-fit: contain; font-size: 34px; line-height: 56px; }
.pk b { position: absolute; top: 4px; right: 6px; font-size: 12px; background: #fff; border-radius: 99px; padding: 0 6px; box-shadow: 0 1px 0 var(--line); }
.pk small { font-size: 11.5px; font-weight: 600; }
.pk-act { margin-top: 12px; background: #fff; border-radius: 20px; padding: 12px; box-shadow: 0 2px 0 var(--line); }
.pk-sel { display: flex; gap: 10px; align-items: center; }
.pk-sel img.big, .pk-sel .emo.big { width: 72px; height: 72px; object-fit: contain; font-size: 44px; text-align: center; }
.pk-sel b { display: block; font-size: 17px; }
.pk-sel small { color: var(--ink2); font-size: 13px; }
.row.wrap .btn { flex: 1 1 auto; }

.pet-reveal .cele-card { display: flex; flex-direction: column; gap: 4px; }
.pet-reveal .fld { text-align: left; margin: 6px 0 10px; }
.pet-reveal .fld input { width: 100%; }
.pet-pic img, .pet-pic .emo { width: 190px; height: 190px; object-fit: contain; margin: 0 auto; display: block; font-size: 120px; line-height: 190px; animation: petdrop .8s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes petdrop { 0% { transform: translateY(-60px) scale(.6); opacity: 0; } 100% { transform: none; opacity: 1; } }
.rare { font-weight: 800; letter-spacing: 1px; color: #e0559a; background: linear-gradient(90deg, #ffe1f0, #fff3c2, #e1f3ff); border-radius: 99px; padding: 4px 12px; align-self: center; animation: bob 1.2s ease-in-out infinite; }
.pet-hero { display: flex; gap: 12px; align-items: center; }
.pet-hero img, .pet-hero .emo { width: 120px; height: 120px; object-fit: contain; flex: none; font-size: 80px; text-align: center; line-height: 120px; }
.pet-hero h3 { margin: 0; font-size: 22px; }
.pet-hero small { display: block; color: var(--ink2); }
.hearts { font-size: 16px; letter-spacing: 1px; margin: 3px 0; }
.pet-acts { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 14px 0 8px; }
.pet-acts .btn { padding-left: 6px; padding-right: 6px; font-size: 14px; }
.petsheet > .btn.ghost { margin-top: 10px; width: 100%; }
.name3d.pet { background: #fff6dc; color: #a86d00; font-size: 11px; }
@media (max-width: 520px) {
  .lvl-pill .xpbar { width: 54px; }
  .pet-acts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  /* 7 buttons in one row on phones: let them share the width */
  .hud-buttons { width: calc(100% - 16px); justify-content: center; gap: 5px; }
  .hud-buttons .hb { flex: 0 1 54px; min-width: 0; }
  .hud-buttons .hb small { font-size: 9.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
}

/* ---- meeting players: emotes, prompts, voice ---- */
#meet-btns { position: absolute; left: 14px; bottom: max(14px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
#meet-btns .round { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--card); font-size: 26px; box-shadow: 0 4px 0 rgba(59,47,74,.16), var(--shadow); }
.voice-pill { display: flex; align-items: center; gap: 6px; border: 0; background: var(--card); border-radius: 99px; padding: 8px 14px 8px 10px; font: inherit; font-weight: 600; box-shadow: 0 4px 0 rgba(59,47,74,.16), var(--shadow); color: var(--ink2); }
.voice-pill .mic { font-size: 18px; filter: grayscale(1); }
.voice-pill.on { background: #dcf8eb; color: #1f9a63; }
.voice-pill.on .mic { filter: none; }
.voice-pill .lvl { width: 4px; height: 16px; border-radius: 2px; background: #3ccf8e; transform: scaleY(0); transform-origin: bottom; transition: transform .08s; }
#meet-prompts { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); z-index: 20; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 32px)); }
.meet-prompt { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 20px; padding: 10px 12px; box-shadow: 0 6px 0 rgba(59,47,74,.14), var(--shadow); animation: popin .35s cubic-bezier(.3, 1.6, .5, 1); font-size: 14px; }
.meet-prompt .mp-ico { font-size: 30px; animation: bob 1s ease-in-out infinite; }
.meet-prompt > div { flex: 1; }
.meet-prompt .x { border: 0; background: none; font-size: 16px; color: var(--ink2); }
.emote-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0; }
.emote-grid.small { grid-template-columns: repeat(2, 1fr); }
.emote { border: 0; background: var(--card); border-radius: 18px; padding: 12px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; font: inherit; color: var(--ink); box-shadow: 0 3px 0 var(--line); cursor: pointer; }
.emote span { font-size: 32px; }
.emote small { font-size: 12px; font-weight: 600; text-align: center; }
.emote:active { transform: translateY(2px); }
.name3d.talking { background: #1fbf75; box-shadow: 0 0 0 3px rgba(31,191,117,.35), 0 3px 8px rgba(0,0,0,.15); }

/* ---- NewThings ---- */
#held-chip { position: absolute; left: 76px; bottom: max(14px, env(safe-area-inset-bottom)); width: 52px; height: 52px; border-radius: 50%; border: 3px solid #fff; background: radial-gradient(circle at 40% 35%, #fff, #ffe9b8); box-shadow: 0 4px 0 rgba(59,47,74,.16), var(--shadow); padding: 0; touch-action: none; user-select: none; -webkit-user-select: none; }
#held-chip img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
#held-chip .ring { position: absolute; inset: -6px; border-radius: 50%; border: 4px solid var(--accent); clip-path: inset(0 0 100% 0); pointer-events: none; }
#held-chip.pressing .ring { animation: ringfill .55s linear forwards; }
@keyframes ringfill { to { clip-path: inset(0 0 0 0); } }
.pk.nt { border-color: color-mix(in srgb, var(--rc) 40%, transparent); }
.pk.nt.on { border-color: var(--rc); background: color-mix(in srgb, var(--rc) 12%, #fff); }
.pk .held-dot, .pk .seal-dot { position: absolute; top: 4px; left: 6px; font-style: normal; font-size: 13px; }
.pk .seal-dot { left: auto; right: 6px; top: 24px; }
.rtag { display: inline-block; font-size: 11px; font-weight: 700; color: #fff; background: var(--rc, #999); border-radius: 99px; padding: 1px 8px; }
.nt-reveal .cele-card { border: 4px solid var(--rc); }
.nt-rarity { align-self: center; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: #fff; background: var(--rc); border-radius: 99px; padding: 3px 14px; font-size: 13px; margin: 4px auto; display: inline-block; }
.nt-serial { font-weight: 700; color: var(--rc, var(--ink2)); font-size: 15px; }
.nt-trade .prow.on { outline: 3px solid var(--accent); border-radius: 16px; }
.nt-trade .btn.big { width: 100%; margin-top: 12px; }
.inspect { position: fixed; inset: 0; z-index: 60; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rc) 22%, #2c2440), #15111f 75%); display: flex; flex-direction: column; color: #fff; opacity: 0; transition: opacity .25s; }
.inspect.in { opacity: 1; }
.ins-top { display: flex; justify-content: space-between; align-items: flex-start; padding: max(16px, env(safe-area-inset-top)) 18px 0; }
.ins-top b { font-size: 20px; }
.ins-top small { display: block; margin-top: 4px; color: #d8d0ea; }
.ins-top .rtag { background: var(--rc); }
.ins-top .x { border: 0; background: rgba(255,255,255,.15); color: #fff; width: 40px; height: 40px; border-radius: 50%; font-size: 18px; }
.ins-cv { flex: 1; width: 100%; min-height: 0; touch-action: none; cursor: grab; }
.ins-hint { text-align: center; font-size: 13px; color: #cfc6e2; }
.ins-bar { padding: 10px 16px max(16px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ins-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
.ins-tools .sw { width: 30px; height: 30px; }
.bsz { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 18px; }
.bsz.on { background: var(--accent); }
.ins-warn { margin: 0; font-size: 13px; color: #ffd27a; }
.ins-note { margin: 0; font-size: 14px; color: #e8e0f6; text-align: center; }
.inspect .btn.ghost { color: #fff; border-color: rgba(255,255,255,.35); }

/* ---- seasonal structures ---- */
.season-head { background: linear-gradient(90deg, #fff1d6, #ffe1ec); border-radius: 14px; padding: 8px 12px; margin-bottom: 8px; }
.season-head b { display: block; font-size: 14px; }
.season-head small { color: var(--ink2); font-size: 12px; line-height: 1.3; }
.cos { position: relative; }
.cos-tag { position: absolute; top: 3px; left: 3px; font-style: normal; font-size: 9.5px; font-weight: 700; background: #fff1d6; color: #b46a00; border-radius: 99px; padding: 1px 5px; }
.cos-tag.last { background: #ffe0e0; color: #d63a3a; }
.cos-xp { font-style: normal; font-size: 10px; font-weight: 700; color: #e09a00; }
@media (max-width: 760px) {
  #meet-btns { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 70px); left: 10px; }
  #held-chip { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 70px); left: 70px; }
  #meet-prompts { bottom: 150px; }
}

/* ---- crafting ---- */
.recipes { display: flex; flex-direction: column; gap: 6px; }
.recipe { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 16px; padding: 7px 10px; opacity: .75; }
.recipe.ok { opacity: 1; background: #fff; box-shadow: 0 2px 0 var(--line); }
.rc-out { position: relative; width: 52px; height: 52px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 30px; }
.rc-out img { width: 52px; height: 52px; object-fit: contain; }
.rc-out b { position: absolute; right: -4px; bottom: -2px; font-size: 11px; background: #fff3d6; border-radius: 99px; padding: 0 5px; }
.rc-info { flex: 1; min-width: 0; }
.rc-info b { font-size: 14px; }
.rc-need { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 12px; margin-top: 2px; }
.rc-need span { white-space: nowrap; }
.rc-need .miss { color: #d63a3a; }
#build-bar { position: absolute; left: 50%; top: calc(max(14px, env(safe-area-inset-top)) + 80px); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 99px; padding: 8px 10px 8px 16px; box-shadow: var(--shadow); white-space: nowrap; max-width: calc(100% - 24px); overflow-x: auto; }
.bb-item small { color: var(--ink2); }
body.building #interact-btn { display: none; }
@media (max-width: 760px) { #build-bar { top: auto; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 140px); } }

/* ---- patch: actions, fishing, catalog, shop, bonding, farming ---- */
#interact-info { position: absolute; left: calc(50% + 120px); bottom: max(30px, env(safe-area-inset-bottom)); width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--card); box-shadow: var(--shadow); font-size: 18px; }
body.building #interact-info { display: none; }
#fish-hint { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); z-index: 30; background: var(--card); border-radius: 99px; padding: 10px 18px; font-weight: 700; font-size: 17px; box-shadow: var(--shadow); animation: popin .3s cubic-bezier(.3, 1.6, .5, 1); pointer-events: none; }
#reel { position: fixed; inset: 0; z-index: 55; display: flex; align-items: center; justify-content: center; background: rgba(30, 60, 90, .35); }
.reel-card { background: var(--cream); border-radius: 28px; padding: 18px 22px; width: min(320px, calc(100% - 32px)); text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.3); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.reel-card small { color: var(--ink2); }
.reel-wrap { display: flex; gap: 12px; align-items: flex-end; }
.reel-bar { position: relative; width: 64px; height: 260px; background: linear-gradient(#bfe9ff, #3d9bff); border-radius: 18px; overflow: hidden; box-shadow: inset 0 0 0 3px rgba(255,255,255,.5); }
.reel-zone { position: absolute; left: 4px; right: 4px; height: 74px; border-radius: 12px; background: rgba(60, 207, 142, .45); border: 3px solid #3ccf8e; }
.reel-zone.on { background: rgba(60, 207, 142, .75); }
.reel-fish { position: absolute; left: 0; right: 0; font-size: 28px; line-height: 28px; text-align: center; }
.reel-prog { width: 14px; height: 260px; background: #efe6d6; border-radius: 99px; display: flex; align-items: flex-end; overflow: hidden; }
.reel-prog i { display: block; width: 100%; background: linear-gradient(#ffd23f, #3ccf8e); border-radius: 99px; }
.reel-btn { touch-action: none; user-select: none; -webkit-user-select: none; width: 100%; }
.bench-lock { background: #fff6dc; border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.bench-lock small { color: var(--ink2); }
.bl-row { display: grid; grid-template-columns: 90px 1fr 46px; gap: 8px; align-items: center; font-size: 13px; }
.bl-row .bar { margin: 0; }
.style-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.style { position: relative; border: 2.5px solid transparent; background: var(--card); border-radius: 14px; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; font: inherit; color: var(--ink); }
.style span { font-size: 24px; }
.style small { font-size: 10.5px; font-weight: 600; text-align: center; }
.style.on { border-color: var(--accent); background: var(--accent-soft); }
.style.locked { opacity: .55; }
.style i { position: absolute; top: 2px; right: 4px; font-style: normal; font-size: 9.5px; font-weight: 700; color: #d63a8a; }
.style-cols { margin-top: 8px; justify-content: center; }
.bond-next small { color: var(--ink2); }
#farm-bar { position: absolute; left: 50%; top: calc(max(14px, env(safe-area-inset-top)) + 80px); transform: translateX(-50%); display: flex; align-items: center; gap: 6px; background: var(--card); border-radius: 99px; padding: 8px 10px; box-shadow: var(--shadow); white-space: nowrap; max-width: calc(100% - 24px); overflow-x: auto; }
.seed-pick { font: inherit; border: 2px solid var(--line); border-radius: 99px; padding: 5px 8px; background: #fff; }
.farm-btn { width: 100%; margin-bottom: 4px; }
.catalog .cat-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.cat-count { font-size: 18px; }
.cat-head small { color: var(--ink2); }
.cat-filter { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.cat-filter button { border: 0; background: var(--card); border-radius: 99px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink2); }
.cat-filter button.on { background: var(--ink); color: #fff; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.cat-card { position: relative; background: #fff; border-radius: 16px; padding: 8px 6px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 2.5px solid color-mix(in srgb, var(--rc) 35%, transparent); }
.cat-card.missing { background: var(--card); border-style: dashed; }
.cat-no { position: absolute; top: 4px; left: 7px; font-size: 10px; font-weight: 700; color: var(--ink2); }
.cat-pic { width: 76px; height: 76px; display: flex; align-items: center; justify-content: center; font-size: 36px; }
.cat-pic img { width: 100%; height: 100%; object-fit: contain; }
.cat-card.missing .cat-pic img, .cat-card.missing .cat-pic .emo { filter: brightness(0); opacity: .22; }
.cat-card b { font-size: 12px; line-height: 1.2; }
.cat-card small { font-size: 10px; color: var(--ink2); }
.cat-card .rtag { font-size: 9.5px; }
.shop-hero { display: flex; gap: 12px; align-items: center; background: #fff6dc; border-radius: 18px; padding: 12px; margin-bottom: 10px; }
.shop-hero > span { font-size: 36px; }
.shop-hero small { display: block; color: var(--ink2); }
.gift-warn { background: #fff1d6; border-radius: 14px; padding: 10px 12px; font-size: 13px; line-height: 1.4; }
@media (max-width: 760px) {
  #interact-info { left: auto; right: 12px; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 140px); }
  #farm-bar { top: auto; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 140px); }
  .style-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---- NEWMEE logo on the login / welcome screens ---- */
.ob-brand { display: block; width: min(360px, 88%); margin: -78px auto 0; filter: drop-shadow(0 8px 14px rgba(120, 40, 90, .25)); animation: brandpop .8s cubic-bezier(.3, 1.6, .5, 1) both, brandfloat 4s ease-in-out .8s infinite; }
.ob-brand img { display: block; width: 100%; height: auto; }
.ob-brand.sm { width: min(280px, 76%); margin: 2px auto 4px; }
.ob-title-logo { margin: 0; }
@keyframes brandpop { 0% { transform: scale(.4) rotate(-8deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes brandfloat { 50% { transform: translateY(-6px) rotate(-1.5deg); } }

/* ---- held item: quick menu ---- */
#held-chip .hc-pic { display: block; width: 100%; height: 100%; pointer-events: none; }
#held-chip .hc-pic img { width: 100%; height: 100%; object-fit: contain; }
#held-chip .hc-pic .emo { font-size: 26px; line-height: 46px; }
#held-menu { position: absolute; left: 14px; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 64px); display: flex; flex-direction: column; gap: 6px; background: var(--card); border-radius: 18px; padding: 10px; box-shadow: var(--shadow); animation: popin .25s cubic-bezier(.3, 1.6, .5, 1); min-width: 190px; }
#held-menu b { font-size: 13px; padding: 0 4px 2px; }
#held-menu .btn { justify-content: flex-start; }
@media (max-width: 760px) { #held-menu { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 130px); left: 10px; } }
.ins-mode { align-self: center; display: flex; gap: 4px; background: rgba(255,255,255,.14); border-radius: 99px; padding: 4px; margin-top: 6px; }
.ins-mode button { border: 0; background: none; color: #fff; font: inherit; font-weight: 600; font-size: 15px; padding: 8px 18px; border-radius: 99px; cursor: pointer; }
.ins-mode button.on { background: #fff; color: var(--ink); }

/* ---- bonus XP on the Levels screen ---- */
.bonus-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.bonus-card { display: flex; gap: 8px; align-items: center; background: #fff6dc; border-radius: 16px; padding: 10px 12px; }
.bonus-card > span { font-size: 26px; }
.bonus-card b { display: block; font-size: 14px; }
.bonus-card small { color: var(--ink2); font-size: 12px; line-height: 1.3; display: block; }
.weekly { display: flex; flex-direction: column; gap: 6px; }
.wk { display: flex; gap: 10px; align-items: center; background: var(--card); border-radius: 14px; padding: 8px 12px; }
.wk > span { font-size: 22px; }
.wk > div { flex: 1; min-width: 0; }
.wk b { font-size: 14px; }
.wk .bar { height: 8px; margin: 4px 0 0; }
.wk > i { font-style: normal; font-size: 12px; font-weight: 700; color: #e09a00; white-space: nowrap; }
.wk.done { background: #dcf8eb; }
@media (max-width: 520px) { .bonus-row { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- flora: Fern the Seed Handler + Flower Book */
.rar-chip { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .02em; padding: 1px 6px; border-radius: 999px; color: #fff; background: var(--rc); vertical-align: middle; }
.fern-chip { position: absolute; left: 50%; transform: translateX(-50%); top: calc(max(10px, env(safe-area-inset-top)) + 64px); display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px; border-radius: 999px; border: 0; background: #fff8ec; color: #3b2f4a; box-shadow: 0 6px 18px rgba(40, 20, 60, .18); font: inherit; cursor: pointer; animation: fernPulse 2.4s ease-in-out infinite; }
.fern-chip span { font-size: 20px; }
.fern-chip b { font-size: 14px; }
.fern-chip small { font-size: 12px; color: #7a6f86; }
@keyframes fernPulse { 50% { box-shadow: 0 6px 22px rgba(60, 207, 142, .45); } }
.name3d.fern3d { background: #3ccf8e; color: #fff; }
.fern-hi { display: flex; gap: 12px; align-items: flex-start; background: #f2fbf5; border-radius: 16px; padding: 12px; margin-bottom: 12px; }
.fern-av { font-size: 34px; width: 52px; height: 52px; border-radius: 50%; background: #dff5e8; display: grid; place-items: center; flex: none; }
.fern-hi p { margin: 4px 0; font-style: italic; }
.fern-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.fern-card { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 10px; border-radius: 16px; background: #fff; border: 2px solid color-mix(in srgb, var(--rc) 45%, transparent); box-shadow: 0 2px 0 color-mix(in srgb, var(--rc) 30%, transparent); }
.fern-card.sold { opacity: .5; }
.fern-card .fc-pic { width: 84px; height: 84px; display: grid; place-items: center; border-radius: 14px; background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--rc) 22%, #fff), #fff 70%); }
.fern-card .fc-pic img { width: 84px; height: 84px; }
.fern-card small { font-size: 11px; color: #7a6f86; }
.fern-card .tag { position: absolute; top: 6px; left: 6px; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 999px; }
.fern-card .tag.new { background: #ff6b9d; color: #fff; }
.fern-card .tag.wish { background: #ffd23f; color: #3b2f4a; }
.fc-price { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin: 2px 0 4px; }
.fc-price .pr, .fern .pr { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; padding: 2px 6px 2px 2px; border-radius: 999px; background: #f3eef7; }
.fc-price .pr img, .fc-price .pr .emo { width: 22px; height: 22px; font-size: 14px; }
.fc-price .pr.ok { background: #e2f7ea; color: #1d7a4a; }
.fc-price .pr.no { background: #fde8ea; color: #b8323f; }
.fern-ask { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-top: 12px; padding: 10px 12px; border-radius: 14px; background: #fff6dc; font-size: 13px; }
.fern-ask button { flex: none; }
.fern-foot { margin-top: 12px; gap: 10px; align-items: center; flex-wrap: wrap; }
.flower-book .book-tabs { margin-bottom: 10px; }
.book-prog { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 14px; background: #fff3f8; margin-bottom: 10px; }
.book-prog .xpbar { display: block; height: 8px; border-radius: 99px; background: #f6d6e4; overflow: hidden; }
.book-prog .xpbar i { display: block; height: 100%; background: linear-gradient(90deg, #ff8fb1, #ffd23f); border-radius: 99px; }
.book-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; background: #fff; margin-bottom: 6px; }
.book-row.unknown .br-pic, .fruit.unknown .br-pic { filter: grayscale(1); opacity: .5; }
.br-pic { width: 56px; height: 56px; flex: none; display: grid; place-items: center; border-radius: 12px; background: #f6f2fa; }
.br-pic img { width: 56px; height: 56px; }
.br-pic .q { font-size: 24px; font-weight: 800; color: #b8adc6; }
.br-main { flex: 1; min-width: 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.sw { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-style: normal; font-weight: 800; color: #b8adc6; background: #efeaf4; border: 2px dashed #d8cfe2; }
.sw.on { border: 2px solid #fff; box-shadow: 0 0 0 1px #d8cfe2; }
.sw.shim.on { box-shadow: 0 0 0 1px #f5a300, 0 0 8px #ffd76a; }
.pin { border: 0; background: #f3eef7; border-radius: 10px; width: 34px; height: 34px; font-size: 16px; cursor: pointer; filter: grayscale(1); opacity: .6; flex: none; }
.pin.on { background: #fff1b8; filter: none; opacity: 1; }
.fruit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.fruit { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 6px; border-radius: 14px; background: #fff; text-align: center; }
.fruit small { font-size: 11px; }
.fruit .pin { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; font-size: 13px; }
@media (max-width: 520px) { .fern-grid { grid-template-columns: repeat(2, 1fr); } .fern-chip { top: calc(max(10px, env(safe-area-inset-top)) + 130px); } }

/* ---------------------------------------------------------------- house */
#house-fade { position: fixed; inset: 0; background: #1d1726; opacity: 0; pointer-events: none; z-index: 60; transition: opacity .25s ease; }
#house-fade.on { opacity: 1; }
.room-chip { position: absolute; left: 50%; transform: translateX(-50%); top: calc(max(10px, env(safe-area-inset-top)) + 64px); display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px; border-radius: 999px; border: 0; background: #fff8ec; color: #3b2f4a; box-shadow: 0 6px 18px rgba(40, 20, 60, .18); font: inherit; cursor: pointer; }
.room-chip span { font-size: 20px; }
.room-chip b { font-size: 14px; }
.room-chip small { font-size: 12px; color: #7a6f86; }
body.indoors #hud-mission, body.indoors #fern-chip, body.indoors #btn-view, body.indoors #btn-globe { display: none !important; }
.house-cost { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0; }
.house-cost .pr { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; padding: 4px 10px; border-radius: 999px; background: #f3eef7; }
.house-cost .pr.ok { background: #e2f7ea; color: #1d7a4a; }
.house-cost .pr.no { background: #fde8ea; color: #b8323f; }
.house-box { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px; border-radius: 16px; background: #fff3e2; margin: 10px 0; }
.house-box .house-cost { margin: 4px 0; }
@media (max-width: 520px) { .room-chip { top: calc(max(10px, env(safe-area-inset-top)) + 130px); } .room-chip small { display: none; } }
