/* Approved Image 2.5 concept C. Original raster bevels + live HTML gauges/text.
   All positions are proportions of the same 949 x 956 instrument, not a bitmap HUD. */
#app .lake-shell { --fight-width: clamp(320px, 28vw, 380px); }
#app #fight-panel {
  position: absolute;
  z-index: 7;
  top: auto;
  left: auto;
  right: calc(var(--hud-gutter) + var(--reel-size) + 18px);
  bottom: var(--hud-bottom);
  width: var(--fight-width);
  height: auto;
  aspect-ratio: 949 / 956;
  padding: 0;
  border: 0;
  border-image: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
  transform: none;
  filter: drop-shadow(0 5px 5px #03334655);
  color: #fff9de;
  font-family: var(--font), sans-serif;
  font-weight: 800;
  text-shadow: 0 1px 1px #00394f, 0 2px 2px #00354f80;
  container-type: inline-size;
  isolation: isolate;
}
#app #fight-panel[hidden] { display: none; }
#app #fight-panel::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 82.32%;
  background: url('./assets/ui/fight-shell-v23.webp') center / 100% 100% no-repeat;
  pointer-events: none;
  z-index: -1;
}
#app #fight-panel::after { content: none; }
#app #fight-panel .fight-face {
  position: absolute;
  left: 8.3%;
  right: 7.7%;
  top: 6.7%;
  height: 65.6%;
  display: grid;
  grid-template-rows: 8.6fr 14fr 30.5fr 10.4fr 11.5fr 10.6fr 10.6fr;
  gap: 1.1%;
  min-width: 0;
}
#app #fight-panel .fight-face > * { min-height: 0; min-width: 0; box-sizing: border-box; }
#app #fight-panel .fight-icon {
  display: inline-block;
  flex: 0 0 auto;
  width: 6.1cqw;
  height: 6.1cqw;
  background: url('./assets/ui/fight-icons-v23.webp') 0 50% / 600% 100% no-repeat;
  filter: drop-shadow(0 1px 1px #002c4a88);
}
#app #fight-panel .fight-icon-rod { background-position-x: 0%; }
#app #fight-panel .fight-icon-tension { background-position-x: 20%; }
#app #fight-panel .fight-icon-hook { background-position-x: 40%; }
#app #fight-panel .fight-icon-fish { background-position-x: 60%; }
#app #fight-panel .fight-icon-feedback { background-position-x: 80%; }
#app #fight-panel .fight-icon-stamina { background-position-x: 100%; }
#app #fight-panel .fight-profile-slot {
  display: flex;
  align-items: center;
  justify-self: start;
  max-width: 100%;
  gap: 1.4cqw;
  padding: 0 2.2cqw 0 1.8cqw;
  border-radius: 3cqw 4cqw 4cqw 1.6cqw;
  background: linear-gradient(110deg, #035875bb, #006583d9);
  box-shadow: inset 0 -1px 0 #39c5dfa0;
}
#app #fight-panel .fight-profile {
  display: block;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: max(9px, 2.85cqw);
  line-height: 1.25;
  color: #f5fffc;
}
#app #fight-panel .fight-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1cqw;
  margin: 0;
  padding: 0 2.6cqw 1cqw 3.8cqw;
  border-radius: 7cqw 10cqw 0 0;
  background: linear-gradient(115deg, #05759545, #014a69a8);
  box-shadow: inset 0 1px 0 #75deed3d;
  font-size: 5.1cqw;
  line-height: 1.1;
}
#app #fight-panel .fight-top strong {
  font-family: var(--font), sans-serif;
  font-size: 7.5cqw;
  line-height: 1.1;
  font-weight: 900;
  white-space: nowrap;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 .45cqw .15cqw #063e53, 0 .7cqw 1cqw #00304570;
}
#app #fight-panel .fight-tension-card {
  display: grid;
  grid-template-rows: 30% 44% 26%;
  padding: 1.1cqw 2cqw .7cqw;
  border-radius: 4cqw 4cqw 3.5cqw 3.5cqw;
  background: linear-gradient(115deg, #006084, #034966ba);
  box-shadow: inset 0 .35cqw .3cqw #003a5366, inset 0 -.3cqw .3cqw #3ab0cda0;
}
#app #fight-panel .tension-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2cqw;
  margin: 0;
  padding: 0 1.4cqw 1cqw .5cqw;
  font-size: 3.8cqw;
  line-height: 1;
}
#app #fight-panel .tension-label > span { display: flex; align-items: center; gap: 1.7cqw; }
#app #fight-panel .tension-label b { font-size: 4cqw; font-weight: 900; font-variant-numeric: tabular-nums; }
#app #fight-panel .tension-track {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 0;
  border: 1.1cqw solid #006481;
  border-radius: 10cqw;
  background: linear-gradient(#003c52, #075c76 60%, #00516f);
  box-shadow: 0 0 0 .38cqw #003b54, 0 .4cqw .5cqw #012c43, inset 0 1cqw 1.1cqw #002b4570, inset 0 -.25cqw .4cqw #60e7f190;
  overflow: hidden;
}
#app #fight-panel .tension-track::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 .45cqw .35cqw #bdfaff6b, inset 0 -.5cqw .65cqw #00354f99;
  pointer-events: none;
  z-index: 4;
}
#app #fight-panel .safe-zone { left: 25%; width: 43%; background: #60f4d329; }
#app #fight-panel #tension-fill {
  position: relative;
  z-index: 1;
  height: 100%;
  border-radius: 7cqw;
  background: linear-gradient(#c6ffe2 1%, #7affc5 20%, #3ae1ad 67%, #41c7a3 91%);
  box-shadow: inset 0 1px 2px #e8fff4, 0 0 1.6cqw #28f5c733;
  transition: background .18s;
}
#app #fight-panel .danger-tick {
  z-index: 2;
  left: 92%;
  right: 0;
  border: 0;
  border-left: 1px solid #ffcfb595;
  border-radius: 0 7cqw 7cqw 0;
  background: linear-gradient(#ffb09a, #f97068 32%, #d23f41 83%, #9b253a);
}
#app #fight-panel .tension-needle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: clamp(.8%, var(--tension-position, 0%), 99.2%);
  width: 1.25cqw;
  border-radius: 2cqw;
  transform: translateX(-50%);
  z-index: 3;
  background: linear-gradient(90deg, #afd5c6, #fffde7 52%, #eeead0);
  box-shadow: 0 .3cqw .6cqw #003a458c;
}
#app #fight-panel .tension-scale {
  display: flex;
  position: relative;
  justify-content: space-between;
  align-items: center;
  margin: .5cqw .7cqw 0;
  color: #f5ffff;
  opacity: 1;
  font-size: max(8px, 2.55cqw);
  line-height: 1;
}
#app #fight-panel .safe-zone-label {
  position: absolute;
  left: 25%;
  width: 43%;
  top: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  border-left: .4cqw solid #79ffdf;
  border-right: .4cqw solid #79ffdf;
  border-radius: .4cqw;
  background: linear-gradient(#137285, #09938f);
  white-space: nowrap;
  font-size: max(7px, 2.35cqw);
}
#app #fight-panel .grip-row,
#app #fight-panel .stamina-row {
  display: flex;
  align-items: center;
  gap: 1.6cqw;
  margin: 0;
  padding: .4cqw 2.1cqw;
  border-radius: 5cqw;
  background: linear-gradient(100deg, #025878, #004661b0);
  box-shadow: inset 0 -1px 0 #40a4bd90;
  font-size: 3.45cqw;
  line-height: 1.15;
}
#app #fight-panel .grip-row > span:not(.fight-icon),
#app #fight-panel .stamina-row > span:not(.fight-icon) { flex: 0 0 auto; white-space: nowrap; }
#app #fight-panel .grip-row > div,
#app #fight-panel .stamina-row > div {
  flex: 1;
  min-width: 0;
  height: 3.5cqw;
  border: .35cqw solid #1383a0;
  border-radius: 6cqw;
  overflow: hidden;
  background: linear-gradient(#00374f, #045777);
  box-shadow: inset 0 .5cqw 1cqw #002838a3, 0 1px 0 #62c6cd40;
}
#app #fight-panel #grip-fill,
#app #fight-panel #stamina-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(#befff0, #3df4cd 30%, #22d6b5 76%, #72fce1);
  box-shadow: inset 0 1px 1px #fffda8a0, 1px 0 2px #00294d9a;
  transition: none;
}
#app #fight-panel .stamina-row { padding-left: 3.7cqw; }
#app #fight-panel #stamina-fill { background: linear-gradient(#fffbae, #ffeb48 30%, #ffd936 80%, #ffef8a); }
#app #fight-panel .fight-cue-slot,
#app #fight-panel .fight-feedback-slot {
  display: flex;
  align-items: center;
  gap: 1.7cqw;
  position: relative;
  padding: .5cqw 2.2cqw;
  overflow: hidden;
  border: .2cqw solid #50c8d68c;
  border-top-color: #94f0ee77;
  border-radius: 2.7cqw;
  background: linear-gradient(110deg, #00617e, #003d58);
  box-shadow: inset 0 .35cqw .5cqw #002f4c7a;
}
#app #fight-panel .fight-cue {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: #ffe77e;
  font-size: 3.42cqw;
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
#app #fight-panel .behavior-track {
  position: absolute;
  display: block;
  height: .6cqw;
  bottom: .55cqw;
  left: 10.2cqw;
  right: 2.5cqw;
  margin: 0;
  background: #001f391f;
  overflow: hidden;
  border-radius: 2cqw;
}
#app #fight-panel #behavior-fill { display: block; height: 100%; border-radius: inherit; background: #ffda64; box-shadow: 0 0 4px #ffc94c; }
#app #fight-panel .fight-feedback-slot { background: linear-gradient(110deg, #075d79, #014762); }
#app #fight-panel .fight-warning {
  margin: 0;
  color: #88f7e5;
  font-size: 3.35cqw;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
#app #fight-panel .rod-controls {
  position: absolute;
  display: flex;
  justify-content: space-between;
  top: 75.42%;
  bottom: 0;
  left: .8%;
  right: 0;
  width: auto;
  gap: 2.8%;
  margin: 0;
  padding: 0;
  z-index: 2;
}
#app #fight-panel .rod-controls[hidden] { display: none; }
#app #fight-panel .rod-controls button {
  display: grid;
  place-items: center;
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 44px;
  height: 100%;
  padding: 0 2% 8%;
  border: 0;
  border-image: none;
  border-radius: 40%;
  background: url('./assets/ui/fight-button-v23.webp') center / 100% 100% no-repeat;
  box-shadow: none;
  color: #fff8dc;
  font-family: inherit;
  font-size: 5cqw;
  line-height: 1.15;
  font-weight: 900;
  text-shadow: 0 .5cqw .1cqw #376262, 0 .8cqw .8cqw #074a60b3;
  transition: transform .11s ease, filter .11s ease;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#app #fight-panel .rod-controls button::before { content: none; }
#app #fight-panel .rod-controls button::after {
  content: '';
  position: absolute;
  left: 34%;
  right: 34%;
  bottom: 29%;
  height: .8cqw;
  border-radius: 2cqw;
  background: #dbfff9;
  box-shadow: 0 0 2cqw #5afbec;
  opacity: 0;
  pointer-events: none;
}
#app #fight-panel .rod-controls button small { display: none; }
#app #fight-panel .rod-controls button.active {
  color: #fff8cf;
  transform: translateY(1.1cqw) scale(.975);
  filter: brightness(1.13) saturate(1.18);
}
#app #fight-panel .rod-controls button.active::after { opacity: 1; background: #ffe893; box-shadow: 0 0 2cqw #ffd76f; }
#app #fight-panel .rod-controls button.recommended:not(.active)::after { opacity: .85; animation: fight-recommend 1.2s ease-in-out infinite; }
#app #fight-panel .rod-controls button:active { transform: translateY(1.3cqw) scale(.97); }
#app #fight-panel .rod-controls button:focus-visible { outline: 3px solid #ffea9c; outline-offset: 1px; }
#app #fight-panel[data-tension='warm'] #tension-fill { background: linear-gradient(#fffacc, #f7e46d 25%, #e4b844 85%, #fff296); }
#app #fight-panel[data-tension='danger'] #tension-fill { background: linear-gradient(#ffccb5, #ff9874 25%, #ee5c4f 85%, #ffbd90); }
#app #fight-panel[data-quality='overload'] { border: 0; box-shadow: none; }
#app #fight-panel[data-quality='overload'] .fight-feedback-slot { background: linear-gradient(110deg, #9c493e, #622e3e); border-color: #ffa088; }
#app #fight-panel[data-quality='overload'] .fight-warning { color: #fff4c7; }
#app #fight-panel[data-quality='overload'] .tension-needle { animation: fight-danger .65s ease-in-out infinite; }
#app #fight-panel[data-quality='slack'] .fight-warning,
#app #fight-panel[data-quality='wrong-direction'] .fight-warning,
#app #fight-panel[data-quality='strain'] .fight-warning { color: #ffe29a; }
#app #fight-panel[data-behavior='surge'] .fight-cue { color: #ffd78d; }
#app #fight-panel[data-behavior='surge'] #behavior-fill { background: #ffae67; }
#app #fight-panel[data-behavior='shake'] #behavior-fill { background: #e1bdff; }
#app #fight-panel[data-behavior='turn'] #behavior-fill { background: #80edff; }
@keyframes fight-recommend { 50% { opacity: .3; transform: scaleX(.72); } }
@keyframes fight-danger { 50% { opacity: .5; } }

/* Portrait: keep the full C face, and give the reel its own thumb zone below. */
@media (max-width: 760px) and (orientation: portrait) {
  #app .lake-shell { --fight-width: min(350px, calc(100vw - 28px)); }
  #app #fight-panel { right: 14px; bottom: calc(var(--hud-bottom) + var(--reel-size) + 23px); }
  #app .lake-shell:has(#fight-panel:not([hidden])) .lake-nav { visibility: hidden; pointer-events: none; }
  #app .lake-shell:has(#fight-panel:not([hidden])) .quest-card { display: none; }
  #app .lake-shell:has(#fight-panel:not([hidden])) .cast-group { bottom: var(--hud-bottom); }
}
@media (max-width: 760px) and (max-height: 650px) and (orientation: portrait) {
  #app .lake-shell:has(#fight-panel:not([hidden])) .spot-tabs { visibility: hidden; pointer-events: none; }
}
/* Short landscape: compact the whole instrument together; never drop gauges. */
@media (max-height: 600px) and (orientation: landscape) {
  #app .lake-shell { --fight-width: min(310px, calc(100dvh - 83px)); }
  #app #fight-panel { right: calc(var(--hud-gutter) + var(--reel-size) + 15px); bottom: var(--hud-bottom); }
  #app .lake-shell:has(#fight-panel:not([hidden])) .spot-tabs { visibility: hidden; pointer-events: none; }
  #app .lake-shell:has(#fight-panel:not([hidden])) .quest-card { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  #app #fight-panel *, #app #fight-panel *::after { animation: none !important; transition: none !important; }
}
