@font-face { font-family: Fraunces; src: url(../fonts/Fraunces-600.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: Fraunces; src: url(../fonts/Fraunces-800.woff2) format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: Fraunces; src: url(../fonts/Fraunces-Italic-600.woff2) format('woff2'); font-weight: 600; font-style: italic; font-display: swap; }
@font-face { font-family: Nunito; src: url(../fonts/Nunito-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Nunito; src: url(../fonts/Nunito-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: Nunito; src: url(../fonts/Nunito-800.woff2) format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: Nunito; src: url(../fonts/Nunito-900.woff2) format('woff2'); font-weight: 900; font-display: swap; }

:root {
  --paper: #F6EEDC; --card: #FFFAF0; --ink: #3B2A1F; --ink2: rgba(59,42,31,.62); --line: rgba(59,42,31,.16);
  --berry: #E0607E; --sun: #F4C24F; --leaf: #7DB45A; --sea: #5FA3D0; --lav: #B9A8E6; --clay: #C9614C;
  --r: 18px; --shadow: 0 4px 0 rgba(59,42,31,.9);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #5DB2BC; color: var(--ink); font: 500 15px/1.35 Nunito, system-ui, sans-serif; overscroll-behavior: none; user-select: none; -webkit-user-select: none; }
canvas#world { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; }
.ico { width: 22px; height: 22px; display: inline-block; vertical-align: middle; }
.ico.lg { width: 34px; height: 34px; }
.ico.xl { width: 48px; height: 48px; }

/* ---------- HUD ---------- */
.hud { position: fixed; z-index: 5; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-tl { top: calc(12px + var(--safe-t)); left: calc(12px + var(--safe-l)); display: flex; gap: 10px; align-items: flex-start; }
.hud-tr { top: calc(12px + var(--safe-t)); right: calc(12px + var(--safe-r)); display: flex; gap: 8px; }
.hud-b { bottom: calc(12px + var(--safe-b)); left: 50%; transform: translateX(-50%); display: flex; gap: 10px; align-items: flex-end; }
.chip { background: var(--card); border: 2px solid var(--ink); border-radius: 999px; box-shadow: var(--shadow); padding: 5px 12px 5px 6px; display: inline-flex; align-items: center; gap: 6px; font-weight: 900; font-size: 15px; white-space: nowrap; }
.me { background: var(--card); border: 2px solid var(--ink); border-radius: 20px; box-shadow: var(--shadow); padding: 6px 14px 6px 6px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.me .ring { position: relative; width: 42px; height: 42px; flex: none; }
.me .ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.me .ring b { position: absolute; inset: 0; display: grid; place-items: center; font: 900 15px Nunito; }
.me .nm { font: 800 16px Fraunces, Georgia, serif; line-height: 1.1; }
.me .sub { font-size: 12px; color: var(--ink2); font-weight: 700; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.mode { font-size: 12px; font-weight: 800; padding: 4px 10px; background: rgba(255,250,240,.88); border: 1.5px solid var(--ink); border-radius: 999px; box-shadow: 0 2px 0 rgba(59,42,31,.9); }
.mode.on { background: #DFF2D2; }
.ibtn { width: 46px; height: 46px; border-radius: 15px; background: var(--card); border: 2px solid var(--ink); box-shadow: var(--shadow); display: grid; place-items: center; position: relative; padding: 0; transition: transform .08s; }
.ibtn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(59,42,31,.9); }
.ibtn .ico { width: 30px; height: 30px; }
.badge { position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--berry); color: #fff; border: 2px solid var(--ink); font: 900 11px Nunito; display: grid; place-items: center; padding: 0 4px; }
.badge.ok { background: var(--leaf); }

.dock { display: flex; gap: 8px; background: rgba(255,250,240,.92); border: 2px solid var(--ink); border-radius: 22px; box-shadow: var(--shadow); padding: 7px; }
.tcard { width: 64px; border-radius: 14px; border: 2px solid var(--ink); background: #fff; padding: 2px 3px 5px; display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; position: relative; transition: transform .08s; }
.tcard:active { transform: translateY(2px); }
.tcard img { width: 52px; height: 52px; }
.tcard img.pet { width: 56px; height: 56px; margin: -2px 0 -3px; }
.tcard .bars { display: grid; gap: 2px; width: 100%; }
.bar { height: 5px; border-radius: 3px; background: rgba(59,42,31,.12); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; }
.bar.b i { background: #E59A4B; } .bar.j i { background: var(--berry); } .bar.e i { background: var(--leaf); }
.tcard .mood { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; background: var(--card); border: 1.5px solid var(--ink); display: grid; place-items: center; }
.tcard .mood img { width: 16px; height: 16px; }
.tcard.empty { background: rgba(255,255,255,.5); border-style: dashed; color: var(--ink2); font-weight: 800; font-size: 12px; justify-content: center; min-height: 82px; text-align: center; }

/* ---------- panels ---------- */
.veil { position: fixed; inset: 0; z-index: 20; background: rgba(40,30,22,.28); display: grid; place-items: center; padding: 16px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.panel { width: min(560px, 100%); max-height: min(86vh, 760px); display: flex; flex-direction: column; background: var(--card); border: 2.5px solid var(--ink); border-radius: 24px; box-shadow: 0 6px 0 rgba(59,42,31,.95); overflow: hidden; animation: pop .2s cubic-bezier(.3,1.5,.5,1); }
@keyframes pop { from { transform: scale(.92) translateY(10px); opacity: 0; } }
.panel header { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px 20px; border-bottom: 2px dashed var(--line); background: var(--paper); }
.panel header h2 { margin: 0; font: 800 22px/1.1 Fraunces, Georgia, serif; flex: 1; }
.panel header p { margin: 2px 0 0; font-size: 13px; color: var(--ink2); font-weight: 700; }
.panel header .ico { width: 40px; height: 40px; }
.x { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; box-shadow: 0 2px 0 rgba(59,42,31,.85); display: grid; place-items: center; padding: 0; flex: none; align-self: flex-start; cursor: pointer; transition: transform .08s, box-shadow .08s; }
.x:hover { background: var(--paper); }
.x:active { transform: translateY(2px); box-shadow: none; }
.x img { width: 15px; height: 15px; }
.body { padding: 14px 16px 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tab { border: 2px solid var(--ink); border-radius: 999px; padding: 6px 14px; background: #fff; font-weight: 800; font-size: 14px; }
.tab.on { background: var(--ink); color: var(--card); }
.row { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1.5px dashed var(--line); }
.row:last-child { border-bottom: 0; }
.row .ico { width: 42px; height: 42px; flex: none; }
.row .t { flex: 1; min-width: 0; }
.row .t b { display: block; font: 700 16px Fraunces, Georgia, serif; }
.row .t span { font-size: 13px; color: var(--ink2); font-weight: 700; }
.price { font-weight: 900; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.price .ico { width: 18px; height: 18px; }
.btn { border: 2px solid var(--ink); border-radius: 14px; padding: 8px 14px; font-weight: 900; font-size: 14px; background: var(--sun); box-shadow: 0 3px 0 rgba(59,42,31,.9); white-space: nowrap; transition: transform .08s; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(59,42,31,.9); }
.btn.berry { background: var(--berry); color: #fff; } .btn.leaf { background: var(--leaf); } .btn.sea { background: var(--sea); color: #fff; } .btn.ghost { background: #fff; } .btn.lav { background: var(--lav); }
.btn.big { padding: 12px 20px; font-size: 17px; border-radius: 16px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.note { background: var(--paper); border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; font-size: 13.5px; font-weight: 700; color: var(--ink2); margin: 8px 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.slot { border: 2px solid var(--ink); border-radius: 16px; background: #fff; padding: 8px 4px 6px; text-align: center; position: relative; cursor: pointer; }
.slot img { width: 46px; height: 46px; }
.slot .n { position: absolute; top: 4px; right: 6px; font: 900 13px Nunito; }
.slot .lbl { font-size: 12px; font-weight: 800; line-height: 1.15; }
.slot.sel { background: #FFF2C2; }
.qty { display: inline-flex; align-items: center; border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; }
.qty button { width: 28px; height: 32px; border: 0; background: #fff; font-weight: 900; }
.qty span { min-width: 28px; text-align: center; font-weight: 900; }
.tufts { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.tbox { border: 2px solid var(--ink); border-radius: 18px; background: #fff; padding: 8px; text-align: center; cursor: pointer; position: relative; }
.tbox img { width: 84px; height: 84px; display: block; margin: 8px auto -2px; }
.tbox b { display: block; font: 700 15px Fraunces, Georgia, serif; }
.tbox span { font-size: 12px; font-weight: 800; color: var(--ink2); }
.tbox .walk { position: absolute; top: 6px; left: 6px; font: 900 10px Nunito; background: var(--leaf); border: 1.5px solid var(--ink); border-radius: 8px; padding: 1px 6px; }
.rar { display: inline-block; font: 900 11px Nunito; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; border: 1.5px solid var(--ink); }
.rar.common { background: #EDE6D6; } .rar.uncommon { background: #D6EDC4; } .rar.rare { background: #CFE3F6; } .rar.epic { background: #E3D7F7; } .rar.legend { background: #FFE6A3; }
.tufthead { display: flex; gap: 14px; align-items: center; }
.tufthead canvas { width: 150px; height: 150px; flex: none; background: radial-gradient(circle at 50% 62%, #F6ECD6 0 52%, rgba(246,236,214,0) 53%); border-radius: 20px; cursor: pointer; }
.tufthead h3 { margin: 0; font: 800 26px Fraunces, Georgia, serif; }
.tufthead .title { font: 600 italic 15px Fraunces, Georgia, serif; color: var(--ink2); margin: 2px 0 6px; }
.blurb { font: 600 italic 15px/1.4 Fraunces, Georgia, serif; color: var(--ink2); margin: 10px 0; }
.needs { display: grid; gap: 8px; margin: 10px 0 12px; }
.need { display: grid; grid-template-columns: 26px 64px 1fr 38px; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; }
.need .bar { height: 10px; border-radius: 6px; border: 1.5px solid var(--ink); }
.need .ico { width: 24px; height: 24px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.picker { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding: 10px; background: var(--paper); border-radius: 14px; border: 1.5px dashed var(--line); }
.picker .slot { width: 78px; }
.progress { height: 12px; border-radius: 7px; border: 1.5px solid var(--ink); background: #fff; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--leaf); }
input.text { font: 800 16px Nunito; border: 2px solid var(--ink); border-radius: 12px; padding: 9px 12px; background: #fff; width: 100%; color: var(--ink); user-select: text; -webkit-user-select: text; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 2.5px solid var(--ink); }
.swatch.on { outline: 3px solid var(--ink); outline-offset: 2px; }
.looks { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.look { aspect-ratio: 1; border: 2px solid var(--line); border-radius: 16px; background: #fff; padding: 2px; display: grid; place-items: center; transition: transform .08s, border-color .1s; }
.look img { width: 100%; height: 100%; max-width: 64px; max-height: 64px; display: block; }
.look:hover { border-color: rgba(59,42,31,.45); }
.look.on { border: 2.5px solid var(--ink); background: #FFF2C2; box-shadow: 0 3px 0 rgba(59,42,31,.9); transform: translateY(-2px); }
.starters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 14px; }
.starter { border: 2.5px solid var(--ink); border-radius: 20px; background: #fff; padding: 6px; text-align: center; cursor: pointer; transition: transform .1s; }
.starter canvas { width: 100%; aspect-ratio: 1; display: block; }
.starter b { font: 800 17px Fraunces, Georgia, serif; display: block; }
.starter span { font-size: 12px; font-weight: 800; color: var(--ink2); }
.starter.on { background: #FFF2C2; transform: translateY(-3px); box-shadow: var(--shadow); }
h4 { font: 800 16px Fraunces, Georgia, serif; margin: 14px 0 6px; }
.small { font-size: 12.5px; color: var(--ink2); font-weight: 700; }
.credits a { color: inherit; font-weight: 800; overflow-wrap: anywhere; }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 30; top: calc(80px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 460px); }
.toast { background: var(--card); border: 2px solid var(--ink); border-radius: 14px; box-shadow: 0 3px 0 rgba(59,42,31,.9); padding: 9px 14px; font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 8px; animation: pop .2s ease; }
.toast.bad { background: #FDE3E3; }
.toast.good { background: #E6F5D8; }
.toast .ico { width: 24px; height: 24px; }

/* ---------- fishing ---------- */
.fishing { position: fixed; z-index: 25; left: 50%; bottom: calc(120px + var(--safe-b)); transform: translateX(-50%); width: min(420px, 92vw); background: var(--card); border: 2.5px solid var(--ink); border-radius: 22px; box-shadow: 0 5px 0 rgba(59,42,31,.95); padding: 12px 16px 16px; text-align: center; animation: pop .2s ease; }
.fishing b { font: 800 18px Fraunces, Georgia, serif; }
.reel { position: relative; height: 34px; margin: 10px 0 12px; border: 2px solid var(--ink); border-radius: 17px; background: linear-gradient(90deg, #CFE6F2, #9FD0DA); overflow: hidden; }
.reel .zone { position: absolute; top: 0; bottom: 0; background: rgba(244,194,79,.85); border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); }
.reel .zone .sweet { position: absolute; top: 0; bottom: 0; left: 35%; right: 35%; background: rgba(224,96,126,.85); }
.reel .bob { position: absolute; top: 3px; width: 24px; height: 24px; margin-left: -12px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); }
.reel .bob::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 50%; background: var(--berry); border-radius: 12px 12px 0 0; }

/* ---------- hatch / wish reveal ---------- */
.reveal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: radial-gradient(circle at 50% 45%, rgba(255,246,214,.96), rgba(246,238,220,.92) 50%, rgba(60,45,35,.55)); animation: fade .25s; }
.reveal .box { text-align: center; width: min(420px, 92vw); }
.reveal canvas { width: 280px; height: 280px; touch-action: manipulation; cursor: pointer; }
.reveal img.prize { width: 150px; height: 150px; display: block; margin: 0 auto 4px; }
.reveal h3 { font: 800 30px Fraunces, Georgia, serif; margin: 0; }
.reveal p { font-weight: 800; color: var(--ink2); margin: 6px 0 16px; }

/* ---------- loading ---------- */
.loading { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--paper); font: 800 20px Fraunces, Georgia, serif; transition: opacity .4s; }
.loading.gone { opacity: 0; pointer-events: none; }

/* ---------- phones ---------- */
@media (max-width: 720px), (max-height: 520px) {
  .me .nm { font-size: 14px; } .me { padding: 4px 10px 4px 4px; border-radius: 16px; } .me .ring { width: 36px; height: 36px; }
  .chip { font-size: 13px; padding: 4px 10px 4px 5px; }
  .ibtn { width: 40px; height: 40px; border-radius: 13px; } .ibtn .ico { width: 26px; height: 26px; }
  .tcard { width: 54px; } .tcard img { width: 42px; height: 42px; }
  .dock { padding: 5px; gap: 6px; border-radius: 18px; }
  .hud-b { left: calc(8px + var(--safe-l)); right: calc(8px + var(--safe-r)); transform: none; justify-content: center; }
  .veil { place-items: end center; padding: 0; }
  .panel { width: 100%; max-height: 82vh; border-radius: 24px 24px 0 0; border-bottom: 0; animation: up .22s ease; }
  @keyframes up { from { transform: translateY(40px); opacity: 0; } }
  .tufthead canvas { width: 116px; height: 116px; }
  .hud-tr .hide-sm { display: none; }
}
@media (max-height: 520px) {
  .panel { max-height: 94vh; width: min(620px, 100%); border-radius: 24px 24px 0 0; }
  .toasts { top: calc(60px + var(--safe-t)); }
  .fishing { bottom: calc(90px + var(--safe-b)); }
}
@media (max-width: 420px) { .mode { display: none; } }

/* ---------- first-time guide (js/play/guide.js) ---------- */
.guide { position: fixed; z-index: 6; background: var(--card); border: 2.5px solid var(--ink); border-radius: 20px; box-shadow: var(--shadow); padding: 8px 10px 10px 12px; overflow-y: auto; animation: pop .22s ease; transition: opacity .2s; }
.guide.side { left: calc(10px + var(--safe-l)); }
.guide.away { opacity: 0; pointer-events: none; }
.guide.fresh { animation: pop .3s cubic-bezier(.3,1.5,.5,1); }
.guide.min { padding: 0; border-radius: 999px; background: transparent; border: 0; box-shadow: none; overflow: visible; }
.g-pill { min-height: 46px; display: inline-flex; align-items: center; gap: 8px; padding: 4px 16px 4px 6px; background: var(--card); border: 2.5px solid var(--ink); border-radius: 999px; box-shadow: var(--shadow); font: 900 14px Nunito, system-ui, sans-serif; white-space: nowrap; }
.g-pill .ico { width: 34px; height: 34px; }
.g-top { display: flex; align-items: center; gap: 6px; }
.g-count { font: 900 12.5px Nunito, system-ui, sans-serif; letter-spacing: .04em; text-transform: uppercase; color: var(--ink2); white-space: nowrap; }
.g-dots { flex: 1; display: flex; gap: 3px; align-items: center; min-width: 0; overflow: hidden; padding-left: 4px; }
.g-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(59,42,31,.16); flex: none; }
.g-dots i.on { background: var(--leaf); }
.g-dots i.now { background: var(--berry); width: 16px; border-radius: 4px; }
.g-top .g-count + .g-icon { margin-left: auto; }
.g-icon { width: 44px; height: 44px; flex: none; border-radius: 14px; border: 2px solid var(--ink); background: #fff; display: grid; place-items: center; padding: 0; font: 900 19px Nunito, system-ui, sans-serif; color: var(--ink); }
.g-icon svg { width: 22px; height: 22px; }
.g-icon:active { transform: translateY(2px); }
.g-line { display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; }
.g-line .g-pic { width: 44px; height: 44px; flex: none; }
.g-line p { margin: 0; font: 800 17.5px/1.25 Fraunces, Georgia, serif; }
.g-sub { font-size: 13px; font-weight: 800; color: var(--ink2); margin: 2px 0 8px 54px; min-height: 2px; }
.g-sub:empty { margin-bottom: 4px; }
.g-show { width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 17px; border-radius: 16px; }
.g-show svg { width: 22px; height: 22px; }
.g-show svg path { stroke: #fff; }
.g-yay { display: flex; align-items: center; gap: 12px; padding: 10px 4px; }
.g-yay svg { width: 46px; height: 46px; flex: none; animation: pop .3s cubic-bezier(.3,1.6,.5,1); }
.g-yay b { display: block; font: 800 19px Fraunces, Georgia, serif; }
.g-yay span { font-weight: 900; color: #3E7A2E; }
.guide.yay { background: #E6F5D8; }
.g-task { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1.5px dashed var(--line); }
.g-top + .g-task { margin-top: 6px; }
.g-task .ico { width: 32px; height: 32px; flex: none; }
.g-task .t { flex: 1; min-width: 0; }
.g-task .t b { display: block; font: 700 14.5px/1.2 Fraunces, Georgia, serif; }
.g-task .t span { font-size: 12.5px; font-weight: 800; color: var(--ink2); }
.g-go { min-height: 44px; padding: 6px 12px; flex: none; }
.g-done { font-weight: 900; font-size: 13px; color: #3E7A2E; padding: 0 6px; }
.g-all { margin: 8px 2px 2px; font-weight: 800; color: var(--ink2); font-size: 14px; }
/* the glow on the exact thing to press */
.g-hl { position: relative; z-index: 2; animation: g-glow 1.1s ease-in-out infinite !important; }
@keyframes g-glow {
  0%, 100% { box-shadow: 0 3px 0 rgba(59,42,31,.9), 0 0 0 3px #FFF7EA, 0 0 0 6px #E0607E; }
  50% { box-shadow: 0 3px 0 rgba(59,42,31,.9), 0 0 0 4px #FFF7EA, 0 0 0 11px rgba(224,96,126,.35); }
}
.g-strip { display: flex; align-items: center; gap: 8px; background: #FFF2C2; border: 2px solid var(--ink); border-radius: 14px; padding: 8px 12px; margin: 0 0 10px; font-weight: 800; font-size: 14.5px; }
.g-strip svg { width: 20px; height: 20px; flex: none; }
.g-strip.hint { background: var(--paper); border: 1.5px solid var(--line); color: var(--ink); }
.g-strip span { flex: 1; min-width: 0; }
.g-strip.next { background: #E6F5D8; padding: 6px 6px 6px 12px; }
.g-strip .g-next { flex: none; min-height: 44px; padding: 6px 14px; }
.g-strip.hint .ico { width: 28px; height: 28px; flex: none; }
/* the arrow over the thing to tap in the world */
.g-arrow { position: fixed; left: 0; top: 0; z-index: 4; width: 44px; height: 58px; pointer-events: none; transform-origin: 22px 58px; filter: drop-shadow(0 3px 0 rgba(59,42,31,.35)); }
.g-arrow .g-bob { width: 44px; height: 54px; animation: g-bob .8s ease-in-out infinite; }
.g-arrow svg { width: 44px; height: 54px; display: block; }
.g-arrow.nudge .g-bob { animation-duration: .35s; }
.g-arrow.edge .g-bob { animation: none; transform: scale(.8); }
@keyframes g-bob { 0%, 100% { transform: translateY(-12px); } 50% { transform: translateY(0); } }
.g-ring { position: fixed; left: 0; top: 0; z-index: 4; width: 64px; height: 28px; pointer-events: none; }
.g-ring::before { content: ''; position: absolute; inset: 0; border: 3px solid #fff; border-radius: 50%; animation: g-ring 1.1s ease-out infinite; }
@keyframes g-ring { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
/* How to play */
.howto { display: grid; gap: 4px; }
.hrow { display: flex; align-items: center; gap: 12px; padding: 6px 2px; font: 700 16.5px/1.3 Fraunces, Georgia, serif; }
.hrow .ico { width: 40px; height: 40px; flex: none; }
.howto-go { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 14px 0 0; }
.fishing .fhint { margin: 2px 0 0; font-size: 13.5px; font-weight: 800; color: var(--ink2); }
@media (max-width: 720px), (max-height: 520px) {
  .ibtn { width: 44px; height: 44px; }
  .x { width: 44px; height: 44px; }
  .x img { width: 16px; height: 16px; }
  .btn, .tab { min-height: 44px; }
  .g-line p { font-size: 16px; }
  .g-line .g-pic { width: 38px; height: 38px; }
  .g-sub { margin-left: 48px; }
  .g-show { min-height: 48px; }
}
@media (max-height: 520px) {
  .g-line { margin-top: 4px; }
  .g-sub { margin-bottom: 6px; }
}

/* music: the toggle (js/play/music.js) and the "now playing" label (CC0 tracks by Komiku) */
.music-btn .ico { width: 24px; height: 24px; }
.music-btn.is-on .ico { animation: music-bob .7s ease-in-out infinite alternate; }
.music-btn[aria-pressed="false"] .ico { opacity: .55; }
@keyframes music-bob { from { transform: translateY(1px) rotate(-6deg); } to { transform: translateY(-2px) rotate(6deg); } }
.music-chip { position: fixed; z-index: 60; pointer-events: none; display: grid; gap: 1px; max-width: min(280px, calc(100vw - 16px)); padding: 8px 12px 9px; background: #FFFAF0; color: #3B2A1F; border: 2px solid #3B2A1F; border-radius: 12px; box-shadow: 0 3px 0 rgba(59,42,31,.9); font: 600 13px/1.25 Nunito, system-ui, sans-serif; opacity: 0; transform: translateY(-4px) scale(.98); transition: opacity .25s ease, transform .25s ease; }
.music-chip.is-on { opacity: 1; transform: none; }
.music-chip-k { font: 900 10.5px/1 Nunito, system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #C9614C; }
.music-chip b { font: 800 15px/1.2 Fraunces, Georgia, serif; }
.music-chip-a { font-size: 12px; color: rgba(59,42,31,.6); }
@media (prefers-reduced-motion: reduce) { .music-btn.is-on .ico { animation: none; } .music-chip { transition: none; } }

/* ---------- wallet chip in the HUD, account in the Menu ---------- */
.hud-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; max-width: calc(100vw - 24px - var(--safe-l) - var(--safe-r)); }
.wchip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; cursor: pointer; font: 800 12px Nunito, system-ui, sans-serif; color: var(--ink); }
.wchip[hidden] { display: none; }
.wdot { width: 8px; height: 8px; border-radius: 50%; background: #C9B9A6; border: 1.5px solid var(--ink); flex: none; }
.wdot.on { background: var(--leaf); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: -.01em; }
.acct { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--paper); border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; margin: 6px 0; }
.acct-addr { flex: 1 1 180px; min-width: 0; display: grid; gap: 1px; }
.acct-addr b { font-size: 16px; }
body.gated .hud, body.gated .guide, body.gated .g-arrow, body.gated .g-ring { visibility: hidden; }

/* ---------- the connect screen (js/play/connect.js) ---------- */
.gate { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; padding: calc(16px + var(--safe-t)) calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) calc(16px + var(--safe-l)); background: radial-gradient(ellipse at 50% 45%, rgba(246,238,220,.18), rgba(40,30,22,.34)); animation: fade .2s ease; overflow: hidden; }
.gate-card { width: min(440px, 100%); max-height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--card); border: 2.5px solid var(--ink); border-radius: 26px; box-shadow: 0 6px 0 rgba(59,42,31,.95); padding: 18px 20px 16px; animation: pop .22s cubic-bezier(.3,1.5,.5,1); user-select: text; -webkit-user-select: text; }
.gate-brand { display: flex; align-items: center; gap: 8px; font: 800 18px Fraunces, Georgia, serif; margin-bottom: 8px; }
.gate-brand img { width: 30px; height: 30px; }
.gate-h { font: 800 27px/1.12 Fraunces, Georgia, serif; margin: 4px 0 6px; }
.gate-lede { margin: 0 0 14px; font-weight: 700; font-size: 15px; line-height: 1.4; color: var(--ink2); }
.gate-lede b { color: var(--ink); }
.gate-acts { display: grid; gap: 10px; margin: 12px 0 0; }
.gate-acts:empty { display: none; }
.btn.wide { width: 100%; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; white-space: normal; text-align: center; text-decoration: none; color: inherit; }
.btn.wide svg { width: 22px; height: 22px; flex: none; }
.btn.berry.wide { color: #fff; }
.btn.wide[disabled] { opacity: .55; }
.gate-main { min-height: 60px !important; font-size: 18px !important; }
.gate-main svg { width: 26px !important; height: 26px !important; }
.gate-main span { display: grid; gap: 1px; text-align: left; }
.gate-main small { font: 800 12.5px Nunito, system-ui, sans-serif; opacity: .9; }
.gate-fine { margin: 14px 0 0; font-size: 12.5px; line-height: 1.45; font-weight: 700; color: var(--ink2); }
.gate-small { margin: 6px 0 0; font-size: 13px; font-weight: 700; color: var(--ink2); text-align: center; }
.gate-small a, .gate-links a, .gate-fine a { color: var(--ink); font-weight: 800; }
.gate-links { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: 10px 0 0; font-size: 14px; }
.gate-links a { min-height: 44px; display: inline-flex; align-items: center; }
.linkbtn { background: none; border: 0; padding: 0; min-height: 44px; font: 800 14px Nunito, system-ui, sans-serif; color: var(--ink2); text-decoration: underline; }
.gate-err { display: grid; gap: 2px; background: #FDE3E3; border: 2px solid var(--clay); border-radius: 14px; padding: 10px 12px; margin: 10px 0 0; font-size: 14px; font-weight: 700; line-height: 1.4; }
.gate-err b { font: 800 15px Fraunces, Georgia, serif; }
.gate-note { background: var(--paper); border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; font-size: 13.5px; font-weight: 700; color: var(--ink2); margin: 0 0 10px; line-height: 1.4; }
.gate-wait { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 12px 0 0; font-weight: 800; font-size: 14px; color: var(--ink2); min-height: 20px; }
.gate-wait:empty { display: none; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid rgba(59,42,31,.2); border-top-color: var(--ink); animation: spin .8s linear infinite; flex: none; display: inline-block; }
.btn.berry .spin { border-color: rgba(255,255,255,.35); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.gate-steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.gate-steps li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; color: var(--ink2); font-weight: 700; }
.gate-steps li.now { border: 2px solid var(--ink); color: var(--ink); background: #FFF2C2; }
.gate-steps li.done { color: var(--ink); background: #E6F5D8; border-color: rgba(62,122,46,.35); }
.gate-steps li.bad { border: 2px solid var(--clay); color: var(--ink); background: #FDE3E3; }
.gs-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 2px solid currentColor; font: 900 13px Nunito, system-ui, sans-serif; }
.gate-steps li.done .gs-dot { background: var(--leaf); border-color: var(--ink); color: var(--ink); }
.gs-dot svg { width: 16px; height: 16px; }
.gs-t { display: grid; gap: 1px; min-width: 0; }
.gs-t b { font: 800 15px Fraunces, Georgia, serif; }
.gs-t small { font-size: 12.5px; font-weight: 700; color: var(--ink2); }
.gate-qr { width: min(260px, 100%); aspect-ratio: 1; margin: 6px auto 0; background: #fff; border: 2px solid var(--ink); border-radius: 18px; padding: 8px; display: grid; place-items: center; }
.gate-qr svg { width: 100%; height: 100%; display: block; }
.gate-qr.phone { width: min(200px, 70%); }
.gate-qr[hidden] { display: none; }
.gate-qr-wait { display: inline-flex; gap: 8px; align-items: center; font-weight: 800; font-size: 13px; color: var(--ink2); }
.gate-open:empty { display: none; }
.gate-open { margin: 4px 0 10px; }
.gate-wallets { display: grid; gap: 8px; }
.gate-wallet { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 8px 12px; border: 2px solid var(--ink); border-radius: 16px; background: #fff; box-shadow: 0 3px 0 rgba(59,42,31,.9); text-align: left; transition: transform .08s; }
.gate-wallet:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(59,42,31,.9); }
.gate-wallet > img, .gw-i { width: 34px; height: 34px; border-radius: 10px; flex: none; }
.gw-i { display: grid; place-items: center; background: var(--paper); border: 1.5px solid var(--line); }
.gw-i svg { width: 22px; height: 22px; }
.gate-wallet > span:not(.gw-i) { flex: 1; min-width: 0; display: grid; gap: 1px; }
.gate-wallet b { font: 800 16px Fraunces, Georgia, serif; overflow-wrap: anywhere; }
.gate-wallet small { font-size: 12.5px; font-weight: 700; color: var(--ink2); }
.gate-wallet > svg { width: 20px; height: 20px; flex: none; opacity: .6; }
@media (max-height: 520px) {
  .gate { padding-top: calc(8px + var(--safe-t)); padding-bottom: calc(8px + var(--safe-b)); }
  .gate-card { padding: 12px 16px 12px; width: min(520px, 100%); }
  .gate-brand { margin-bottom: 2px; font-size: 16px; }
  .gate-h { font-size: 22px; }
  .gate-lede { margin-bottom: 8px; font-size: 14px; }
  .gate-acts { margin-top: 8px; gap: 8px; }
  .gate-main { min-height: 52px !important; }
  .gate-qr { width: min(200px, 100%); }
  .gate-fine { margin-top: 8px; }
}

/* ---------- create your keeper (js/play/connect.js) ---------- */
.kc-veil { z-index: 42; background: rgba(40,30,22,.22); }
.kc { width: min(600px, 100%); }
.kc header { padding: 14px 16px 12px 20px; }
.kc-head { flex: 1; min-width: 0; }
.kc-dots { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; align-self: center; }
.kc-dots li { width: 12px; height: 12px; border-radius: 50%; background: rgba(59,42,31,.16); border: 1.5px solid rgba(59,42,31,.35); }
.kc-dots li.done { background: var(--leaf); border-color: var(--ink); }
.kc-dots li.on { background: var(--berry); border-color: var(--ink); width: 26px; border-radius: 7px; }
.kc-body { flex: 1 1 auto; }
.kc-foot { display: flex; gap: 10px; justify-content: space-between; padding: 10px 16px calc(12px + var(--safe-b)); border-top: 2px dashed var(--line); background: var(--paper); }
.kc-foot .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; }
.kc-foot .btn svg { width: 20px; height: 20px; }
.kc-foot [data-go] { margin-left: auto; min-width: 160px; }
.kc-foot [hidden] { display: none; }
.kc-look { display: grid; gap: 12px; }
.kc-stage { position: relative; display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; gap: 6px; background: radial-gradient(circle at 50% 62%, #F6ECD6 0 46%, rgba(246,236,214,0) 47%); border-radius: 22px; }
.kc-live { width: 100%; height: 230px; display: block; cursor: pointer; touch-action: manipulation; }
.kc-live.small { width: 150px; height: 170px; flex: none; }
.kc-arrow { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; box-shadow: 0 3px 0 rgba(59,42,31,.9); display: grid; place-items: center; padding: 0; transition: transform .08s; }
.kc-arrow:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(59,42,31,.9); }
.kc-arrow svg { width: 24px; height: 24px; }
.kc-count { position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%); font: 900 12px Nunito, system-ui, sans-serif; background: var(--card); border: 1.5px solid var(--ink); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.kc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; }
.kc-grid .look { min-height: 48px; }
.kc-name { display: flex; gap: 16px; align-items: center; }
.kc-field { flex: 1; min-width: 0; display: grid; gap: 8px; }
.kc-field label { font: 800 17px Fraunces, Georgia, serif; }
.kc-field input { min-height: 48px; font-size: 18px; }
.kc-field .bad { color: var(--clay); }
.kc-starters { margin-top: 2px; }
.kc-starters .starter { font: inherit; color: inherit; }
.kc-blurb { text-align: center; margin: 6px 0 4px; }
.kc-more { text-align: center; margin: 0; }
@media (max-width: 720px) {
  .kc { max-height: 92vh; max-height: 92dvh; }
  .kc-live { height: 190px; }
  .kc-name { flex-direction: column; align-items: stretch; gap: 8px; }
  .kc-live.small { width: 100%; height: 150px; }
  .kc-foot [data-go] { min-width: 0; flex: 1; }
}
@media (max-height: 520px) {
  .kc { max-height: 100vh; max-height: 100dvh; width: min(760px, 100%); }
  .kc header { padding: 8px 12px 8px 16px; }
  .kc header h2 { font-size: 19px; }
  .kc-look { grid-template-columns: minmax(200px, 40%) 1fr; align-items: start; }
  .kc-live { height: 170px; }
  .kc-grid { grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 6px; }
  .kc-name { flex-direction: row; align-items: center; }
  .kc-live.small { width: 130px; height: 140px; }
  .kc-starters .starter canvas { max-height: 120px; }
  .kc-foot { padding: 6px 12px calc(6px + var(--safe-b)); }
  .kc-foot .btn { min-height: 46px; padding: 8px 16px; }
}
a.btn { color: var(--ink); text-decoration: none; }
a.btn.berry, a.btn.sea { color: #fff; }
body.gated .music-chip { visibility: hidden; }
@media (min-width: 721px) and (min-height: 521px) { .kc-body { min-height: 380px; } }
/* phones: toasts sit under the HUD rows (name, then Pips and the wallet), never on them; the wallet chip stays */
@media (max-width: 720px), (max-height: 520px) { .toasts { top: calc(104px + var(--safe-t)); } }
@media (max-width: 420px) { .hud-row .wchip:not([hidden]) { display: inline-flex; } }
.gate-small a { display: inline-block; padding: 12px 2px; margin: -12px 0; }
