@font-face { font-family: 'Fredoka'; src: url(../fonts/fredoka.woff2) format('woff2'); font-weight: 300 700; font-display: swap; }

:root {
  --ink: #2b2340; --cream: #fff7e6; --paper: #fff3dc; --red: #e8423f; --yellow: #ffd166; --teal: #2ec4b6;
  --purple: #9b5de5; --blue: #3f8ae8; --green: #5ac85a; --pink: #ff7eb6; --orange: #f2933a; --grey: #8a90a0;
  --font: 'Fredoka', ui-rounded, 'Nunito', system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #3c4250; color: var(--ink); font-family: var(--font);
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; touch-action: none; }
canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
[hidden] { display: none !important; }
button { font-family: var(--font); cursor: pointer; }

#flash { position: fixed; inset: 0; pointer-events: none; background: #fff6d8; opacity: 0; mix-blend-mode: screen; }
#vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, rgba(20, 22, 40, .38) 100%); }
#vignette.hurt { background: radial-gradient(ellipse at center, transparent 60%, rgba(200, 40, 60, .32) 100%); }

/* ---------------------------------------------------------------- clay buttons and panels */
.clay { position: relative; border: 0; border-radius: 22px; padding: 14px 28px; font-size: 22px; font-weight: 700; color: #fff; letter-spacing: .3px;
  background: var(--c, var(--red)); text-shadow: 0 2px 0 rgba(0, 0, 0, .18);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .45), inset 0 -6px 0 rgba(0, 0, 0, .18), 0 6px 0 rgba(0, 0, 0, .22), 0 10px 22px rgba(0, 0, 0, .22);
  transition: transform .08s, box-shadow .08s, filter .15s; }
.clay:hover { filter: brightness(1.07); transform: translateY(-1px); }
.clay:active { transform: translateY(4px); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .45), inset 0 -3px 0 rgba(0, 0, 0, .18), 0 2px 0 rgba(0, 0, 0, .22), 0 4px 10px rgba(0, 0, 0, .2); }
.clay.small { font-size: 17px; padding: 10px 18px; border-radius: 16px; }
.clay.ghost { --c: rgba(255, 255, 255, .16); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .25), 0 4px 0 rgba(0, 0, 0, .18); }
.clay[disabled] { filter: grayscale(.8) brightness(.9); cursor: default; transform: none; }
.panel { background: var(--paper); border-radius: 28px; box-shadow: inset 0 4px 0 rgba(255, 255, 255, .7), inset 0 -8px 0 rgba(120, 80, 30, .12), 0 12px 0 rgba(0, 0, 0, .18), 0 24px 50px rgba(0, 0, 0, .3); }
.iconbtn { border: 0; width: 46px; height: 46px; border-radius: 14px; background: rgba(255, 255, 255, .85); color: var(--ink); font-size: 16px; font-weight: 700;
  box-shadow: inset 0 2px 0 #fff, 0 4px 0 rgba(0, 0, 0, .2); }

/* ---------------------------------------------------------------- HUD */
#hud { position: fixed; inset: 0; pointer-events: none; }
.hud-top { position: absolute; top: calc(10px + var(--safe-t)); left: 12px; right: 12px; display: flex; align-items: center; gap: 14px; }
#spirit { display: flex; gap: 3px; flex: none; }
#spirit i { width: 30px; height: 28px; display: block; background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 30'%3E%3Cpath d='M16 28C6 21 1 15 1 9a7.5 7.5 0 0 1 15-2 7.5 7.5 0 0 1 15 2c0 6-5 12-15 19z' fill='%23ff5d6c' stroke='%23fff' stroke-width='2.4'/%3E%3Cellipse cx='9' cy='8' rx='3' ry='2' fill='%23fff' opacity='.6'/%3E%3C/svg%3E");
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .25)); transition: transform .2s; }
#spirit i.empty { filter: grayscale(1) brightness(.7) drop-shadow(0 2px 0 rgba(0, 0, 0, .25)); opacity: .55; transform: scale(.85); }
#spirit i.pop { animation: heartpop .4s; }
@keyframes heartpop { 50% { transform: scale(1.4); } }
#xpbar { position: relative; flex: 1; height: 22px; border-radius: 12px; background: rgba(30, 30, 50, .45); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .35), 0 2px 0 rgba(255, 255, 255, .25); overflow: hidden; }
#xpbar .fill { position: absolute; inset: 3px auto 3px 3px; width: 0; border-radius: 9px; transition: width .15s;
  background: linear-gradient(90deg, #ff6b8a, #ffd166, #5ac85a, #3f8ae8, #9b5de5); background-size: 400px 100%; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5); }
#xpbar .lvl { position: absolute; right: 10px; top: 0; line-height: 22px; font-size: 14px; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
#count { flex: none; display: flex; align-items: baseline; gap: 4px; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .35); padding-right: 54px; }
#count b { font-size: 30px; line-height: 1; }
#count small { font-size: 15px; opacity: .8; }
#count span { font-size: 13px; opacity: .85; margin-left: 4px; }
#count.full b { color: var(--yellow); }
#pausebtn { position: absolute; top: calc(8px + var(--safe-t)); right: 10px; pointer-events: auto; }
#objective { position: absolute; top: calc(44px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; gap: 10px; align-items: center;
  color: #fff; font-size: 16px; font-weight: 600; text-shadow: 0 2px 0 rgba(0, 0, 0, .4); white-space: nowrap; }
#objective .cl { width: 34px; height: 22px; display: inline-block; background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 26'%3E%3Cpath d='M8 24a7 7 0 0 1 0-14 9 9 0 0 1 17-4 8 8 0 0 1 9 9 5 5 0 0 1-1 9z' fill='%2399a0ad' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E"); }
#objective .cl.done { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 26'%3E%3Ccircle cx='20' cy='13' r='8' fill='%23ffd166' stroke='%23fff' stroke-width='2'/%3E%3Cg stroke='%23ffd166' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M20 1v3M20 22v3M8 13H5M35 13h-3M11.5 4.5l2 2M26.5 19.5l2 2M11.5 21.5l2-2M26.5 6.5l2-2'/%3E%3C/g%3E%3C/svg%3E"); }
#objective .bossbar { width: min(420px, 60vw); height: 16px; border-radius: 9px; background: rgba(30, 30, 50, .5); overflow: hidden; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .4); }
#objective .bossbar div { height: 100%; background: linear-gradient(90deg, #6d7381, #aab0bd); transition: width .2s; }
#band { position: absolute; left: 10px; bottom: calc(10px + var(--safe-b)); display: flex; gap: 6px; flex-wrap: wrap; max-width: 60vw; }
#band .sec { position: relative; width: 50px; height: 50px; border-radius: 14px; background: rgba(255, 247, 230, .92); box-shadow: inset 0 2px 0 #fff, 0 3px 0 rgba(0, 0, 0, .25);
  display: grid; place-items: center; }
#band .sec img { width: 40px; height: 40px; object-fit: contain; }
#band .sec .n { position: absolute; right: -4px; top: -6px; min-width: 20px; padding: 0 5px; height: 20px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 12px; line-height: 20px; text-align: center; }
#band .sec .pips { position: absolute; bottom: 3px; left: 0; right: 0; display: flex; justify-content: center; gap: 2px; }
#band .sec .pips i { width: 6px; height: 6px; border-radius: 3px; background: rgba(0, 0, 0, .15); }
#band .sec .pips i.on { background: var(--c, var(--red)); }
#band .sec.charm { width: 40px; height: 40px; border-radius: 12px; }
#band .sec.charm img { width: 30px; height: 30px; }
#edgeArrows { position: absolute; inset: 0; }
#edgeArrows .ea { position: absolute; width: 40px; height: 40px; margin: -20px; border-radius: 50%; background: rgba(255, 255, 255, .85); display: grid; place-items: center;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .25); font-size: 18px; transition: opacity .3s; }
#edgeArrows .ea i { display: block; width: 0; height: 0; border: 9px solid transparent; border-left: 13px solid var(--ink); margin-left: 8px; }

/* ---------------------------------------------------------------- floating text */
#pops { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.pop { position: absolute; left: 0; top: 0; white-space: nowrap; font-weight: 700; color: #fff; text-align: center; transform-origin: 50% 100%;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .3), 0 0 12px rgba(0, 0, 0, .2); -webkit-text-stroke: 1px rgba(0, 0, 0, .15); will-change: transform, opacity; }
.pop.big { font-size: 44px; color: var(--yellow); }
.pop.mid { font-size: 28px; }
.pop.small { font-size: 18px; }
#banner { position: fixed; left: 0; right: 0; top: 17%; text-align: center; pointer-events: none; }
#banner .b { display: inline-block; padding: 12px 34px 16px; border-radius: 26px; color: #fff; background: var(--c, var(--red));
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .45), inset 0 -6px 0 rgba(0, 0, 0, .18), 0 8px 0 rgba(0, 0, 0, .22); animation: bannerin .5s cubic-bezier(.2, 1.6, .4, 1) both; }
#banner .b h2 { margin: 0; font-size: clamp(30px, 6vw, 56px); line-height: 1.05; text-shadow: 0 3px 0 rgba(0, 0, 0, .2); }
#banner .b p { margin: 6px 0 0; font-size: clamp(15px, 2.4vw, 20px); font-weight: 500; opacity: .95; max-width: 640px; }
#banner .b.out { animation: bannerout .4s ease-in both; }
@keyframes bannerin { from { transform: scale(.4) rotate(-6deg); opacity: 0; } }
@keyframes bannerout { to { transform: scale(.7) translateY(-30px); opacity: 0; } }

/* ---------------------------------------------------------------- modal: cards, bandstand, pause */
#modal { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(30, 28, 50, .55); backdrop-filter: blur(3px); padding: 16px; overflow: auto; }
.dialog { width: min(960px, 100%); padding: 22px 24px 26px; text-align: center; animation: dialogin .35s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes dialogin { from { transform: translateY(40px) scale(.92); opacity: 0; } }
.dialog h2 { margin: 0 0 4px; font-size: 34px; color: var(--ink); }
.dialog .sub { margin: 0 0 18px; color: #6b5a70; font-size: 17px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.card { position: relative; border: 0; text-align: left; padding: 16px 16px 18px; border-radius: 22px; background: #fff; color: var(--ink);
  box-shadow: inset 0 0 0 4px var(--c, #ddd), inset 0 -8px 0 rgba(0, 0, 0, .06), 0 6px 0 rgba(0, 0, 0, .18); transition: transform .12s; font-size: 16px; }
.card:hover, .card:focus-visible { transform: translateY(-5px) rotate(-.6deg); outline: none; box-shadow: inset 0 0 0 5px var(--c, #ddd), inset 0 -8px 0 rgba(0, 0, 0, .06), 0 11px 0 rgba(0, 0, 0, .18); }
.card .top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.card .ic { width: 64px; height: 64px; flex: none; border-radius: 18px; background: var(--c, #eee); display: grid; place-items: center; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .45), inset 0 -4px 0 rgba(0, 0, 0, .12); }
.card .ic img { width: 54px; height: 54px; object-fit: contain; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .2)); }
.card h3 { margin: 0; font-size: 21px; line-height: 1.1; }
.card .tag { display: inline-block; margin-top: 3px; font-size: 13px; font-weight: 600; padding: 2px 9px; border-radius: 9px; background: var(--c, #eee); color: #fff; }
.card .tag.new { background: var(--ink); }
.card p { margin: 6px 0 0; color: #4a4060; line-height: 1.32; }
.card .lvp { display: flex; gap: 4px; margin-top: 10px; }
.card .lvp i { flex: 1; height: 7px; border-radius: 4px; background: #eee; }
.card .lvp i.on { background: var(--c); }
.card .lvp i.next { background: var(--c); animation: blink .6s infinite alternate; }
.card .key { position: absolute; right: 12px; top: 10px; font-size: 13px; color: #aaa; font-weight: 600; }
@keyframes blink { to { opacity: .35; } }
.dialog .row { display: flex; justify-content: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- full screens: title, results */
#screen { position: fixed; inset: 0; overflow: auto; }
#screen:empty { display: none; }
.title { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px 40px; gap: 18px; text-align: center; }
.title .logo { width: min(720px, 92vw); filter: drop-shadow(0 10px 0 rgba(0, 0, 0, .2)); animation: logobob 2.4s ease-in-out infinite; }
.title h1.logo-text { margin: 0; font-size: clamp(54px, 13vw, 128px); line-height: .9; color: #fff; letter-spacing: 1px; -webkit-text-stroke: 3px rgba(0, 0, 0, .12);
  text-shadow: 0 6px 0 #c2334b, 0 10px 0 rgba(0, 0, 0, .25); animation: logobob 2.4s ease-in-out infinite; }
.title h1.logo-text span { display: inline-block; animation: letterbob 1s ease-in-out infinite; }
@keyframes logobob { 50% { transform: translateY(-6px) rotate(.5deg); } }
@keyframes letterbob { 50% { transform: translateY(-8px); } }
.title .tagline { margin: 0; font-size: clamp(17px, 2.6vw, 23px); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .3); max-width: 640px; }
.title .menu { display: flex; flex-direction: column; gap: 14px; align-items: stretch; width: min(360px, 90vw); }
.title .menu .clay { font-size: 24px; }
.title .foot { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.title .stats { color: #fff; opacity: .9; font-size: 15px; text-shadow: 0 1px 0 rgba(0, 0, 0, .4); }

.results { width: min(760px, 100%); margin: 6vh auto; padding: 26px; text-align: center; }
.results h2 { font-size: 44px; margin: 0; }
.results .big { display: flex; justify-content: center; gap: 22px; margin: 18px 0; flex-wrap: wrap; }
.results .big div { min-width: 120px; }
.results .big b { display: block; font-size: 46px; line-height: 1; color: var(--red); }
.results .big span { font-size: 15px; color: #6b5a70; }
.results ul { list-style: none; padding: 0; margin: 10px auto; max-width: 460px; text-align: left; }
.results li { display: flex; justify-content: space-between; padding: 6px 4px; border-bottom: 2px dashed rgba(0, 0, 0, .08); font-size: 17px; }
.results .rosettes { font-size: 22px; font-weight: 700; color: var(--purple); margin: 12px 0; }
.board { text-align: left; margin: 14px auto 0; max-width: 460px; }
.board h3 { margin: 6px 0; font-size: 18px; }
.board ol { margin: 0; padding-left: 28px; max-height: 240px; overflow: auto; }
.board li { padding: 3px 0; display: flex; justify-content: space-between; font-size: 16px; border: 0; }
.board li.me { color: var(--red); font-weight: 700; }

#loading { position: fixed; inset: 0; display: grid; place-items: center; background: #3c4250; transition: opacity .4s; }
#loading.done { opacity: 0; pointer-events: none; }
.spin { width: 56px; height: 56px; border-radius: 50%; border: 7px solid rgba(255, 255, 255, .2); border-top-color: var(--yellow); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* touch stick */
#stick { position: fixed; width: 120px; height: 120px; margin: -60px; border-radius: 50%; background: rgba(255, 255, 255, .14); border: 3px solid rgba(255, 255, 255, .35); pointer-events: none; display: none; }
#stick i { position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; margin: -25px; border-radius: 50%; background: rgba(255, 255, 255, .7); }

@media (max-width: 640px) {
  #count span { display: none; }
  #count b { font-size: 24px; }
  #spirit i { width: 22px; height: 21px; }
  .card { padding: 12px; }
  .card .ic { width: 48px; height: 48px; }
  .card .ic img { width: 40px; height: 40px; }
  .card p { font-size: 14px; }
  .dialog { padding: 16px; }
  .dialog h2 { font-size: 26px; }
  #band .sec { width: 40px; height: 40px; }
  #band .sec img { width: 32px; height: 32px; }
  #objective { top: calc(40px + var(--safe-t)); font-size: 14px; }
}

/* ---------------------------------------------------------------- title extras */
.title .who { display: flex; align-items: center; gap: 10px; background: rgba(255, 247, 230, .92); border-radius: 18px; padding: 8px 10px; text-align: left; color: var(--ink);
  box-shadow: inset 0 2px 0 #fff, 0 4px 0 rgba(0, 0, 0, .2); font-size: 16px; }
.title .who .pic { width: 54px; height: 54px; flex: none; }
.title .who > span:nth-child(2) { flex: 1; line-height: 1.2; }
.title .who small { color: #6b5a70; }
.title .who a { color: var(--purple); }
.title .row2 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.title .row2 .clay { padding: 10px 6px; font-size: 16px; line-height: 1.1; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.title .row2 .clay small { font-size: 12px; font-weight: 500; opacity: .9; }
.title .menu { width: min(460px, 92vw); }
.title .logo { width: min(640px, 88vw); margin-bottom: -6px; }
.title { background: radial-gradient(ellipse at 50% 40%, rgba(255, 240, 200, .25), transparent 60%); }
.title .tagline { background: rgba(43, 35, 64, .38); padding: 6px 16px; border-radius: 14px; }
.title .stats { background: rgba(43, 35, 64, .38); padding: 6px 14px; border-radius: 12px; }
.title .stats:empty { display: none; }

/* ---------------------------------------------------------------- sheets: leaders, shop, hall, how */
.sheet { width: min(980px, calc(100% - 24px)); margin: 4vh auto; padding: 22px 22px 24px; text-align: center; }
.sheet h2 { margin: 0; font-size: 36px; }
.sheet .sub { margin: 4px 0 16px; color: #6b5a70; font-size: 16px; }
.sheet .row { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.sheet .ros { font-size: 18px; font-weight: 700; color: var(--purple); }
.leaders { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; }
.lcard { background: #fff; border-radius: 22px; padding: 12px 14px 16px; box-shadow: inset 0 0 0 3px #eee, 0 5px 0 rgba(0, 0, 0, .14); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.lcard.sel { box-shadow: inset 0 0 0 4px var(--green), 0 5px 0 rgba(0, 0, 0, .14); }
.lcard.locked .lpic img { filter: grayscale(1) brightness(.85); opacity: .75; }
.lcard h3 { margin: 0; font-size: 22px; }
.lcard h3 small { font-weight: 500; color: #6b5a70; font-size: 16px; }
.lcard p { margin: 0; color: #4a4060; font-size: 15px; min-height: 40px; }
.lcard .lsec { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: #6b5a70; }
.lcard .lsec img { width: 30px; height: 30px; object-fit: contain; }
.shop { display: flex; flex-direction: column; gap: 8px; text-align: left; max-height: 58vh; overflow: auto; padding: 4px; }
.srow { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 16px; padding: 8px 12px; box-shadow: 0 3px 0 rgba(0, 0, 0, .1); }
.srow img, .srow .perk { width: 46px; height: 46px; object-fit: contain; flex: none; display: grid; place-items: center; font-size: 28px; color: var(--yellow); }
.srow > div { flex: 1; }
.srow p { margin: 2px 0 0; font-size: 14px; color: #4a4060; }
.srow small { color: #8a7fa8; }
.srow.done { opacity: .6; }
.srow .owned { font-weight: 700; color: var(--green); }
.tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }
.board { margin: 0 auto; max-width: 560px; text-align: left; }
.board ol { max-height: 46vh; }
.board .mine { font-weight: 700; color: var(--red); text-align: center; }
.board small { color: #8a7fa8; font-size: 12px; }
.howgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; text-align: left; }
.howgrid div { background: #fff; border-radius: 16px; padding: 12px 14px; box-shadow: 0 3px 0 rgba(0, 0, 0, .1); }
.howgrid b { font-size: 19px; color: var(--red); }
.howgrid p { margin: 4px 0 0; color: #4a4060; font-size: 15px; line-height: 1.35; }
.namebox { display: flex; gap: 8px; justify-content: center; margin: 8px 0; flex-wrap: wrap; }
.namebox input { font: inherit; font-size: 17px; padding: 10px 14px; border-radius: 14px; border: 3px solid #e6dcc8; min-width: 240px; }
.results .rank { min-height: 22px; font-weight: 600; color: var(--blue); margin: 4px 0; }

/* ---------------------------------------------------------------- hints */
#hint { position: fixed; left: 50%; top: calc(76px + var(--safe-t)); transform: translate(-50%, -16px); max-width: min(620px, 90vw); padding: 10px 18px; border-radius: 16px;
  background: rgba(255, 247, 230, .96); color: var(--ink); font-size: 17px; font-weight: 600; text-align: center; pointer-events: none; opacity: 0;
  box-shadow: inset 0 2px 0 #fff, 0 5px 0 rgba(0, 0, 0, .2); transition: opacity .3s, transform .35s cubic-bezier(.2, 1.4, .4, 1); }
#hint.in { opacity: 1; transform: translate(-50%, 0); }
#hint.out { opacity: 0; transform: translate(-50%, -10px); }
@media (max-width: 640px) { .title .row2 .clay { font-size: 14px; } .title .who { font-size: 14px; } #hint { font-size: 15px; top: calc(66px + var(--safe-t)); } }

/* evolutions, stickers, toasts, edge pointers */
.card.evo { background: linear-gradient(160deg, #fff8dc, #ffe9a8); box-shadow: inset 0 0 0 5px #f2b233, inset 0 -8px 0 rgba(0, 0, 0, .06), 0 6px 0 rgba(0, 0, 0, .18), 0 0 30px rgba(255, 200, 60, .6); animation: evoglow 1.2s ease-in-out infinite alternate; }
@keyframes evoglow { to { box-shadow: inset 0 0 0 5px #f2b233, inset 0 -8px 0 rgba(0, 0, 0, .06), 0 6px 0 rgba(0, 0, 0, .18), 0 0 50px rgba(255, 200, 60, .9); } }
#band .sec.evo { background: linear-gradient(160deg, #fff8dc, #ffd36b); box-shadow: inset 0 2px 0 #fff, 0 3px 0 rgba(0, 0, 0, .25), 0 0 14px rgba(255, 190, 40, .8); }
#band .sec.evo::after { content: '★'; position: absolute; left: -5px; top: -7px; color: #f2b233; font-size: 18px; text-shadow: 0 1px 0 #7a5200; }
#toasts { position: fixed; right: 12px; top: calc(70px + var(--safe-t)); display: flex; flex-direction: column; gap: 8px; z-index: 5; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 320px; padding: 10px 14px; border-radius: 16px; background: rgba(255, 247, 230, .97);
  box-shadow: inset 0 2px 0 #fff, 0 5px 0 rgba(0, 0, 0, .2); animation: toastin .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.toast.out { animation: toastout .5s ease-in both; }
.toast img { width: 40px; height: 40px; object-fit: contain; }
.toast .st { font-size: 30px; color: var(--yellow); text-shadow: 0 2px 0 #b07800; }
.toast b { display: block; font-size: 16px; } .toast small { font-size: 13px; color: #6b5a70; }
@keyframes toastin { from { transform: translateX(120%); } }
@keyframes toastout { to { transform: translateX(120%); opacity: 0; } }
.ptr { position: absolute; width: 44px; height: 44px; margin: -22px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 247, 230, .92);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .25); pointer-events: none; transition: opacity .25s; }
.ptr img { width: 32px; height: 32px; object-fit: contain; }
.ptr i { position: absolute; width: 0; height: 0; border: 8px solid transparent; border-left: 12px solid var(--ink); left: 50%; top: 50%; margin: -8px 0 0 -6px; transform-origin: -14px 50%; }
.stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; text-align: left; max-height: 58vh; overflow: auto; padding: 4px; }
.sticker { background: #fff; border-radius: 16px; padding: 10px 12px; box-shadow: 0 3px 0 rgba(0, 0, 0, .1); }
.sticker b { display: block; font-size: 16px; } .sticker p { margin: 3px 0 0; font-size: 13px; color: #4a4060; } .sticker small { color: var(--purple); font-weight: 600; }
.sticker.locked { opacity: .5; filter: grayscale(.8); }
.sticker .badge { float: right; font-size: 24px; }
.card small.cnt { color: #8a7fa8; font-weight: 600; font-size: 13px; margin-left: 4px; }

#objective .cl { position: relative; }
#objective .cl b { position: absolute; left: 3px; right: auto; bottom: -5px; height: 4px; border-radius: 2px; background: #c9d2e6; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); }
#spirit i.lost { animation: heartlost .7s; }
@keyframes heartlost { 0% { transform: scale(1.6); filter: none; opacity: 1; } 30% { transform: scale(1.3) rotate(-12deg); } 100% { transform: scale(.85); } }
#band .sec.charm .pips i { width: 4px; height: 4px; }

/* sheets keep their buttons in reach on short windows */
.sheet .row { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--paper) 28%); padding-top: 14px; margin-top: 8px; }
.leaders { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.lcard { padding: 8px 10px 12px; gap: 4px; }
.lcard .lpic img { width: 84px; height: 84px; }
.lcard p { min-height: 0; font-size: 14px; }
@media (max-height: 760px) { .sheet { margin: 2vh auto; padding: 14px 16px 16px; } .sheet h2 { font-size: 28px; } .lcard .lpic img { width: 64px; height: 64px; } }
.vol { display: flex; align-items: center; gap: 10px; justify-content: space-between; font-weight: 600; color: #4a4060; padding: 2px 6px; }
.vol input { flex: 1; accent-color: var(--purple); }
/* layering: dialogs above hints and toasts */
#modal { z-index: 20; } #hint { z-index: 15; } #toasts { z-index: 16; } #screen { z-index: 12; }
/* short windows (a phone on its side): a smaller title so the menu is on screen */
@media (max-height: 540px) {
  .title { gap: 8px; padding: 10px 12px 16px; justify-content: flex-start; }
  .title .logo { width: min(380px, 52vw); margin: 0; }
  .title .tagline { font-size: 14px; padding: 4px 10px; }
  .title .menu { gap: 8px; }
  .title .menu .clay { font-size: 18px; padding: 9px 16px; }
  .title .stats { font-size: 12px; }
  .dialog { padding: 12px 14px 14px; } .dialog h2 { font-size: 24px; } .dialog .sub { margin-bottom: 8px; }
  .card { padding: 10px; } .card p { font-size: 13px; } .card .ic { width: 44px; height: 44px; } .card .ic img { width: 36px; height: 36px; }
}
