/* trophy.css — the Trophy room. Uses the later (light-page) mockup version:
   cream page, five colored panels, the Subject shelf along the bottom. Shapes
   only; each shelf card's colors come from the course's --shelf-* tokens. */

.trophy-head{
  display: flex; align-items: center; gap: 16px;
  width: 100%; max-width: 1400px; margin: 0 auto; padding: 28px 40px 6px;
  padding-top: calc(28px + env(safe-area-inset-top, 0px));
}
.trophy-head h1{ font-size: clamp(30px, 5vw, 46px); color: var(--teal-dark); margin: 0; line-height: 1.05; }
.tan-back{
  background: var(--tan); border: none; border-radius: 16px; flex: none;
  width: 50px; height: 50px; font-size: 24px; color: var(--teal-dark);
  display: flex; align-items: center; justify-content: center;
}
.tan-back:hover{ background: #dccdb4; }

.trophy-wrap{
  width: 100%; max-width: 1400px; margin: 0 auto; padding: 12px 40px 60px;
  display: flex; flex-direction: column; gap: 28px;
}
.trophy-trio{ display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; }

.trophy-panel{
  --panel-edge: #000;
  color: #fff; border-radius: 32px; padding: 26px 28px 28px;
  box-shadow: 0 10px 0 var(--panel-edge);
}
.panel-title{
  font-family: var(--font-display); font-weight: 800; font-size: 28px; margin: 0; line-height: 1.1;
}
.panel-title .panel-sub{ font-family: var(--font-body); font-weight: 600; font-size: 15px; margin-left: 10px; opacity: .82; }
.panel-sub{ font-size: 14px; font-weight: 600; opacity: .82; margin: 6px 0 16px; }
.panel-empty{ font-size: 14px; font-weight: 600; opacity: .8; margin: 8px 0; }

/* Weekly Ribbons */
.ribbons-panel{ background: #8b5a3a; --panel-edge: #6e4529; }
.ribbons-body{ display: flex; gap: 22px; align-items: stretch; margin-top: 16px; }
.puzzle-big{
  flex: none; width: 200px; background: rgba(0,0,0,0.18); border-radius: 22px; padding: 16px 12px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
}
.puzzle-big svg{ width: 104px; height: 104px; margin-bottom: 6px; }
.puzzle-big b{ font-family: var(--font-display); font-size: 18px; }
.puzzle-big span{ font-size: 13px; opacity: .85; font-weight: 600; }
.ribbon-grid{
  flex: 1; min-width: 0; display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto);
  grid-auto-columns: 104px; gap: 14px 6px; overflow-x: auto; padding-bottom: 6px; align-content: start;
}
.ribbon-item{ display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 800; font-size: 14px; }
.ribbon-item svg{ width: 58px; height: 74px; }

/* Challenge Coins */
.coins-panel{ background: #23324f; --panel-edge: #172338; }
.coin-grid{ display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
.coin{
  display: flex; align-items: center; gap: 10px; background: none; border: none; color: #fff;
  text-align: left; padding: 0; perspective: 700px; min-width: 0;
}
.coin-disc{ position: relative; flex: none; width: 88px; height: 88px; transform-style: preserve-3d; transition: transform .5s; }
.coin.flipped .coin-disc{ transform: rotateY(180deg); }
.coin-face{ position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.coin-face svg{ width: 100%; height: 100%; display: block; }
.coin-back{
  transform: rotateY(180deg); border-radius: 50%; background: var(--gold); color: #3a2c0d;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 12px; font-size: 10.5px; font-weight: 800; line-height: 1.2;
}
.coin-back small{ font-weight: 700; opacity: .75; margin-top: 4px; }
.coin-label{ font-family: var(--font-display); font-weight: 800; font-size: 16px; line-height: 1.1; min-width: 0; overflow-wrap: anywhere; }

/* Reading Stamps */
.stamps-panel{ background: #5c3b5a; --panel-edge: #3f2740; }
.stamp-board{
  background: #24232b; border-radius: 20px; padding: 16px; min-height: 250px;
  display: grid; grid-template-columns: repeat(auto-fill, 86px); gap: 12px; justify-content: start; align-content: start;
}
.stamp-slot{ aspect-ratio: 90 / 118; border: 2px dashed rgba(255,255,255,0.3); border-radius: 6px; }
.stamp-slot.filled{ border: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
.stamp-slot.filled svg{ width: 100%; height: 100%; display: block; }

/* Adventure Cards */
.cards-panel{ background: #b55839; --panel-edge: #8f4326; display: flex; flex-direction: column; }
.card-box-btn{ flex: 1; display: flex; flex-direction: column; justify-content: space-between; width: 100%; background: none; border: none; padding: 0; color: inherit; text-align: center; }
.card-box-btn:disabled{ cursor: default; }
.card-fan{ position: relative; height: 218px; flex: none; }
.card-fan.empty{ display: flex; align-items: center; justify-content: center; }
.adv-card{
  position: absolute; left: 50%; top: 8px; width: 146px; height: 196px; margin-left: -73px;
  border-radius: 16px; box-shadow: 0 4px 10px rgba(0,0,0,.25);
  display: flex; flex-direction: column; align-items: stretch; padding: 8px; gap: 6px;
}
.adv-card.back-2{ background: #9fbca4; transform: translateX(-58px) rotate(-12deg); }
.adv-card.back-1{ background: #5b4a7e; transform: translateX(-26px) rotate(-5deg); }
.adv-card.front{ background: var(--cream-card); color: var(--ink); transform: translateX(14px) rotate(5deg); }
.adv-title{
  background: var(--gold); border-radius: 8px; padding: 6px 4px; text-align: center;
  font-family: var(--font-display); font-weight: 800; font-size: 13px; line-height: 1.1;
}
.adv-art{ flex: 1; background: #3b2f4d; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.adv-art svg{ width: 70%; height: 70%; }
.adv-note{ text-align: center; font-weight: 800; font-size: 11px; line-height: 1.2; }
.card-box{
  display: block; background: #5a3a22; color: #f2d98a; border-radius: 14px; padding: 18px 12px;
  font-family: var(--font-display); font-weight: 800; font-size: 18px; margin-top: -26px; position: relative; flex: none;
  box-shadow: inset 0 6px 0 rgba(0,0,0,.18);
}
.card-list{ display: none; margin-top: 14px; flex-direction: column; gap: 8px; }
.adv-row{ background: rgba(0,0,0,.2); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.adv-row span{ font-size: 13px; opacity: .85; font-weight: 600; }
.cards-panel.box-open .card-fan{ display: none; }
.cards-panel.box-open .card-box{ margin-top: 0; }
.cards-panel.box-open .card-list{ display: flex; }

/* Subject shelf */
.shelf-heading{ font-size: 28px; color: var(--teal-dark); margin: 6px 0 -10px; }
.shelf-heading span{ font-family: var(--font-body); font-weight: 600; font-size: 14px; color: var(--ink-soft); margin-left: 8px; }
.shelf{
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 22px;
  overflow-x: auto; padding: 4px 2px 14px;
}
.shelf-card{
  --shelf-bg: #4a4a4a; --shelf-edge: #2d2d2d;
  background: var(--shelf-bg); color: #fff; border-radius: 26px; padding: 20px 22px 22px;
  box-shadow: 0 8px 0 var(--shelf-edge); display: flex; flex-direction: column; gap: 4px;
}
.shelf-card h3{ margin: 0; font-size: 24px; line-height: 1.1; }
.shelf-prize{ margin: 0; font-size: 14px; font-weight: 600; opacity: .82; }
.shelf-art{ height: 92px; margin: 10px 0 4px; display: flex; justify-content: center; }
.shelf-art svg{ height: 100%; width: auto; }
.shelf-line{ margin: 0; text-align: center; font-weight: 800; font-size: 15px; }

@media (max-width: 720px){
  .trophy-head{ padding: 20px 16px 4px; padding-top: calc(20px + env(safe-area-inset-top, 0px)); }
  .trophy-wrap{ padding: 10px 16px 48px; gap: 22px; }
  .ribbons-body{ flex-direction: column; }
  .puzzle-big{ width: 100%; }
  .trophy-trio{ grid-template-columns: 1fr; }
  .coin-grid{ grid-template-columns: 1fr; gap: 16px; }
  .coin-label{ overflow-wrap: normal; font-size: 18px; }
  .ribbon-grid{ grid-auto-flow: row; grid-template-rows: none; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); overflow-x: visible; }
  .ribbon-item{ text-align: center; white-space: nowrap; }
  .panel-title .panel-sub{ display: block; margin: 6px 0 0; }
}
