/* =========================================================
   RUNWAY RIVALS — MAIN STYLESHEET
   ========================================================= */

:root {
  --pink: #ff5fa2;
  --hot-pink: #ff2fd0;
  --purple: #7c4dff;
  --gold: #ffd700;
  --cream: #fff8ef;
  --ink: #33264d;
  --panel-radius: 28px;
  --shadow-soft: 0 10px 30px rgba(80, 30, 90, 0.18);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Baloo 2", "Comic Sans MS", "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(160deg, #ffe3f3 0%, #ffd6e8 30%, #e6d6ff 70%, #d6c3ff 100%);
  color: var(--ink);
  overflow-x: hidden;
}

button {
  font-family: inherit;
}

/* ---------- Screens ---------- */

.screen {
  display: none;
  min-height: 100vh;
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 48px;
  animation: fadeIn 0.4s ease;
}

.screen.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-title {
  text-align: center;
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  color: var(--purple);
  text-shadow: 1px 1px 0 #fff;
  margin: 0 0 20px;
}

.btn {
  cursor: pointer;
  border: none;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.02em;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: linear-gradient(135deg, var(--hot-pink), var(--purple));
  color: white;
  box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-2px) scale(1.02);
}

.btn-secondary {
  background: white;
  color: var(--purple);
  border: 2px solid var(--purple);
  box-shadow: var(--shadow-soft);
}

.btn-secondary:hover {
  background: #f4ecff;
  transform: translateY(-2px) scale(1.02);
}

.btn-huge {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  padding: 18px 40px;
  margin-top: 24px;
}

/* ---------- Title screen ---------- */

.title-wrap {
  text-align: center;
  max-width: 720px;
}

.title-logo {
  width: min(90vw, 560px);
  filter: drop-shadow(0 12px 24px rgba(120, 30, 120, 0.35));
  animation: floatLogo 3.5s ease-in-out infinite;
}

@keyframes floatLogo {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}

.tagline {
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  color: var(--ink);
  font-weight: 700;
  margin: 8px 0 4px;
}

.credit {
  margin-top: 28px;
  font-size: 0.95rem;
  opacity: 0.75;
  font-weight: 600;
}

/* Collapsed-by-default rival difficulty picker — Kennedy wanted this
   small and out-of-the-way, not a big always-open box (see BACKLOG.md
   #4), so .rival-difficulty-panel starts `hidden` and only opens when
   .rival-difficulty-toggle is clicked (see game.js). */
.rival-difficulty-wrap {
  margin: 16px 0 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.rival-difficulty-toggle {
  cursor: pointer;
  border: none;
  background: white;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--purple);
  box-shadow: var(--shadow-soft);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: transform 0.15s ease;
}

.rival-difficulty-toggle:hover {
  transform: translateY(-1px);
}

.rival-difficulty-toggle .chevron {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}

.rival-difficulty-toggle.open .chevron {
  transform: rotate(180deg);
}

.rival-difficulty-panel[hidden] {
  display: none;
}

.rival-difficulty-panel {
  display: flex;
  gap: 6px;
  background: white;
  border-radius: 999px;
  padding: 6px;
  box-shadow: var(--shadow-soft);
  animation: popIn 0.25s ease;
}

.rival-diff-option {
  cursor: pointer;
  border: none;
  background: #f4ecff;
  border-radius: 999px;
  padding: 7px 13px;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--purple);
}

.rival-diff-option.active {
  background: linear-gradient(135deg, var(--hot-pink), var(--purple));
  color: white;
}

/* ---------- Theme reveal screen ---------- */

.theme-wrap {
  text-align: center;
  max-width: 720px;
  width: 100%;
}

.theme-card {
  background: white;
  border-radius: var(--panel-radius);
  padding: 32px 24px;
  box-shadow: var(--shadow-soft);
  border: 4px dashed var(--gold);
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.theme-emoji {
  font-size: 4rem;
  line-height: 1;
}

.theme-name {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  margin: 8px 0;
  background: linear-gradient(135deg, var(--hot-pink), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.theme-blurb {
  font-size: 1.1rem;
  font-weight: 600;
  color: #6a5a8a;
}

.judges-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 28px 0 8px;
  flex-wrap: wrap;
}

.judge-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 110px;
}

.judge-mini img {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid white;
  box-shadow: var(--shadow-soft);
  background: white;
}

.judge-mini span {
  font-size: 0.85rem;
  font-weight: 700;
}

/* Hidden whenever there's no active rival this round — see
   renderRivalBanner() in game.js. Needs an explicit [hidden] override
   since `display: flex` below has the same specificity as the browser's
   built-in `[hidden] { display: none }` rule and would otherwise win by
   cascade order (author stylesheet beats user-agent at a specificity
   tie) — same fix as .runway-walkers-rival[hidden] below. */
.rival-banner[hidden] {
  display: none;
}

.rival-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff4d6;
  border: 3px solid var(--gold);
  border-radius: 20px;
  padding: 12px 18px;
  margin: 22px auto 6px;
  max-width: 460px;
  text-align: left;
}

/* The rival's "portrait" is cropped straight out of her full-body base
   art via background-size/position math (no separate portrait asset) —
   works for any rival base since they're all pixel-registered to the
   same pose as popstar-base.png (see data.js RIVALS comment). The magic
   numbers below map the same face-region box used for the plan's mockup
   thumbnails (roughly x 27%-76%, y 1%-34% of the 1024x1536 canvas) onto
   whatever pixel size this circle actually renders at. */
.rival-banner-portrait {
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: var(--shadow-soft);
  background-color: white;
  background-repeat: no-repeat;
  background-size: 205% auto;
  background-position: 53% 2%;
}

.rival-banner-title {
  font-weight: 800;
  margin: 0 0 2px;
  color: var(--ink);
}

.rival-banner-sub {
  font-size: 0.82rem;
  color: #8a7aa8;
  margin: 0;
}

/* ---------- Closet screen ---------- */

.closet-wrap {
  width: 100%;
  max-width: 980px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.theme-banner {
  align-self: center;
  background: white;
  border-radius: 999px;
  padding: 8px 20px;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.closet-main {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 12px;
}

.stage-column {
  text-align: center;
}

.stage-label {
  font-weight: 800;
  color: var(--purple);
  margin: 6px 0 0;
}

.character-stage {
  position: relative;
  width: min(38vw, 260px);
  aspect-ratio: 3 / 4;
  background: radial-gradient(ellipse at 50% 85%, rgba(255,255,255,0.9), rgba(255,255,255,0));
  border-radius: 20px;
}

.stage-base,
.stage-slot {
  position: absolute;
  pointer-events: none;
}

.stage-base {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.stage-slot {
  display: none;
  object-fit: contain;
}

.stage-slot.equipped {
  display: block;
}

/* Body-fitted slots (onepiece/top/bottom/socks/shoes/dog-body) are drawn
   from a per-item extracted cutout that's already pixel-registered to the
   base character art (see tools/extract-garment.py) — so the overlay just
   needs to sit exactly on top of the base image, at its exact size, rather
   than in its own small per-slot box like the old sticker-style overlays. */
.stage-slot-fitted {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Small/finicky items (jewelry, sunglasses, hats, held props, dog bows
   and collars) don't get overlaid on the body at all — seeing them
   correctly fitted would need the same per-item extraction pipeline as
   body-fitted slots, but that technique breaks down for tiny items (the
   "keep the single largest diff blob" cleanup discards a small accessory
   whenever something else in the image — like the held microphone —
   drifts position by more pixels between AI generations). Instead they
   just show up as icons in this box beside the character. */
/* Cosmetic hair-stripe color picker — a row of plain CSS color swatches,
   not item icons, since these aren't real WARDROBE items (no tags, no
   scoring impact, see data.js HAIR_STRIPES). Only shown under the Pop
   Star (the dog doesn't have a hair streak to recolor). */
.hair-picker-label {
  margin: 8px 0 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #8a7aa8;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hair-picker {
  margin-top: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.hair-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 2px 6px rgba(80, 30, 90, 0.25);
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease;
}

.hair-swatch:hover {
  transform: scale(1.12);
}

.hair-swatch.selected {
  border-color: var(--purple);
  transform: scale(1.15);
}

.accessory-box {
  margin-top: 10px;
  min-height: 44px;
  width: min(38vw, 260px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 14px;
}

.accessory-box:empty {
  visibility: hidden;
}

.accessory-box .accessory-chip {
  width: 40px;
  height: 40px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(80, 30, 90, 0.15);
  padding: 4px;
}

.accessory-box .accessory-chip img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.closet-drawer {
  background: white;
  border-radius: var(--panel-radius);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 2px dashed #f0d9ff;
}

.category-tab {
  flex: 0 0 auto;
  background: #f4ecff;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--purple);
  cursor: pointer;
  white-space: nowrap;
}

.category-tab.active {
  background: linear-gradient(135deg, var(--hot-pink), var(--purple));
  color: white;
}

.item-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 4px 12px;
  /* Snap-scrolling makes the horizontal drawer feel intentional (like a
     row of cards) rather than an accidental sideways scroll. */
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.item-card {
  flex: 0 0 96px;
  background: #fdf6ff;
  border: 3px solid transparent;
  border-radius: 16px;
  padding: 8px;
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s ease, border-color 0.15s ease;
  scroll-snap-align: start;
}

.item-card:hover {
  transform: translateY(-3px);
}

.item-card.selected {
  border-color: var(--hot-pink);
  background: #ffe9f7;
}

.item-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}

.item-card .item-name {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 4px;
  color: #6a5a8a;
  line-height: 1.15;
}

/* ---------- Runway screen ---------- */

.runway-wrap {
  width: 100%;
  max-width: 900px;
  text-align: center;
}

.runway-floor {
  position: relative;
  height: 60vh;
  min-height: 380px;
  background: linear-gradient(180deg, #2a1a4a 0%, #4a1a5a 55%, #ff5fa2 55%, #ff2fd0 100%);
  border-radius: var(--panel-radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.runway-floor::before {
  content: "";
  position: absolute;
  inset: 55% 0 0 0;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,0.25) 0 4px, transparent 4px 60px);
}

.runway-walkers {
  position: absolute;
  bottom: 10%;
  left: -40%;
  width: 55%;
  aspect-ratio: 4 / 3;
  animation: walkAcross 2.4s ease-in-out forwards;
}

/* Settles at left:6% (spans ~6%-61%) so its box never overlaps the
   rival's box, which settles at right:2% (spans ~68%-98%) — see
   .runway-walkers-rival below. There's a ~7% gap between them since
   bounding boxes that don't overlap horizontally can't overlap at all,
   regardless of their different vertical offsets/sizes. */
@keyframes walkAcross {
  0%   { left: -45%; transform: scale(0.8); }
  70%  { left: 10%; transform: scale(1.05); }
  100% { left: 6%; transform: scale(1.05); }
}

.runway-char,
.runway-slot-fitted {
  position: absolute;
  object-fit: contain;
  animation: bob 0.5s ease-in-out infinite alternate;
}

@keyframes bob {
  from { transform: translateY(0); }
  to { transform: translateY(-3%); }
}

#runway-popstar-base {
  bottom: 0;
  left: 12%;
  width: 55%;
  height: 100%;
}

#runway-dog-base.runway-dog {
  bottom: 0;
  left: -18%;
  width: 55%;
  height: 65%;
}

/* Rival walks side-by-side with the player (Kennedy's pick), not one at a
   time — a second, smaller .runway-walkers group, further back/higher up
   on the floor. Its own walk-in animation mirrors walkAcross but enters
   from the right and settles smaller/further back, since perspective (not
   the player's own walk) is what should make her read as "the other
   contestant" at a glance. */
.runway-walkers-rival {
  position: absolute;
  bottom: 42%;
  right: -34%;
  width: 30%;
  aspect-ratio: 4 / 3;
  animation: walkAcrossRival 2.4s ease-in-out forwards;
}

.runway-walkers-rival[hidden] {
  display: none;
}

/* Settles at right:2% (spans ~68%-98%) — see the gap-math comment on
   .runway-walkers/@keyframes walkAcross above. */
@keyframes walkAcrossRival {
  0% { right: -34%; transform: scale(0.75); }
  70% { right: -2%; transform: scale(0.95); }
  100% { right: 2%; transform: scale(0.95); }
}

/* Same relative box as #runway-popstar-base / #runway-dog-base.runway-dog
   above, just scoped to the rival's own (smaller) .runway-walkers-rival
   container — the .runway-slot-fitted[data-slot=...] rules already apply
   generically to any matching element regardless of container, so the
   rival's fitted clothing slots need zero extra CSS beyond these two base
   images. */
#runway-rival-popstar-base {
  bottom: 0;
  left: 12%;
  width: 55%;
  height: 100%;
}

#runway-rival-dog-base.runway-dog-rival {
  bottom: 0;
  left: -18%;
  width: 55%;
  height: 65%;
}

.runway-slot {
  position: absolute;
  display: none;
  object-fit: contain;
  pointer-events: none;
}

.runway-slot.equipped { display: block; }

/* Fitted overlays sit exactly on top of their matching base character art
   (same box #runway-popstar-base / #runway-dog-base.runway-dog use) since
   the cutout is already pixel-registered to it — see .stage-slot-fitted. */
.runway-slot-fitted[data-slot="hair-stripe"],
.runway-slot-fitted[data-slot="onepiece"],
.runway-slot-fitted[data-slot="top"],
.runway-slot-fitted[data-slot="bottom"],
.runway-slot-fitted[data-slot="socks"],
.runway-slot-fitted[data-slot="shoes"] {
  bottom: 0;
  left: 12%;
  width: 55%;
  height: 100%;
}

.runway-slot-fitted[data-slot="dog-body"] {
  bottom: 0;
  left: -18%;
  width: 55%;
  height: 65%;
}

.runway-accessories {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  min-height: 1px;
}

.runway-accessories:empty {
  margin-top: 0;
}

.runway-accessories .accessory-chip {
  width: 36px;
  height: 36px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(80, 30, 90, 0.15);
  padding: 4px;
}

.runway-accessories .accessory-chip img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.flash-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.flash-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: white;
  opacity: 0;
  box-shadow: 0 0 12px 4px white;
  animation: flashPop 0.7s ease-out;
}

@keyframes flashPop {
  0% { opacity: 0; transform: scale(0.5); }
  15% { opacity: 1; transform: scale(1.4); }
  100% { opacity: 0; transform: scale(0.6); }
}

.runway-caption {
  font-weight: 700;
  color: var(--purple);
  margin-top: 16px;
  font-size: 1.1rem;
}

/* ---------- Judging screen ---------- */

.judging-wrap {
  max-width: 900px;
  width: 100%;
  text-align: center;
}

.judge-cards {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.judge-card {
  background: white;
  border-radius: 22px;
  padding: 18px 16px;
  width: 200px;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(20px);
  animation: judgeIn 0.5s ease forwards;
}

@keyframes judgeIn {
  to { opacity: 1; transform: translateY(0); }
}

.judge-card img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid #f4ecff;
  margin-bottom: 10px;
}

.judge-card .judge-name {
  font-weight: 800;
  color: var(--purple);
  display: block;
}

.judge-card .judge-role {
  font-size: 0.8rem;
  color: #8a7aa8;
  display: block;
  margin-bottom: 10px;
}

.judge-card .judge-score {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--hot-pink);
  opacity: 0;
  transform: scale(0.4) rotate(-15deg);
}

.judge-card .judge-score.revealed {
  animation: scoreReveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes scoreReveal {
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}

.judge-card .judge-comment {
  font-size: 0.78rem;
  font-weight: 600;
  color: #6a5a8a;
  min-height: 32px;
  margin-top: 6px;
  opacity: 0;
}

.judge-card .judge-comment.revealed {
  opacity: 1;
  animation: fadeIn 0.4s ease;
}

.total-score {
  background: white;
  display: inline-flex;
  gap: 8px;
  align-items: baseline;
  padding: 12px 26px;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  font-weight: 700;
  animation: popIn 0.4s ease;
}

.total-score strong {
  font-size: 1.8rem;
  color: var(--hot-pink);
}

/* Second judging pass, reusing the exact same .judge-card markup/timing
   as the player's row above. Hidden whenever there's no active rival —
   see revealRivalJudging() in game.js. */
.rival-judging-wrap {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 2px dashed #f0d9ff;
}

.rival-judging-label {
  font-weight: 800;
  color: var(--purple);
  margin: 0 0 16px;
  font-size: 1.1rem;
}

.judge-cards-rival .judge-card {
  width: 160px;
  padding: 14px 12px;
}

.judge-cards-rival .judge-card img {
  width: 68px;
  height: 68px;
}

.judge-cards-rival .judge-card .judge-score {
  font-size: 1.7rem;
}

.total-score-rival strong {
  color: #d8649a;
}

.rival-result-banner {
  display: inline-block;
  margin-top: 16px;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 800;
  color: white;
  box-shadow: var(--shadow-soft);
}

.rival-result-banner:not(:empty) {
  animation: popIn 0.4s ease;
}

.rival-result-win {
  background: linear-gradient(135deg, var(--gold), var(--hot-pink));
}

.rival-result-lose {
  background: linear-gradient(135deg, var(--purple), #4a1a5a);
}

.rival-result-tie {
  background: linear-gradient(135deg, #8a7aa8, #6a5a8a);
}

/* ---------- Finale screen ---------- */

.finale-wrap {
  max-width: 720px;
  width: 100%;
  text-align: center;
}

.finale-content {
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.finale-title {
  font-size: clamp(1.6rem, 4.5vw, 2.4rem);
  color: var(--purple);
  margin-bottom: 12px;
}

.finale-title.win {
  background: linear-gradient(135deg, var(--gold), var(--hot-pink), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(30deg); }
}

.finale-art-row {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.finale-art {
  width: min(42vw, 230px);
  filter: drop-shadow(0 10px 18px rgba(120, 30, 120, 0.3));
  animation: floatLogo 2.4s ease-in-out infinite;
}

.finale-message {
  font-size: 1.05rem;
  font-weight: 600;
  color: #6a5a8a;
  max-width: 560px;
  margin: 0 auto;
}

/* Retry screen gets 2 options — redress for the SAME theme, or skip to a
   whole new one — instead of only "try again" (see BACKLOG.md). */
.finale-retry-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.finale-retry-actions .btn-huge {
  margin-top: 0;
}

/* Fun bonus stat only — never affects win/retry (see goToFinale() +
   renderFinaleRivalLine() in game.js). Hidden whenever there was no
   active rival this round. */
.finale-rival-line {
  font-weight: 700;
  color: var(--purple);
  margin: 10px 0 0;
}

/* ---------- Photo Op screen ---------- */

.photo-wrap {
  max-width: 780px;
  width: 100%;
  text-align: center;
}

.photo-frame {
  background: white;
  border-radius: var(--panel-radius);
  padding: 12px;
  box-shadow: var(--shadow-soft);
  display: inline-block;
  max-width: 100%;
}

#photo-preview {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 16px;
}

.photo-caption {
  font-weight: 700;
  color: #6a5a8a;
  margin: 16px 0 0;
}

.photo-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.photo-actions .btn-huge {
  margin-top: 20px;
}

/* ---------- Photo Album screen ---------- */

.album-wrap {
  max-width: 900px;
  width: 100%;
  text-align: center;
}

.album-empty {
  font-weight: 700;
  color: #6a5a8a;
  margin: 0 0 20px;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.album-card {
  position: relative;
  background: white;
  border-radius: 18px;
  padding: 10px;
  box-shadow: var(--shadow-soft);
}

.album-card img {
  width: 100%;
  border-radius: 12px;
  cursor: pointer;
  display: block;
}

.album-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--purple);
  margin-top: 8px;
  gap: 6px;
}

.album-card-date {
  color: #9a8ab8;
  font-weight: 600;
  white-space: nowrap;
}

.album-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: white;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.album-delete-btn:hover {
  background: #ffe3ec;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(40, 20, 60, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.photo-lightbox[hidden] {
  display: none;
}

.photo-lightbox-inner {
  background: white;
  border-radius: var(--panel-radius);
  padding: 16px;
  max-width: min(92vw, 640px);
  max-height: 90vh;
  overflow: auto;
  text-align: center;
}

#photo-lightbox-img {
  max-width: 100%;
  max-height: 65vh;
  border-radius: 14px;
  display: block;
  margin: 0 auto;
}

.photo-lightbox-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.photo-lightbox-actions .btn-huge {
  margin-top: 16px;
  padding: 12px 28px;
  font-size: 1rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

/* ---------- Confetti ---------- */

#confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

.mute-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.mute-toggle:hover {
  transform: scale(1.08);
}

.mute-toggle:active {
  transform: scale(0.94);
}

.confetti-piece {
  position: absolute;
  top: -5vh;
  width: 10px;
  height: 16px;
  opacity: 0.95;
  animation-name: confettiFall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes confettiFall {
  from { transform: translateY(0) rotate(0deg); }
  to { transform: translateY(110vh) rotate(720deg); }
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .closet-main {
    gap: 10px;
  }
  .character-stage {
    width: 42vw;
  }
  .judge-card {
    width: 42vw;
    padding: 12px 10px;
  }
  .judge-card img {
    width: 72px;
    height: 72px;
  }
}
