/* ==========================================================
 * 出战部署（地图 + 难度选择）样式
 * ----------------------------------------------------------
 * 与大厅同一套配色（奶油 #fff8ea / 棕描边 #6b3b2a / 粉内框 #ffc4dc / 金 #f2b640），
 * 控件全部走「切角板 + 斜切读数条」的军用 HUD 形制：
 *   · 没有一个是简单矩形或圆形 —— 每块面板都由 clip-path 切掉对角，配双层描边与角标
 *   · 选中态统一用黄色（#ffc93c）描边 + 外发光 + 循环流光
 *   · 动效：面板入场逐级浮现、缩略图缓慢推近、扫描线循环下移、主按钮流光
 * ========================================================== */

.sel-screen {
  position: absolute; inset: 0; z-index: 6;
  display: flex; align-items: center; justify-content: center;
  padding: 2vh 2vw;
  overflow: hidden;
}
.sel-screen.hidden { display: none; }
/* 背幕：中央透出大厅画面，四周压暗，让面板像悬在大厅之上 */
.sel-veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% 46%, rgba(30, 12, 40, 0.10) 0%, rgba(24, 10, 34, 0.62) 58%, rgba(14, 6, 22, 0.82) 100%),
    linear-gradient(180deg, rgba(12, 8, 22, 0.55), rgba(12, 8, 22, 0.30));
  backdrop-filter: blur(3px) saturate(1.05);
}
/* 全屏扫描线：极慢下移，制造「战术屏」质感 */
.sel-scan {
  position: absolute; left: 0; right: 0; top: -30%;
  height: 26%;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 201, 60, 0) 0%, rgba(255, 201, 60, 0.055) 55%, rgba(255, 255, 255, 0.09) 82%, rgba(255, 201, 60, 0) 100%);
  animation: selScan 7.5s linear infinite;
}
@keyframes selScan { to { top: 108%; } }

/* ---------- 主体面板：切角 + 双层描边 ---------- */
.sel-wrap {
  position: relative;
  width: min(1240px, 96vw);
  /* 高度随内容收缩，最多 96vh；超出时 flex 列把 .sel-body 压矮并由它自己滚动，
   * 标题栏与底栏始终完整可见 */
  max-height: 96vh;
  overflow: hidden;
  /* 底部内边距固定 30px：外框左下角有一段 26px 高的台阶切口，
   * 返回大厅按钮必须整体停在切口上方，否则会被 clip-path 裁掉一角 */
  padding: clamp(16px, 2.2vh, 26px) clamp(18px, 2.4vw, 34px) 30px;
  display: flex; flex-direction: column;
  color: #5a3322;
  background: linear-gradient(160deg, #7a4632, #5a2f22 60%, #6b3b2a);
  clip-path: polygon(
    0 26px, 26px 0,
    calc(100% - 96px) 0, calc(100% - 68px) 26px,
    100% 26px, 100% calc(100% - 26px),
    calc(100% - 26px) 100%, 118px 100%, 92px calc(100% - 26px),
    0 calc(100% - 26px));
  box-shadow: 0 26px 70px rgba(46, 12, 54, 0.46);
  animation: selIn 0.42s cubic-bezier(0.2, 0.95, 0.3, 1) both;
}
/* 奶油面板 + 内层粉色细描边 */
.sel-wrap::after {
  content: ""; position: absolute; inset: 4px; z-index: 0;
  pointer-events: none;
  background: linear-gradient(150deg, #fffcfa 0%, #fff6e9 46%, #ffeef5 100%);
  clip-path: polygon(
    0 24px, 24px 0,
    calc(100% - 94px) 0, calc(100% - 66px) 24px,
    100% 24px, 100% calc(100% - 24px),
    calc(100% - 24px) 100%, 120px 100%, 94px calc(100% - 24px),
    0 calc(100% - 24px));
  box-shadow: inset 0 0 0 2px rgba(255, 196, 220, 0.9);
}
@keyframes selIn { from { opacity: 0; transform: translateY(22px) scale(0.985); } }

/* 三块内容都在奶油面之上 */
.sel-head, .sel-body, .sel-foot { position: relative; z-index: 1; }

/* ---------- 顶部标题绶带 ---------- */
.sel-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
  padding-bottom: 12px;
}
.sel-title { display: flex; align-items: baseline; gap: 12px; position: relative; }
.sel-title h2 {
  margin: 0;
  font-size: clamp(22px, 2.2vw, 34px); font-weight: 900; letter-spacing: 8px;
  color: #d8457f;
  text-shadow: 0 2px 0 #fff, 0 4px 10px rgba(200, 60, 120, 0.28);
}
.sel-title-tag {
  padding: 3px 9px;
  font-size: 10px; font-weight: 900; letter-spacing: 2px;
  color: #fff;
  background: linear-gradient(180deg, #4a8ce8, #2f6ad0);
  clip-path: polygon(0 0, 100% 0, calc(100% - 7px) 100%, 0 100%);
}
.sel-title-line {
  position: absolute; left: 0; right: 0; bottom: -7px; height: 4px;
  background: linear-gradient(90deg, #f2b640 0 34%, rgba(242, 182, 64, 0.25) 34% 38%, rgba(242, 182, 64, 0.12) 38% 100%);
  clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
/* 右上读数：当前地图 / 难度，斜切药丸 */
.sel-readout {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 18px 7px 14px;
  /* 外框右上角有一段 96px 宽的台阶切口，读数必须整体停在切口左侧（再留 8px），
   * 否则会被 clip-path 裁掉一角。104px = 切口 96px + 间距 8px，减去面板右内边距 */
  margin-right: calc(104px - clamp(18px, 2.4vw, 34px));
  font-size: 13px; font-weight: 800;
  background: linear-gradient(120deg, rgba(255, 235, 246, 0.95), rgba(255, 248, 236, 0.95));
  border-left: 4px solid #f2b640;
  clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 100%, 0 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 196, 220, 0.8);
}
.sel-ro-k { color: #a4806a; font-size: 12px; }
.sel-readout b { color: #d8457f; font-size: 15px; letter-spacing: 1px; }
.sel-ro-sep { width: 1px; height: 16px; background: rgba(107, 59, 42, 0.28); }

/* ---------- 两栏布局 ---------- */
.sel-body {
  display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(14px, 1.6vw, 26px);
  padding: 6px 0 2px;
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  /* 滚动条单独占一条轨道：滑块不压在卡片边上，出现 / 消失时布局也不跳 */
  scrollbar-gutter: stable;
  padding-right: 6px;
  /* 关键：行高一律按内容撑开，永不压缩。
   * 没有这两条时，grid 行会被压到比内容还矮，地图卡就会溢出来压住难度区。 */
  grid-auto-rows: max-content;
  align-content: start;
}
/* 列本身不设 min-height:0 —— 那会覆盖 grid 子项的自动最小尺寸，
 * 正是「两区重叠」的根源。让内容自然撑高，溢出交给 .sel-body 滚动。 */
.sel-col { display: flex; flex-direction: column; min-width: 0; }
/* 右侧难度列：自身高度决定，不跟随左侧地图列 */
.sel-col-diff { align-self: start; }
.sel-sec-head { margin-bottom: 10px; }
.sel-sec-head h3 {
  display: flex; align-items: center; gap: 9px;
  margin: 0; font-size: 15px; font-weight: 900; letter-spacing: 3px; color: #6b3b2a;
}
.sel-sec-head h3 i {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 22px;
  font-size: 11px; font-style: normal; font-weight: 900; letter-spacing: 0;
  color: #fff;
  background: linear-gradient(180deg, #ffa2cd, #ef5fa4);
  clip-path: polygon(0 0, 100% 0, 100% 72%, 78% 100%, 0 100%);
}
.sel-sec-sub { display: block; margin: 5px 0 0 35px; font-size: 11px; color: #a4806a; letter-spacing: 0.5px; }

/* ---------- 地图卡 ---------- */
.sel-map-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(10px, 1.1vw, 18px);
  min-height: 0;
}
.sel-map-card {
  position: relative;
  display: block;
  padding: 4px;                      /* 四周留 4px，露出描边层 */
  border: 0; background: none;
  font-family: var(--font); color: inherit; text-align: left;
  cursor: pointer;
  /* 切角：左上、右下各切一刀 */
  clip-path: polygon(0 20px, 20px 0, calc(100% - 34px) 0, 100% 34px, 100% 100%, 0 100%);
  transition: transform 0.16s ease, filter 0.16s ease;
  animation: selCardIn 0.44s cubic-bezier(0.2, 0.95, 0.3, 1) both;
  animation-delay: calc(var(--i, 0) * 0.08s + 0.06s);
}
@keyframes selCardIn { from { opacity: 0; transform: translateY(16px); } }
/* 未选中：粉描边；选中时整块变成黄色描边（卡面内缩 4px 露出这条描边） */
.sel-map-card::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255, 196, 220, 0.85), rgba(242, 182, 64, 0.55));
  clip-path: inherit;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}
.mc-face {
  position: relative;                /* 在流里撑起卡片高度 */
  display: flex; flex-direction: column;
  background: #fffaf2;
  clip-path: polygon(0 17px, 17px 0, calc(100% - 31px) 0, 100% 31px, 100% 100%, 0 100%);
  overflow: hidden;
}
.mc-shot {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #cfe0ea;
}
.mc-shot img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transform: scale(1.02);
  transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.3, 1), filter 0.3s ease;
  filter: saturate(0.92) contrast(1.02);
}
/* 缩略图上的网格 + 斜切遮罩：削弱照片感，和 UI 融合 */
.mc-shot::after {
  content: ""; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 26px),
    linear-gradient(180deg, rgba(12, 20, 32, 0) 44%, rgba(24, 14, 30, 0.62) 100%);
}
.mc-plate {
  position: relative;
  display: flex; align-items: baseline; gap: 10px;
  padding: 9px 14px 10px;
  background: linear-gradient(100deg, #fffdf8, #ffeff6);
  border-top: 3px solid #f2b640;
}
.mc-name {
  font-size: clamp(14px, 1.15vw, 19px); font-weight: 900; letter-spacing: 2px;
  color: #5a3322;
}
.mc-en { font-size: 10px; font-weight: 800; letter-spacing: 2px; color: #b09070; }
.mc-brief { padding: 0 14px 10px; font-size: 11.5px; line-height: 1.5; color: #8a6a54; }
.mc-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 12px; }
.mc-tag {
  padding: 2px 9px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.5px; color: #2f6ad0;
  background: rgba(74, 140, 232, 0.14);
  clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
/* 左上角编号徽标 */
.mc-key {
  position: absolute; left: 4px; top: 4px; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 30px;
  font-size: 14px; font-weight: 900; color: #fff;
  background: linear-gradient(180deg, #ffa2cd, #ef5fa4);
  clip-path: polygon(0 0, 100% 0, 100% 70%, 72% 100%, 0 100%);
  text-shadow: 0 1px 0 rgba(160, 58, 106, 0.6);
}
/* 选中勾：斜切刀形 */
.mc-tick {
  position: absolute; right: 12px; top: 12px; z-index: 2;
  display: none; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  font-size: 15px; font-weight: 900; line-height: 1; color: #3a2408;
  background: linear-gradient(180deg, #ffe08a, #f2b640);
  clip-path: polygon(18% 0, 100% 0, 100% 100%, 0 100%, 0 34%);
  box-shadow: 0 2px 8px rgba(120, 70, 10, 0.35);
}
.sel-map-card:hover { transform: translateY(-3px); }
.sel-map-card:hover .mc-shot img { transform: scale(1.07); }
.sel-map-card:focus-visible { outline: none; filter: drop-shadow(0 0 0 3px rgba(61, 123, 224, 0.95)); }
/* 选中：黄色描边 + 外发光 + 缩略图推近 + 顶部流光 */
.sel-map-card.on { transform: translateY(-3px); }
.sel-map-card.on::before {
  background: linear-gradient(180deg, #ffe89a, #ffc93c 55%, #f2a51e);
  box-shadow: 0 0 22px rgba(255, 201, 60, 0.55);
}
.sel-map-card.on .mc-tick { display: flex; }
.sel-map-card.on .mc-shot img { transform: scale(1.06); filter: saturate(1.05) contrast(1.04); }
.sel-map-card.on .mc-shot .mc-sheen {
  content: ""; position: absolute; left: -60%; top: 0; bottom: 0; width: 42%; z-index: 2;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.5) 50%, rgba(255, 255, 255, 0) 100%);
  animation: mcSheen 2.8s ease-in-out infinite;
}
@keyframes mcSheen { 0% { left: -60%; } 60%, 100% { left: 118%; } }

/* ---------- 难度板 ---------- */
.sel-diff-list { display: flex; flex-direction: column; gap: clamp(8px, 1vh, 13px); min-height: 0; }
.sel-diff {
  position: relative;
  display: grid; grid-template-columns: 62px 1fr auto;
  align-items: center; gap: 12px;
  padding: 0; border: 0; background: none;
  font-family: var(--font); text-align: left; color: inherit;
  cursor: pointer;
  clip-path: polygon(0 14px, 14px 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
  transition: transform 0.16s ease;
  animation: selCardIn 0.44s cubic-bezier(0.2, 0.95, 0.3, 1) both;
  animation-delay: calc(var(--i, 0) * 0.07s + 0.12s);
}
.sel-diff::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255, 196, 220, 0.8), rgba(214, 186, 150, 0.55));
  clip-path: inherit;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}
.df-face {
  position: absolute; inset: 4px;
  background: linear-gradient(100deg, #fffdf8 0%, #fff6ec 58%, #ffeff6 100%);
  clip-path: polygon(0 11px, 11px 0, calc(100% - 19px) 0, 100% 19px, 100% 100%, 19px 100%, 0 calc(100% - 19px));
}
/* 左侧难度色条 */
.df-face::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: var(--df, #f2b640);
  clip-path: polygon(0 0, 100% 12px, 100% calc(100% - 12px), 0 100%);
}
.df-badge, .df-main, .df-pips { position: relative; z-index: 1; }
.sel-diff:hover { transform: translateX(3px); }
.sel-diff:focus-visible { outline: none; filter: drop-shadow(0 0 0 3px rgba(61, 123, 224, 0.95)); }
/* 难度徽记：切角方块 + 罗马数字 */
.df-badge {
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; margin-left: 14px;
  font-size: 16px; font-weight: 900;
  color: #fff;
  background: var(--df, #f2b640);
  clip-path: polygon(22% 0, 100% 0, 100% 78%, 78% 100%, 0 100%, 0 22%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.df-main { padding: 10px 0; min-width: 0; }
.df-top { display: flex; align-items: baseline; gap: 9px; }
.df-name { font-size: clamp(14px, 1.1vw, 18px); font-weight: 900; letter-spacing: 2px; color: #5a3322; }
.df-en { font-size: 10px; font-weight: 800; letter-spacing: 2px; color: #b09070; }
.df-brief { margin-top: 3px; font-size: 11.5px; color: #8a6a54; }
/* 数值条：哈姆数量 / 血量 / 每批出怪 */
.df-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 7px; }
.df-stat { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: #a4806a; }
.df-bar {
  position: relative;
  width: 40px; height: 6px;
  background: rgba(107, 59, 42, 0.14);
  clip-path: polygon(0 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
  overflow: hidden;
}
.df-bar i {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: var(--p, 50%);
  background: linear-gradient(90deg, var(--df, #f2b640), rgba(255, 255, 255, 0.75));
}
.df-stat b { color: #6b3b2a; font-size: 11.5px; font-variant-numeric: tabular-nums; }
/* 右侧：威胁等级菱形点阵 */
.df-pips { display: flex; gap: 4px; padding-right: 16px; }
.df-pip {
  width: 9px; height: 16px;
  background: rgba(107, 59, 42, 0.16);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.df-pip.on { background: linear-gradient(180deg, #ff8a4c, var(--df, #f2b640)); }
/* 选中：黄色描边 + 呼吸色条 */
.sel-diff.on { transform: translateX(3px); }
.sel-diff.on::before {
  background: linear-gradient(180deg, #ffe89a, #ffc93c 55%, #f2a51e);
  box-shadow: 0 0 20px rgba(255, 201, 60, 0.5);
}
.sel-diff.on .df-face::after { animation: dfPulse 1.6s ease-in-out infinite; }
@keyframes dfPulse { 50% { opacity: 0.42; } }

/* ---------- 底部操作区 ---------- */
.sel-foot {
  display: flex; align-items: center; gap: 16px;
  padding-top: clamp(10px, 1.4vh, 18px);
  margin-top: 6px;
  border-top: 2px dashed rgba(107, 59, 42, 0.22);
}
.sel-back {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 20px 9px 14px;
  margin-left: 6px;             /* 不紧贴窗口左边缘 */
  font-family: var(--font); font-size: 13px; font-weight: 800; color: #6b3b2a;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(107, 59, 42, 0.35);
  clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s;
}
.sel-back:hover { background: #ffe3ef; border-color: #6b3b2a; }
.sel-back:focus-visible { outline: 3px solid #3d7be0; outline-offset: 2px; }
.sel-back-ic {
  width: 0; height: 0;
  border-right: 7px solid #d8457f;
  border-top: 5px solid transparent; border-bottom: 5px solid transparent;
}
/* 进入战场：主行动按钮，切角 + 金渐变 + 循环流光 */
.sel-go {
  position: relative;
  margin-left: auto;
  padding: 0; border: 0; background: none;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
  filter: drop-shadow(0 8px 18px rgba(120, 70, 10, 0.34));
  transition: transform 0.14s ease, filter 0.14s ease;
}
.sel-go-inner {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  padding: clamp(10px, 1.5vh, 16px) clamp(38px, 4.4vw, 74px);
  background: linear-gradient(180deg, #ffe9a6 0%, #f7bf46 48%, #de9a1c 100%);
  clip-path: inherit;
}
.sel-go-k { font-size: 10px; font-weight: 900; letter-spacing: 4px; color: rgba(90, 55, 12, 0.72); }
.sel-go-v {
  font-size: clamp(17px, 1.5vw, 24px); font-weight: 900; letter-spacing: 7px;
  color: #3a2408;
  text-shadow: 0 1px 0 rgba(255, 250, 230, 0.9);
}
/* 流光：一道斜向高光循环扫过按钮 */
.sel-go-sheen {
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(104deg, rgba(255, 255, 255, 0) 34%, rgba(255, 255, 255, 0.62) 50%, rgba(255, 255, 255, 0) 66%);
  transform: translateX(-120%);
  animation: goSheen 3.4s ease-in-out infinite;
  mix-blend-mode: screen;
  clip-path: inherit;
}
@keyframes goSheen { 0%, 22% { transform: translateX(-120%); } 62%, 100% { transform: translateX(120%); } }
.sel-go:hover { transform: translateY(-2px) scale(1.015); }
.sel-go:active { transform: translateY(1px) scale(0.99); }
.sel-go:focus-visible {
  outline: none;
  filter: drop-shadow(0 0 0 3px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 0 6px rgba(74, 140, 232, 0.9));
}
.sel-go:disabled { cursor: progress; filter: grayscale(0.3) brightness(0.95); }
.sel-hint { margin: 0; font-size: 11.5px; color: #8a6a54; }
.sel-hint kbd { color: #5a3322; background: #fff3e0; border-color: #d9b996; }

@media (prefers-reduced-motion: reduce) {
  .sel-scan, .sel-go-sheen, .sel-map-card.on .mc-shot .mc-sheen { animation: none; }
}
/* 窄屏 / 矮屏的排版适配统一放在 responsive.css */
