/* Item plates (Gage 10-29): "icons ... fill up the entirety of the box they're shown in" and "the boxes around them are kind of
   plain and boring ... no title or anything". One plate language for every box that shows an item: an inked frame with corner
   ticks, an eyebrow strip (what it is on the left, how rare on the right, five pips), the picture filling its box, then the
   name. Rarity reads from the frame colour, the strip and the pips. Decoration sits behind the picture and never takes taps.
   The picture itself is fitted to its real silhouette (ModelView.framing, ModelView.poster), so the box is what limits it. */
:root {
  --plate-ink: #0c0b0a;
  --plate-paper: #1a1613;
  --plate-line: #ae9770;
}

/* ---- the strip: kind + rarity pips ---- */
.rp-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; box-sizing: border-box; padding: 3px 6px 3px 7px; min-height: 18px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--spin-color, var(--plate-line)) 38%, var(--plate-ink)), color-mix(in srgb, var(--spin-color, var(--plate-line)) 10%, var(--plate-ink)));
  border-bottom: 1px solid color-mix(in srgb, var(--spin-color, var(--plate-line)) 60%, transparent); }
.rp-kind { font: 400 11px/1 var(--display, inherit); font-style: normal; letter-spacing: .14em; text-transform: uppercase; color: #f1e6cd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rp-pips { display: inline-flex; gap: 2px; flex: none; }
.rp-pips i { width: 6px; height: 6px; transform: rotate(45deg); background: #0c0b0a; border: 1px solid color-mix(in srgb, var(--spin-color, var(--plate-line)) 55%, #000); box-sizing: border-box; }
.rp-pips i.on { background: var(--spin-color, var(--plate-line)); border-color: #fff4; box-shadow: 0 0 5px color-mix(in srgb, var(--spin-color, var(--plate-line)) 70%, transparent); }
.rp-text { display: grid; gap: 2px; min-width: 0; justify-items: center; text-align: center; }
.rp-text small { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--spin-color, var(--plate-line)); }
.rp-text b { font: 400 20px/1.05 var(--display, inherit); overflow-wrap: anywhere; color: #fbf4e4; text-shadow: 1px 2px #0009; }

/* ---- the reveal plate (Reward Spin, Super Spin, Open All) ---- */
.spin-landed .spin-prize { padding: 0 0 7px; gap: 5px; align-content: start; overflow: hidden; border: 1px solid color-mix(in srgb, var(--spin-color) 70%, #24201b);
  background:
    linear-gradient(var(--spin-color), var(--spin-color)) 4px 25px / 9px 2px no-repeat, linear-gradient(var(--spin-color), var(--spin-color)) 4px 25px / 2px 9px no-repeat,
    linear-gradient(var(--spin-color), var(--spin-color)) calc(100% - 4px) 25px / 9px 2px no-repeat, linear-gradient(var(--spin-color), var(--spin-color)) calc(100% - 4px) 25px / 2px 9px no-repeat,
    radial-gradient(ellipse at 50% 42%, color-mix(in srgb, var(--spin-color) 22%, transparent), transparent 70%),
    linear-gradient(170deg, #241e19, #12100e);
  box-shadow: inset 0 0 0 3px var(--plate-ink), inset 0 0 0 4px color-mix(in srgb, var(--spin-color) 38%, transparent), 0 3px 0 #070605; }
/* The picture box is always the picture's own 3:2 shape (as wide as the plate allows, never taller than --pic-h), so the model fills the box instead of floating in a box of another shape. */
.spin-landed .spin-prize .spin-prize-picture { height: auto; aspect-ratio: 3 / 2; max-height: var(--pic-h, 128px); max-width: none; width: min(calc(100% - 14px), calc(var(--pic-h, 128px) * 1.5)); margin: 4px auto 0; filter: drop-shadow(0 3px 5px #000a) drop-shadow(0 0 9px color-mix(in srgb, var(--spin-color) 38%, transparent)); }
/* The picture is laid over its box (absolute), so a picture can never push the box taller than its own height: the image is as big as
   the box lets it, contained, never larger. */
.spin-landed .spin-prize .spin-prize-picture { display: block; position: relative; }
.spin-landed .spin-prize .spin-prize-picture > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.spin-landed .spin-prize .spin-prize-picture > .art { position: absolute; inset: 0; width: 100%; height: 100%; display: grid; place-items: center; }
.spin-landed .spin-prize .spin-prize-picture > .art img { width: auto; height: 100%; max-width: 100%; object-fit: contain; }
.spin-landed .spin-prize .spin-prize-picture > .wi, .spin-landed .spin-prize .spin-prize-picture > svg { position: absolute; inset: 15%; width: 70%; height: 70%; }
.super-prizes { justify-items: stretch; align-items: stretch; }
.super-prizes .spin-prize { justify-self: stretch; width: auto; min-width: 0; }
.spin-landed .spin-prize.lucky .spin-prize-picture > img { inset: 50% 0 auto 0; height: auto; max-height: 100%; transform: translateY(-50%); }
.spin-landed .spin-prize .rp-text { padding: 0 8px; }
.spin-prize[data-rarity=common] { --plate-glow: 0; }

/* The one Reward Spin prize: a big plate over the dimmed wheel. */
.spin-wheel-card.wheel-prize .spin-landed .spin-prize { width: min(100%, 250px); margin: 0 auto; --pic-h: clamp(110px, 21dvh, 170px); }
.spin-wheel-card.wheel-prize .spin-landed .spin-prize .rp-text b { font-size: 26px; }

/* The Super Spin's three prizes: the best one is the featured plate across the top (a wide box), the other two sit side by side
   under it. The machine becomes a smaller banner once all three have landed (spins.js repaints its resting frame), so the prizes
   get the room: a long tank or plane fills a box two to three times as wide as the old third-of-the-width cell. */
.spin-machine:not(.spin-batch) .wheel-super.landed > canvas { height: clamp(112px, 19dvh, 168px); }
.spin-machine:not(.spin-batch) .super-prizes { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "f f" "a b"; gap: 6px; min-height: 0; }
.spin-machine:not(.spin-batch) .super-prizes .spin-prize { min-height: 0; padding: 0 0 6px; --pic-h: clamp(52px, 13dvh, 112px); }
.spin-machine:not(.spin-batch) .super-prizes .spin-prize.feature { grid-area: f; display: grid; grid-template-columns: minmax(0, 60%) minmax(0, 1fr); grid-template-areas: "top top" "pic text"; gap: 4px 0; align-items: center; justify-items: stretch; --pic-h: clamp(66px, 18dvh, 150px); }
.spin-machine:not(.spin-batch) .super-prizes .spin-prize.feature .rp-top { grid-area: top; }
.spin-machine:not(.spin-batch) .super-prizes .spin-prize.feature .spin-prize-picture { grid-area: pic; width: min(calc(100% - 10px), calc(var(--pic-h) * 1.5)); margin: 0 auto 0 7px; }
.spin-machine:not(.spin-batch) .super-prizes .spin-prize.feature .rp-text { grid-area: text; justify-items: start; text-align: left; padding: 0 8px 0 6px; }
.spin-machine:not(.spin-batch) .super-prizes .spin-prize.feature .rp-text b { font-size: 25px; }
.spin-machine:not(.spin-batch) .super-prizes .spin-prize:not(.feature) .rp-text b { font-size: 19px; }
.spin-machine:not(.spin-batch) .super-prizes .spin-prize:not(.feature) .rp-kind { font-size: 10.5px; letter-spacing: .1em; }

/* Open All: many small plates, three to a row. */
.spin-batch .super-prizes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.spin-batch .spin-landed .spin-prize { --pic-h: 62px; padding-bottom: 5px; }
.spin-batch .spin-landed .spin-prize .rp-kind { font-size: 10px; letter-spacing: .08em; }
.spin-batch .spin-landed .spin-prize .rp-pips i { width: 5px; height: 5px; }
.spin-batch .spin-landed .spin-prize .rp-text b { font-size: 15px; }
.spin-batch .spin-landed .spin-prize .rp-text small { font-size: 10px; }

@media (max-width: 360px) {
  .spin-machine:not(.spin-batch) .super-prizes .spin-prize.feature .rp-text b { font-size: 21px; }
  .spin-machine:not(.spin-batch) .super-prizes .spin-prize:not(.feature) .rp-text b { font-size: 16px; }
  .rp-kind { font-size: 10px; letter-spacing: .1em; }
}
@media (max-height: 600px) {
  .spin-machine:not(.spin-batch) .wheel-super.landed > canvas { height: clamp(84px, 15dvh, 110px); }
  .spin-machine:not(.spin-batch) .super-prizes .spin-prize { --pic-h: 58px; }
  .spin-machine:not(.spin-batch) .super-prizes .spin-prize.feature { --pic-h: 78px; }
  .spin-machine:not(.spin-batch) .super-prizes .spin-prize .rp-text small { font-size: 10px; }
}
/* ---- Supply: one heading per group (Gage 10-29 "unorganised or unlabeled"): under "Spins and crates" the Reward spins title is a
   quiet sub-label with a rule, so the section reads as a heading and its parts instead of two headings stacked ---- */
#so-spins .spin-supplies { padding: 4px 0 10px; }
#so-spins .supply-section-head { padding-left: 9px; border-left: 3px solid #bb974f; margin-bottom: 10px; }
#so-spins .supply-section-head h3.shop-h { font-size: 14px; letter-spacing: .16em; color: #d8c79c; gap: 6px; }
#so-spins .supply-section-head h3.shop-h .art { width: 20px; height: 20px; }

/* ---- the Daily Deal's picture: a small plate, the item filling its box ---- */
.deal { grid-template-columns: 112px minmax(0, 1fr) auto; }
.deal .deal-pic { grid-row: 2; display: grid; align-content: start; overflow: hidden; border: 1px solid color-mix(in srgb, var(--spin-color, #a15be0) 70%, #20182c);
  background: radial-gradient(ellipse at 50% 55%, color-mix(in srgb, var(--spin-color, #a15be0) 24%, transparent), transparent 72%), linear-gradient(170deg, #271a3a, #120b1d);
  box-shadow: inset 0 0 0 2px var(--plate-ink), inset 0 0 0 3px color-mix(in srgb, var(--spin-color, #a15be0) 38%, transparent); }
.deal .deal-pic .rp-top { min-height: 16px; padding: 2px 5px; }
.deal .deal-pic .rp-kind { font-size: 10px; }
.deal .deal-pic .rp-pips i { width: 5px; height: 5px; }
.deal .deal-pic > .deal-cv { display: block; width: calc(100% - 8px); height: 70px; margin: 3px 4px 3px; image-rendering: pixelated; }
.deal-txt small { text-transform: uppercase; letter-spacing: .08em; }
.deal-txt > span { flex-wrap: wrap; }
@media (max-width: 380px) {
  .deal { grid-template-columns: 88px minmax(0, 1fr) auto; gap: 4px 8px; padding: 10px; }
  .deal .deal-pic > .deal-cv { height: 56px; }
  .deal-txt small { letter-spacing: .03em; font-size: 12px; }
  .deal-txt em { font-size: 20px; }
  .deal .btn.small { padding-left: 12px; padding-right: 12px; }
}

/* ---- the crate's prize (the Locker item, coins, gems or booster that comes out) ---- */
.crate-stage .loot.crate-plate { display: grid; grid-template-columns: 1fr; justify-items: center; align-content: start; gap: 6px; width: min(86%, 250px); padding: 0 0 10px; overflow: hidden; z-index: 1;
  border: 1px solid color-mix(in srgb, var(--rc) 75%, #1c1814); text-align: center;
  background: radial-gradient(ellipse at 50% 46%, color-mix(in srgb, var(--rc) 24%, transparent), transparent 70%), linear-gradient(170deg, #261f19, #110f0d);
  box-shadow: inset 0 0 0 3px var(--plate-ink), inset 0 0 0 4px color-mix(in srgb, var(--rc) 40%, transparent), 0 4px 0 #070605, 0 0 26px color-mix(in srgb, var(--rc) 30%, transparent); }
.crate-stage .loot.crate-plate .rar { font-size: 22px; letter-spacing: .1em; }
.crate-stage .loot.crate-plate canvas { width: calc(100% - 18px); height: 128px; image-rendering: auto; }
.crate-stage .loot.crate-plate > .wi { width: 96px; height: 96px; }
.crate-stage .loot.crate-plate b { font: 400 26px/1.05 var(--display); white-space: normal; overflow-wrap: anywhere; padding: 0 8px; }
.crate-stage .loot.crate-plate small { white-space: normal; }

@media (orientation: landscape) and (max-height: 480px) {
  .spin-machine:not(.spin-batch) .super-prizes { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: none; }
  .spin-machine:not(.spin-batch) .super-prizes .spin-prize, .spin-machine:not(.spin-batch) .super-prizes .spin-prize.feature { grid-area: auto; display: grid; grid-template-columns: 1fr; grid-template-areas: none; --pic-h: 54px; }
  .spin-machine:not(.spin-batch) .super-prizes .spin-prize.feature .spin-prize-picture, .spin-machine:not(.spin-batch) .super-prizes .spin-prize.feature .rp-top, .spin-machine:not(.spin-batch) .super-prizes .spin-prize.feature .rp-text { grid-area: auto; }
  .spin-machine:not(.spin-batch) .super-prizes .spin-prize.feature .rp-text { justify-items: center; text-align: center; padding: 0 8px; }
  .spin-machine:not(.spin-batch) .super-prizes .spin-prize.feature .rp-text b { font-size: 17px; }
}
