/* css/play.css: the game page. Marble and parchment cards with a deep Aegean edge and a meander (Greek key) frieze,
   Cinzel for panel titles and names, Nunito for everything else, Aegean blue for the main buttons, gold for rewards.
   Palette and fonts: ELYPET.md. Class names (btn.berry, btn.sea, btn.leaf ...) are the code's; only their look is Greek. */
@font-face { font-family: Cinzel; src: url(../fonts/Cinzel-600.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: Cinzel; src: url(../fonts/Cinzel-700.woff2) format('woff2'); font-weight: 700; 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 {
  /* surfaces and ink */
  --paper: #F1E9D8; --card: #FBF8F1; --marble: #F4EFE4; --parch: #EADFC8; --ink: #2B2620; --ink2: rgba(43,38,32,.68); --line: rgba(43,38,32,.16);
  --deep: #12395F; --aegean: #1F5FA8; --gold: #C9A23A; --gold2: #E2C063; --terra: #C4643A; --olive: #7C8B4A; --laurel: #4F6B3A;
  /* button roles (names kept from the code): berry = the main action (Aegean blue), sun = buy and rewards (gold),
     leaf = go / show me (olive), sea = water and wallet (deep teal), lav = quiet extras */
  --berry: #1F5FA8; --sun: #E2C063; --leaf: #B3C277; --sea: #1B7B9B; --lav: #CFC6E8; --clay: #C4643A;
  --head: Cinzel, 'Trajan Pro', Georgia, serif;
  --r: 14px; --shadow: 0 3px 0 var(--deep);
  --key: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M0 22H24M0 2H24M4 22V6H20V18H8V10H16V14H12' fill='none' stroke='%2312395F' stroke-width='2'/%3E%3C/svg%3E");
  --key-gold: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M0 22H24M0 2H24M4 22V6H20V18H8V10H16V14H12' fill='none' stroke='%23E2C063' stroke-width='2'/%3E%3C/svg%3E");
  --deepA: #12395F; --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: #5BB6C9; 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(--deep); border-radius: 999px; box-shadow: var(--shadow); color: var(--ink); padding: 5px 12px 5px 6px; display: inline-flex; align-items: center; gap: 6px; font-weight: 900; font-size: 15px; white-space: nowrap; }
.me { background: linear-gradient(170deg, var(--card), var(--marble)); border: 2px solid var(--deep); border-radius: 16px; box-shadow: inset 0 0 0 3px var(--card), inset 0 0 0 4px rgba(201,162,58,.55), 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: 700 15.5px var(--head); line-height: 1.15; color: var(--deep); letter-spacing: .02em; }
.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; color: var(--ink); background: rgba(251,248,241,.92); border: 1.5px solid var(--deep); border-radius: 999px; box-shadow: 0 2px 0 var(--deepA); }
.mode.on { background: #E3EACB; }
.ibtn { width: 46px; height: 46px; border-radius: 12px; background: var(--card); border: 2px solid var(--deep); 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 var(--deepA); }
.ibtn .ico { width: 30px; height: 30px; }
.badge { position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--terra); color: #fff; border: 2px solid var(--deep); font: 900 11px Nunito; display: grid; place-items: center; padding: 0 4px; }
.badge.ok { background: var(--gold2); color: var(--ink); }

.dock { display: flex; gap: 8px; background: rgba(251,248,241,.94); border: 2px solid var(--deep); border-radius: 18px; box-shadow: var(--shadow); padding: 7px; }
.tcard { width: 64px; border-radius: 12px; border: 2px solid var(--deep); background: var(--card); 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(18,57,95,.12); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; }
.bar.b i { background: #D9933F; } .bar.j i { background: #3E86C8; } .bar.e i { background: #8FA34E; }
.tcard .mood { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; background: var(--card); border: 1.5px solid var(--deep); display: grid; place-items: center; }
.tcard .mood img { width: 16px; height: 16px; }
.tcard.empty { background: rgba(251,248,241,.6); 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(14,36,60,.3); 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: 2px solid var(--deep); border-radius: 16px; box-shadow: 0 5px 0 var(--deep), 0 22px 44px rgba(14,36,60,.28); overflow: hidden; animation: pop .2s cubic-bezier(.3,1.5,.5,1); }
@keyframes pop { from { transform: scale(.92) translateY(10px); opacity: 0; } }
.panel header { position: relative; display: flex; align-items: center; gap: 12px; padding: 16px 16px 26px 20px; background: linear-gradient(180deg, var(--marble), var(--parch)); border-top: 4px solid var(--gold); }
.panel header::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 14px; background: var(--deep) var(--key-gold) left center / 14px 14px repeat-x; }
.panel header h2 { margin: 0; font: 700 21px/1.15 var(--head); flex: 1; color: var(--deep); letter-spacing: .02em; }
.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: 10px; border: 2px solid var(--deep); background: var(--card); box-shadow: 0 2px 0 var(--deepA); 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(--marble); }
.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(--deep); border-radius: 999px; padding: 6px 14px; background: var(--card); font-weight: 800; font-size: 14px; color: var(--deep); }
.tab.on { background: var(--deep); color: var(--card); }
.row { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid rgba(201,162,58,.35); }
.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: 800 16px/1.25 Nunito, system-ui, sans-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(--deep); border-radius: 11px; padding: 8px 14px; font-weight: 900; font-size: 14px; color: var(--ink); background: var(--sun); box-shadow: 0 3px 0 var(--deepA); white-space: nowrap; transition: transform .08s, filter .12s; }
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--deepA); }
.btn.berry { background: var(--berry); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16), 0 3px 0 var(--deep); } .btn.leaf { background: var(--leaf); } .btn.sea { background: var(--sea); color: #fff; } .btn.ghost { background: var(--card); color: var(--deep); } .btn.lav { background: var(--lav); }
.btn.big { padding: 12px 20px; font-size: 17px; border-radius: 13px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.note { background: var(--paper); border: 1.5px solid rgba(201,162,58,.45); border-radius: 12px; 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(--deep); border-radius: 12px; background: var(--card); 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: #F6E7B6; }
.qty { display: inline-flex; align-items: center; border: 2px solid var(--deep); border-radius: 10px; overflow: hidden; }
.qty button { width: 28px; height: 32px; border: 0; background: var(--card); 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(--deep); border-radius: 14px; background: linear-gradient(175deg, var(--card), var(--marble)); 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 14.5px var(--head); color: var(--deep); letter-spacing: .02em; }
.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(--deep); 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(--deep); }
.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%, #EFE6D2 0 52%, rgba(239,230,210,0) 53%); border-radius: 20px; cursor: pointer; }
.tufthead h3 { margin: 0; font: 700 25px var(--head); color: var(--deep); letter-spacing: .02em; }
.tufthead .title { font: 800 14.5px Nunito, system-ui, sans-serif; color: var(--terra); margin: 2px 0 6px; }
.blurb { font: 700 15px/1.45 Nunito, system-ui, sans-serif; color: var(--ink2); margin: 10px 0; padding-left: 12px; border-left: 3px solid var(--gold); }
.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(--deep); }
.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: 12px; border: 1.5px solid rgba(201,162,58,.45); }
.picker .slot { width: 78px; }
.progress { height: 12px; border-radius: 7px; border: 1.5px solid var(--deep); background: var(--card); overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold2)); }
input.text { font: 800 16px Nunito, system-ui, sans-serif; border: 2px solid var(--deep); border-radius: 10px; padding: 9px 12px; background: var(--card); 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: 2px solid var(--deep); }
.swatch.on { outline: 3px solid var(--deep); 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: 12px; background: var(--card); 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(18,57,95,.45); }
.look.on { border: 2px solid var(--deep); background: #F6E7B6; box-shadow: 0 3px 0 var(--deepA); transform: translateY(-2px); }
.starters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 14px; }
.starter { border: 2px solid var(--deep); border-radius: 14px; background: var(--card); padding: 6px; text-align: center; cursor: pointer; transition: transform .1s; }
.starter canvas { width: 100%; aspect-ratio: 1; display: block; }
.starter b { font: 700 16px var(--head); display: block; color: var(--deep); letter-spacing: .02em; }
.starter span { font-size: 12px; font-weight: 800; color: var(--ink2); }
.starter.on { background: #F6E7B6; transform: translateY(-3px); box-shadow: var(--shadow); }
h4 { font: 700 15px var(--head); margin: 16px 0 6px; color: var(--deep); letter-spacing: .03em; }
.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); color: var(--ink); border: 2px solid var(--deep); border-radius: 12px; box-shadow: 0 3px 0 var(--deepA); padding: 9px 14px; font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 8px; animation: pop .2s ease; }
.toast.bad { background: #F7E1D6; }
.toast.good { background: #E6ECCF; }
.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: 2px solid var(--deep); border-top: 4px solid var(--gold); border-radius: 16px; box-shadow: 0 5px 0 var(--deepA); padding: 12px 16px 16px; text-align: center; animation: pop .2s ease; }
.fishing b { font: 700 18px var(--head); color: var(--deep); letter-spacing: .02em; }
.reel { position: relative; height: 34px; margin: 10px 0 12px; border: 2px solid var(--deep); border-radius: 17px; background: linear-gradient(90deg, #BFE2EC, #7FC6D6); overflow: hidden; }
.reel .zone { position: absolute; top: 0; bottom: 0; background: rgba(226,192,99,.92); border-left: 2px solid var(--deep); border-right: 2px solid var(--deep); }
.reel .zone .sweet { position: absolute; top: 0; bottom: 0; left: 35%; right: 35%; background: rgba(196,100,58,.85); }
.reel .bob { position: absolute; top: 3px; width: 24px; height: 24px; margin-left: -12px; border-radius: 50%; background: var(--card); border: 2px solid var(--deep); }
.reel .bob::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 50%; background: var(--terra); 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(251,244,222,.97), rgba(244,239,228,.93) 50%, rgba(14,36,60,.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: 700 30px var(--head); margin: 0; color: var(--deep); letter-spacing: .02em; }
.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(--marble) var(--key) center calc(50% + 34px) / 18px 18px repeat-x; font: 700 20px var(--head); color: var(--deep); letter-spacing: .04em; 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: 16px 16px 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: 16px 16px 0 0; }
  .panel header { padding: 8px 12px 20px 16px; border-top-width: 3px; }
  .panel header::after { height: 12px; background-size: 12px 12px; }
  .panel header h2 { font-size: 19px; }
  .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: 2px solid var(--deep); border-top: 4px solid var(--gold); border-radius: 16px; 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: 2px solid var(--deep); border-radius: 999px; box-shadow: var(--shadow); font: 900 14px Nunito, system-ui, sans-serif; color: var(--deep); 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(18,57,95,.16); flex: none; }
.g-dots i.on { background: var(--gold); }
.g-dots i.now { background: var(--aegean); width: 16px; border-radius: 4px; }
.g-top .g-count + .g-icon { margin-left: auto; }
.g-icon { width: 44px; height: 44px; flex: none; border-radius: 11px; border: 2px solid var(--deep); background: var(--card); display: grid; place-items: center; padding: 0; font: 900 19px Nunito, system-ui, sans-serif; color: var(--deep); }
.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 17px/1.3 Nunito, system-ui, sans-serif; color: var(--ink); }
.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: 13px; }
.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: 700 18px var(--head); color: var(--deep); letter-spacing: .02em; }
.g-yay span { font-weight: 900; color: #4F6B3A; }
.guide.yay { background: #EEF0D9; }
.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: 800 14.5px/1.25 Nunito, system-ui, sans-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: #4F6B3A; 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 var(--deep), 0 0 0 3px #FBF8F1, 0 0 0 6px #E0A92E; }
  50% { box-shadow: 0 3px 0 var(--deep), 0 0 0 4px #FBF8F1, 0 0 0 11px rgba(224,169,46,.45); }
}
.g-strip { display: flex; align-items: center; gap: 8px; background: #F6E7B6; border: 2px solid var(--deep); border-radius: 12px; 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 rgba(201,162,58,.5); color: var(--ink); }
.g-strip span { flex: 1; min-width: 0; }
.g-strip.next { background: #E6ECCF; 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(18,57,95,.4)); }
.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: 800 16px/1.35 Nunito, system-ui, sans-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: var(--card); color: var(--ink); border: 2px solid var(--deep); border-radius: 12px; box-shadow: 0 3px 0 var(--deepA); 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: var(--terra); }
.music-chip b { font: 700 14px/1.25 var(--head); color: var(--deep); letter-spacing: .02em; }
.music-chip-a { font-size: 12px; color: rgba(43,38,32,.62); }
@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(--deep); 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: 2px solid var(--deep); border-radius: 26px; box-shadow: 0 6px 0 var(--deepA); 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: 10px; font: 700 18px var(--head); color: var(--deep); letter-spacing: .04em; margin-bottom: 8px; }
.gate-brand img { width: 30px; height: 30px; }
.gate-h { font: 700 25px/1.15 var(--head); color: var(--deep); letter-spacing: .02em; 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: #F7E1D6; 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: 900 15px Nunito, system-ui, sans-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(18,57,95,.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: var(--card); color: var(--ink2); font-weight: 700; }
.gate-steps li.now { border: 2px solid var(--deep); color: var(--ink); background: #F6E7B6; }
.gate-steps li.done { color: var(--ink); background: #E6ECCF; border-color: rgba(62,122,46,.35); }
.gate-steps li.bad { border: 2px solid var(--clay); color: var(--ink); background: #F7E1D6; }
.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 Nunito, system-ui, sans-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: var(--card); border: 2px solid var(--deep); 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(--deep); border-radius: 16px; background: var(--card); box-shadow: 0 3px 0 var(--deepA); text-align: left; transition: transform .08s; }
.gate-wallet:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--deepA); }
.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 Nunito, system-ui, sans-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 28px 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(18,57,95,.16); border: 1.5px solid rgba(18,57,95,.35); }
.kc-dots li.done { background: var(--gold); border-color: var(--deep); }
.kc-dots li.on { background: var(--aegean); border-color: var(--deep); 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: 1px solid rgba(201,162,58,.5); 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%, #EFE6D2 0 46%, rgba(239,230,210,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(--deep); background: var(--card); box-shadow: 0 3px 0 var(--deepA); display: grid; place-items: center; padding: 0; transition: transform .08s; }
.kc-arrow:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--deepA); }
.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(--deep); 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: 700 16px var(--head); color: var(--deep); letter-spacing: .02em; }
.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 20px 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 Obols 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; }
