/* trophies.css — the trainer's trophies (A31; trophyCase.js, trophyPop.js, the shelf and
 * the TROPHIES row in trainerRoom.js).
 *
 * The case is the gym's wooden sheet (gymplates.css .gp-*) holding a dark wood cabinet:
 * shelves with a plank under each, brass nameplates, tier pips. A tier glows its metal;
 * a prestiged trophy glows gold; obsidian glows purple with a hint of magma. No dashed
 * borders (B58). Every animation sits inside `prefers-reduced-motion: no-preference`.
 */

[class*="tc-"], [class*="tp-"], [class*="ts-"] { box-sizing: border-box; }
.tc-card img, .tp-card img, .ts-shelf img, .ts-row img { image-rendering: pixelated; }
.sil { filter: brightness(0) opacity(.34); }

/* ---------- the case ---------- */
.tc-card { padding: 8px 8px 10px; background: #6b4228; }
.tc-sum { display: flex; justify-content: space-between; gap: 6px; padding: 6px 8px; font-size: 10.5px; font-weight: 900; letter-spacing: .5px; color: #3a2c23;
  background: #f6eee4; border: 2px solid #3a2c23; border-radius: 4px; }
.tc-edit { display: block; width: 100%; height: 32px; margin-top: 6px; font-size: 11px; letter-spacing: 1.5px; }
.tc-tip { margin: 6px 2px 2px; font-size: 10.5px; font-weight: 800; color: #f6d9a8; }
.tc-gname { display: flex; justify-content: space-between; margin: 10px 2px 3px; font-size: 10px; font-weight: 900; letter-spacing: 2px; color: #f6d9a8; }
.tc-shelf { display: grid; grid-template-columns: repeat(4, 1fr); align-items: end; gap: 2px; padding: 6px 2px 0;
  background: linear-gradient(180deg, #4a2c1a, #5a3620); border: 2px solid #2a1a10; border-bottom: 0; border-radius: 3px 3px 0 0;
  box-shadow: inset 0 6px 10px rgba(0, 0, 0, .35); }
.tc-shelf.secret { background: linear-gradient(180deg, #24182c, #2e1f38); }
.tc-plank { height: 9px; margin-bottom: 2px; background: #c9975b; border: 2px solid #2a1a10; border-radius: 2px; box-shadow: inset 0 2px 0 #ddb07a, inset 0 -2px 0 #8a5a35; }

.tc-slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; padding: 0 0 4px; font: inherit;
  color: inherit; background: none; border: 0; cursor: pointer; }
.tc-art { position: relative; display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 48px; }
.tc-art img { position: relative; z-index: 1; max-height: 44px; max-width: 56px; }
.tc-art::before { content: ''; position: absolute; left: 50%; bottom: 0; width: 46px; height: 32px; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(closest-side, var(--aura, transparent), transparent); }
.au-1 { --aura: rgba(205, 127, 70, .55); } .au-2 { --aura: rgba(220, 225, 235, .6); } .au-3 { --aura: rgba(255, 205, 80, .7); }
.au-4 { --aura: rgba(120, 220, 255, .75); } .au-p { --aura: rgba(255, 196, 64, .95); } .au-o { --aura: rgba(176, 90, 255, .95); }
.tc-nm { max-width: 100%; padding: 0 3px; font-size: 8.5px; font-weight: 900; color: #3a2c23; background: #e8c48f; border: 1px solid #2a1a10;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.secret .tc-nm { color: #e9d6ff; background: #3d2a4a; border-color: #120a18; }
.tc-pr { max-width: 100%; font-size: 8.5px; font-weight: 900; color: #f6d9a8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.secret .tc-pr { color: #b89ad0; }
.tc-slot.ready .tc-pr { color: #3a2c23; padding: 0 3px; background: #f6d24a; border: 1px solid #2a1a10; }
.tc-q { font-size: 22px; font-weight: 900; line-height: 42px; color: #6d4f86; }
.tc-pips { display: flex; gap: 2px; }
.tc-pips i { width: 6px; height: 6px; border: 1px solid #2a1a10; background: rgba(255, 255, 255, .12); }
.tc-pips i.b { background: #b9774a; } .tc-pips i.s { background: #c8ccd4; } .tc-pips i.g { background: #f2c14a; } .tc-pips i.d { background: #7fd3f2; }
.tc-pips i.o0 { border-color: #7d4fb0; }
.tc-pips i.o { background: #1b1424; border-color: #b05aff; box-shadow: 0 0 4px #b05aff; }
.tc-ontag { position: absolute; top: 0; right: 3px; z-index: 2; padding: 0 3px; font-size: 7.5px; font-weight: 900; color: #3a2c23; background: #f6d24a; border: 1px solid #2a1a10; }
.tc-tick { position: absolute; top: 2px; left: 4px; z-index: 2; width: 17px; height: 17px; font-size: 11px; font-weight: 900; line-height: 13px; text-align: center;
  color: #fff; background: rgba(0, 0, 0, .25); border: 2px solid #c9975b; }
.tc-tick.on { background: #4f8f53; border-color: #2a1a10; }
.tc-tick.none { display: none; }
.tc-save { display: flex; gap: 6px; margin-top: 8px; }
.tc-save .gp-pq { flex: 1; height: 40px; font-size: 13px; letter-spacing: 1.5px; }

/* the picker's live shelf: his wall's shelf slice, scaled --k */
.tc-prev { position: relative; height: 104px; overflow: hidden; border: 2px solid #3a2c23; border-radius: 4px; image-rendering: pixelated;
  background-repeat: no-repeat; background-size: calc(var(--bw) * var(--k) * 1px) calc(var(--bh) * var(--k) * 1px);
  background-position: calc(var(--sx) * var(--k) * -1px) calc(var(--sy) * var(--k) * -1px); }
.tc-prow { position: absolute; left: calc(6 * var(--k) * 1px); width: calc(76 * var(--k) * 1px); top: 0; height: calc(30 * var(--k) * 1px);
  display: flex; justify-content: space-around; align-items: flex-end; }
.tc-pimg { height: calc(21 * var(--k) * 1px); filter: drop-shadow(0 0 3px rgba(255, 220, 120, .95)); }
.tc-pimg.obs { filter: drop-shadow(0 0 3px rgba(190, 110, 255, 1)); }
.tc-pempty { width: 30px; height: calc(20 * var(--k) * 1px); border: 2px solid rgba(255, 255, 255, .4); border-radius: 3px; }

/* a trophy's card */
.tc-veil { align-items: center; padding: 16px; }
.tc-cardup { width: min(100%, 360px); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 0 10px 12px; color: #3a2c23; font-weight: 700;
  background: #f6eee4; border: 3px solid #3a2c23; border-radius: 10px; box-shadow: 5px 5px 0 rgba(0, 0, 0, .5); }
.tc-cardup.secret { background: #2e1f38; color: #e9d6ff; }
.tc-cardhead { display: flex; align-items: center; gap: 8px; margin: 0 -10px; padding: 6px 6px 6px 12px; font-size: 14px; letter-spacing: 2px;
  background: #c9975b; border-bottom: 3px solid #3a2c23; border-radius: 7px 7px 0 0; box-shadow: inset 0 3px 0 #ddb07a, inset 0 -3px 0 #8a5a35; }
.tc-cardhead b { flex: 1; color: #3a2c23; }
.tc-big { position: relative; display: flex; justify-content: center; align-items: flex-end; height: 110px; margin-top: 10px; }
.tc-big img { position: relative; z-index: 1; height: 96px; }
.tc-big::before { content: ''; position: absolute; left: 50%; bottom: 0; width: 140px; height: 90px; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(closest-side, var(--aura, transparent), transparent); }
.tc-what { margin: 6px 0 8px; font-size: 12px; text-align: center; color: #7a6a5c; }
.secret .tc-what { color: #cdb6e6; }
.tc-ladder { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; padding: 6px 4px; background: #4a2c1a; border: 2px solid #2a1a10; border-radius: 4px; }
.tc-ladder div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; font-size: 8px; font-weight: 900; color: #f6d9a8; text-align: center; }
.tc-ladder img { max-height: 30px; max-width: 34px; filter: brightness(0) opacity(.4); }
.tc-ladder .on img { filter: none; }
.tc-ladder .obs span { color: #d6b0ff; }
.tc-prog { margin-top: 8px; font-size: 12px; }
.tc-prog small { display: block; font-size: 9.5px; font-weight: 900; letter-spacing: 1px; color: #7a6a5c; }
.tc-bar { position: relative; height: 10px; margin-top: 4px; background: #e5d6c3; border: 2px solid #3a2c23; }
.tc-bar i { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(90deg, #f6d24a 0 6px, #e8b04a 6px 8px); }
.tc-prestige { display: block; width: 100%; height: 42px; margin-top: 10px; font-size: 14px; letter-spacing: 2px; }
.tc-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; }
.tc-ask span { flex: 1 1 100%; }
.tc-ask .gp-pq { flex: 1; height: 38px; font-size: 12px; }

/* ---------- his shelf on the wall ---------- */
.ts-shelf { position: absolute; z-index: 2; display: flex; justify-content: space-around; align-items: flex-end; pointer-events: none; }
.ts-shelf img { height: calc(21 * var(--art-px)); filter: drop-shadow(0 0 2px rgba(255, 220, 120, .95)) drop-shadow(0 0 6px rgba(255, 200, 80, .55)); }
.ts-shelf img.obs { filter: drop-shadow(0 0 2px rgba(190, 110, 255, 1)) drop-shadow(0 0 7px rgba(255, 110, 40, .7)); }
.ts-tap { position: absolute; z-index: 3; padding: 0; background: none; border: 0; cursor: pointer; }

/* ---------- the TROPHIES row on STATS ---------- */
.ts-row { display: flex; align-items: center; gap: 10px; margin: 0 10px; padding: 8px 10px; font: inherit; text-align: left; color: var(--fg, #f8f3e4);
  background: linear-gradient(90deg, rgba(232, 176, 74, .22), rgba(240, 230, 200, .06)); border: 2px solid #e8b04a; border-radius: 6px; cursor: pointer; width: calc(100% - 20px); }
.ts-row img { flex: 0 0 auto; width: 34px; max-height: 38px; object-fit: contain; }
.ts-tx { flex: 1; min-width: 0; }
.ts-tx b { display: block; font-size: 12.5px; letter-spacing: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-tx small { display: block; font-size: 10.5px; color: var(--sub, #e7c99a); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-bar { position: relative; height: 8px; margin-top: 4px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(240, 230, 200, .25); }
.ts-bar i { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(90deg, #f6d24a 0 6px, #e8b04a 6px 8px); }
.ts-open { flex: 0 0 auto; padding: 7px 10px; font-size: 11px; font-weight: 900; letter-spacing: 1px; color: #3a2c23; background: #c9975b;
  border: 2px solid #3a2c23; border-radius: 4px; box-shadow: inset 0 -2px 0 #8a5a35; }

/* ---------- the pop-ups ---------- */
.tp-veil { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(8, 14, 10, .72); }
.tp-veil.obs { background: rgba(6, 4, 10, .9); overflow: hidden; }
.tp-card { position: relative; width: min(100%, 320px); padding: 0 0 14px; overflow: hidden; text-align: center; color: #3a2c23; font-weight: 700;
  background: #f6eee4; border: 3px solid #3a2c23; border-radius: 10px; box-shadow: 5px 5px 0 rgba(0, 0, 0, .5); }
.tp-head { padding: 8px; font-size: 15px; font-weight: 900; letter-spacing: 3px; background: #c9975b; border-bottom: 3px solid #3a2c23;
  box-shadow: inset 0 3px 0 #ddb07a, inset 0 -3px 0 #8a5a35; }
.tp-card.secret .tp-head { color: #e9d6ff; background: #3d2a4a; box-shadow: none; }
.tp-rays { position: relative; width: 160px; height: 160px; margin: 10px auto 0; }
.tp-rays::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: repeating-conic-gradient(rgba(242, 193, 74, .55) 0 12deg, transparent 12deg 30deg); }
.tp-rays img { position: absolute; z-index: 1; left: 50%; top: 50%; width: 100px; transform: translate(-50%, -50%); }
.tp-card h3 { margin: 4px 10px 0; font-size: 18px; letter-spacing: 1px; }
.tp-tag { display: inline-block; margin-top: 4px; padding: 1px 8px; font-size: 11px; font-weight: 900; letter-spacing: 2px; background: #f2c14a; border: 2px solid #3a2c23; }
.tp-card p { margin: 6px 14px 10px; font-size: 12px; color: #7a6a5c; }
.tp-ok { padding: 8px 30px; font: inherit; font-size: 13px; font-weight: 900; letter-spacing: 2px; color: #f8f3e4; background: #4f8f53;
  border: 2px solid #3a2c23; border-radius: 4px; box-shadow: inset 0 -3px 0 #3a6b3e; cursor: pointer; }
.tp-conf { position: absolute; top: -10px; width: 5px; height: 8px; transform: rotate(var(--r)); opacity: 0; }

/* obsidian */
.tp-card.obsidian { color: #f3e6ff; background: radial-gradient(circle at 50% 30%, #3a1d52, #120a18 70%); border-color: #b05aff;
  box-shadow: 0 0 0 3px #120a18, 0 0 40px rgba(176, 90, 255, .65), 0 0 90px rgba(255, 110, 40, .35); }
.tp-card.obsidian .tp-head { color: #ffb35c; text-shadow: 0 0 8px #ff6a1f; letter-spacing: 5px; background: none; border-bottom: 2px solid #b05aff; box-shadow: none; }
.tp-card.obsidian .tp-rays::before { background: repeating-conic-gradient(rgba(176, 90, 255, .55) 0 8deg, transparent 8deg 22deg); }
.tp-card.obsidian .tp-rays::after { content: ''; position: absolute; inset: 30px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 120, 40, .7), transparent); }
.tp-card.obsidian .tp-rays img { filter: drop-shadow(0 0 8px #ff7a2a); }
.tp-card.obsidian .tp-tag { color: #f3e6ff; letter-spacing: 3px; background: #1b1424; border-color: #b05aff; box-shadow: 0 0 8px #b05aff; }
.tp-card.obsidian p { color: #cdb6e6; }
.tp-card.obsidian .tp-ok { color: #1b1424; background: #ffb35c; border-color: #120a18; box-shadow: inset 0 -3px 0 #c76a1f, 0 0 12px #ff6a1f; }
.tp-crack { position: absolute; width: 0; height: 3px; background: #ff7a2a; box-shadow: 0 0 8px #ff6a1f; transform-origin: 0 50%; transform: rotate(var(--a)); opacity: 0; }
.tp-ember { position: absolute; bottom: 0; width: 4px; height: 4px; background: #ffb35c; box-shadow: 0 0 6px #ff6a1f; opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  .ts-shelf img { animation: tsGlow 2.4s ease-in-out infinite alternate; }
  @keyframes tsGlow { to { filter: drop-shadow(0 0 3px rgba(255, 235, 150, 1)) drop-shadow(0 0 9px rgba(255, 210, 90, .8)); } }
  .tp-card { animation: tpIn .45s cubic-bezier(.2, 1.4, .4, 1) both; }
  @keyframes tpIn { from { transform: scale(.6); opacity: 0; } }
  .tp-rays::before { animation: tpSpin 9s linear infinite; }
  @keyframes tpSpin { to { transform: rotate(360deg); } }
  .tp-conf { animation: tpFall 1.8s ease-in forwards; }
  @keyframes tpFall { 0% { opacity: 1; transform: translateY(0) rotate(var(--r)); } 100% { opacity: 0; transform: translateY(330px) rotate(calc(var(--r) + 360deg)); } }
  /* obsidian: dark → rumble → cracks → flash → the card rises in embers */
  .tp-veil.obs { animation: tpRumble .5s steps(6) .2s 2; }
  @keyframes tpRumble { 25% { transform: translate(4px, -2px); } 50% { transform: translate(-3px, 3px); } 75% { transform: translate(2px, 2px); } }
  .tp-crack { animation: tpCrack .45s ease-out forwards; }
  @keyframes tpCrack { from { width: 0; opacity: 1; } to { width: 46%; opacity: 1; } }
  .tp-veil.obs::after { content: ''; position: absolute; inset: 0; background: #c070ff; opacity: 0; pointer-events: none; animation: tpFlash .6s ease-out 1.3s; }
  @keyframes tpFlash { 0% { opacity: .85; } 100% { opacity: 0; } }
  .tp-card.obsidian { animation: tpRise .9s cubic-bezier(.2, 1.2, .4, 1) 1.35s both; }
  @keyframes tpRise { from { transform: translateY(60px) scale(.7); opacity: 0; } }
  .tp-ember { animation: tpEmber 3s ease-out infinite; }
  @keyframes tpEmber { 0% { opacity: 0; transform: translateY(0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-260px) translateX(12px); } }
}
@media (prefers-reduced-motion: reduce) {
  .tp-crack { width: 46%; opacity: 1; }
}

/* a tap on the trainer (the Poke secret): a small hop */
@media (prefers-reduced-motion: no-preference) {
  .tr-coach.poked { animation: tsPoke .28s ease-out; }
  @keyframes tsPoke { 40% { transform: translateY(-5%); } }
}
.tr-coach { cursor: pointer; }
