/* The ring, the pocket, the sit button and the "carrying" hint. Owner: J29. Pocket and Sit live bottom right; the joystick is bottom left. */
.ring { position: absolute; inset: 0; pointer-events: none; font-family: var(--font); color: var(--ink); z-index: 40; }

.ring-btn {
  position: absolute; left: 0; top: 0;
  width: 76px; height: 76px; padding: 0; border: 0;
  background: none;
  display: none;
  pointer-events: auto;
  cursor: pointer;
  will-change: transform;
  color: inherit; font: inherit;
}
.ring-on .ring-btn { display: block; }
.ring-face {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border-radius: 50%;
  background: rgba(251, 240, 226, .96);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .7), 0 6px 18px rgba(74, 63, 74, .18);
  animation: ring-in .22s ease-out both;
  transition: background-color .15s ease;
}
.ring-btn:hover .ring-face, .ring-btn:focus-visible .ring-face { background: #ffe9ae; }
.ring-btn:focus-visible { outline: none; }
.ring-btn:focus-visible .ring-face { box-shadow: 0 0 0 3px #ffd877, 0 6px 18px rgba(74, 63, 74, .18); }
.ring-word { font-size: 13.5px; font-weight: 700; line-height: 1; }
@keyframes ring-in { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: scale(1); } }

.ring-tray {
  position: absolute; left: 0; top: 0;
  display: none; flex-wrap: wrap; justify-content: center; gap: 8px;
  max-width: min(320px, calc(100vw - 16px));
  padding: 10px;
  border-radius: 26px;
  background: rgba(251, 240, 226, .97);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .7), 0 10px 26px rgba(74, 63, 74, .2);
  pointer-events: auto;
  will-change: transform;
}
.ring-tray-on .ring-tray { display: flex; }
.ring-chip {
  position: relative;
  width: 60px; height: 60px; padding: 0; border: 0; border-radius: 50%;
  background: #fff7ea; color: inherit; font: inherit;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.ring-chip svg { width: 40px; height: 40px; }
.ring-chip:hover, .ring-chip:focus-visible { background: #ffe9ae; outline: none; }
.ring-chip:focus-visible { box-shadow: 0 0 0 3px #ffd877; }
.ring-n {
  position: absolute; right: 2px; bottom: 2px;
  min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px;
  background: var(--ink); color: var(--cream);
  font-size: 13px; font-weight: 700; line-height: 20px; text-align: center;
}
.ring-note { max-width: 230px; padding: 2px 8px; font-size: 16px; font-weight: 600; line-height: 1.25; text-align: center; }

.ring-cursor {
  position: absolute; left: 0; top: 0;
  border-radius: 50%;
  border: 3px solid #ffd877;
  box-shadow: 0 0 0 2px rgba(251, 240, 226, .7), 0 0 18px rgba(255, 216, 119, .55);
  opacity: 0; visibility: hidden;
  transition: opacity .18s ease;
  will-change: transform;
}
.ring-cursor.on { opacity: 1; visibility: visible; }
.ring-say { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.ring-still .ring-face, .ring-still .ring-cursor { animation: none; transition: none; }

/* The hint while carrying someone. */
.held-hint {
  position: absolute; left: 50%; top: calc(env(safe-area-inset-top) + 18px);
  transform: translateX(-50%);
  padding: 9px 18px; border-radius: 22px;
  background: rgba(251, 240, 226, .95);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .55), 0 6px 18px rgba(74, 63, 74, .16);
  color: var(--ink); font-family: var(--font); font-size: 17px; font-weight: 700;
  white-space: nowrap;
  opacity: 0; visibility: hidden;
  transition: opacity .2s ease;
  pointer-events: none;
  z-index: 35;
}
.held-hint.on { opacity: 1; visibility: visible; }
#ui.title-on .held-hint { display: none; }

/* The pocket and Sit. */
.pk {
  position: absolute;
  right: calc(env(safe-area-inset-right) + 14px);
  bottom: calc(env(safe-area-inset-bottom) + 18px);
  display: flex; align-items: flex-end; gap: 10px;
  font-family: var(--font); color: var(--ink);
  z-index: 30;
  transition: opacity .3s ease;
}
#ui.title-on .pk { opacity: 0; visibility: hidden; }
.pk-btn {
  position: relative;
  width: 70px; height: 70px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(251, 240, 226, .92);
  box-shadow: 0 0 0 2px rgba(251, 240, 226, .75), 0 6px 18px rgba(74, 63, 74, .16);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  color: inherit; font: inherit;
  pointer-events: auto;
  cursor: pointer;
  transition: background-color .2s ease;
}
.pk-btn:hover { background: #fff6e8; }
.pk-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px #ffd877, 0 6px 18px rgba(74, 63, 74, .16); }
.pk-open .pk-toggle, .pk-sit.pk-on { background: #ffe9ae; }
.pk-word { font-size: 13px; font-weight: 700; line-height: 1; }
.pk-badge {
  position: absolute; right: -2px; top: -2px;
  min-width: 24px; height: 24px; padding: 0 5px; border-radius: 12px;
  background: var(--ink); color: var(--cream);
  font-size: 14px; font-weight: 700; line-height: 24px; text-align: center;
  opacity: 0; transition: opacity .2s ease;
}
.pk-badge.on { opacity: 1; }

.pk-panel {
  position: absolute; right: 0; bottom: 82px;
  width: min(288px, calc(100vw - 28px));
  padding: 12px 14px 14px;
  border-radius: 24px;
  background: rgba(251, 240, 226, .96);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .55), 0 10px 30px rgba(74, 63, 74, .18);
  pointer-events: auto;
  visibility: hidden; opacity: 0;
  transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}
.pk-open .pk-panel { visibility: visible; opacity: 1; transform: none; transition: opacity .2s ease, transform .2s ease; }
.pk-head { font-size: 16px; font-weight: 700; line-height: 1.25; margin: 0 2px 10px; }
.pk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pk-slot {
  aspect-ratio: 1; border: 0; padding: 0; border-radius: 18px;
  background: #fff7ea; color: inherit; font: inherit;
  display: flex; align-items: center; justify-content: center;
}
button.pk-slot { cursor: pointer; }
.pk-slot svg { width: 44px; height: 44px; }
.pk-empty { background: rgba(232, 201, 122, .16); }
button.pk-slot:hover, button.pk-slot:focus-visible, .pk-slot.pk-chosen { background: #ffe9ae; outline: none; }
button.pk-slot:focus-visible { box-shadow: 0 0 0 3px #ffd877; }
.pk-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; min-height: 20px; }
.pk-acts:empty { display: none; }
.pk-name { width: 100%; font-size: 16px; font-weight: 700; }
.pk-faint { font-weight: 500; font-size: 15px; opacity: .8; }
.pk-act {
  min-height: 48px; padding: 8px 16px; border: 0; border-radius: 24px;
  background: #fff1cf; color: inherit; font: inherit; font-size: 15.5px; font-weight: 700;
  cursor: pointer;
}
.pk-act:hover, .pk-act:focus-visible { background: #ffe9ae; outline: none; }
.pk-act:focus-visible { box-shadow: 0 0 0 3px #ffd877; }
.pk-still * { transition: none !important; }

/* On foot on a phone the ring needs the corners: nothing else wants pressing while it's open. */
#ui.walk-on:has(.ring-on) :is(.tgc-joy, .pk-btn, .walk-talk, .walk-sparkle, .walk-btn) { visibility: hidden; }
