/* Arena & Monsters */

.arena-tag {
  font-size: 11px;
  color: var(--frost);
  margin-bottom: 12px;
}

/* ==========================================================================
   Arena Card Gradient Styling (Matches Quest Board look)
   ========================================================================== */

.arena-scene.arena-card {
  /* Use --scene-from and --scene-to inline variables passed by JS */
  background: linear-gradient(
    160deg,
    var(--scene-from, #3a2c14) 0%,
    var(--scene-to, #7a5a2a) 100%
  ) !important;
  
  border: 1px solid var(--border);
  border-bottom: 2px solid var(--gold-dim);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.5);
  padding: 12px 14px;
}

/* Semi-transparent telegraph box over the rich colored gradient */
.arena-scene .telegraph-banner {
  background: rgba(10, 10, 10, 0.45);
  backdrop-filter: blur(2px);
  border-left: 4px solid var(--gold);
  margin-top: 10px;
}

.monster-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.monster-head .micon {
  font-size: 44px;
}

.monster-head .mname {
  font-family: var(--font-display);
  font-size: 22px;
}

.monster-head .mtag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--blood);
  border: 1px solid var(--blood-dim);
  border-radius: 3px;
  padding: 2px 6px;
  margin-left: 8px;
  vertical-align: middle;
}

/* Encounter Overlay */

.encounter-icon {
  font-size: 48px;
  text-align: center;
  margin: 12px 0;
}

.encounter-text {
  text-align: center;
  line-height: 1.6;
  margin: 18px 0;
}

.encounter-info {
  margin: 16px 0;
  padding: 12px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-dim);
}

/* ==========================================================================
   Monster Telegraph 
   ========================================================================== */

.telegraph-banner {
  background: linear-gradient(90deg, #261a1a 0%, #1a1614 100%);
  border: 1px solid var(--blood-dim);
  border-left: 4px solid var(--gold); /* Heavy warning accent on the left */
  border-radius: 0;
  padding: 10px 14px;
  margin: 12px 0;
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
}

.telegraph-banner .tt-label {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  font-family: var(--font-display);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 0 6px rgba(199, 154, 60, 0.4);
}

/* ==========================================================================
   Enhanced Status Bars & Gauges
   ========================================================================== */

.barwrap {
  position: relative;
  overflow: hidden;
  height: 12px;
  background: #080a09; /* Deep cavern black */
  border: 1px solid var(--border);
  border-radius: 0; /* Kill rounded edges */
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.9); /* Inset depth shadow */

  /* GAME TRICK: Angled clip on the container end */
  clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}

.barfill {
  height: 100%;
  transition: width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
}

/* Add a diagonal light gloss across all fills */
.barfill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.2) 0%,
    transparent 50%,
    rgba(0, 0, 0, 0.4) 100%
  );
  pointer-events: none;
}

/* Health Bar: Deep Blood Red Gradient */
.barfill.hp {
  background: linear-gradient(90deg, var(--blood-dim) 0%, var(--blood) 100%);
  box-shadow: 0 0 8px rgba(162, 59, 46, 0.6);
}

/* Stamina Bar: Vibrant Moss/Emerald */
.barfill.stam {
  background: linear-gradient(90deg, var(--moss-dim) 0%, var(--moss) 100%);
  box-shadow: 0 0 8px rgba(122, 154, 110, 0.4);
}

.barfill.part {
  background: linear-gradient(90deg, var(--gold-dim) 0%, var(--gold) 100%);
}

.barfill.broken {
  background: #2a2a2a;
}

.barlabel {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
  font-size: 11px;
  font-family: var(--font-display);
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

/* Monster Parts Grid */

.parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.part-card {
  position: relative;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 0;
}

.part-card.broken {
  opacity: 1; /* Keep fully visible! */
  background: linear-gradient(
    180deg,
    rgba(162, 59, 46, 0.2) 0%,
    var(--panel-alt) 100%
  );

  /* Red shattered outline to signify weakpoint / open flesh */
  border: 1px solid var(--blood);
  border-left: 3px solid var(--blood);
  box-shadow:
    inset 0 0 12px rgba(162, 59, 46, 0.3),
    0 0 8px rgba(162, 59, 46, 0.2);
}

.part-card.broken .pname {
  color: #ff6b52; /* Bright crimson title */
  font-weight: bold;
}

.part-card .pname {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  letter-spacing: 0.5px;
}

.part-tag {
  padding: 1px 5px;
  border-radius: 2px;
  font-size: 9px;
  letter-spacing: 0.5px;
}

.part-tag.exposed {
  background: var(--gold-dim);
  color: #1a1408;
}

.part-tag.spent {
  background: var(--blood);
  color: #ffffff;
  font-weight: bold;
  border: 1px solid var(--gold);
  text-shadow: 0 1px 2px #000;
  box-shadow: 0 0 6px rgba(162, 59, 46, 0.5);
}
.part-tag.armored {
  background: #3a2a1a;
  color: var(--frost);
  border: 1px solid var(--frost);
}

.hint-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.hint-chip {
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 9px;
  color: var(--text-dim);
}

/* Player Status */

.player-status {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 14px 0;
}

.player-status .col {
  flex: 1;
  min-width: 180px;
}

/* Actions */

.action-group-label {
  margin: 10px 0 4px;
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 6px;
}

/* ==========================================================================
   Combat Log (Game Style)
   ========================================================================== */

.log {
  height: 190px;
  overflow-y: auto;
  padding: 12px 14px;
  background: #0a0d0c;

  /* Double border trick for a carved recessed frame */
  border: 1px solid var(--border);
  outline: 1px solid #000;
  outline-offset: -2px;
  border-radius: 0;

  font-family: var(--font-mono); /* Keeping mono for clean combat readouts */
  font-size: 11px;
  line-height: 1.7;

  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8);
}

/* Custom Themed Scrollbar */
.log::-webkit-scrollbar {
  width: 6px;
}

.log::-webkit-scrollbar-track {
  background: #080a09;
  border-left: 1px solid var(--border);
}

.log::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 0;
}

.log::-webkit-scrollbar-thumb:hover {
  background: var(--gold-dim);
}

.log div {
  margin-bottom: 3px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 2px;
}

/* Regular Hit */
.log .l-hit {
  color: var(--text);
}

/* Critical Hits / Big Wins */
.log .l-crit {
  color: var(--gold);
  font-weight: bold;
  text-shadow: 0 0 6px rgba(199, 154, 60, 0.4);
}

/* Damage Dealt or Taken */
.log .l-dmg {
  color: #e05244; /* Brighter blood red so it stands out */
  font-weight: bold;
}

/* System Messages / Fluff Text */
.log .l-sys {
  color: var(--text-dim);
  font-style: italic;
  opacity: 0.8;
}

/* Part Break / Armor Shatter - Massive Event Feel */
.log .l-break {
  color: var(--gold);
  font-weight: bold;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(199, 154, 60, 0.1);
  padding: 1px 4px;
  border-left: 2px solid var(--gold);
}

/* Incoming Boss Telegraph / Warning */
.log .l-telegraph {
  color: var(--frost);
  font-style: italic;
}

/* Positive Buffs / Healing / Parries */
.log .l-good {
  color: var(--moss);
  font-weight: bold;
}

/* Loot Overlay */

.overlay {
  position: relative;
  margin-top: 14px;
  padding: 16px;
  background: var(--panel-alt);
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
}

.overlay h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  color: var(--gold);
}

.loot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.loot-item {
  padding: 6px 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 12px;
}

/* Move Select */

.move-select {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 8px 0 4px;
}

.move-pick {
  text-align: left;
  padding: 8px 10px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.move-pick:hover {
  border-color: var(--gold-dim);
}

.move-pick.selected {
  background: #26201a;
  border-color: var(--gold);
}

.move-name {
  font-size: 13px;
  letter-spacing: 0.5px;
  color: var(--text);
}

.move-pick.selected .move-name {
  color: var(--gold);
}

.move-desc {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-dim);
}

.move-cost {
  margin-top: 5px;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--moss);
}

.arena-scene {
  --scene-from: #20201c;
  --scene-to: var(--panel-alt);
  background: linear-gradient(
    160deg,
    var(--scene-from) 0%,
    var(--scene-to) 70%
  );
  padding: 14px 14px 10px;
  margin: -1px -1px 14px;
  border-radius: 4px 4px 0 0;
  border-bottom: 1px solid var(--border);
}

.arena-scene .telegraph-banner {
  background: rgba(10, 10, 10, 0.35);
}

/* Part Icon Strip (choose a part to strike)
   Reuses the .icon-strip layout convention from the Forge sub-tabs;
   .hunt-part-icon is the hunt-specific icon variant, same idea as
   .gear-icon there. Worth unifying naming once the .armor-* -> .gear-*
   rename pass happens. */

.hunt-icon-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin: 8px 0 14px;
}

.hunt-part-icon {
  flex: 0 0 auto;
  min-width: 100px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.hunt-part-icon:hover {
  border-color: var(--gold-dim);
}

.hunt-part-icon.selected {
  background: #26201a;
  border-color: var(--gold);
}

.hunt-part-icon.broken {
  border-left: 3px solid var(--blood);
}

.hunt-part-icon-name {
  font-size: 12px;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.barwrap.mini {
  height: 6px;
}

/* Part Detail Panel
   Opens below the icon strip once a part is selected; shows the sprite
   placeholder, full status, hitzone hints, and the move list scoped to
   that part. Clicking a move fires the attack directly — no separate
   "confirm" step. */

/* ==========================================================================
   Append to combat.css (or wherever expedition/village visuals live) —
   Expedition trail strip placeholder
   ========================================================================== */

.expedition-trail {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  padding: 10px 4px;
  overflow-x: auto;
}

.trail-node {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  font-size: 15px;
  opacity: 0.55;
}

.trail-node.done {
  opacity: 0.4;
  border-color: var(--moss-dim);
  background: rgba(122, 154, 110, 0.12);
}

.trail-node.current {
  opacity: 1;
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(199, 154, 60, 0.5);
  transform: scale(1.15);
}

.trail-node.upcoming {
  opacity: 0.55;
}

.trail-node.boss {
  border-color: var(--blood);
}

.trail-node.boss.current {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(162, 59, 46, 0.6);
}

.trail-line {
  flex: 1 1 16px;
  min-width: 10px;
  height: 2px;
  background: var(--border);
  margin: 0 2px;
}

/* ==========================================================================
   1280x720 Fixed Viewport Layout for Hunt Screen
   ========================================================================== */

#hunt-screen {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* Master 2-Column Grid Layout */
.hunt-grid-layout {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 12px;
  height: 100%;
  box-sizing: border-box;
}

/* Left Column: Monster Visuals, Player Stats & Defense */
.hunt-col-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  min-height: 0;
}

/* Right Column: Part Targeting, Move Execution & Combat Log */
.hunt-col-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  min-height: 0;
}

/* Modular Panels inside the Columns */
.hunt-panel {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  outline: 1px solid rgba(0, 0, 0, 0.8);
  outline-offset: -3px;
  padding: 10px 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.arena-card {
  border-radius: 0;
  margin: 0;
}

.player-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Grid layout for Dodge and Defense buttons */
.actions.dodge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.actions.util-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

/* Targeting & Moves Layout */
.targeting-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.move-select-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  max-height: 130px;
  overflow-y: auto;
  padding-right: 4px;
}

.move-select-grid::-webkit-scrollbar {
  width: 4px;
}
.move-select-grid::-webkit-scrollbar-thumb {
  background: var(--border);
}

/* Log Container with Header Bar */
.log-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; /* Crucial for internal scrolling flexbox */
  padding: 8px 12px;
}

.loadout-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-dim);
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.loadout-bar strong {
  color: var(--gold);
}

/* Override combat log fixed height to fit flexbox nicely */
.log-card .log {
  flex: 1;
  height: 100% !important;
  margin: 0;
}

/* ==========================================================================
   Centered Modal Overlay for End Hunt (Victory/Defeat)
   ========================================================================== */

.hunt-grid-layout {
  position: relative; /* Container reference for absolute modal placement */
}

.hunt-overlay-modal {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: rgba(8, 10, 9, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease-out;
}

.hunt-overlay-card {
  width: 440px;
  background: var(--panel-alt);
  border: 1px solid var(--gold);
  outline: 1px solid rgba(0, 0, 0, 0.9);
  outline-offset: -4px;
  padding: 24px;
  text-align: center;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.9),
    inset 0 0 15px rgba(0, 0, 0, 0.6);
}

.overlay-title {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 2px;
  margin: 0 0 10px 0;
}

.overlay-title.victory {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(199, 154, 60, 0.5);
}

.overlay-title.defeat {
  color: var(--blood);
  text-shadow: 0 0 10px rgba(162, 59, 46, 0.5);
}

.overlay-sub {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.overlay-actions {
  display: flex;
  justify-content: center;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.hunt-overlay-card .loot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
  margin: 8px 0;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.hunt-overlay-card .loot-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  font-size: 11px;
}

.loot-qty {
  color: var(--gold);
  font-weight: bold;
}

/* Add to combat.css */
button:disabled,
button[disabled],
.gear-icon:disabled,
.move-pick:disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  filter: grayscale(80%);
}

@keyframes telegraphGlow {
  0% { border-color: var(--border); box-shadow: 0 0 0px transparent; }
  50% { border-color: var(--gold); box-shadow: 0 0 8px var(--gold); }
  100% { border-color: var(--border); box-shadow: 0 0 0px transparent; }
}

.timing-bar-container.telegraphing {
  animation: telegraphGlow 0.5s ease-in-out infinite;
}

.timing-bar-container.delay-phase #offset-zone {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
}

/* Hidden by default */
#offset-zone {
  display: none;
}

/* Revealed only when timing starts */
.timing-bar-container.running #offset-zone {
  display: block;
}