/* =========================================================================
   概念空战（打字射击）· 复古矢量深空皮肤
   只作用于 .ty 容器内（本次战斗专属），不碰暖纸皮肤与塔防战斗画面。
   类名统一 ty- 前缀，避免与 battle.css / camp.css 冲突。
   ========================================================================= */

/* 本皮肤里 display:flex/grid 的元素会盖掉 [hidden] 的浏览器默认表现，
   所以统一在这里兜一条 —— 否则"隐藏"的答题台/结算页照样占位、照样显示。 */
.ty [hidden] { display: none !important; }

.ty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #d7ecff;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(64, 132, 255, .22), transparent 60%),
    radial-gradient(90% 60% at 50% 110%, rgba(255, 92, 140, .14), transparent 60%),
    #05070f;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ---------------- 顶栏 ---------------- */
.ty-top {
  display: flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 10px; flex: none;
  border-bottom: 1px solid rgba(96, 158, 255, .18);
  background: rgba(8, 14, 28, .72);
}
.ty-hearts { display: flex; gap: 2px; font-size: 15px; line-height: 1; }
.ty-heart { color: #ff5c7a; text-shadow: 0 0 8px rgba(255, 92, 122, .7); }
.ty-heart.off { color: rgba(120, 145, 180, .35); text-shadow: none; }
.ty-title {
  flex: 1; min-width: 0; text-align: center;
  font-size: 12px; letter-spacing: .06em; color: #8fb6e8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ty-empbox { font-size: 12px; color: #ffd479; white-space: nowrap; }
.ty-empbox b { font-size: 13px; }
.ty-empbox.empty { opacity: .35; }
.ty .mini {
  width: 30px; height: 30px; flex: none; border-radius: 8px;
  border: 1px solid rgba(96, 158, 255, .3); background: rgba(20, 34, 60, .8);
  color: #bcd8ff; font-size: 13px; cursor: pointer;
}

/* ---------------- 战场 ---------------- */
.ty-field { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.ty-lanes { position: absolute; inset: 0; display: grid; }
.ty-lane { position: relative; border-right: 1px dashed rgba(96, 158, 255, .12); }
.ty-lane:last-child { border-right: 0; }
.ty-lane-key {
  position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%);
  font-size: 10px; color: rgba(120, 160, 220, .35); letter-spacing: .1em;
}
.ty-line {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 92, 122, .85), transparent);
  box-shadow: 0 0 14px rgba(255, 92, 122, .6);
}
.ty-ents { position: absolute; inset: 0; }

/* ---------------- 敌机（概念卡） ---------------- */
.ty-enemy {
  position: absolute;
  transform: translate(-50%, -50%);
  transition: top .06s linear, opacity .18s;
  will-change: top;
}
.ty-enemy.is-dim { opacity: .42; }
.ty-key {
  position: absolute; left: -2px; top: -8px; z-index: 2;
  min-width: 18px; height: 18px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #04121f;
  background: #7fd4ff; border-radius: 5px;
  box-shadow: 0 0 10px rgba(127, 212, 255, .75);
}
.ty-key.ty-key-off { background: rgba(127, 212, 255, .28); color: rgba(220, 240, 255, .7); box-shadow: none; }
.ty-card {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  margin: 0 auto; padding: 6px 4px 5px;
  width: 88%;
  border: 1px solid rgba(127, 212, 255, .45);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(18, 34, 62, .95), rgba(10, 18, 34, .95));
  box-shadow: 0 0 0 1px rgba(8, 14, 28, .8) inset, 0 6px 18px rgba(0, 0, 0, .45);
}
.ty-emoji { font-size: 22px; line-height: 1.05; }
.ty-name {
  font-size: 10px; line-height: 1.2; text-align: center; color: #cfe6ff;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-all;
}
.ty-hp { height: 3px; margin: 4px auto 0; width: 88%; border-radius: 2px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.ty-hp i { display: block; height: 100%; background: #4fe08a; transition: width .18s; }

.ty-enemy.rar-rare .ty-card { border-color: rgba(126, 176, 255, .8); }
.ty-enemy.rar-epic .ty-card { border-color: rgba(196, 140, 255, .85); box-shadow: 0 0 16px rgba(166, 106, 255, .35); }
.ty-enemy.rar-legend .ty-card { border-color: rgba(255, 196, 86, .9); box-shadow: 0 0 18px rgba(255, 180, 60, .45); }
.ty-enemy.boss .ty-card {
  border-color: #ff6a92; border-width: 2px;
  background: linear-gradient(180deg, rgba(60, 16, 36, .96), rgba(24, 8, 18, .96));
  box-shadow: 0 0 22px rgba(255, 92, 132, .5);
}
.ty-enemy.boss .ty-emoji { font-size: 28px; }
.ty-enemy.boss .ty-name { color: #ffd0dc; font-weight: 700; }

.ty-enemy.is-locked .ty-card { border-color: #7fffd4; box-shadow: 0 0 20px rgba(127, 255, 212, .6); }
.ty-enemy.is-boom { animation: tyBoom .38s ease-out forwards; }
.ty-enemy.is-emp { animation: tyEmp .4s ease-out forwards; }
@keyframes tyBoom {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.7); opacity: 0; filter: brightness(2.4); }
}
@keyframes tyEmp {
  0% { transform: translate(-50%, -50%) scale(1); }
  100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

/* ---------------- 我方飞船 ---------------- */
.ty-ship {
  position: absolute; bottom: 2px; left: 50%;
  transform: translateX(-50%);
  font-size: 26px; line-height: 1;
  transition: left .22s ease-out;
  filter: drop-shadow(0 0 10px rgba(127, 212, 255, .8));
  z-index: 3;
}
.ty-ship.ty-ship-fire { animation: tyRecoil .18s ease-out; }
@keyframes tyRecoil {
  0% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(4px); }
  100% { transform: translateX(-50%) translateY(0); }
}

/* ---------------- 炮弹 / 哑弹 ---------------- */
.ty-bullet {
  position: absolute; left: 50%; top: 100%;
  width: 4px; height: 14px; margin-left: -2px; border-radius: 2px;
  background: linear-gradient(180deg, #eafcff, #57d7ff);
  box-shadow: 0 0 12px rgba(87, 215, 255, .95);
  transition: top .19s linear, opacity .19s;
  z-index: 2;
}
.ty-bullet.dud { background: linear-gradient(180deg, #9aa7b5, #5b6774); box-shadow: none; }
.ty-smoke {
  position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border-radius: 50%; background: radial-gradient(circle, rgba(180, 190, 200, .55), transparent 70%);
  animation: tySmoke .5s ease-out forwards; z-index: 2;
}
@keyframes tySmoke {
  0% { transform: scale(.4); opacity: .9; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* ---------------- 战场反馈 ---------------- */
.ty-field.ty-shake { animation: tyShake .22s; }
@keyframes tyShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
.ty-field.ty-breach { animation: tyBreach .46s; }
@keyframes tyBreach {
  0% { box-shadow: inset 0 -60px 60px -40px rgba(255, 60, 90, .9); }
  100% { box-shadow: inset 0 0 0 0 rgba(255, 60, 90, 0); }
}
.ty-field.ty-emp { animation: tyEmpFlash .42s; }
@keyframes tyEmpFlash {
  0% { background: rgba(200, 240, 255, .7); }
  100% { background: transparent; }
}
.ty-field.ty-bosswave { animation: tyBoss .7s; }
@keyframes tyBoss {
  0% { box-shadow: inset 0 0 60px rgba(255, 60, 110, .75); }
  100% { box-shadow: inset 0 0 0 rgba(255, 60, 110, 0); }
}
.ty-dud {
  position: absolute; right: 8px; top: 8px;
  padding: 3px 8px; border-radius: 20px; font-size: 11px;
  color: #ffd0d0; background: rgba(120, 40, 50, .6); border: 1px solid rgba(255, 120, 140, .4);
}
.ty-dud.pop { animation: tyPop .3s; }
@keyframes tyPop { 0% { transform: scale(1.4); } 100% { transform: scale(1); } }
.ty-toast {
  position: absolute; left: 50%; top: 42%; transform: translateX(-50%);
  padding: 6px 14px; border-radius: 20px; font-size: 12px; white-space: nowrap;
  color: #eaf6ff; background: rgba(20, 40, 70, .9); border: 1px solid rgba(127, 212, 255, .35);
  animation: tyToastIn .22s ease-out; z-index: 4;
}
.ty-toast.boss { color: #ffd6e0; border-color: rgba(255, 106, 146, .6); background: rgba(60, 12, 30, .92); }
.ty-toast.win { color: #d8ffe9; border-color: rgba(79, 224, 138, .6); }
.ty-toast.out { opacity: 0; transition: opacity .3s; }
@keyframes tyToastIn { 0% { opacity: 0; transform: translateX(-50%) translateY(8px); } 100% { opacity: 1; } }

/* ---------------- 下方答题台 ---------------- */
.ty-console {
  flex: none; height: 33vh; min-height: 186px; max-height: 320px;
  padding: 10px 12px 12px; overflow: hidden;
  border-top: 1px solid rgba(96, 158, 255, .22);
  background: linear-gradient(180deg, rgba(10, 18, 34, .96), rgba(6, 10, 20, .99));
  display: flex; flex-direction: column; gap: 8px;
}
.ty-console.ty-shake { animation: tyShake .2s; }
.ty-idle { margin: auto; text-align: center; color: #8fb6e8; }
.ty-idle-h { font-size: 13px; margin-bottom: 8px; }
.ty-idle-s { font-size: 11px; color: #6d8fbb; }
.ty-idle kbd {
  display: inline-block; min-width: 20px; margin: 0 2px; padding: 1px 4px;
  font-size: 11px; font-weight: 700; color: #04121f; background: #7fd4ff; border-radius: 4px;
}

.ty-panel { display: flex; flex-direction: column; gap: 7px; height: 100%; min-height: 0; }
.ty-qhead { display: flex; align-items: center; gap: 6px; flex: none; }
.ty-qemoji { font-size: 17px; }
.ty-qname { font-size: 13px; color: #eaf6ff; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ty-qhp { font-size: 11px; color: #ffd479; }
.ty-expand {
  flex: none; font-size: 11px; padding: 2px 7px; border-radius: 6px; cursor: pointer;
  color: #9fc6ef; background: rgba(30, 50, 84, .8); border: 1px solid rgba(96, 158, 255, .3);
}
.ty-q {
  flex: none; font-size: 13.5px; line-height: 1.42; color: #dceeff;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ty-opts {
  flex: 1; min-height: 0; display: grid; gap: 6px;
  grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr;
}
.ty-opt {
  display: flex; align-items: flex-start; gap: 6px; text-align: left;
  padding: 6px 8px; border-radius: 9px; cursor: pointer;
  color: #cfe6ff; background: rgba(22, 40, 70, .85);
  border: 1px solid rgba(96, 158, 255, .26);
  font-size: 11.5px; line-height: 1.3;
  transition: transform .08s, background .12s, border-color .12s;
}
.ty-opt:active { transform: scale(.97); background: rgba(40, 70, 116, .95); border-color: rgba(127, 212, 255, .6); }
.ty-oKey {
  flex: none; width: 16px; height: 16px; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #04121f; background: #7fd4ff; border-radius: 4px;
}
.ty-oTxt {
  min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* 展开全文（空格 / ⤢）：解除截断，超出部分在答题台内滚动 */
.ty-panel.ty-expand .ty-q,
.ty-panel.ty-expand .ty-oTxt { -webkit-line-clamp: 99; overflow: auto; }
.ty-panel.ty-expand .ty-opts { grid-auto-rows: auto; overflow: auto; }
.ty-keys { flex: none; display: flex; gap: 10px; font-size: 10px; color: #6d8fbb; }
.ty-keys .ty-k { white-space: nowrap; }

/* ---------------- 倒计时 / 暂停 / 结算 ---------------- */
.ty-count {
  position: absolute; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  font-size: 64px; font-weight: 800; color: #eafcff;
  text-shadow: 0 0 24px rgba(127, 212, 255, .9);
  pointer-events: none; opacity: 0;
}
.ty-count.show { opacity: 1; animation: tyCount .6s ease-out; }
.ty-count.hold { font-size: 46px; color: #7fffd4; }
@keyframes tyCount {
  0% { transform: scale(1.6); opacity: 0; }
  40% { transform: scale(1); opacity: 1; }
  100% { transform: scale(.94); opacity: .9; }
}
.ty-pause {
  position: absolute; inset: 0; z-index: 15;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #cfe6ff; background: rgba(4, 8, 16, .82);
}
.ty-pause.hidden { display: none; }

.ty-result {
  position: absolute; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(3, 6, 14, .92);
  overflow: auto;
}
.ty-result.hidden { display: none; }
.ty-res { width: 100%; max-width: 460px; text-align: center; }
.ty-res-ico { font-size: 46px; line-height: 1; }
.ty-res h3 { margin: 6px 0 4px; font-size: 19px; color: #eafcff; }
.ty-res.lose h3 { color: #ffc9d4; }
.ty-res-sub { margin: 0 0 12px; font-size: 12px; line-height: 1.5; color: #8fb6e8; }
.ty-res-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px;
}
.ty-res-grid > div {
  padding: 7px 4px; border-radius: 9px;
  background: rgba(20, 36, 62, .85); border: 1px solid rgba(96, 158, 255, .2);
}
.ty-res-grid b { display: block; font-size: 16px; color: #7fd4ff; }
.ty-res-grid span { font-size: 10px; color: #7ea3cd; }
.ty-res-h { margin: 0 0 6px; font-size: 11px; color: #7ea3cd; text-align: left; }
.ty-res-cards { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; max-height: 26vh; overflow: auto; }
.ty-rcard {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 9px; border-radius: 8px; text-align: left;
  background: rgba(16, 28, 50, .85); border: 1px solid rgba(96, 158, 255, .18);
}
.ty-rcard.boss { border-color: rgba(255, 106, 146, .5); }
.ty-rce { font-size: 15px; }
.ty-rcn { flex: 1; min-width: 0; font-size: 12px; color: #dceeff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ty-rs { font-size: 10px; color: #6d8fbb; white-space: nowrap; }
.ty-rd { font-size: 11px; color: #ffd479; white-space: nowrap; }
.ty-res-btns { display: flex; flex-direction: column; gap: 8px; }
.ty-btn {
  padding: 11px 14px; border-radius: 11px; font-size: 14px; cursor: pointer;
  color: #cfe6ff; background: rgba(24, 42, 72, .9); border: 1px solid rgba(96, 158, 255, .32);
}
.ty-btn.primary {
  color: #04121f; font-weight: 700;
  background: linear-gradient(180deg, #8ff0d0, #40c9a6); border-color: transparent;
}
