/* ============================================================================
   POKÉSPIRE · LIGHT-MODE EXPEDITION PREP SUITE (Standard / Daily / Custom)
   Clean pure-white canvas (#ffffff) + floating light frosted cards matching
   the Title & Single-Player Mode Select aesthetic.
   Strictly scoped to .expedition-prep so internal gameplay screens stay untouched.
   ============================================================================ */

.collection-ui.expedition-prep {
  --collection-ink: #0f172a;
  --collection-muted: #475569;
  --collection-line: #e2e8f0;
  --collection-panel: #ffffff;
  --collection-control: #f8fafc;
  --collection-yellow: #0ea5e9;
  --collection-highlight: #0369a1;
  --collection-background: #ffffff;
  background: #ffffff !important;
  color: #0f172a !important;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
}

.expedition-prep h1:focus,
.expedition-prep h2:focus {
  outline: none;
}

/* Light-mode controls strictly inside .expedition-prep */
.collection-ui.expedition-prep .collection-control {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 11px;
  color: #1e293b !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04) !important;
  transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, color 0.14s ease;
}

.collection-ui.expedition-prep .collection-control:hover:not(:disabled) {
  background: #f0f9ff !important;
  border-color: #38bdf8 !important;
  color: #0369a1 !important;
  box-shadow: 0 6px 16px -6px rgba(14, 165, 233, 0.25) !important;
}

.collection-ui.expedition-prep .collection-control:is(.is-current, [aria-pressed="true"]) {
  background: #e0f2fe !important;
  border-color: #0ea5e9 !important;
  color: #0369a1 !important;
  box-shadow: 0 4px 12px -4px rgba(14, 165, 233, 0.3) !important;
}

.collection-ui.expedition-prep .collection-control:disabled {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
  color: #94a3b8 !important;
  opacity: 0.72;
  cursor: not-allowed;
  box-shadow: none !important;
}

.collection-ui.expedition-prep :is(button, summary, input):focus-visible {
  outline: 2px solid #0ea5e9;
  outline-offset: 2px;
}

/* ============================================================================
   1. STANDARD EXPEDITION / TRAINER SELECT (100VH PURE WHITE + FLOATING CARDS)
   ============================================================================ */
.expedition-prep-standard {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #ffffff !important;
  z-index: auto;
}

.prep-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px clamp(18px, 2.6vw, 36px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #f1f5f9;
}

.prep-topbar h1 {
  margin: 0;
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.prep-topbar .collection-control,
.collection-ui.expedition-prep .dex-detail-back {
  padding: 8px 18px;
  border-radius: 999px !important;
  font-size: 13.5px;
  font-weight: 800;
}

.prep-widescreen-body {
  display: grid;
  grid-template-columns: clamp(280px, 25vw, 364px) minmax(0, 1fr) clamp(340px, 34vw, 520px);
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
  padding: clamp(12px, 2vh, 24px) clamp(18px, 2.6vw, 36px);
  min-height: 0;
  overflow: hidden;
}

.prep-glass-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 100%;
  padding: clamp(18px, 1.8vw, 24px);
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  background: #ffffff;
  box-shadow:
    0 20px 48px -18px rgba(15, 23, 42, 0.12),
    0 4px 14px -4px rgba(15, 23, 42, 0.05);
}

.prep-left-col {
  align-self: center;
}

.prep-identity-head h2 {
  margin: 4px 0 8px;
  font-size: clamp(32px, 3.4vw, 48px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: #0f172a;
}

.prep-kicker {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.1);
  color: #0369a1;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.prep-asc-slot {
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

/* Open center hero showcase over clean pure-white canvas */
.prep-center-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.prep-stage-aura {
  position: absolute;
  bottom: 6%;
  left: 50%;
  transform: translateX(-50%);
  width: min(86%, 500px);
  height: 66%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, var(--prep-aura, rgba(14, 165, 233, 0.22)) 0%, transparent 68%);
  filter: blur(26px);
  opacity: 0.42;
}

.prep-center-stage .prep-trainer-art {
  position: relative;
  z-index: 3;
  height: clamp(190px, 34vh, 300px);
  width: auto;
  margin-right: -36px;
  margin-bottom: 12px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 12px 18px rgba(15, 23, 42, 0.22));
}

.prep-center-stage .prep-pokemon-art {
  position: relative;
  z-index: 2;
  height: clamp(260px, 54vh, 470px);
  max-width: 78%;
  object-fit: contain;
  filter: drop-shadow(0 18px 26px rgba(15, 23, 42, 0.18));
}

/* Right panel: Always-visible starter deck customization */
.prep-right-col {
  align-self: center;
  min-height: 0;
}

.prep-deck-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.prep-deck-head h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 900;
  color: #0f172a;
}

.prep-reset-btn {
  padding: 4px 11px !important;
  min-height: 28px !important;
  font-size: 12px;
}

.prep-right-col .prep-deck-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 0;
  align-items: start;
}

.prep-right-col[data-deck-cols="2"] .prep-deck-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 340px);
  margin-inline: auto;
}

.prep-deck-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.prep-deck-slot figcaption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: #334155;
}

.prep-slot-qty {
  font-weight: 900;
  color: #0369a1;
}

.prep-swap-btn {
  padding: 2px 9px !important;
  min-height: 26px !important;
  font-size: 11.5px;
}

/* Bottom Full-Width Trainer Roster + Primary CTA */
.prep-bottom-dock {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px clamp(18px, 2.6vw, 36px) 16px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -10px 30px -18px rgba(15, 23, 42, 0.1);
}

.prep-bottom-dock .prep-portraits {
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(19, minmax(0, 1fr));
  gap: 5px;
  padding: 2px 0;
  overflow: visible;
}

.prep-bottom-dock .prep-portraits .prep-portrait {
  min-width: 0;
  flex: none;
  padding: 5px 2px;
  font-size: 10.5px;
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  border-radius: 10px;
}

.prep-bottom-dock .prep-portrait img,
.prep-bottom-dock .prep-portrait b {
  width: 32px;
  height: 36px;
}

.prep-bottom-dock .prep-portrait span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.collection-ui.expedition-prep .prep-confirm-cta,
.collection-ui.expedition-prep .prep-footer .prep-primary:not(:disabled) {
  flex: none;
  padding: 12px 24px !important;
  border-radius: 13px !important;
  border: 0 !important;
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%) !important;
  color: #ffffff !important;
  font-size: 15px !important;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 10px 24px -8px rgba(37, 99, 235, 0.48) !important;
}

.collection-ui.expedition-prep .prep-confirm-cta:hover:not(:disabled),
.collection-ui.expedition-prep .prep-footer .prep-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #0284c7 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 14px 28px -8px rgba(37, 99, 235, 0.6) !important;
}

/* ============================================================================
   2. SHARED PREP COMPONENTS + DAILY / CUSTOM LIGHT-MODE SHELLS
   ============================================================================ */
.collection-ui.expedition-prep .dex-detail-bar {
  background: rgba(255, 255, 255, 0.96) !important;
  border-bottom: 1px solid #f1f5f9 !important;
  box-shadow: none !important;
}

.collection-ui.expedition-prep .dex-detail-bar h1 {
  color: #0f172a !important;
  font-weight: 900;
}

.collection-ui.expedition-prep .prep-scroll {
  background: #ffffff !important;
  scrollbar-color: #cbd5e1 #ffffff;
}

.prep-content {
  display: grid;
  gap: clamp(14px, 2.2vw, 24px);
  padding-block: clamp(16px, 3vh, 30px);
}

.prep-content h2, .prep-content h3, .prep-content p { margin: 0; }
.prep-content h2 { font-size: 1.45em; font-weight: 900; color: #0f172a; }
.prep-content h3 { font-size: 1.12em; font-weight: 800; color: #0369a1; }

.prep-panel {
  padding: clamp(16px, 2.2vw, 26px);
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #ffffff;
  box-shadow:
    0 18px 44px -18px rgba(15, 23, 42, 0.11),
    0 4px 12px -4px rgba(15, 23, 42, 0.05);
}

.prep-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  font-weight: 800;
  font-size: 13.5px;
}

.prep-stats span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #b45309;
}

.prep-stats span:first-child {
  color: #e11d48;
}

.prep-stats img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  image-rendering: pixelated;
}

.prep-item {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.prep-item img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.prep-item strong {
  color: #0f172a;
  display: block;
  margin-bottom: 2px;
  font-weight: 800;
}

.prep-item p, .prep-supplies {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #475569;
}

.prep-supplies, .prep-supplies span {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.prep-supplies { gap: 8px; font-size: .88em; }
.prep-supplies img { width: 18px; height: 18px; object-fit: contain; image-rendering: pixelated; }

.prep-ascension {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.prep-ascension .collection-control {
  justify-content: center;
  min-width: 36px;
  padding: 6px 8px;
  font-size: 1.25em;
}

.prep-asc-copy {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.prep-asc-copy p {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: #475569;
}

.prep-asc-copy small {
  color: #64748b;
  font-size: 11px;
}

.prep-level {
  margin-right: 4px;
  color: #0369a1;
  font: 800 1.25em/1 var(--font-ptcg-num);
}

.prep-portraits {
  display: flex;
  overflow: auto;
  gap: 6px;
  padding: 3px 3px 8px;
  scrollbar-color: #cbd5e1 #ffffff;
}

.prep-portraits .prep-portrait {
  display: grid;
  place-items: center;
  flex: 0 0 60px;
  padding: 4px 3px;
  gap: 1px;
  text-align: center;
  white-space: nowrap;
  font-size: 11px;
}

.prep-portrait img, .prep-portrait b {
  width: 37px;
  height: 42px;
  object-fit: contain;
  image-rendering: pixelated;
  text-align: center;
}

.prep-portrait b { font-size: 22px; line-height: 36px; color: #94a3b8; }
.prep-portrait small { font-size: 8.5px; color: #64748b; }

.prep-card-preview {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
}

.prep-card-preview figcaption, .prep-deck-grid figcaption {
  text-align: center;
  color: #475569;
  font-size: .88em;
  font-weight: 700;
}

#app .expedition-prep .poke-card.prep-real-card {
  width: min(100%, var(--prep-card-width, 138px)) !important;
  height: auto !important;
  aspect-ratio: .718;
  margin: 0 !important;
}

#app .expedition-prep-standard .prep-right-col .poke-card.prep-real-card {
  width: min(100%, clamp(96px, 9.6vw, 140px)) !important;
}

.prep-columns { grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); align-items: start; }
.prep-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.prep-side .prep-card-preview { --prep-card-width: 157px; }
.prep-daily-details { display: grid; gap: 16px; }

.prep-daily-date {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.prep-daily-date time { color: #0369a1; font-weight: 800; }
.prep-daily-date strong { color: #0f172a; font-variant-numeric: tabular-nums; }

.prep-daily-trainer {
  display: flex;
  align-items: center;
  gap: 14px;
}

.prep-daily-trainer > img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  image-rendering: pixelated;
}

.prep-daily-trainer code {
  padding: 2px 7px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #0369a1;
  font-weight: 800;
}

.prep-record p { margin-top: 6px; color: #475569; }
.prep-record .prep-score strong {
  font: 800 2em/1 var(--font-ptcg-num);
  color: #0284c7;
}

.prep-mod-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }

.prep-modifier {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 9px 12px;
  background: #f8fafc;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.prep-modifier img { width: 30px; height: 30px; object-fit: contain; image-rendering: pixelated; }
.prep-modifier strong, .prep-modifier small { display: block; }
.prep-modifier strong { color: #0f172a; font-weight: 800; }
.prep-modifier small { color: #475569; font-size: .92em; margin-top: 2px; }
label.prep-modifier { cursor: pointer; }
label.prep-modifier:hover { border-color: #7dd3fc; background: #f0f9ff; }
.prep-modifier input { flex: none; margin: 4px 0 0; accent-color: #0284c7; }
.prep-modifier:has(input:checked) { border-color: #0ea5e9; background: #eff6ff; }

.prep-rules-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.prep-rules-head p { color: #64748b; }
.prep-rules-head .collection-control { flex: none; }

.prep-custom-config { display: grid; gap: 14px; }
.prep-custom-identity { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, .8fr); align-items: center; gap: 14px; }
.prep-custom-identity label { display: block; margin-top: 10px; font-weight: 800; color: #334155; font-size: 13px; }
.prep-custom-identity input {
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  margin-top: 5px;
  padding: 6px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  font: inherit;
}
.prep-custom-identity input:focus {
  outline: 2px solid #0ea5e9;
  border-color: #0ea5e9;
  background: #ffffff;
}
.prep-custom-identity .prep-card-preview { --prep-card-width: 113px; }
.prep-notice { color: #dc2626; font-weight: 700; }

.prep-footer {
  border-top: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.96);
}

.prep-footer > div {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px 20px;
  padding-block: 10px;
}

.prep-footer p { margin: 0 auto 0 0; color: #64748b; }
.prep-footer .prep-primary { flex: none; }

@media (min-width: 571px) {
  [data-prep="custom"] .prep-scroll { overflow: hidden; }
  [data-prep="custom"] .prep-content { height: 100%; grid-template-rows: minmax(0, 1fr); }
  .prep-custom-config, .prep-custom-rules { max-height: 100%; overflow: auto; scrollbar-color: #cbd5e1 #ffffff; }
}

@media (max-width: 730px) {
  .prep-standard-stage { grid-template-columns: minmax(190px, 1.2fr) minmax(100px, .56fr); }
  .prep-stage-art { inset-inline: 28% 10%; opacity: .6; }
  .prep-standard-stage .prep-card-preview { grid-column: 2; }
}

@media (max-width: 570px) {
  .prep-columns { grid-template-columns: minmax(0, 1fr); }
  .prep-standard-stage { grid-template-columns: minmax(0, 1fr) minmax(90px, .55fr); gap: 8px; }
  .prep-footer > div { flex-wrap: wrap; }
}

@media (max-height: 470px) {
  .prep-standard-stage { min-height: 0; }
  .prep-standard-stage .prep-card-preview { --prep-card-width: 103px; }
  .prep-footer > div { padding-block: 4px; }
  .prep-custom-identity .prep-card-preview { --prep-card-width: 74px; }
  .prep-custom-config, .prep-custom-rules { padding: 10px; }
  .prep-asc-copy { padding: 6px 8px; }
}
