/* Pack Hands paints its own children. Card transforms belong to reveal/tilt. */
.pack-hands, .pack-hands * { box-sizing: border-box; }
[data-pack-hands][hidden], .pack-hands[hidden] { display: none; }
.pack-hands {
  --hand-pearl: #fae9dc;
  --hand-pink: #f2b7d3;
  --hand-gold: #efcf93;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  min-height: 34px;
  max-width: calc(100vw - 32px);
  margin: 0 auto;
  color: var(--hand-pearl);
  font-family: inherit;
}
.pack-hands-status { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 9px; }
.pack-hands-help { position: relative; flex: 0 0 auto; }
.pack-hands-toggle {
  display: flex; align-items: center; gap: 6px; min-height: 34px; padding: 5px 8px;
  border: 1px solid rgb(246 209 225 / 16%); border-radius: 20px;
  background: rgb(240 202 220 / 4%); color: #dac2cf;
  font: inherit; font-size: 10px; letter-spacing: .025em; cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}
.pack-hands-toggle-icon { font-size: 17px; line-height: 1; color: var(--hand-pink); }
.pack-hands-question { display: grid; place-items: center; width: 13px; height: 13px; border: 1px solid rgb(239 207 219 / 32%); border-radius: 50%; font-size: 9px; }
.pack-hands-toggle:hover, .pack-hands-toggle[aria-expanded="true"] { color: #fff1e8; border-color: rgb(246 209 225 / 40%); background: rgb(240 202 220 / 9%); }
.pack-hands-toggle:focus-visible, .pack-hands-panel:focus-visible { outline: 2px solid var(--hand-gold); outline-offset: 3px; }
.pack-hands-panel {
  position: fixed; z-index: 140;
  width: min(340px, calc(100vw - 32px)); max-height: min(520px, 75dvh); overflow-y: auto;
  padding: 23px; border: 1px solid rgb(247 207 222 / 32%); border-radius: 17px;
  background: radial-gradient(ellipse at 100% 0, rgb(129 71 102 / 23%), transparent 58%), #211d28;
  box-shadow: 0 18px 65px rgb(0 0 0 / 48%), inset 0 1px 0 rgb(255 239 229 / 9%);
  text-align: left; line-height: 1.45; overscroll-behavior: contain;
}
.pack-hands-panel[hidden] { display: none; }
.pack-hands-heading { margin: 0; color: var(--hand-pearl); font-family: inherit; font-weight: 600; font-size: 15px; line-height: 1.3; }
.pack-hands-rate-caption { margin: 4px 0 0; color: #b8aab6; font-size: 10px; }
.pack-hands-legend { display: grid; gap: 0; margin-top: 12px; }
.pack-hands-legend-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-top: 1px solid rgb(248 221 230 / 10%); }
.pack-hands-legend-copy { display: grid; gap: 6px; }
.pack-hands-legend-copy > strong { font-size: 11px; font-weight: 550; }
.pack-hands-legend-values { display: grid; justify-items: end; gap: 4px; flex-shrink: 0; }
.pack-hands-legend-rate { color: #cbb9c7; font-size: 11px; font-variant-numeric: tabular-nums; }
.pack-hands-legend-reward { display: flex; align-items: baseline; gap: 4px; color: var(--hand-gold); font-size: 16px; font-variant-numeric: tabular-nums; }
.pack-hands-legend-reward small { font-size: 7px; letter-spacing: .08em; opacity: .75; }
.pack-hands-footnote { margin: 7px 0 0; color: #b8aab6; font-size: 10px; }
.pack-hands-pips { display: inline-flex; align-items: center; gap: 3px; }
.pack-hands-pip {
  --pip-color: #c9c9c9;
  display: grid; place-items: center; width: 24px; height: 19px;
  border: 1px solid color-mix(in srgb, var(--pip-color) 60%, transparent); border-radius: 4px;
  background: color-mix(in srgb, var(--pip-color) 10%, transparent);
  color: var(--pip-color); font-family: inherit; font-size: 8px; font-weight: 650; font-style: normal; letter-spacing: -.025em; line-height: 1;
}
.pack-hands-pip[data-rarity="R"] { --pip-color: #a8dbf5; }
.pack-hands-pip[data-rarity="SR"] { --pip-color: #cea7f5; }
.pack-hands-pip[data-rarity="SSR"] { --pip-color: #f9d480; }
.pack-hands-pip[data-rarity="UR"] { --pip-color: #f3c5e1; }
.pack-hands-pip-break { margin-left: 6px; }
.pack-hands-badge {
  display: flex; align-items: center; gap: 9px; min-height: 35px; padding: 6px 12px 6px 10px;
  border: 1px solid rgb(240 201 170 / 46%); border-radius: 10px;
  background: linear-gradient(108deg, rgb(243 186 213 / 12%), rgb(249 218 166 / 10%));
  box-shadow: inset 0 1px 0 rgb(255 242 223 / 10%); color: #f9e8d8;
}
.pack-hands-badge-star { font-size: 22px; line-height: 1; color: var(--hand-gold); }
.pack-hands-badge-title { font-size: 12px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.pack-hands-motif { display: inline-flex; gap: 7px; }
.pack-hands-motif .pack-hands-pip { width: 22px; height: 20px; }
.pack-hands-reward { display: inline-flex; align-items: baseline; gap: 4px; padding-left: 9px; border-left: 1px solid rgb(249 219 181 / 20%); color: #f6d59c; font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pack-hands-reward small { font-size: 7px; font-weight: 500; letter-spacing: .07em; }
.pack-hands-card-accent {
  position: absolute; z-index: 24; inset: -3px; border: 1px solid rgb(245 199 220 / 56%);
  border-radius: inherit; box-shadow: 0 0 13px rgb(234 161 198 / 21%), inset 0 0 9px rgb(243 200 220 / 11%);
  pointer-events: none; opacity: 1;
}
.pack-hands-card-accent[data-stage="4"] { border-color: rgb(249 218 166 / 80%); box-shadow: 0 0 22px rgb(249 208 150 / 32%), inset 0 0 12px rgb(249 208 150 / 14%); }
.pack-hands-card-accent[data-stage="win"] { border: 2px solid #f0d19e; box-shadow: 0 0 22px rgb(240 203 157 / 28%), inset 0 0 14px rgb(240 203 157 / 15%); }
.pack-hands-card-accent[data-stage="win"][data-group="1"] { border-color: #efbdd5; box-shadow: 0 0 22px rgb(239 189 213 / 29%); }
/* Reserve space in the footer; a badge outside the card is clipped in Light
   mode and in the mobile deck's scrolling viewport. */
.pack-hands-card-mark { display: grid; place-items: center; flex: 0 0 18px; height: 18px; border-radius: 5px; background: #2b2330; color: #f0d19e; font-size: 16px; line-height: 1; letter-spacing: 0; }
.pack-hands-card-mark[data-group="1"] { color: #efbdd5; }
.pack-hands-pearl { position: fixed; z-index: 150; width: 6px; height: 6px; border-radius: 50%; background: #ffe8bd; box-shadow: 0 0 9px rgb(253 211 170 / 60%); pointer-events: none; }
@media (max-width: 760px), (pointer: coarse) {
  .pack-hands { gap: 5px 10px; min-height: 31px; }
  .pack-hands-toggle { min-height: 32px; font-size: 9px; padding: 4px 7px; }
  .pack-hands-badge { gap: 6px; padding: 6px 8px; border-radius: 9px; min-height: 32px; }
  .pack-hands-badge-star { display: none; }
  .pack-hands-badge-title { font-size: 10px; }
  .pack-hands-motif { gap: 4px; }
  .pack-hands-motif .pack-hands-pips { gap: 2px; }
  .pack-hands-motif .pack-hands-pip { width: 17px; height: 17px; font-size: 6px; border-radius: 3px; }
  .pack-hands-reward { font-size: 12px; padding-left: 6px; gap: 3px; }
  .pack-hands-reward small { font-size: 6px; }
  .pack-hands.has-open-help { z-index: 140; }
  .pack-hands-panel { width: min(380px, calc(100vw - 32px)); padding: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .pack-hands *, .pack-hands-card-accent { transition: none !important; animation: none !important; }
  .pack-hands-pearl { display: none; }
}

.pack-hands-card-accent[data-hand="rainbow"] { --hand-rainbow: #c9c9c9; border-color: var(--hand-rainbow); box-shadow: 0 0 22px color-mix(in srgb, var(--hand-rainbow) 30%, transparent); }
.pack-hands-card-accent[data-hand="rainbow"][data-rarity="R"] { --hand-rainbow: #a8dbf5; }
.pack-hands-card-accent[data-hand="rainbow"][data-rarity="SR"] { --hand-rainbow: #cea7f5; }
.pack-hands-card-accent[data-hand="rainbow"][data-rarity="SSR"] { --hand-rainbow: #f9d480; }
.pack-hands-card-accent[data-hand="rainbow"][data-rarity="UR"] { --hand-rainbow: #f3c5e1; }

.pack-hands-kicker { margin-left: 6px; opacity: .35; border-style: dashed; }

.pack-hands-fleck { position: fixed; z-index: 150; width: 4px; height: 7px; border-radius: 1px; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .pack-hands-fleck { display: none; } }

/* Perks sit above the compact result stack without moving its controls. */
.results-perks {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.results-perks > [data-glory-results] { max-width: 100%; }
@media (max-width: 760px), (pointer: coarse) {
  /* Results follow the controls so a triggered perk never shrinks the deck or
     moves the reveal button. The page can scroll for longer result summaries. */
  .results-perks { position: static; grid-column: 1 / -1; justify-content: center; }
  .results-perks:not(:has([data-pack-hands]:not([hidden]), .glory-triggered:not(:empty))) { display: none; }
}
.results-view .results-actions .secondary-action {
  box-sizing: border-box;
  height: 48px;
  min-width: 180px;
}
@media (max-width: 760px), (pointer: coarse) {
  .results-view .results-actions .secondary-action { height: 44px; min-width: 128px; }
}
.results-view .results-actions .secondary-action:is(:hover, :active) { transform: none; }

.results-perks:has(.has-open-help) { z-index: 140; }
