/*
Tuin Face Pong
File: css/06-trophy-room.css

Trophy Room base styling plus living-room/final walking overrides.
Loaded after style.css and before final override files.
*/

#trophyRoomOverlay {
  z-index: 260;
  background:
    radial-gradient(circle at top, rgba(0,217,255,0.16), rgba(0,0,0,0.58) 45%, rgba(0,0,0,0.94) 100%);
}

#trophyRoomPanel {
  width: min(1120px, 96vw);
  height: min(760px, 94vh);
  position: relative;
  border: 3px solid #ffcc00;
  border-radius: 26px;
  overflow: hidden;
  background: #050505;
  box-shadow:
    0 0 46px rgba(255,204,0,0.48),
    0 0 34px rgba(0,217,255,0.22),
    inset 0 0 34px rgba(255,255,255,0.06);
}

#trophyRoomStage {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 22px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  overflow: hidden;
}

#trophyRoomBackdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(0,217,255,0.18), rgba(0,0,0,0.90));
  background-size: cover;
  background-position: center;
  filter: saturate(1.12) brightness(0.86);
  transform: scale(1.04);
  z-index: 0;
}

#trophyRoomStage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.18), rgba(0,0,0,0.62)),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 6px);
  pointer-events: none;
}

#trophyRoomHeader,
#trophyRoomContent,
#trophyRoomButtons {
  position: relative;
  z-index: 2;
}

#trophyRoomHeader {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(0,0,0,0.54);
  border: 2px solid rgba(255,204,0,0.28);
  box-shadow: inset 0 0 18px rgba(255,255,255,0.04);
}

#trophyRoomHeader h1 {
  margin: 0 0 5px;
  color: #ffcc00;
  font-size: 36px;
  text-shadow:
    0 0 14px rgba(255,204,0,0.82),
    0 0 22px rgba(0,217,255,0.24);
}

#trophyRoomHeader p {
  margin: 0;
  color: #dcdcdc;
  font-size: 14px;
}

#trophyRoomCoinInfo {
  min-width: 130px;
  padding: 10px 14px;
  border-radius: 16px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(255,204,0,0.20), rgba(0,0,0,0.46));
  border: 2px solid rgba(255,204,0,0.42);
  box-shadow: 0 0 18px rgba(255,204,0,0.22);
}

#trophyRoomCoinInfo span {
  display: block;
  color: #ffcc00;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#trophyRoomCoinInfo strong {
  display: block;
  color: #fff;
  font-size: 26px;
  text-shadow: 0 0 12px rgba(255,204,0,0.60);
}

#trophyRoomContent {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 16px;
  min-height: 0;
}

#trophyHeadZone,
#trophyGoldZone {
  position: relative;
  min-height: 0;
  border-radius: 22px;
  background: rgba(0,0,0,0.42);
  border: 2px solid rgba(255,255,255,0.14);
  box-shadow:
    inset 0 0 22px rgba(255,255,255,0.04),
    0 0 18px rgba(0,0,0,0.32);
  overflow: hidden;
}

#trophyHeadCloud {
  position: relative;
  height: 100%;
  min-height: 430px;
  display: grid;
  grid-template-columns: repeat(5, minmax(88px, 1fr));
  gap: 14px;
  padding: 24px;
  align-content: center;
}

.trophyHeadCard {
  position: relative;
  min-width: 0;
  padding: 25px 8px 10px;
  border-radius: 18px;
  text-align: center;
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.08), rgba(0,0,0,0.32));
  border: 2px solid rgba(255,255,255,0.16);
  box-shadow:
    0 0 16px rgba(0,0,0,0.35),
    inset 0 0 14px rgba(255,255,255,0.04);
  animation: trophyFloat 2.8s ease-in-out infinite alternate;
  animation-delay: var(--float-delay, 0s);
}

.trophyHeadCard img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  display: block;
  margin: 0 auto 7px;
  filter: drop-shadow(0 0 14px rgba(255,204,0,0.22));
}

.trophyHeadCard span {
  display: block;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trophySourceLabel {
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 8px;
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: rgba(0,0,0,0.72);
  border: 1px solid rgba(255,255,255,0.22);
}

.sourceNormal { border-color: rgba(0,217,255,0.42); }
.sourceNormal .trophySourceLabel { color: #00d9ff; }
.sourceMarket { border-color: rgba(255,204,0,0.52); }
.sourceMarket .trophySourceLabel { color: #ffcc00; }
.sourcePresent { border-color: rgba(184,0,255,0.62); }
.sourcePresent .trophySourceLabel { color: #d78cff; }
.sourceSecret { border-color: rgba(255,48,77,0.62); }
.sourceSecret .trophySourceLabel { color: #ff304d; }
.sourcePrestige { border-color: rgba(64,255,145,0.62); }
.sourcePrestige .trophySourceLabel { color: #40ff91; }
.sourceSpecial { border-color: rgba(255,204,0,0.86); }
.sourceSpecial .trophySourceLabel { color: #ffcc00; text-shadow: 0 0 10px rgba(255,204,0,0.82), 0 0 16px rgba(184,0,255,0.62); }

#trophyGoldZone {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at center, rgba(255,204,0,0.16), rgba(0,0,0,0.50));
}

#trophyGoldPile {
  width: min(210px, 100%);
  max-height: 260px;
  object-fit: contain;
  filter:
    drop-shadow(0 0 20px rgba(255,204,0,0.52))
    drop-shadow(0 0 12px rgba(0,0,0,0.60));
  animation: trophyGoldPulse 2s ease-in-out infinite alternate;
}

#trophyGoldLabel {
  margin-top: 14px;
  padding: 7px 12px;
  border-radius: 999px;
  color: #ffcc00;
  background: rgba(0,0,0,0.62);
  border: 1px solid rgba(255,204,0,0.42);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-shadow: 0 0 10px rgba(255,204,0,0.42);
}

.trophyEmpty {
  grid-column: 1 / -1;
  justify-self: center;
  align-self: center;
  padding: 18px;
  border-radius: 16px;
  background: rgba(0,0,0,0.58);
  border: 2px dashed rgba(255,204,0,0.38);
  color: #ddd;
  text-align: center;
}

#trophyRoomButtons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

#trophyShuffleHeadsBtn,
#trophyShuffleRoomBtn {
  background: #00d9ff;
  color: #001015;
  box-shadow: 0 0 18px rgba(0,217,255,0.45);
}

#trophyRoomBackBtn {
  background: #555;
  color: #eee;
}

@keyframes trophyFloat {
  from { transform: translateY(calc(var(--float-drift, 4px) * -1)); }
  to { transform: translateY(var(--float-drift, 4px)); }
}

@keyframes trophyGoldPulse {
  from { transform: scale(1); filter: drop-shadow(0 0 16px rgba(255,204,0,0.45)); }
  to { transform: scale(1.035); filter: drop-shadow(0 0 28px rgba(255,204,0,0.68)); }
}

@media (max-width: 700px) {
  #trophyRoomPanel {
    width: 96vw;
    height: 90vh;
  }

  #trophyRoomStage {
    padding: 12px;
  }

  #trophyRoomHeader {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  #trophyRoomHeader h1 {
    font-size: 28px;
  }

  #trophyRoomContent {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  #trophyHeadCloud {
    min-height: 0;
    grid-template-columns: repeat(2, minmax(110px, 1fr));
    padding: 12px;
    gap: 10px;
  }

  .trophyHeadCard img {
    width: 68px;
    height: 68px;
  }

  #trophyGoldZone {
    min-height: 190px;
  }

  #trophyGoldPile {
    max-height: 150px;
  }

  #trophyRoomButtons {
    flex-direction: column;
  }

  #trophyRoomButtons button {
    width: 100%;
  }
}

/* Trophy Room living-room mode override */
#trophyRoomPanel {
  border-color: rgba(255,204,0,0.88);
  background: #120907;
}

#trophyRoomBackdrop {
  background-image:
    linear-gradient(rgba(0,0,0,0.04), rgba(0,0,0,0.18)),
    url("../trophy/livingroom.png");
  background-size: cover !important;
  background-position: center center !important;
  filter: saturate(1.08) brightness(1.02) !important;
  transform: none !important;
}

#trophyRoomStage::before {
  background:
    linear-gradient(180deg, rgba(0,0,0,0.04), rgba(0,0,0,0.12) 64%, rgba(0,0,0,0.24)),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 5px) !important;
  opacity: 0.82;
}

#trophyRoomHeader {
  background: rgba(0,0,0,0.34) !important;
  border-color: rgba(255,204,0,0.20) !important;
  backdrop-filter: blur(2px);
}

#trophyRoomContent {
  grid-template-columns: 1fr 250px !important;
  min-height: 0;
}

#trophyHeadZone {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

#trophyHeadCloud {
  display: block !important;
  position: relative !important;
  height: 100% !important;
  min-height: 430px !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.trophyHeadCard {
  position: absolute !important;
  width: 104px !important;
  height: 126px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
  transform-origin: 50% 86%;
  animation:
    trophyWalk var(--walk-speed, 8.5s) ease-in-out infinite alternate,
    trophyChillBob var(--bob-speed, 2.6s) ease-in-out infinite alternate !important;
  animation-delay: var(--float-delay, 0s), calc(var(--float-delay, 0s) * -1) !important;
}

.trophyHeadCard.trophyJumper {
  animation-name: trophyWalk, trophyJump !important;
  animation-duration: var(--walk-speed, 8.5s), 4.2s !important;
  animation-delay: var(--float-delay, 0s), calc(var(--float-delay, 0s) * -1) !important;
}

.trophyHeadCard::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 18px;
  height: 10px;
  border-radius: 50%;
  background: rgba(0,0,0,0.34);
  filter: blur(3px);
  z-index: 0;
  animation: trophyShadowPulse var(--bob-speed, 2.6s) ease-in-out infinite alternate;
}

.trophyHeadCard img {
  position: relative;
  z-index: 2;
  width: 76px !important;
  height: 76px !important;
  object-fit: contain;
  display: block;
  margin: 28px auto 5px !important;
  transform: scale(var(--head-scale, 1));
  filter:
    drop-shadow(0 4px 4px rgba(0,0,0,0.55))
    drop-shadow(0 0 10px rgba(255,204,0,0.18)) !important;
}

.trophyHeadCard:nth-child(4n) img {
  animation: trophyLookAround 3.4s ease-in-out infinite alternate;
}

.trophyHeadCard span {
  display: none !important;
}

.trophySourceLabel {
  top: 0 !important;
  z-index: 3;
  border: 0 !important;
  background: rgba(0,0,0,0.62) !important;
  box-shadow: 0 0 8px rgba(0,0,0,0.48);
  pointer-events: none;
}

.trophyMemoryText {
  position: absolute;
  z-index: 1;
  max-width: 190px;
  padding: 5px 8px;
  border: 1px solid rgba(141,242,255,0.42);
  border-radius: 6px;
  background: rgba(0,12,18,0.48);
  color: #dffcff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow:
    0 0 8px rgba(0,217,255,0.92),
    0 0 14px rgba(255,204,0,0.36);
  box-shadow:
    0 0 10px rgba(0,217,255,0.30),
    inset 0 0 12px rgba(0,217,255,0.12);
  pointer-events: none;
  animation: trophyMemoryGlow 4.8s ease-in-out infinite;
}

.trophyMemoryText::before {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: -5px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,204,0,0.78), transparent);
  box-shadow: 0 0 8px rgba(255,204,0,0.72);
}

.sourceNormal,
.sourceMarket,
.sourcePresent,
.sourceSecret,
.sourcePrestige,
.sourceSpecial {
  border: 0 !important;
}

.sourceNormal .trophySourceLabel {
  color: #00d9ff !important;
  text-shadow: 0 0 8px rgba(0,217,255,0.78);
}

.sourceMarket .trophySourceLabel {
  color: #ffcc00 !important;
  text-shadow: 0 0 8px rgba(255,204,0,0.78);
}

.sourcePresent .trophySourceLabel {
  color: #d78cff !important;
  text-shadow: 0 0 8px rgba(184,0,255,0.78);
}

.sourceSecret .trophySourceLabel {
  color: #ff304d !important;
  text-shadow: 0 0 8px rgba(255,48,77,0.78);
}

.sourcePrestige .trophySourceLabel {
  color: #40ff91 !important;
  text-shadow: 0 0 8px rgba(64,255,145,0.78);
}

.sourceSpecial .trophySourceLabel {
  color: #ffcc00 !important;
  text-shadow:
    0 0 8px rgba(255,204,0,0.95),
    0 0 14px rgba(184,0,255,0.78),
    0 0 20px rgba(255,48,77,0.46);
}

.trophyHeadCard:nth-child(1) { left: 6%; top: 50%; --walk-distance: 42px; }
.trophyHeadCard:nth-child(2) { left: 18%; top: 36%; --walk-distance: -34px; }
.trophyHeadCard:nth-child(3) { left: 31%; top: 55%; --walk-distance: 54px; }
.trophyHeadCard:nth-child(4) { left: 44%; top: 41%; --walk-distance: -48px; }
.trophyHeadCard:nth-child(5) { left: 58%; top: 57%; --walk-distance: 36px; }
.trophyHeadCard:nth-child(6) { left: 10%; top: 68%; --walk-distance: -50px; }
.trophyHeadCard:nth-child(7) { left: 26%; top: 72%; --walk-distance: 44px; }
.trophyHeadCard:nth-child(8) { left: 48%; top: 70%; --walk-distance: -40px; }
.trophyHeadCard:nth-child(9) { left: 64%; top: 34%; --walk-distance: 32px; }
.trophyHeadCard:nth-child(10) { left: 70%; top: 64%; --walk-distance: -46px; }

.trophyHeadCard:nth-child(3n) {
  animation-name: trophyWalk, trophyJump !important;
  animation-duration: 9s, 3.8s !important;
}

#trophyGoldZone {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  justify-content: end !important;
  padding-bottom: 54px !important;
}

#trophyGoldPile {
  width: min(230px, 100%) !important;
  max-height: 280px !important;
}

#trophyGoldLabel {
  background: rgba(0,0,0,0.62) !important;
  border-color: rgba(255,204,0,0.42) !important;
}

#trophyRoomButtons {
  background: rgba(0,0,0,0.28);
  width: fit-content;
  margin: 0 auto;
  padding: 8px 12px;
  border-radius: 16px;
  backdrop-filter: blur(2px);
}

@keyframes trophyWalk {
  from { transform: translateX(calc(var(--walk-distance, 40px) * -1)); }
  to { transform: translateX(var(--walk-distance, 40px)); }
}

@keyframes trophyChillBob {
  from { margin-top: -4px; }
  to { margin-top: 5px; }
}

@keyframes trophyJump {
  0%, 70%, 100% { margin-top: 0; }
  78% { margin-top: -22px; }
  84% { margin-top: 0; }
  90% { margin-top: -8px; }
}

@keyframes trophyShadowPulse {
  from { transform: scaleX(0.82); opacity: 0.26; }
  to { transform: scaleX(1.08); opacity: 0.42; }
}

@keyframes trophyLookAround {
  from { transform: rotate(-2deg) scaleX(1); }
  to { transform: rotate(2deg) scaleX(-1); }
}

@keyframes trophyMemoryGlow {
  0%, 100% {
    opacity: 0.52;
    transform: translateY(0);
    filter: saturate(0.92);
  }

  45% {
    opacity: 1;
    transform: translateY(-3px);
    filter: saturate(1.25);
  }
}

@media (max-width: 700px) {
  #trophyRoomContent {
    grid-template-columns: 1fr !important;
  }

  #trophyHeadCloud {
    min-height: 420px !important;
  }

  .trophyHeadCard {
    width: 86px !important;
    height: 108px !important;
  }

  .trophyHeadCard img {
    width: 62px !important;
    height: 62px !important;
  }

  .trophyMemoryText {
    max-width: 132px;
    padding: 4px 6px;
    font-size: 8px;
  }

  .trophyHeadCard:nth-child(n) {
    --walk-distance: 22px;
  }

  #trophyGoldZone {
    min-height: 170px;
    padding-bottom: 14px !important;
  }
}
