/* =========================================================================
   The Wizengamot Oath v4.0 — Interactive Gameplay Systems & Mini-Games CSS
   (Evidence Satchel, Revelio Cipher, Astrolabe Seal, Stealth, Cross-Exam, QTE)
   ========================================================================= */

/* HUD RPG Status Chips */
.hud-rpg-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.rpg-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(14, 11, 22, 0.86);
  border: 1px solid rgba(214, 178, 110, 0.45);
  color: #f3e4c2;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rpg-pill:hover {
  border-color: var(--brass-bright);
  background: rgba(122, 28, 38, 0.55);
}

.rpg-pill.hours { border-color: rgba(124, 201, 255, 0.55); color: #cdeeff; cursor: default; }
.rpg-pill.shields { border-color: rgba(110, 231, 183, 0.5); color: #d1fae5; cursor: default; }

/* Unified Gameplay Overlay Container inside Stage Frame */
.gameplay-overlay {
  position: absolute;
  inset: 0;
  z-index: 22;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 58px 20px 18px;
  background: radial-gradient(circle at center, rgba(10, 8, 16, 0.25) 0%, rgba(8, 6, 14, 0.72) 100%);
  backdrop-filter: blur(2px);
  animation: fadeInOverlay 0.3s ease;
}
.gameplay-overlay.cinema-strip {
  padding: 0 18px 14px;
  background: linear-gradient(180deg, transparent 0%, transparent 56%, rgba(8, 6, 14, 0.88) 100%);
  backdrop-filter: none;
  pointer-events: none;
}
.gameplay-overlay.cinema-strip .gp-card {
  pointer-events: auto;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(14, 11, 22, 0.78), rgba(9, 7, 15, 0.92));
  border-color: rgba(214, 178, 110, 0.55);
}
.gameplay-overlay.cinema-strip .testimony-quote {
  padding: 6px 11px;
  margin-bottom: 8px;
  background: rgba(14, 10, 20, 0.58);
}
.gameplay-overlay.hidden { display: none; }

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

.gp-card {
  width: 100%;
  max-width: 820px;
  background: linear-gradient(180deg, rgba(20, 16, 28, 0.94), rgba(11, 9, 18, 0.96));
  border: 1.5px solid rgba(214, 178, 110, 0.65);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(245, 222, 168, 0.2);
  color: #f4ead4;
}

.gp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(214, 178, 110, 0.22);
}

.gp-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(138, 30, 42, 0.55);
  border: 1px solid var(--brass);
  color: var(--brass-bright);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.gp-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--brass-bright);
}

.gp-sub {
  margin: 4px 0 12px;
  font-size: 12.5px;
  color: #d6c8ad;
  line-height: 1.45;
}

/* Mini-Game #1: Revelio Parchment Cipher */
.revelio-board {
  position: relative;
  width: 100%;
  height: 190px;
  border-radius: 8px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(190, 146, 86, 0.28), rgba(44, 29, 18, 0.94)),
    repeating-linear-gradient(0deg, rgba(255, 232, 180, 0.03) 0px, rgba(255, 232, 180, 0.03) 2px, transparent 2px, transparent 16px);
  border: 1px solid rgba(214, 178, 110, 0.48);
  cursor: crosshair;
  margin-bottom: 12px;
}

.revelio-light {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 236, 175, 0.42) 0%, rgba(255, 180, 90, 0.14) 48%, transparent 72%);
  mix-blend-mode: screen;
}

.revelio-spot {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px dashed rgba(255, 198, 118, 0.45);
  background: rgba(34, 18, 14, 0.65);
  color: rgba(255, 224, 168, 0.78);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
}

.revelio-spot:hover, .revelio-spot.near {
  border-style: solid;
  border-color: #ffdf8c;
  background: rgba(145, 28, 38, 0.82);
  color: #fff5d8;
  box-shadow: 0 0 22px rgba(255, 120, 90, 0.8);
  transform: translate(-50%, -50%) scale(1.08);
}

.revelio-spot.found {
  border-style: solid;
  border-color: #6ee7b7;
  background: rgba(18, 84, 56, 0.92);
  color: #d1fae5;
  box-shadow: 0 0 18px rgba(110, 231, 183, 0.6);
}

.revelio-log {
  font-size: 12px;
  color: #f3dfb8;
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid var(--brass);
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  min-height: 36px;
}

/* Mini-Game #2: Astrolabe Star-Ring Lock */
.astrolabe-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
}

.astrolabe-dial {
  position: relative;
  width: 176px;
  height: 176px;
  flex-shrink: 0;
  margin: 0 auto;
}

.astro-apex {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  color: #ffe396;
  font-size: 14px;
  text-shadow: 0 0 10px #ffe396;
  z-index: 5;
}

.astro-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 3px solid rgba(214, 178, 110, 0.55);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s ease;
  cursor: pointer;
}

.astro-ring.aligned {
  border-color: #6ee7b7;
  box-shadow: 0 0 18px rgba(110, 231, 183, 0.55);
}

.astro-ring .ring-gem {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffe396;
  box-shadow: 0 0 12px #ffe396;
}

.astro-ring.aligned .ring-gem {
  background: #6ee7b7;
  box-shadow: 0 0 14px #6ee7b7;
}

.astro-ring.r0 { width: 164px; height: 164px; margin: -82px 0 0 -82px; }
.astro-ring.r1 { width: 116px; height: 116px; margin: -58px 0 0 -58px; }
.astro-ring.r2 { width: 68px; height: 68px; margin: -34px 0 0 -34px; }

.astro-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50%;
  background: radial-gradient(circle, #3366aa, #122444);
  border: 1.5px solid #9bd4ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.astro-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Mini-Game #3 & #4: Cross-Examination & Stealth Bars */
.meter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.meter-block {
  flex: 1;
}

.meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #d9cbb0;
  margin-bottom: 4px;
}

.meter-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}

.meter-fill.gold { background: linear-gradient(90deg, #b88435, #ffe294); }
.meter-fill.danger { background: linear-gradient(90deg, #a62424, #ff6b6b); }
.meter-fill.emerald { background: linear-gradient(90deg, #1b7f5a, #6ee7b7); }

.testimony-quote {
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(122, 28, 38, 0.24);
  border: 1px solid rgba(245, 180, 120, 0.35);
  margin-bottom: 10px;
}

.testimony-en {
  font-family: var(--font-serif);
  font-size: 14px;
  color: #fff3d6;
  margin-bottom: 3px;
}

.testimony-zh {
  font-size: 12px;
  color: #d8c8aa;
}

.gp-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.gp-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 9px 13px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(214, 178, 110, 0.42);
  color: #f7ebd2;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.gp-btn:hover {
  background: rgba(138, 30, 42, 0.45);
  border-color: var(--brass-bright);
  transform: translateY(-1px);
}

.gp-btn.primary {
  background: linear-gradient(135deg, rgba(138, 30, 42, 0.72), rgba(74, 16, 26, 0.88));
  border-color: var(--brass-bright);
}

.gp-btn.clue-btn {
  background: rgba(24, 54, 92, 0.55);
  border-color: rgba(143, 211, 255, 0.65);
}

.gp-btn.clue-btn:hover {
  background: rgba(36, 84, 138, 0.8);
  border-color: #b7e4ff;
}

.gp-btn small {
  font-size: 10.5px;
  font-weight: 400;
  color: #cbbda2;
}

/* Mini-Game #4: Live Expelliarmus Spell-Trace QTE */
.qte-arena {
  position: relative;
  width: 100%;
  height: 175px;
  border-radius: 10px;
  background: radial-gradient(circle at center, rgba(120, 26, 36, 0.35), rgba(10, 8, 18, 0.85));
  border: 1.5px solid rgba(255, 212, 128, 0.55);
  margin-bottom: 10px;
  overflow: hidden;
}

.qte-rune-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(180, 44, 52, 0.92), rgba(62, 14, 22, 0.96));
  border: 2px solid var(--brass-bright);
  color: #fff6dc;
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px rgba(255, 216, 128, 0.65);
  transition: transform 0.15s ease, opacity 0.2s ease;
}

.qte-rune-node.next {
  animation: qtePulse 0.75s ease-in-out infinite;
  border-color: #fff1b8;
  box-shadow: 0 0 32px rgba(255, 226, 130, 0.98);
}

.qte-rune-node.hit {
  background: radial-gradient(circle, #1f8a62, #0d3f2c);
  border-color: #6ee7b7;
  box-shadow: 0 0 20px rgba(110, 231, 183, 0.8);
  pointer-events: none;
}

@keyframes qtePulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.14); }
}

/* Evidence Satchel Dialog */
.dialog-satchel {
  max-width: 640px;
  width: 92vw;
}

.satchel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.satchel-item {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(214, 178, 110, 0.32);
}

.satchel-item.locked {
  opacity: 0.45;
  border-style: dashed;
}

.satchel-item-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--brass-bright);
  margin-bottom: 4px;
}

.satchel-item-desc {
  font-size: 11.5px;
  color: #cfc3ab;
  line-height: 1.4;
}

/* =========================================================================
   v5.0 Additions: Companion Portrait Dialogues, Spell-Clash Duel & Open Endings
   ========================================================================= */

.gp-portrait-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.gp-avatar {
  width: 78px;
  height: 78px;
  border-radius: 12px;
  object-fit: cover;
  object-position: center top;
  border: 2px solid var(--brass-bright);
  box-shadow: 0 0 20px rgba(245, 222, 168, 0.45);
  flex-shrink: 0;
}

.gp-avatar.ghost { border-color: #9de8ff; box-shadow: 0 0 22px rgba(130, 225, 255, 0.65); }
.gp-avatar.elf { border-color: #6ee7b7; box-shadow: 0 0 20px rgba(110, 231, 183, 0.55); }
.gp-avatar.giant { border-color: #f5b971; box-shadow: 0 0 20px rgba(245, 185, 113, 0.55); }

.gp-speaker-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.gp-speaker-name {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--brass-bright);
}

.gp-race-pill {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(90, 62, 130, 0.55);
  border: 1px solid rgba(190, 160, 255, 0.55);
  color: #efe2ff;
}

.gp-bond-pill {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(168, 34, 62, 0.55);
  border: 1px solid rgba(255, 150, 175, 0.65);
  color: #ffe2ea;
}

/* Spell-Clash Duel Arena (Over S_duel_clash.mp4 POV!) */
.duel-clash-bar {
  position: relative;
  width: 100%;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, #b91c1c 0%, #f59e0b 45%, #10b981 55%, #047857 100%);
  border: 1.5px solid rgba(255, 230, 160, 0.75);
  margin: 8px 0 12px;
  overflow: visible;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.45);
}

.duel-clash-fill-left {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 999px 0 0 999px;
  background: linear-gradient(90deg, #dc2626, #fbbf24);
  transition: width 0.2s ease-out;
}

.duel-clash-orb {
  position: absolute;
  top: 50%;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, #ffffff 10%, #fde68a 45%, #f59e0b 100%);
  box-shadow: 0 0 28px #fde68a, 0 0 12px #ffffff;
  transition: left 0.2s ease-out;
  z-index: 3;
}

.duel-telegraph {
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  background: rgba(20, 45, 36, 0.72);
  border: 1px solid rgba(110, 231, 183, 0.45);
  color: #d1fae5;
  transition: all 0.2s ease;
}

.duel-telegraph.danger {
  background: rgba(168, 22, 34, 0.86);
  border-color: #ff8a8a;
  color: #fff0f0;
  animation: qtePulse 0.6s ease-in-out infinite;
}

.spell-deck {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.spell-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3px;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1.5px solid rgba(214, 178, 110, 0.55);
  background: rgba(18, 14, 28, 0.9);
  color: #fff4d8;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.spell-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--brass-bright);
  box-shadow: 0 0 18px rgba(245, 222, 168, 0.55);
}

.spell-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.spell-btn.protego { border-color: #60a5fa; background: rgba(22, 46, 88, 0.85); }
.spell-btn.expelliarmus { border-color: #fbbf24; background: rgba(124, 28, 34, 0.85); }
.spell-btn.incendio { border-color: #fb923c; background: rgba(120, 44, 18, 0.85); }
.spell-btn.patronus { border-color: #9de8ff; background: linear-gradient(135deg, rgba(28, 72, 116, 0.92), rgba(76, 140, 198, 0.85)); }

.spell-btn small {
  font-size: 10px;
  font-weight: 400;
  color: #d8ccb4;
}

/* Companion Bonds Dialog */
.bonds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.bond-card {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(214, 178, 110, 0.35);
}

.bond-card img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  object-position: center top;
  border: 1px solid var(--brass);
}

.open-epilogue-box {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(122, 28, 38, 0.22);
  border: 1px dashed rgba(245, 222, 168, 0.55);
  text-align: left;
}
