/* =====================================================================================================================
   SS Online tutorial guide (js/ui/guide.js): quest tracker content, operator LYRA bubble, objective marker / trail /
   edge arrow, spotlight ring, AUTO unlock burst, reward cards and tip cards. Proposed 2026-10-09 (DESIGN §5).
   Tokens only (css/ui-tokens.css). HUD pieces use px with a Thai minimum of 13 px (the HUD is px-sized); dialogs use
   the kit's --u scale. Nothing here ever covers input it does not own: the overlay root is pointer-events: none and
   only the bubble, the objective pill and the tracker take taps.
   ===================================================================================================================== */

/* ------------------------------------------------------------------------------------------------ tracker (#questList) */
#questList .gq {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px 10px 12px;
  color: var(--text);
}
#questList .gq + .gq { border-top: 1px solid var(--line); }
.gq-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
}
.gq-chain {
  flex: none;
  font: 600 13px/1 var(--f-head);
  color: var(--accent);
}
.gq-steps {
  display: flex;
  flex: 1;
  gap: 3px;
  min-width: 40px;
}
.gq-steps i {
  flex: 1;
  height: 5px;
  background: var(--panel-3);
  transform: skewX(-24deg);
}
.gq-steps i.is-done { background: var(--accent-dim); }
.gq-steps i.is-now { background: var(--accent); box-shadow: 0 0 6px var(--accent-a35); }
.gq-rule {
  flex: 1;
  height: 4px;
  background: var(--hazard-dim);
  opacity: 0.7;
}
.gq-of {
  flex: none;
  font: 600 12px/1 var(--f-num);
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.gq-more {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 28px;
  margin: -2px -4px -2px 0;
  border: 0;
  padding: 0;
  color: var(--dim);
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}
/* 44 px touch targets (2026-10-09 review); the negative margins keep the row as tall as before */
body.touch .gq-more { width: 44px; height: 44px; margin: -10px -8px -10px 0; }
.gq-more[aria-expanded="true"] { color: var(--accent); }
.gq-dots { width: 20px; height: 20px; fill: currentColor; }
.gq-main {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  width: 100%;
  margin: 0;
  padding: 9px 10px 9px 12px;
  border: 0;
  text-align: left;
  color: inherit;
  background: linear-gradient(90deg, var(--accent-a16), var(--accent-a08) 45%, transparent 85%);
  box-shadow: inset 3px 0 0 var(--accent);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
  transition: background var(--t-fast) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .gq-main:hover { background: linear-gradient(90deg, var(--accent-a35), var(--accent-a16) 50%, transparent 90%); }
  .gq-more:hover, .gq-menu button:hover { color: var(--text); }
}
.gq-main:active { transform: translateY(1px); }
.gq-title {
  font: 600 16px/1.3 var(--f-head);
  color: var(--text);
  overflow-wrap: anywhere;
}
.gq-obj {
  font: 400 13px/1.4 var(--f-body);
  color: var(--dim);
}
.gq-prog {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 1px;
}
.gq-bar {
  position: relative;
  flex: 1;
  height: 7px;
  background: var(--panel-3);
  box-shadow: inset 0 0 0 1px var(--line);
  -webkit-clip-path: polygon(3px 0, 100% 0, calc(100% - 3px) 100%, 0 100%);
  clip-path: polygon(3px 0, 100% 0, calc(100% - 3px) 100%, 0 100%);
}
.gq-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--v, 0) * 100%);
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  transition: width var(--t-slow) var(--ease);
}
.gq-prog b {
  flex: none;
  min-width: 34px;
  text-align: right;
  font: 700 15px/1 var(--f-num);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.gq-go {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 18px;
  font: 500 13px/1.2 var(--f-body);
  color: var(--info);
}
.gq-walk { width: 15px; height: 15px; flex: none; fill: currentColor; }
.gq-dist {
  margin-left: auto;
  font: 600 13px/1 var(--f-num);
  color: var(--info);
  font-variant-numeric: tabular-nums;
}
.gq-claim {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 0;
  font: 600 15px/1 var(--f-head);
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-a35);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  animation: gqClaim 1.1s ease-in-out infinite alternate;
}
body.touch .gq-claim { min-height: 46px; }
.gq-claim svg { width: 18px; height: 18px; fill: currentColor; }
@keyframes gqClaim {
  from { filter: brightness(1); }
  to { filter: brightness(1.25) drop-shadow(0 0 8px var(--accent-a35)); }
}
.gq-menu {
  position: absolute;
  z-index: 3;
  top: 40px;
  right: 6px;
  display: flex;
  flex-direction: column;
  min-width: 170px;
  padding: 5px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5), inset 0 0 0 1px var(--line-strong);
  -webkit-clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}
.gq-menu[hidden] { display: none; }
.gq-pop {
  position: fixed;
  z-index: 34;
  top: 0;
  right: auto;
  left: 0;
  pointer-events: auto;
}
.gq-menu button {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  text-align: left;
  font: 500 14px/1.2 var(--f-body);
  color: var(--text);
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}
body.touch .gq-menu button { min-height: 44px; }
.gq-menu button + button { border-top: 1px solid var(--line); }
.gq-menu button.is-danger { color: var(--bad); }
.gq.is-ready .gq-main { box-shadow: inset 3px 0 0 var(--good); background: linear-gradient(90deg, var(--good-a14), transparent 85%); }
.gq.is-ready .gq-obj { color: var(--good); }
.gq-flash .gq-prog b { animation: gqTick 0.5s var(--ease); }
.gq-flash .gq-bar { animation: gqBar 0.6s var(--ease); }
@keyframes gqTick { 40% { transform: scale(1.35); color: var(--text); } }
@keyframes gqBar { 30% { filter: brightness(1.8); } }
.gq-advance { animation: gqIn 0.5s var(--ease); }
@keyframes gqIn {
  from { opacity: 0; transform: translateX(14px); }
}
/* the "next goals" block after the chain: horizon eyebrow (+ how far) over one line of goal text */
#questList .gq.gq-next { gap: 3px; padding-top: 8px; padding-bottom: 8px; }
.gq-goal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 8px;
  row-gap: 1px;
  align-items: baseline;
  width: 100%;
  padding: 4px 8px 5px 10px;
  border: 0;
  text-align: left;
  color: inherit;
  background: var(--text-a04);
  box-shadow: inset 2px 0 0 var(--line-strong);
  cursor: pointer;
  touch-action: manipulation;
}
.gq-goal:first-of-type { box-shadow: inset 2px 0 0 var(--accent); }
@media (hover: hover) and (pointer: fine) {
  .gq-goal:hover { background: var(--accent-a08); box-shadow: inset 2px 0 0 var(--accent); }
}
.gq-h {
  font: 600 13px/1.25 var(--f-head);
  font-style: normal;
  color: var(--accent);
}
.gq-goal small {
  justify-self: end;
  font: 500 13px/1.25 var(--f-body);
  color: var(--dim);
  white-space: nowrap;
}
.gq-gt {
  grid-column: 1 / -1;
  font: 600 14px/1.3 var(--f-head);
  color: var(--text);
}
/* the quest button's badge (step n/7, or "!" when a reward waits) */
#questToggle { position: relative; }
#questToggle.gq-ping { animation: gqPing 0.9s var(--ease) 2; }
@keyframes gqPing {
  40% { box-shadow: 0 0 0 4px var(--accent-a35); }
}
.gq-badge {
  position: absolute;
  top: -7px;
  right: -9px;
  min-width: 22px;
  padding: 3px 5px 2px;
  font: 700 11px/1 var(--f-num);
  color: var(--accent-ink);
  background: var(--accent);
  pointer-events: none;
  -webkit-clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
}
.gq-badge[hidden] { display: none; }
.gq-badge.is-ready { background: var(--good); animation: gqClaim 0.8s ease-in-out infinite alternate; }

/* ------------------------------------------------------------------------------------------------ overlay root */
.gg-root {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  overflow: hidden;
}
.gg-root.is-busy .gg-op,
.gg-root.is-busy .gg-pill { visibility: hidden; }

/* ------------------------------------------------------------------------------------------------ operator bubble */
.gg-op {
  --c: 14px;
  position: absolute;
  left: calc(var(--sl) + 24px);
  bottom: calc(var(--sb) + 136px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: clamp(340px, calc(50vw - 300px), 460px);
  padding: 10px 10px 12px 10px;
  pointer-events: auto;
  cursor: pointer;
  color: var(--text);
  background:
    linear-gradient(90deg, var(--info-a10), transparent 45%),
    var(--glass);
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45));
  -webkit-clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
  touch-action: manipulation;
}
.gg-op[hidden] { display: none; }
.gg-op::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(var(--info), var(--info)) left 0 top var(--c) / 2px calc(100% - var(--c)) no-repeat,
    linear-gradient(90deg, var(--line-strong), transparent 80%) left var(--c) top 0 / 100% 1px no-repeat,
    linear-gradient(90deg, transparent 20%, var(--line-strong)) left 0 bottom 0 / calc(100% - var(--c)) 1px no-repeat;
}
.gg-op.is-in { animation: ggOpIn 0.26s var(--ease) both; }
@keyframes ggOpIn {
  from { opacity: 0; transform: translateY(10px); }
}
.gg-op-face { display: block; flex: none; width: 78px; line-height: 0; }
.gg-op-face svg { width: 100%; height: auto; display: block; }
.gg-op-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.gg-op-who {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.gg-op-who b { font: 600 15px/1.2 var(--f-head); color: var(--info); }
.gg-op-who span { font: 500 13px/1.2 var(--f-body); color: var(--dim); }
.gg-op-who i {
  margin-left: auto;
  font: 600 10px/1 var(--f-head);
  font-style: normal;
  letter-spacing: 0.12em;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.gg-op-text {
  margin: 0;
  font: 500 15px/1.45 var(--f-body);
  color: var(--text);
}
.gg-op-text span { display: block; }
.gg-op-acts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  align-self: stretch;
  gap: 6px;
}
.gg-op-x {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: -4px -2px 0 0;
  padding: 0;
  border: 0;
  color: var(--dim);
  background: transparent;
  cursor: pointer;
}
.gg-op-x svg { width: 16px; height: 16px; fill: currentColor; }
.gg-op-tip {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  font: 600 13px/1 var(--f-head);
  color: var(--info);
  background: var(--info-a10);
  box-shadow: inset 0 0 0 1px var(--info-dim);
  white-space: nowrap;
  cursor: pointer;
  -webkit-clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}
.gg-op-tip[hidden] { display: none; }
.gg-op-time {
  position: absolute;
  left: var(--c);
  right: var(--c);
  bottom: 0;
  height: 2px;
  background: var(--info);
  opacity: 0.55;
  transform-origin: left;
}
.gg-op.is-in .gg-op-time { animation: ggTime var(--dur, 5s) linear both; }
@keyframes ggTime { to { transform: scaleX(0); } }
/* touch: top centre, between the pilot card and the menu buttons, away from the stick and the skill pad */
body.touch .gg-op {
  --c: 10px;
  left: 50%;
  top: calc(var(--st) + 8px);
  bottom: auto;
  width: min(430px, calc(100vw - 440px - var(--sl) - var(--sr)));
  min-width: 300px;
  translate: -50% 0;
  gap: 9px;
  padding: 7px 8px 9px 7px;
}
body.touch .gg-op.is-in { animation-name: ggOpInTop; }
@keyframes ggOpInTop {
  from { opacity: 0; transform: translateY(-8px); }
}
/* the quest panel open on a phone (it drops over the top right): the bubble keeps to the space left of it */
body.touch .gg-root.q-open .gg-op {
  left: calc(var(--sl) + 222px);
  translate: none;
  width: min(430px, calc(100vw - 222px - 300px - var(--sl) - var(--sr)));
  min-width: 0;
}
body.touch .gg-op-face { width: 58px; }
body.touch .gg-op-who i { display: none; }
body.touch .gg-op-who b { font-size: 14px; }
body.touch .gg-op-text { font-size: 14px; line-height: 1.4; }
/* 44 px touch targets (2026-10-09 review): the close button sits under the tip and reaches into the bubble's padding
   (right and bottom; the top too when the tip is hidden and it is alone in the column) */
body.touch .gg-op-acts { gap: 0; }
body.touch .gg-op-x { width: 44px; height: 44px; margin: 0 -10px -8px 0; }
body.touch .gg-op-tip[hidden] + .gg-op-x { margin-top: -10px; }
body.touch .gg-op-tip { min-height: 44px; min-width: 44px; }
/* toasts share the top centre with the bubble on touch landscape: they step below it while it speaks */
@media (orientation: landscape) {
  body.touch:has(.gg-root:not(.is-busy) > .gg-op:not([hidden])) .gtoasts { top: calc(var(--st) + 100px); }
}
@media (orientation: portrait) {
  body.touch .gg-op {
    top: calc(var(--st) + 238px);
    width: calc(100vw - 20px - var(--sl) - var(--sr));
    min-width: 0;
  }
}

/* ------------------------------------------------------------------------------------------------ objective pill (touch) */
.gg-pill {
  position: absolute;
  left: 50%;
  top: calc(var(--st) + 8px);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(430px, calc(100vw - 440px - var(--sl) - var(--sr)));
  min-height: 36px;
  padding: 0 14px 0 12px;
  border: 0;
  transform: translateX(-50%);
  pointer-events: auto;
  font: 600 13px/1.2 var(--f-head);
  color: var(--text);
  background: linear-gradient(90deg, var(--accent-a16), transparent 70%), var(--glass);
  box-shadow: inset 3px 0 0 var(--accent), inset 0 0 0 1px var(--line);
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-clip-path: polygon(0 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%);
}
.gg-pill[hidden] { display: none; }
.gg-pill span { overflow: hidden; text-overflow: ellipsis; }
.gq-pill-dot {
  flex: none;
  width: 8px;
  height: 8px;
  background: var(--accent);
  transform: rotate(45deg);
  box-shadow: 0 0 8px var(--accent);
}
.gq-pill-dot.is-ready { background: var(--good); box-shadow: 0 0 8px var(--good); }
/* touch landscape: the pill sits just under the target frame's slot (#tf, top centre), not over the monster's health
   bar (user, 2026-10-11); compact #tf is ~42 px tall, the full one ~67 px */
@media (orientation: landscape) {
  body.touch .gg-pill { top: calc(var(--hud-edge, 24px) + var(--st) + 74px); }
  body.touch.hud-compact .gg-pill { top: calc(var(--hud-edge, 10px) + var(--st) + 48px); }
}
@media (orientation: portrait) {
  .gg-pill { top: calc(var(--st) + 238px); max-width: calc(100vw - 20px); }
}

/* ------------------------------------------------------------------------------------------------ spotlight */
.gg-spot {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 31;
  pointer-events: none;
  will-change: transform;
}
.gg-spot[hidden] { display: none; }
.gg-spot.in-win { z-index: 50; }
.gg-spot-ring {
  position: absolute;
  inset: 0;
  border: 2px solid var(--accent);
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 0 16px var(--accent-a35), inset 0 0 12px var(--accent-a16), 0 0 0 0 rgba(4, 7, 8, 0);
  transition: box-shadow 0.7s var(--ease);
  animation: ggRing 1.15s ease-in-out infinite alternate;
}
.gg-spot.is-round .gg-spot-ring { border-radius: 50%; }
.gg-spot.dim .gg-spot-ring:not(.r2) {
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 0 16px var(--accent-a35), inset 0 0 12px var(--accent-a16), 0 0 0 200vmax rgba(4, 7, 8, 0.4);
}
.gg-spot-ring.r2 {
  border-width: 2px;
  box-shadow: none;
  opacity: 0;
  animation: ggRingOut 1.6s ease-out infinite;
}
@keyframes ggRing {
  from { border-color: var(--accent); }
  to { border-color: #ffd47a; }
}
@keyframes ggRingOut {
  0% { opacity: 0.9; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.35); }
}
.gg-spot.is-in .gg-spot-ring:not(.r2) { animation: ggSpotIn 0.35s var(--ease) both, ggRing 1.15s 0.35s ease-in-out infinite alternate; }
@keyframes ggSpotIn {
  from { opacity: 0; transform: scale(1.6); }
}
.gg-spot-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  padding: 5px 11px 6px;
  font: 600 13px/1.1 var(--f-head);
  color: var(--accent-ink);
  background: var(--accent);
  white-space: nowrap;
  transform: translateX(-50%);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
  animation: ggBob 0.9s ease-in-out infinite alternate;
}
.gg-spot-label[hidden] { display: none; }
.gg-spot-label::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  border: 6px solid transparent;
  border-top-color: var(--accent);
  transform: translateX(-50%);
}
.gg-spot.lbl-below .gg-spot-label { bottom: auto; top: calc(100% + 12px); }
.gg-spot.lbl-below .gg-spot-label::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--accent); }
.gg-spot.lbl-left .gg-spot-label { left: auto; right: 0; transform: none; }
.gg-spot.lbl-left .gg-spot-label::after { left: auto; right: 14px; transform: none; }
.gg-spot.lbl-right .gg-spot-label { left: 0; transform: none; }
.gg-spot.lbl-right .gg-spot-label::after { left: 14px; transform: none; }
@keyframes ggBob { to { translate: 0 -4px; } }

/* ------------------------------------------------------------------------------------------------ ground marker, trail, edge arrow */
.gg-mark,
.gg-edge {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  will-change: transform;
}
.gg-mark[hidden],
.gg-edge[hidden] { display: none; }
.gg-mark-ring {
  position: absolute;
  left: -26px;
  top: -10px;
  width: 52px;
  height: 20px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: ggGround 1.8s ease-out infinite;
}
.gg-mark-ring.r2 { animation-delay: 0.9s; }
@keyframes ggGround {
  0% { opacity: 0.95; transform: scale(0.35); }
  100% { opacity: 0; transform: scale(1.5); }
}
.gg-mark-pin {
  position: absolute;
  left: -13px;
  top: -54px;
  width: 26px;
  height: 32px;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5));
  animation: ggPin 0.8s ease-in-out infinite alternate;
}
.gg-mark-pin svg { width: 100%; height: 100%; display: block; }
.gg-mark-pin path { fill: var(--accent); }
.gg-mark-pin path.in { fill: var(--accent-ink); opacity: 0.35; }
@keyframes ggPin { to { translate: 0 -7px; } }
.gg-mark-d {
  position: absolute;
  left: 0;
  top: -78px;
  transform: translateX(-50%);
  padding: 2px 6px;
  font: 700 13px/1 var(--f-num);
  color: var(--text);
  background: rgba(11, 15, 16, 0.72);
  white-space: nowrap;
}
.gg-mark-d:empty { display: none; }
.gg-mark[data-kind="enemy"] .gg-mark-ring { display: none; }
.gg-mark[data-kind="enemy"] .gg-mark-pin { left: -10px; top: -30px; width: 20px; height: 25px; }
.gg-mark[data-kind="enemy"] .gg-mark-d { top: -48px; }
.gg-trail i {
  position: absolute;
  left: -13px;
  top: -9px;
  width: 26px;
  height: 18px;
  opacity: 0;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 18'%3E%3Cpath d='M4 2l10 7-10 7' fill='none' stroke='%231a1203' stroke-width='6' stroke-linecap='round' stroke-linejoin='round' opacity='.45'/%3E%3Cpath d='M4 2l10 7-10 7M12 2l10 7-10 7' fill='none' stroke='%23ffb21e' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  transform-origin: 13px 9px;
  will-change: transform, opacity;
}
.gg-edge-arrow {
  position: absolute;
  left: -22px;
  top: -22px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(11, 15, 16, 0.8) 58%, transparent 72%);
  box-shadow: inset 0 0 0 2px var(--accent-a35);
}
.gg-edge-arrow svg {
  width: 30px;
  height: 30px;
  fill: var(--accent);
  filter: drop-shadow(0 0 6px var(--accent-a35));
  animation: ggNudge 0.7s ease-in-out infinite alternate;
}
@keyframes ggNudge { to { translate: 4px 0; } }
.gg-edge-d {
  position: absolute;
  left: 0;
  top: 22px;
  transform: translateX(-50%);
  padding: 2px 6px;
  font: 700 13px/1 var(--f-num);
  color: var(--accent);
  background: rgba(11, 15, 16, 0.78);
  white-space: nowrap;
}

/* ------------------------------------------------------------------------------------------------ HUD reactions */
#bAuto.gg-shake { animation: ggShake 0.5s var(--ease); }
@keyframes ggShake {
  20% { translate: -4px 0; }
  40% { translate: 4px 0; }
  60% { translate: -3px 0; }
  80% { translate: 2px 0; }
}
#bAuto.gg-unlocked { animation: ggUnlocked 2.2s var(--ease); }
@keyframes ggUnlocked {
  0%, 30% { filter: brightness(2.2) drop-shadow(0 0 14px var(--accent)); }
  100% { filter: none; }
}

/* ------------------------------------------------------------------------------------------------ AUTO unlock burst */
.gg-burst {
  --s: 60px;
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
}
.gg-burst > i {
  position: absolute;
  left: calc(var(--s) * -0.5);
  top: calc(var(--s) * -0.5);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
}
.gg-b-flash {
  background: radial-gradient(circle, rgba(255, 230, 170, 0.95), var(--accent-a35) 45%, transparent 70%);
  animation: ggFlash 0.9s ease-out both;
}
@keyframes ggFlash {
  0% { opacity: 0; transform: scale(0.4); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: scale(2.6); }
}
.gg-b-ring {
  border: 3px solid var(--accent);
  animation: ggBurstRing 1.1s cubic-bezier(0.1, 0.7, 0.2, 1) both;
}
.gg-b-ring.r2 { border-color: var(--info); border-width: 2px; animation-delay: 0.18s; }
@keyframes ggBurstRing {
  0% { opacity: 1; transform: scale(0.6); }
  100% { opacity: 0; transform: scale(3); }
}
.gg-b-rays {
  background: repeating-conic-gradient(from 0deg, var(--accent) 0 4deg, transparent 4deg 30deg);
  -webkit-mask: radial-gradient(circle, transparent 38%, #000 40%, #000 62%, transparent 64%);
  mask: radial-gradient(circle, transparent 38%, #000 40%, #000 62%, transparent 64%);
  animation: ggRays 1s ease-out both;
}
@keyframes ggRays {
  0% { opacity: 0; transform: scale(0.8) rotate(0deg); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: scale(2.4) rotate(40deg); }
}
.gg-b-lock {
  position: absolute;
  left: -16px;
  top: -16px;
  width: 32px;
  height: 32px;
}
.gg-b-lock svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: var(--accent);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}
.gg-b-lock .l { animation: ggLockL 0.9s 0.15s cubic-bezier(0.3, 0.6, 0.4, 1) both; }
.gg-b-lock .r { animation: ggLockR 0.9s 0.15s cubic-bezier(0.3, 0.6, 0.4, 1) both; }
@keyframes ggLockL { to { opacity: 0; transform: translate(-26px, 18px) rotate(-40deg); } }
@keyframes ggLockR { to { opacity: 0; transform: translate(26px, 18px) rotate(40deg); } }
.gg-b-label,
.gg-burst small {
  position: absolute;
  left: 0;
  transform: translateX(-50%);
  white-space: nowrap;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}
.gg-b-label {
  top: calc(var(--s) * -0.5 - 58px);
  font: 700 26px/1 var(--f-head);
  color: var(--accent);
  animation: ggLabel 2.2s var(--ease) both;
}
.gg-burst small {
  top: calc(var(--s) * -0.5 - 28px);
  font: 600 14px/1 var(--f-head);
  color: var(--text);
  animation: ggLabel 2.2s 0.08s var(--ease) both;
}
@keyframes ggLabel {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.8); }
  15% { opacity: 1; transform: translate(-50%, 0) scale(1.08); }
  25% { transform: translate(-50%, 0) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -8px); }
}

/* ------------------------------------------------------------------------------------------------ reward cards (wm.dialog) */
.gdialog.gg-reward { width: min(calc(680 * var(--u)), 100%); }
.gdialog.gg-reward.is-final,
.gdialog.gg-reward.is-got { width: min(calc(600 * var(--u)), 100%); }
.gg-rw {
  display: grid;
  grid-template-columns: minmax(0, calc(250 * var(--u))) minmax(0, 1fr);
  gap: calc(20 * var(--u));
  align-items: center;
}
.gg-rw-hero {
  --rc: var(--r-std);
  --ra: var(--r-std-a);
  position: relative;
  aspect-ratio: 5 / 4;
  background:
    radial-gradient(70% 60% at 50% 55%, var(--ra), transparent 75%),
    linear-gradient(180deg, var(--panel-3), var(--panel-2) 60%, var(--panel));
  box-shadow: inset 0 0 0 1px var(--rc), inset 0 -40px 40px -30px var(--ra);
  -webkit-clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}
.gg-rw-hero.r-tuned { --rc: var(--r-tuned); --ra: var(--r-tuned-a); }
.gg-rw-hero.r-special { --rc: var(--r-special); --ra: var(--r-special-a); }
.gg-rw-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grid-faint);
  opacity: 0.8;
}
.gg-rw-hero::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 0;
  top: 0;
  height: 4px;
  background: var(--rc);
}
.gg-rw-art {
  position: absolute;
  inset: 16% 8% 18%;
  filter: drop-shadow(0 calc(10 * var(--u)) calc(12 * var(--u)) rgba(0, 0, 0, 0.55));
  animation: ggHero 0.6s var(--ease) both;
}
.gg-rw-art > * { position: absolute; inset: 0; width: 100%; height: 100%; }
@keyframes ggHero {
  from { opacity: 0; transform: scale(0.85) rotate(-4deg); }
}
.gg-rw-rar {
  position: absolute;
  left: calc(10 * var(--u));
  bottom: calc(8 * var(--u));
  display: flex;
  align-items: center;
  gap: calc(6 * var(--u));
  font: 600 var(--fs-label) / 1 var(--f-head);
  color: var(--rc);
}
.gg-rw-new,
.gg-rw-tier {
  position: absolute;
  top: calc(10 * var(--u));
  padding: calc(3 * var(--u)) calc(7 * var(--u));
  font: 700 var(--fs-xs) / 1 var(--f-num);
  letter-spacing: 0.08em;
}
.gg-rw-new { right: calc(10 * var(--u)); color: var(--accent-ink); background: var(--accent); }
.gg-rw-tier { left: calc(18 * var(--u)); color: var(--dim); background: rgba(11, 15, 16, 0.6); }
.gg-rw-info {
  display: flex;
  flex-direction: column;
  gap: calc(8 * var(--u));
  min-width: 0;
}
.gg-rw-name {
  font: 600 var(--fs-xl) / 1.25 var(--f-head);
  color: var(--text);
}
.gg-rw-role {
  font: 500 var(--fs-sm) / 1.35 var(--f-body);
  color: var(--dim);
}
.gg-rw-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: calc(6 * var(--u));
}
.gg-rw-stats span {
  display: flex;
  flex-direction: column;
  gap: calc(3 * var(--u));
  padding: calc(7 * var(--u)) calc(9 * var(--u));
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.gg-rw-stats small { font: 600 var(--fs-label) / 1.1 var(--f-head); color: var(--dim); }
.gg-rw-stats b { font: 700 var(--fs-xl) / 1 var(--f-num); color: var(--text); }
.gg-rw-stats b i { font-size: 0.65em; font-style: normal; color: var(--dim); }
.gg-rw-chips { display: flex; flex-wrap: wrap; gap: calc(8 * var(--u)); }
.gg-rw-chip {
  display: inline-flex;
  align-items: center;
  gap: calc(6 * var(--u));
  min-height: calc(34 * var(--u));
  padding: 0 calc(12 * var(--u));
  font: 700 var(--fs-lg) / 1 var(--f-num);
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.gg-rw-chip svg { width: calc(18 * var(--u)); height: calc(18 * var(--u)); fill: currentColor; }
.gg-rw-chip.k-money { color: var(--accent); }
.gg-rw-chip.k-good { color: var(--good); }
.gg-rw-note {
  display: flex;
  align-items: center;
  gap: calc(6 * var(--u));
  margin: 0;
  font: 500 var(--fs-label) / 1.35 var(--f-body);
  color: var(--dim);
}
.gg-rw-note svg { flex: none; width: calc(15 * var(--u)); height: calc(15 * var(--u)); fill: currentColor; }
.gg-rw-note.k-info { color: var(--info); }
.gg-rw-slot {
  margin: 0;
  padding: calc(8 * var(--u)) calc(10 * var(--u));
  font: 600 var(--fs-body) / 1.3 var(--f-head);
  color: var(--accent);
  background: var(--accent-a08);
  box-shadow: inset 3px 0 0 var(--accent);
}
.gg-rw-lead { margin: 0; font: 400 var(--fs-sm) / 1.45 var(--f-body); color: var(--dim); }
.gg-rw-got { grid-template-columns: minmax(0, calc(200 * var(--u))) minmax(0, 1fr); }
/* final reward */
.gg-rw-final { grid-template-columns: minmax(0, calc(170 * var(--u))) minmax(0, 1fr); }
.gg-rw-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(8 * var(--u));
  text-align: center;
}
.gg-rw-emblem { width: calc(130 * var(--u)); height: auto; animation: ggHero 0.6s var(--ease) both; }
.gg-rw-badge b { font: 600 var(--fs-sm) / 1.3 var(--f-head); color: var(--accent); }
.gg-rw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(calc(120 * var(--u)), 1fr));
  gap: calc(10 * var(--u));
}
.gg-rw-tile {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: calc(10 * var(--u));
  align-items: center;
  padding: calc(10 * var(--u)) calc(12 * var(--u));
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.gg-rw-ic {
  grid-row: span 2;
  width: calc(52 * var(--u));
  height: calc(52 * var(--u));
  display: grid;
  place-items: center;
}
.gg-rw-ic > * { width: 100%; height: 100%; }
.gg-rw-star { color: var(--good); }
.gg-rw-star svg { width: 70%; height: 70%; fill: currentColor; }
.gg-rw-tile b { font: 700 var(--fs-title) / 1 var(--f-num); color: var(--text); }
.gg-rw-tile small { font: 600 var(--fs-label) / 1.2 var(--f-head); color: var(--dim); }
html[data-tier="phone"] .gg-rw { grid-template-columns: minmax(0, calc(210 * var(--u))) minmax(0, 1fr); gap: calc(14 * var(--u)); }
html[data-tier="phone"] .gg-rw-got { grid-template-columns: minmax(0, calc(170 * var(--u))) minmax(0, 1fr); }
html[data-tier="phone"] .gg-rw-final { grid-template-columns: minmax(0, calc(140 * var(--u))) minmax(0, 1fr); }
html[data-tier="phone"] .gg-rw-emblem { width: calc(96 * var(--u)); }
html[data-tier="phone"] .gg-rw-info { gap: calc(6 * var(--u)); }
html[data-tier="phone"] .gg-rw-name { font-size: var(--fs-lg); }
html[data-tier="phone"] .gg-rw-stats span { flex-direction: row; align-items: baseline; justify-content: space-between; gap: calc(6 * var(--u)); padding: calc(5 * var(--u)) calc(8 * var(--u)); }
html[data-tier="phone"] .gg-rw-stats b { font-size: var(--fs-lg); }
html[data-tier="phone"] .gg-rw-chip { min-height: calc(30 * var(--u)); font-size: var(--fs-body); }
html[data-orient="portrait"] .gg-rw,
html[data-orient="portrait"] .gg-rw-got,
html[data-orient="portrait"] .gg-rw-final { grid-template-columns: minmax(0, 1fr); }
html[data-orient="portrait"] .gg-rw-hero { max-width: calc(300 * var(--u)); width: 100%; justify-self: center; }

/* ------------------------------------------------------------------------------------------------ tip cards (wm.dialog) */
.gdialog.gg-tipdlg { width: min(calc(820 * var(--u)), 100%); }
.gg-tip {
  display: flex;
  flex-direction: column;
  gap: calc(14 * var(--u));
}
.gg-tip-art {
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 9;
  line-height: 0;
  touch-action: pan-y;
}
.gg-tip-art > svg:first-child,
.gg-tip-art > img:first-child { width: 100%; height: 100%; display: block; }
.gg-tip-nav {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: calc(44 * var(--u));
  height: calc(64 * var(--u));
  min-width: 36px;
  min-height: 44px;
  padding: 0;
  border: 0;
  color: var(--text);
  background: rgba(11, 15, 16, 0.72);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transform: translateY(-50%);
  cursor: pointer;
}
.gg-tip-nav.prev { left: calc(6 * var(--u)); }
.gg-tip-nav.next { right: calc(6 * var(--u)); }
.gg-tip-nav svg { width: calc(24 * var(--u)); height: calc(24 * var(--u)); min-width: 18px; min-height: 18px; fill: currentColor; }
@media (hover: hover) and (pointer: fine) {
  .gg-tip-nav:hover { color: var(--accent-ink); background: var(--accent); }
}
.gg-tip-text {
  display: flex;
  flex-direction: column;
  gap: calc(6 * var(--u));
  font: 400 var(--fs-body) / 1.55 var(--f-body);
}
.gg-tip-text p { margin: 0; }
.gg-tip-dots { display: flex; gap: calc(6 * var(--u)); margin-top: calc(4 * var(--u)); }
.gg-tip-dots i {
  width: calc(18 * var(--u));
  height: 4px;
  background: var(--line-strong);
  transform: skewX(-24deg);
}
.gg-tip-dots i.is-on { background: var(--accent); }
/* short landscape screens: picture beside the text so the card fits without scrolling */
@media (orientation: landscape) and (max-height: 620px) {
  .gdialog.gg-tipdlg { width: min(calc(900 * var(--u)), 100%); }
  .gg-tip {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: calc(16 * var(--u));
  }
  .gg-tip-art { width: min(calc(56vw - 40px), calc((100dvh - 190px) * 16 / 9)); }
  .gg-tip-text { font-size: var(--fs-sm); }
}

@media (prefers-reduced-motion: reduce) {
  .gg-spot-ring, .gg-spot-ring.r2, .gg-spot-label, .gg-mark-ring, .gg-mark-pin, .gg-edge-arrow svg, .gq-claim, .gq-badge.is-ready,
  .gg-op-time { animation: none !important; }
  .gg-mark-ring { opacity: 0.8; }
}
