#topbar {
  position: absolute; z-index: 5; left: 0; right: 0; top: 0;
  height: calc(64px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  display: flex; align-items: center; justify-content: space-between; pointer-events: none;
}
#topbar > * { pointer-events: auto; }
.tb-me {
  display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px 0 4px; border-radius: 24px;
  background: #ffffffc8; box-shadow: 0 3px 8px #0002; font-weight: 800; font-size: 17px; color: #445;
  max-width: 55vw;
}
.tb-me img { width: 40px; height: 40px; object-fit: contain; border-radius: 50%; background: #fff; }
.tb-me span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#topbar .tb-me:not(.tb-multi) { pointer-events: none; }
.tb-me.tb-multi:active { transform: scale(.95); }
.tb-gear {
  position: relative; width: 46px; height: 46px; border-radius: 50%;
  background: #ffffff90; box-shadow: 0 3px 8px #0002; opacity: .6;
  display: flex; align-items: center; justify-content: center; font-size: 22px; color: #556;
}
.tb-gear svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.tb-gear .ring { fill: none; stroke: #2a78d6; stroke-width: 8; stroke-linecap: round; }
.tb-gear.holding { opacity: 1; transform: scale(1.1); }
.tb-hint {
  position: absolute; right: max(12px, env(safe-area-inset-right)); top: calc(64px + env(safe-area-inset-top));
  background: #000a; color: #fff; padding: 6px 12px; border-radius: 14px; font-size: 14px; font-weight: 700; pointer-events: none;
}

.pk-root {
  z-index: 110; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4dvmin;
  background: radial-gradient(circle at 50% 30%, #fff7, transparent 60%), linear-gradient(160deg, #ffd9a8, #9ad8ff 55%, #c9f5c8);
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.pk-title { font-size: clamp(22px, 5dvmin, 40px); font-weight: 900; color: #3a3a5c; opacity: .8; }
.pk-grid {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4dvmin;
  max-width: min(94vw, 900px);
}
.pk-card {
  display: flex; flex-direction: column; align-items: center; gap: 1.2dvmin;
  animation: popIn .45s cubic-bezier(.3,1.5,.5,1) both;
}
.pk-face {
  width: clamp(130px, 37dvmin, 220px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #fff3d6 70%); box-shadow: 0 8px 0 #0002, inset 0 -6px 0 #0001;
  display: flex; align-items: center; justify-content: center; transition: transform .15s;
}
.pk-face img { width: 78%; height: 78%; object-fit: contain; filter: drop-shadow(0 3px 2px #0002); }
.pk-name { font-size: clamp(18px, 4dvmin, 30px); font-weight: 900; color: #3a3a5c; max-width: 34dvmin; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-card:active .pk-face { transform: scale(.92); }
.pk-on .pk-face { animation: jelly .4s ease-in-out; box-shadow: 0 0 0 8px #ffd23f, 0 8px 0 #0002; }
