/* ============================================================
   Blockpost 风格首页 + 三体风格立绘
   ============================================================ */

#homeScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background:
    radial-gradient(ellipse at 50% 30%, #0d1f33 0%, #050a12 55%, #000 100%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  transition: opacity 0.6s ease;
  overflow: hidden;
  font-family: 'Helvetica Now Condensed', 'Arial Narrow', sans-serif;
}

#homeScreen.hidden {
  opacity: 0;
  pointer-events: none;
}

/* 星空画布 */
#homeStarsCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* 暗角 */
.home-vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(0,0,0,0.75) 100%);
  z-index: 1;
  pointer-events: none;
}

/* 扫描线 */
.home-scanlines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 229, 255, 0.025) 0px,
    rgba(0, 229, 255, 0.025) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 2;
  pointer-events: none;
  opacity: 0.6;
}

/* ============================================================
   顶部 Logo
   ============================================================ */

.home-header {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 28px 20px 10px;
  animation: homeHeaderIn 1s ease-out;
}

@keyframes homeHeaderIn {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}

.home-logo-mark {
  font-size: 1.6rem;
  color: #00e5ff;
  text-shadow: 0 0 20px #00e5ff, 0 0 40px #00e5ff;
  letter-spacing: 12px;
  margin-bottom: 4px;
  animation: markPulse 2.5s ease-in-out infinite alternate;
}

@keyframes markPulse {
  from { opacity: 0.7; text-shadow: 0 0 20px #00e5ff, 0 0 40px #00e5ff; }
  to { opacity: 1; text-shadow: 0 0 30px #00e5ff, 0 0 60px #00e5ff, 0 0 90px #00e5ff; }
}

.home-title {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 14px;
  color: #e8f4ff;
  text-shadow: 0 0 30px rgba(0, 229, 255, 0.6), 0 0 60px rgba(0, 229, 255, 0.3);
  line-height: 1.1;
  text-transform: uppercase;
}

.home-title span {
  font-size: 1.6rem;
  letter-spacing: 20px;
  color: #00e5ff;
  text-shadow: 0 0 20px #00e5ff, 0 0 40px rgba(0, 229, 255, 0.5);
}

.home-subtitle {
  font-size: 0.8rem;
  letter-spacing: 8px;
  color: #6a9ab0;
  margin-top: 8px;
}

.home-badge {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 16px;
  font-size: 0.6rem;
  letter-spacing: 4px;
  color: #00e5ff;
  border: 1px solid rgba(0, 229, 255, 0.4);
  background: rgba(0, 229, 255, 0.05);
  font-family: 'Courier New', monospace;
}

/* ============================================================
   中部主体
   ============================================================ */

.home-body {
  position: relative;
  z-index: 5;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 20px;
  padding: 20px 40px;
  overflow-y: auto;
  animation: homeBodyIn 1.2s ease-out;
}

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

.home-panel {
  background: rgba(6, 18, 32, 0.75);
  border: 1px solid rgba(0, 229, 255, 0.25);
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.08), inset 0 0 30px rgba(0, 229, 255, 0.03);
  padding: 16px 18px;
  position: relative;
  backdrop-filter: blur(6px);
}

.home-panel::before,
.home-panel::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid #00e5ff;
}

.home-panel::before {
  top: -1px; left: -1px;
  border-right: none;
  border-bottom: none;
}

.home-panel::after {
  bottom: -1px; right: -1px;
  border-left: none;
  border-top: none;
}

.home-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.2);
}

.hp-corner {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #00e5ff;
  box-shadow: 0 0 8px #00e5ff;
  transform: rotate(45deg);
}

.hp-title {
  font-size: 0.7rem;
  letter-spacing: 3px;
  color: #00e5ff;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
  font-family: 'Courier New', monospace;
}

/* ============================================================
   左侧属性
   ============================================================ */

.home-stats {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 4px;
  font-size: 0.72rem;
  border-bottom: 1px dashed rgba(0, 229, 255, 0.08);
}

.home-stat .label {
  color: #6a9ab0;
  letter-spacing: 1px;
}

.home-stat .value {
  color: #c5e6ff;
  font-family: 'Courier New', monospace;
  font-weight: 500;
}

.home-stat .value.good { color: #4ae0a0; text-shadow: 0 0 6px rgba(74, 224, 160, 0.5); }
.home-stat .value.warn { color: #ffaa44; text-shadow: 0 0 6px rgba(255, 170, 68, 0.5); }

/* ============================================================
   中央立绘（我的三体风格）
   ============================================================ */

.home-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-portrait-frame {
  position: relative;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 3 / 4;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(0, 229, 255, 0.12) 0%, transparent 70%),
    linear-gradient(180deg, rgba(6, 18, 32, 0.6) 0%, rgba(0, 8, 16, 0.9) 100%);
  border: 2px solid rgba(0, 229, 255, 0.35);
  box-shadow:
    0 0 40px rgba(0, 229, 255, 0.15),
    inset 0 0 60px rgba(0, 229, 255, 0.08);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  animation: portraitFloat 4s ease-in-out infinite alternate;
}

@keyframes portraitFloat {
  from { transform: translateY(0); }
  to { transform: translateY(-6px); }
}

.portrait-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid #00e5ff;
  z-index: 3;
  box-shadow: 0 0 12px #00e5ff;
}

.portrait-corner.tl { top: 6px; left: 6px; border-right: none; border-bottom: none; }
.portrait-corner.tr { top: 6px; right: 6px; border-left: none; border-bottom: none; }
.portrait-corner.bl { bottom: 6px; left: 6px; border-right: none; border-top: none; }
.portrait-corner.br { bottom: 6px; right: 6px; border-left: none; border-top: none; }

/* ---------- 三体风格方块化舰长 ---------- */
.trisolaris-captain {
  position: relative;
  width: 70%;
  height: 90%;
  margin-bottom: 6%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.4));
  animation: captainBreath 3s ease-in-out infinite alternate;
}

@keyframes captainBreath {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-4px) scale(1.01); }
}

/* 头盔 */
.tc-head {
  position: relative;
  width: 42%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(180deg, #e8f4ff 0%, #b8d4e8 50%, #8aaccc 100%);
  border: 3px solid #1a3a5a;
  box-shadow:
    inset 0 -10px 20px rgba(0, 0, 0, 0.3),
    inset 0 6px 12px rgba(255, 255, 255, 0.6);
  z-index: 4;
}

.tc-visor {
  position: absolute;
  top: 30%;
  left: 12%;
  width: 76%;
  height: 26%;
  background: linear-gradient(180deg, #00e5ff 0%, #0070a0 100%);
  border: 2px solid #0a1a2a;
  box-shadow:
    0 0 12px #00e5ff,
    inset 0 0 8px rgba(0, 229, 255, 0.8);
}

.tc-visor-glint {
  position: absolute;
  top: 34%;
  left: 18%;
  width: 20%;
  height: 6%;
  background: rgba(255, 255, 255, 0.9);
  filter: blur(1px);
}

.tc-antenna-left,
.tc-antenna-right {
  position: absolute;
  top: -18%;
  width: 4px;
  height: 24%;
  background: #1a3a5a;
}

.tc-antenna-left { left: 22%; transform: rotate(-12deg); }
.tc-antenna-right { right: 22%; transform: rotate(12deg); }

.tc-antenna-left::before,
.tc-antenna-right::before {
  content: '';
  position: absolute;
  top: -6px;
  left: -3px;
  width: 10px;
  height: 10px;
  background: #ff3333;
  border-radius: 50%;
  box-shadow: 0 0 10px #ff3333, 0 0 20px #ff3333;
  animation: antennaBlink 1.5s ease-in-out infinite alternate;
}

@keyframes antennaBlink {
  from { opacity: 0.5; }
  to { opacity: 1; }
}

/* 肩甲 */
.tc-shoulders {
  position: relative;
  width: 100%;
  height: 12%;
  display: flex;
  justify-content: space-between;
  margin-top: -2%;
  z-index: 3;
}

.tc-shoulder {
  width: 22%;
  height: 100%;
  background: linear-gradient(180deg, #e8f4ff 0%, #8aaccc 100%);
  border: 3px solid #1a3a5a;
  box-shadow: inset 0 -6px 12px rgba(0, 0, 0, 0.25);
}

.tc-shoulder-l { transform: skewY(-8deg); }
.tc-shoulder-r { transform: skewY(8deg); }

/* 躯干 */
.tc-torso {
  position: relative;
  width: 52%;
  height: 32%;
  background: linear-gradient(180deg, #e8f4ff 0%, #b8d4e8 60%, #8aaccc 100%);
  border: 3px solid #1a3a5a;
  box-shadow:
    inset 0 -10px 20px rgba(0, 0, 0, 0.3),
    inset 0 6px 12px rgba(255, 255, 255, 0.5);
  z-index: 2;
}

.tc-core {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  width: 22%;
  height: 22%;
  background: radial-gradient(circle, #00e5ff 0%, #0070a0 100%);
  border-radius: 50%;
  box-shadow: 0 0 16px #00e5ff, 0 0 32px rgba(0, 229, 255, 0.6);
  animation: corePulse 1.8s ease-in-out infinite alternate;
}

@keyframes corePulse {
  from { box-shadow: 0 0 12px #00e5ff, 0 0 24px rgba(0, 229, 255, 0.4); }
  to { box-shadow: 0 0 20px #00e5ff, 0 0 40px rgba(0, 229, 255, 0.8); }
}

.tc-panel {
  position: absolute;
  width: 12%;
  height: 6%;
  background: #1a3a5a;
}

.tc-panel-1 { top: 12%; left: 12%; }
.tc-panel-2 { top: 12%; right: 12%; }
.tc-panel-3 { bottom: 12%; left: 50%; transform: translateX(-50%); width: 40%; }

/* 臂 */
.tc-arm {
  position: absolute;
  top: 26%;
  width: 12%;
  height: 26%;
  background: linear-gradient(180deg, #e8f4ff 0%, #8aaccc 100%);
  border: 3px solid #1a3a5a;
  z-index: 1;
}

.tc-arm-l { left: 12%; transform: rotate(6deg); }
.tc-arm-r { right: 12%; transform: rotate(-6deg); }

.tc-arm::after {
  content: '';
  position: absolute;
  bottom: -18%;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 20%;
  background: #1a3a5a;
}

/* 腿 */
.tc-leg {
  position: absolute;
  bottom: 0;
  width: 16%;
  height: 30%;
  background: linear-gradient(180deg, #b8d4e8 0%, #5a7a9a 100%);
  border: 3px solid #1a3a5a;
  z-index: 1;
}

.tc-leg-l { left: 26%; }
.tc-leg-r { right: 26%; }

/* 扫描线覆盖 */
.portrait-scan {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(0, 229, 255, 0.08) 45%,
    rgba(0, 229, 255, 0.25) 50%,
    rgba(0, 229, 255, 0.08) 55%,
    transparent 100%);
  background-size: 100% 40px;
  animation: scanMove 3s linear infinite;
  pointer-events: none;
  z-index: 5;
}

@keyframes scanMove {
  from { background-position: 0 -40px; }
  to { background-position: 0 100%; }
}

.portrait-label {
  position: absolute;
  bottom: 8px;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 0.6rem;
  letter-spacing: 3px;
  color: #00e5ff;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.8);
  font-family: 'Courier New', monospace;
  z-index: 6;
}

/* ============================================================
   右侧特性
   ============================================================ */

.home-features {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.home-feature {
  padding: 6px 8px;
  background: rgba(0, 60, 120, 0.15);
  border-left: 2px solid #00e5ff;
  transition: all 0.2s;
}

.home-feature:hover {
  background: rgba(0, 100, 180, 0.25);
  border-left-color: #4ae0a0;
  transform: translateX(3px);
}

.home-feature .ft-title {
  font-size: 0.7rem;
  color: #b0e4ff;
  margin-bottom: 2px;
  letter-spacing: 1px;
}

.home-feature .ft-desc {
  font-size: 0.58rem;
  color: #6a9ab0;
  line-height: 1.4;
}

/* 操作说明 */
.home-controls {
  padding-top: 10px;
  border-top: 1px solid rgba(0, 229, 255, 0.15);
}

.hc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 0.6rem;
}

.hc-key {
  display: inline-block;
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid rgba(0, 229, 255, 0.4);
  color: #00e5ff;
  padding: 1px 6px;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
  min-width: 70px;
  text-align: center;
}

.hc-act {
  color: #8ab8d8;
}

/* ============================================================
   底部
   ============================================================ */

.home-footer {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 10px;
  font-size: 0.6rem;
  letter-spacing: 4px;
  color: #4a6a80;
  font-family: 'Courier New', monospace;
}

/* ============================================================
   开始游戏按钮
   ============================================================ */

.home-start-btn {
  position: fixed;
  bottom: 40px;
  right: 40px;
  z-index: 10;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.15) 0%, rgba(0, 100, 180, 0.35) 100%);
  border: 2px solid #00e5ff;
  color: #ffffff;
  border-radius: 0;
  padding: 16px 28px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.5), inset 0 0 20px rgba(0, 229, 255, 0.1);
  text-transform: uppercase;
  font-family: 'Courier New', monospace;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: btnGlow 2s ease-in-out infinite alternate;
}

@keyframes btnGlow {
  from { box-shadow: 0 0 20px rgba(0, 229, 255, 0.5), inset 0 0 20px rgba(0, 229, 255, 0.1); }
  to { box-shadow: 0 0 40px rgba(0, 229, 255, 0.9), inset 0 0 30px rgba(0, 229, 255, 0.25); }
}

.home-start-btn:hover {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.4) 0%, rgba(0, 140, 220, 0.6) 100%);
  box-shadow: 0 0 60px rgba(0, 229, 255, 1), inset 0 0 40px rgba(0, 229, 255, 0.4);
  transform: translateY(-3px);
}

.home-start-btn:active { transform: translateY(0); }

.hsb-line {
  display: inline-block;
  width: 20px;
  height: 1px;
  background: #00e5ff;
  box-shadow: 0 0 8px #00e5ff;
}

.hsb-text { display: inline-block; }

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 1100px) {
  .home-body {
    grid-template-columns: 1fr;
    padding: 10px 20px;
  }
  .home-panel-left,
  .home-panel-right { max-height: 240px; overflow-y: auto; }
  .home-center { order: -1; }
  .home-portrait-frame { max-width: 240px; }
  .home-title { font-size: 1.6rem; letter-spacing: 8px; }
  .home-title span { font-size: 1rem; letter-spacing: 12px; }
  .home-start-btn { bottom: 20px; right: 20px; padding: 12px 20px; font-size: 0.75rem; letter-spacing: 3px; }
}

@media (max-width: 600px) {
  .home-header { padding: 16px 10px 6px; }
  .home-logo-mark { font-size: 1rem; letter-spacing: 6px; }
  .home-title { font-size: 1.2rem; letter-spacing: 6px; }
  .home-title span { font-size: 0.8rem; letter-spacing: 8px; }
  .home-subtitle { font-size: 0.6rem; letter-spacing: 4px; }
  .home-badge { font-size: 0.5rem; letter-spacing: 2px; padding: 3px 10px; }
  .home-portrait-frame { max-width: 180px; }
  .home-stat { font-size: 0.62rem; padding: 4px 2px; }
  .home-feature .ft-title { font-size: 0.6rem; }
  .home-feature .ft-desc { font-size: 0.5rem; }
}