﻿/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: #0d1a0f url('/img/ui/ui.png') no-repeat center center / cover;
  font-family: 'Noto Serif SC', 'SimSun', serif;
  color: #e8d9b0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 16px;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(4, 12, 6, 0.78);
  pointer-events: none;
  z-index: 0;
}

#game-wrapper {
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}

/* ===== Rotate Overlay ===== */
#rotate-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.95);
  align-items: center;
  justify-content: center;
}

#rotate-box {
  text-align: center;
  color: #fff;
}

#rotate-icon {
  font-size: 64px;
  animation: rotatePulse 1.2s ease-in-out infinite;
  display: block;
  margin-bottom: 20px;
}

@keyframes rotatePulse {
  0%   { transform: rotate(0deg); }
  40%  { transform: rotate(90deg); }
  60%  { transform: rotate(90deg); }
  100% { transform: rotate(0deg); }
}

#rotate-text {
  font-size: 18px;
  line-height: 1.8;
  color: #caa45d;
  letter-spacing: 2px;
}

@media (orientation: portrait) and (max-width: 768px) {
  #rotate-overlay { display: flex; }
  #game-wrapper   { display: none; }
}

/* ===== Game Title ===== */
#game-title {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 14px;
  padding: 6px 0 2px;
}

#title-main {
  font-size: 28px;
  font-weight: bold;
  color: #caa45d;
  letter-spacing: 4px;
  text-shadow: 0 0 18px rgba(202,164,93,0.6), 0 2px 4px rgba(0,0,0,0.8);
}

#title-sub {
  font-size: 14px;
  color: #e88;
  letter-spacing: 2px;
  border: 1px solid rgba(220,80,80,0.4);
  background: rgba(180,40,40,0.2);
  padding: 2px 10px;
  border-radius: 10px;
}

/* ===== Status Bar ===== */
#status-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(202,164,93,0.2);
  border-radius: 14px;
  padding: 10px 20px;
}

.status-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.player-side { flex-direction: row-reverse; }

.status-label {
  font-size: 11px;
  font-weight: bold;
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: 1px;
  white-space: nowrap;
}

#status-center {
  flex-shrink: 0;
  text-align: center;
  min-width: 100px;
}

/* ===== Enemy Area ===== */
#enemy-area {
  background: rgba(120, 20, 20, 0.12);
  border: 1px solid rgba(220, 80, 80, 0.15);
  border-radius: 14px;
  padding: 10px 20px;
  display: flex;
  justify-content: center;
}

#enemy-hand {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 90px;
}

.card-back {
  width: 58px;
  height: 82px;
  border-radius: 8px;
  background: linear-gradient(135deg, #7b1e1e 0%, #3a0a0a 100%);
  border: 2px solid rgba(200, 80, 80, 0.5);
  box-shadow: 2px 2px 8px rgba(0,0,0,0.5);
  position: relative;
  margin: 0 -4px;
  transition: transform 0.3s, opacity 0.3s;
}

.card-back::after {
  content: '';
  font-size: 28px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.6;
}

.card-back.played {
  opacity: 0.2;
  transform: translateY(10px);
}

.hp-bar-wrap {
  flex: 1;
  height: 10px;
  background: rgba(255,255,255,0.1);
  border-radius: 6px;
  overflow: hidden;
  min-width: 80px;
}

.hp-bar {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s ease;
  width: 100%;
}

.enemy-bar { background: linear-gradient(90deg, #e74c3c, #c0392b); }
.player-bar { background: linear-gradient(90deg, #27ae60, #2ecc71); }

.hp-num {
  font-size: 20px;
  font-weight: bold;
  color: #fff;
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.hp-label { font-size: 11px; color: #aaa; letter-spacing: 1px; }

/* ===== Player Tags ===== */
.player-tag {
  font-size: 12px;
  font-weight: bold;
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: 1px;
  white-space: nowrap;
}

.enemy-tag {
  background: rgba(180, 40, 40, 0.4);
  border: 1px solid rgba(220,80,80,0.5);
  color: #f88;
}

.player-tag-self {
  background: rgba(40, 140, 60, 0.4);
  border: 1px solid rgba(80,200,100,0.5);
  color: #8f8;
}

/* ===== Battlefield ===== */
#battlefield {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-height: 340px;
}

.field-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.zone-label {
  font-size: 12px;
  color: #caa45d;
  letter-spacing: 2px;
  padding: 3px 14px;
  border: 1px solid rgba(202,164,93,0.3);
  border-radius: 14px;
  background: rgba(202,164,93,0.06);
  white-space: nowrap;
}

.card-slot {
  width: 220px;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-slot {
  width: 220px;
  height: 320px;
  border: 2px dashed rgba(202,164,93,0.2);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(202,164,93,0.25);
  font-size: 13px;
  letter-spacing: 2px;
}

/* ===== Center Panel ===== */
#center-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

#round-display {
  font-size: 13px;
  font-weight: bold;
  color: #caa45d;
  text-shadow: 0 0 8px rgba(202,164,93,0.4);
  text-align: center;
  letter-spacing: 2px;
  white-space: nowrap;
}

#hint-text {
  font-size: 13px;
  color: #aaa;
  text-align: center;
  min-height: 20px;
  letter-spacing: 1px;
}

/* ===== Log Panel ===== */
#log-panel {
  width: 100%;
  background: rgba(0,0,0,0.72);
  border: 1px solid rgba(202,164,93,0.4);
  border-radius: 12px;
  padding: 12px 16px;
  max-height: 260px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(202,164,93,0.3) transparent;
}

#log-panel::-webkit-scrollbar { width: 4px; }
#log-panel::-webkit-scrollbar-track { background: transparent; }
#log-panel::-webkit-scrollbar-thumb { background: rgba(202,164,93,0.3); border-radius: 2px; }

#log-title {
  font-size: 11px;
  color: #caa45d;
  letter-spacing: 4px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(202,164,93,0.2);
  text-align: center;
}

#log-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.log-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  opacity: 0;
  animation: logFadeIn 0.4s ease forwards;
}

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

.log-turn {
  flex-shrink: 0;
  font-size: 10px;
  background: rgba(202,164,93,0.15);
  color: #caa45d;
  padding: 2px 8px;
  border-radius: 8px;
  margin-top: 3px;
  white-space: nowrap;
  border: 1px solid rgba(202,164,93,0.2);
}

.log-text {
  font-size: 13px;
  line-height: 1.7;
  color: #f0e0b0;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 4px 10px;
  flex: 1;
  border-left: 3px solid rgba(202,164,93,0.2);
}

.log-text.immune {
  color: #7de8ff;
  background: rgba(100,200,255,0.08);
  border-left-color: #7de8ff;
  font-weight: bold;
}
.log-text.attack {
  color: #ff8080;
  background: rgba(255,80,80,0.08);
  border-left-color: #ff6b6b;
  font-weight: bold;
}
.log-text.wrong {
  color: #ffbb66;
  background: rgba(255,160,60,0.07);
  border-left-color: #ffaa55;
}
.log-text.victory {
  color: #ffe040;
  background: rgba(255,220,40,0.1);
  border-left-color: #ffe040;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(255,224,64,0.5);
}
.log-text.defeat {
  color: #ff5555;
  background: rgba(255,60,60,0.08);
  border-left-color: #ff5555;
  font-weight: bold;
}

/* ===== Player Area ===== */
#player-area {
  background: rgba(20, 80, 30, 0.18);
  border: 1px solid rgba(80, 200, 100, 0.2);
  border-radius: 14px;
  padding: 10px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

#player-info {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
}

/* ===== Player Hand ===== */
#player-hand {
  display: flex;
  justify-content: center;
  position: relative;
  min-height: 145px;
  align-items: flex-end;
  width: 100%;
}

.hand-card {
  width: 88px;
  height: 128px;
  border-radius: 10px;
  background: url('/img/han_backgroud.png') no-repeat center / cover;
  border: 2px solid rgba(202,164,93,0.5);
  box-shadow: 2px 4px 12px rgba(0,0,0,0.5);
  cursor: pointer;
  position: relative;
  margin: 0 -10px;
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s, border-color 0.2s, opacity 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 8px;
  flex-shrink: 0;
}

.hand-card.no-bg { background: linear-gradient(160deg, #1a1033, #2a1f4a); }

.hand-card:hover {
  transform: translateY(-28px) scale(1.06) !important;
  box-shadow: 0 12px 28px rgba(202,164,93,0.4);
  border-color: #caa45d;
  z-index: 10;
}

.hand-card.selected {
  transform: translateY(-36px) scale(1.1) !important;
  border-color: #ffd700;
  box-shadow: 0 0 0 3px rgba(255,215,0,0.55), 0 14px 32px rgba(255,215,0,0.3);
  z-index: 20;
}

.hand-card.used {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-60px) scale(0.75) !important;
}

.hand-card.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.6);
}

.hand-card.disabled:hover {
  transform: none !important;
  box-shadow: 2px 4px 12px rgba(0,0,0,0.5);
}

.hand-card .mini-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid #caa45d;
  object-fit: cover;
  background: #1a1033;
  display: block;
}

.hand-card .mini-avatar-placeholder {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid #caa45d;
  background: #1a1033;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.hand-card .mini-title {
  font-size: 10px;
  font-weight: bold;
  color: #f0dfa0;
  margin-top: 5px;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
  line-height: 1.3;
  padding: 0 4px;
  max-width: 84px;
  word-break: keep-all;
}

.hand-card .mini-type {
  position: absolute;
  bottom: 5px;
  font-size: 9px;
  color: rgba(202,164,93,0.8);
  letter-spacing: 0.5px;
}

/* ===== Full Battlefield Card ===== */
.card {
  width: 220px;
  height: 320px;
  background: url('/img/han_backgroud.png') no-repeat center / cover;
  border-radius: 14px;
  padding-top: 14px;
  text-align: center;
  position: relative;
  box-shadow: 0 6px 24px rgba(0,0,0,0.6), 0 0 0 2px rgba(202,164,93,0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: cardAppear 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}

.card.no-bg { background: linear-gradient(160deg, #1a1033, #2a1f4a); border: 2px solid rgba(202,164,93,0.5); }

@keyframes cardAppear {
  from { opacity: 0; transform: translateY(-20px) scale(0.88); }
  to   { opacity: 1; transform: none; }
}

.card .avatar { margin-top: 16px; }

.card .avatar img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid #caa45d;
  object-fit: cover;
  background: #1a1033;
}

.card.enemy-card .avatar img { border-color: #e74c3c; }
.card.player-card .avatar img { border-color: #2ecc71; }

.card .avatar-placeholder {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid #caa45d;
  background: linear-gradient(135deg, #2d1b4e, #1a2d4e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

.card .title {
  margin-top: 10px;
  font-size: 16px;
  font-weight: bold;
  color: #f0dfa0;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  letter-spacing: 2px;
  padding: 0 12px;
}

.card .card-divider {
  width: 55%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #caa45d, transparent);
  margin: 8px auto 0;
}

.card .desc {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.65;
  color: #d4c49a;
  padding: 0 14px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

.card .card-type {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #caa45d;
  letter-spacing: 1px;
  padding: 2px 10px;
  border: 1px solid rgba(202,164,93,0.35);
  border-radius: 8px;
  white-space: nowrap;
}

.card.immune-pulse { animation: immunePulse 0.7s ease forwards; }
@keyframes immunePulse {
  0%  { box-shadow: 0 0 0 0 rgba(100,200,255,0.8), 0 6px 24px rgba(0,0,0,0.6); }
  50% { box-shadow: 0 0 0 24px rgba(100,200,255,0), 0 6px 24px rgba(0,0,0,0.6); }
  100%{ box-shadow: 0 0 0 0 rgba(100,200,255,0), 0 6px 24px rgba(0,0,0,0.6); }
}

.card.attack-flash { animation: attackFlash 0.5s ease forwards; }
@keyframes attackFlash {
  0%,100% { filter: none; }
  35%     { filter: brightness(2) hue-rotate(300deg) saturate(0.4); }
}

.card.wrong-flash { animation: wrongFlash 0.55s ease forwards; }
@keyframes wrongFlash {
  0%,100% { filter: none; transform: translateX(0); }
  20%     { transform: translateX(-8px); }
  40%     { transform: translateX(8px); }
  60%     { transform: translateX(-5px); filter: brightness(1.8) sepia(1) hue-rotate(320deg); }
  80%     { transform: translateX(5px); }
}

.card.win-glow { animation: winGlow 1s ease infinite alternate; }
@keyframes winGlow {
  from { box-shadow: 0 0 18px rgba(255,215,0,0.4), 0 6px 24px rgba(0,0,0,0.6); }
  to   { box-shadow: 0 0 50px rgba(255,215,0,0.9), 0 6px 24px rgba(0,0,0,0.6); }
}

/* ===== Buttons ===== */
#start-btn {
  padding: 10px 28px;
  font-size: 15px;
  font-family: inherit;
  color: #0d0d1a;
  background: linear-gradient(135deg, #caa45d, #e8c87a, #caa45d);
  border: none;
  border-radius: 22px;
  cursor: pointer;
  letter-spacing: 2px;
  font-weight: bold;
  box-shadow: 0 3px 14px rgba(202,164,93,0.4);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

#start-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 20px rgba(202,164,93,0.6); }
#start-btn:active { transform: none; }
#start-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

#play-btn {
  padding: 9px 24px;
  font-size: 14px;
  font-family: inherit;
  color: #0d1a0f;
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  letter-spacing: 2px;
  font-weight: bold;
  box-shadow: 0 3px 14px rgba(46,204,113,0.35);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.2s;
  display: none;
  white-space: nowrap;
  flex-shrink: 0;
}

#play-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 20px rgba(46,204,113,0.5); }
#play-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

/* ===== Result Overlay ===== */
#result-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
  animation: overlayIn 0.35s ease;
}

@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
#result-overlay.hidden { display: none; }

#result-box {
  background: linear-gradient(160deg, #1a1033, #2a1f4a);
  border: 2px solid #caa45d;
  border-radius: 20px;
  padding: 44px 60px;
  text-align: center;
  box-shadow: 0 0 60px rgba(202,164,93,0.3);
  animation: winBoxIn 0.45s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes winBoxIn {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

#result-title { font-size: 44px; margin-bottom: 10px; }
#result-desc  { font-size: 15px; color: #caa45d; letter-spacing: 2px; margin-bottom: 30px; }

#result-box button {
  padding: 11px 36px;
  font-size: 15px;
  font-family: inherit;
  color: #0d0d1a;
  background: linear-gradient(135deg, #caa45d, #e8c87a);
  border: none;
  border-radius: 22px;
  cursor: pointer;
  font-weight: bold;
  letter-spacing: 2px;
  transition: transform 0.15s, box-shadow 0.15s;
}

#result-box button:hover { transform: translateY(-2px); box-shadow: 0 5px 18px rgba(202,164,93,0.5); }

/* ===== DNA Report Overlay ===== */
#dna-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  backdrop-filter: blur(3px);
  animation: overlayIn 0.3s ease;
}
#dna-overlay.hidden { display: none; }

#dna-box {
  background: linear-gradient(160deg, #0a1a0a 0%, #0d1f2d 100%);
  border: 1px solid rgba(100, 220, 120, 0.4);
  border-radius: 18px;
  padding: 28px 32px 24px;
  width: 540px;
  max-width: 95vw;
  box-shadow: 0 0 40px rgba(50, 200, 80, 0.2);
  animation: winBoxIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

#dna-title {
  text-align: center;
  font-size: 17px;
  font-weight: bold;
  color: #5ddc7a;
  letter-spacing: 3px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(100,220,120,0.2);
}

.dna-reports {
  display: flex;
  gap: 16px;
}

.dna-report {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.08);
}

.dna-report-title {
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 2px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.dna-report.mine .dna-report-title { color: #2ecc71; }
.dna-report.enemy .dna-report-title { color: #e74c3c; }

.dna-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.dna-label {
  font-size: 11px;
  color: #ccc;
  min-width: 80px;
  flex-shrink: 0;
}

.dna-bar-wrap {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}

.dna-bar-fill {
  height: 100%;
  border-radius: 4px;
  width: 0;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}

.dna-report.mine  .dna-bar-fill { background: linear-gradient(90deg, #27ae60, #2ecc71); }
.dna-report.enemy .dna-bar-fill { background: linear-gradient(90deg, #c0392b, #e74c3c); }

.dna-pct {
  font-size: 12px;
  font-weight: bold;
  color: #fff;
  min-width: 32px;
  text-align: right;
  flex-shrink: 0;
}

#dna-close {
  display: block;
  margin: 20px auto 0;
  padding: 8px 32px;
  font-size: 13px;
  font-family: inherit;
  color: #0d1a0f;
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  border: none;
  border-radius: 18px;
  cursor: pointer;
  font-weight: bold;
  letter-spacing: 2px;
  transition: transform 0.15s, box-shadow 0.15s;
}
#dna-close:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(46,204,113,0.4); }

/* ===== DNA Scanning ===== */
#dna-scanning {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px 0 20px;
}

#dna-scan-icon {
  font-size: 40px;
  animation: dnaSpin 1.2s linear infinite;
}

@keyframes dnaSpin {
  0%   { transform: rotateY(0deg) scale(1); }
  50%  { transform: rotateY(180deg) scale(1.15); }
  100% { transform: rotateY(360deg) scale(1); }
}

#dna-scan-txt {
  font-size: 13px;
  color: #5ddc7a;
  letter-spacing: 2px;
  min-height: 20px;
}

#dna-scan-wrap {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}

#dna-scan-bar {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, #27ae60, #5ddc7a, #27ae60);
  background-size: 200% 100%;
  animation: scanShimmer 1s linear infinite;
  transition: width 0.08s linear;
}

@keyframes scanShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

#dna-card-intro {
  background: rgba(93, 220, 122, 0.07);
  border: 1px solid rgba(93, 220, 122, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 12px;
  line-height: 1.7;
}
.dna-card-name {
  font-weight: bold;
  color: #5ddc7a;
  margin-right: 6px;
  font-size: 13px;
}
.dna-card-flavour { color: #c8d8c0; }

/* ===== Mobile Landscape ===== */
@media (max-height: 520px) and (orientation: landscape) {

  body { padding: 6px 8px; align-items: flex-start; }

  #game-wrapper { gap: 5px; }

  /* 标题压缩 */
  #game-title { padding: 2px 0; gap: 8px; }
  #title-main { font-size: 16px; letter-spacing: 2px; }
  #title-sub  { font-size: 11px; padding: 1px 7px; }

  /* 状态栏压缩 */
  #status-bar { padding: 5px 10px; border-radius: 8px; gap: 8px; }
  #status-center { min-width: 70px; }
  #round-display { font-size: 10px; letter-spacing: 1px; }
  .hp-bar-wrap { min-width: 55px; height: 7px; }
  .hp-num { font-size: 13px; min-width: 26px; }
  .hp-label { font-size: 9px; }
  .status-label { font-size: 9px; padding: 2px 6px; }

  /* 敌方背牌区隐藏 */
  #enemy-area { display: none; }

  /* 战场：三栏布局 */
  #battlefield {
    display: grid;
    grid-template-columns: 120px 1fr 130px;
    grid-template-rows: 1fr;
    gap: 6px;
    min-height: unset;
    height: calc(100vh - 130px);
    align-items: stretch;
  }

  /* 左栏：敌我卡槽竖排 */
  .field-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    gap: 4px;
  }

  .zone-label {
    font-size: 9px;
    padding: 2px 8px;
    letter-spacing: 1px;
  }

  .card-slot {
    width: 100px;
    height: calc(50% - 22px);
  }

  .empty-slot {
    width: 100px;
    height: 100%;
    font-size: 9px;
    border-radius: 8px;
  }

  .card {
    width: 100px;
    height: 100%;
    border-radius: 8px;
    padding-top: 6px;
  }

  .card .avatar img,
  .card .avatar-placeholder {
    width: 48px;
    height: 48px;
  }

  .card .card-title { font-size: 10px; margin-top: 4px; }
  .card .card-type  { font-size: 9px; }
  .card .card-desc  { display: none; }

  /* 中栏：战报 */
  #center-panel {
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow: hidden;
    min-width: 0;
  }

  #hint-text {
    font-size: 11px;
    min-height: 16px;
    letter-spacing: 0.5px;
  }

  #log-panel {
    flex: 1;
    max-height: unset;
    padding: 7px 10px;
    border-radius: 8px;
    overflow-y: auto;
  }

  #log-title { font-size: 9px; letter-spacing: 2px; margin-bottom: 6px; padding-bottom: 4px; }
  #log-list  { gap: 5px; }

  .log-item  { gap: 6px; }
  .log-turn  { font-size: 9px; padding: 1px 5px; margin-top: 2px; }
  .log-text  { font-size: 11px; line-height: 1.5; padding: 3px 7px; border-radius: 6px; border-left-width: 2px; }

  /* 右栏：手牌+按钮，field-col是第1和第3子元素
     中间panel是第2，右侧手牌区需要单独定位 */
  #player-area {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 6px 4px;
    border-radius: 10px;
    gap: 4px;
  }

  #player-hand {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    min-height: unset;
    width: 100%;
  }

  /* 手牌纵向排列 */
  .hand-card {
    width: 110px;
    height: 36px;
    margin: 0;
    border-radius: 8px;
    flex-direction: row;
    padding: 4px 8px;
    justify-content: flex-start;
    align-items: center;
    gap: 7px;
    position: static;
  }

  .hand-card:hover {
    transform: translateX(6px) scale(1.02) !important;
  }

  .hand-card.selected {
    transform: translateX(10px) scale(1.04) !important;
    box-shadow: 0 0 0 2px rgba(255,215,0,0.7), 2px 0 14px rgba(255,215,0,0.3);
  }

  .hand-card.used {
    transform: translateX(40px) scale(0.8) !important;
  }

  .hand-card .mini-avatar,
  .hand-card .mini-avatar-placeholder {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
  }

  .hand-card .mini-title {
    font-size: 10px;
    margin-top: 0;
    max-width: 62px;
    text-align: left;
  }

  .hand-card .mini-type { display: none; }

  #player-info {
    width: 100%;
    justify-content: center;
  }

  #start-btn, #play-btn {
    font-size: 11px !important;
    padding: 6px 14px !important;
    border-radius: 14px !important;
  }

  /* 战场列顺序：左=敌我槽（.field-col），中=center-panel，右已是player-area */
  #battlefield > .field-col:first-child  { grid-column: 1; grid-row: 1; }
  #battlefield > #center-panel           { grid-column: 2; grid-row: 1; }
  #battlefield > .field-col:last-child   { display: none; } /* 隐藏右侧重复槽 */

  /* player-area 移入 battlefield grid */
  #player-area {
    position: fixed;
    right: 8px;
    top: 70px;
    bottom: 8px;
    width: 126px;
    z-index: 10;
    border-radius: 10px;
    margin: 0;
  }

  /* battlefield 右侧留出 player-area 宽度 */
  #battlefield {
    grid-template-columns: 110px 1fr;
    margin-right: 134px;
  }

  /* 结果弹窗 */
  #result-box { padding: 20px 18px; }
  #result-title { font-size: 24px; }
  #result-desc  { font-size: 13px; }

  /* DNA弹窗 */
  #dna-box { padding: 14px 16px 14px; width: 92vw; }
  #dna-title { font-size: 13px; margin-bottom: 12px; }
  #dna-card-intro { padding: 7px 10px; font-size: 11px; margin-bottom: 10px; }
  .dna-reports { gap: 10px; }
  .dna-report  { padding: 10px 12px; }
  .dna-report-title { font-size: 10px; }
  .dna-label { font-size: 10px; }
  .dna-pct   { font-size: 11px; }
  #dna-close { font-size: 12px; padding: 8px 20px; }
}
