.page-knight-duel{
  min-height:calc(100vh - var(--nav-h, 64px));
  max-width:980px;
  margin:0 auto;
  padding:24px 16px 40px;
  color:#e2e8f0;
}

.page-knight-duel .duel-hero{
  margin-bottom:12px;
}

.page-knight-duel .duel-title{
  margin:0;
  font-size:34px;
  font-weight:800;
  letter-spacing:.01em;
}

.page-knight-duel .duel-subtitle{
  margin:8px 0 0;
  color:rgba(226,232,240,.82);
}

.page-knight-duel .duel-status{
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%);
  z-index:6;
  padding:8px 18px;
  border-radius:10px;
  border:1px solid rgba(148,163,184,.25);
  background:rgba(15,23,42,.72);
  font-weight:700;
  font-size:15px;
  text-align:center;
  white-space:nowrap;
  pointer-events:none;
  backdrop-filter:blur(4px);
}

.page-knight-duel .duel-arena{
  display:grid;
  gap:10px;
  margin-bottom:16px;
}

.page-knight-duel .duel-hud{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.page-knight-duel .duel-field{
  position:relative;
  min-height:180px;
  border:1px solid rgba(148,163,184,.24);
  border-radius:18px;
  overflow:hidden;
  background: var(--t-surface);
}

.page-knight-duel .duel-field::after{
  content:'';
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:44px;
  background:rgba(28,28,27,.5);
}

.page-knight-duel .duel-fighter{
  position:absolute;
  bottom:16px;
  z-index:1;
  transition:left .35s ease-out, right .35s ease-out, filter .16s ease;
}

.page-knight-duel .duel-fighter.self{ left:18%; }
.page-knight-duel .duel-fighter.opponent{ right:18%; }

.page-knight-duel .duel-fighter.self.advance{ left:38%; }
.page-knight-duel .duel-fighter.opponent.advance{ right:38%; }

.page-knight-duel .duel-fighter.attack{
  filter:brightness(1.08);
}

.page-knight-duel .duel-fighter.hit{
  filter:brightness(1.3) saturate(2.5) drop-shadow(0 0 12px rgba(239,68,68,.7));
  transition:filter .15s ease;
}

.page-knight-duel .duel-player{
  border:1px solid rgba(148,163,184,.2);
  border-radius:16px;
  padding:14px;
  background:rgba(28,28,27,.52);
  overflow:hidden;
  transition:transform .16s ease, box-shadow .16s ease;
}

.page-knight-duel .duel-player.hit{
  transform:translateX(-8px);
  box-shadow:0 0 0 2px rgba(239,68,68,.55), 0 12px 30px rgba(239,68,68,.25);
}

.page-knight-duel .duel-player.opponent.hit{
  transform:translateX(8px);
}

.page-knight-duel .duel-player.attack{
  transform:translateX(12px);
}

.page-knight-duel .duel-player.opponent.attack{
  transform:translateX(-12px);
}

.page-knight-duel .duel-player.hit{
  box-shadow:0 0 0 2px rgba(239,68,68,.35), 0 8px 22px rgba(239,68,68,.18);
}

.page-knight-duel .duel-player-name{
  font-weight:700;
  margin-bottom:10px;
}

.page-knight-duel .duel-hp-wrap{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:8px;
}

.page-knight-duel .duel-hp-label{
  color:rgba(148,163,184,.95);
  font-size:12px;
  letter-spacing:.08em;
}

.page-knight-duel .duel-hp-bar{
  height:10px;
  border-radius:999px;
  overflow:hidden;
  background:rgba(2,6,23,.65);
  border:1px solid rgba(148,163,184,.25);
}

.page-knight-duel .duel-hp-fill{
  height:100%;
  width:100%;
  transition:width .22s ease;
}

.page-knight-duel .duel-hp-fill.self{ background:#22c55e; }
.page-knight-duel .duel-hp-fill.opponent{ background:#f59e0b; }

.page-knight-duel .duel-hp-value{
  font-weight:700;
  min-width:22px;
  text-align:right;
}

.page-knight-duel .duel-knight-wrap{
  position:relative;
  margin-top:12px;
  height:128px;
  display:flex;
  align-items:flex-end;
  justify-content:center;
}

.page-knight-duel .duel-knight-wrap.opponent{
  transform:scaleX(-1);
}

.page-knight-duel .knight-shadow{
  position:absolute;
  bottom:6px;
  left:50%;
  transform:translateX(-50%);
  width:86px;
  height:14px;
  border-radius:50%;
  background:rgba(2,6,23,.35);
}

.page-knight-duel .knight-figure{
  position:relative;
  width:90px;
  height:116px;
  animation:knight-idle 1.9s ease-in-out infinite;
  transform-origin:50% 90%;
}

.page-knight-duel .duel-fighter.attack .knight-figure{
  animation:knight-strike .4s ease;
}

.page-knight-duel .duel-fighter.hit .knight-figure{
  animation:knight-hit .4s ease;
}

.page-knight-duel .knight-cape{
  position:absolute;
  left:20px;
  top:34px;
  width:42px;
  height:56px;
  background:#7f1d1d;
  border-radius:16px 12px 14px 18px;
  transform:rotate(8deg);
  opacity:.94;
}

.page-knight-duel .knight-legs{
  position:absolute;
  bottom:0;
  left:24px;
  width:42px;
  height:30px;
  display:flex;
  justify-content:space-between;
}

.page-knight-duel .knight-legs .leg{
  width:14px;
  height:28px;
  border-radius:6px;
  background:#64748b;
  box-shadow:inset 0 -5px 0 rgba(15,23,42,.45);
}

.page-knight-duel .knight-body{
  position:absolute;
  left:24px;
  top:40px;
  width:42px;
  height:40px;
  border-radius:10px;
  background:#cbd5e1;
  box-shadow:inset 0 0 0 2px rgba(15,23,42,.28);
}

.page-knight-duel .knight-belt{
  position:absolute;
  left:6px;
  right:6px;
  top:20px;
  height:6px;
  border-radius:4px;
  background:#334155;
}

.page-knight-duel .knight-arm{
  position:absolute;
  top:46px;
  width:12px;
  height:30px;
  border-radius:8px;
  background:#94a3b8;
}

.page-knight-duel .knight-arm.back{ left:16px; transform:rotate(16deg); }
.page-knight-duel .knight-arm.front{ right:14px; transform:rotate(-26deg); }

.page-knight-duel .knight-head{
  position:absolute;
  left:30px;
  top:18px;
  width:30px;
  height:26px;
  border-radius:10px 10px 8px 8px;
  background:#e2e8f0;
  box-shadow:inset 0 0 0 2px rgba(15,23,42,.3);
}

.page-knight-duel .knight-visor{
  position:absolute;
  left:6px;
  right:6px;
  top:10px;
  height:6px;
  border-radius:5px;
  background:#1e293b;
}

.page-knight-duel .knight-shield{
  position:absolute;
  left:2px;
  top:48px;
  width:24px;
  height:30px;
  border-radius:12px 12px 10px 10px;
  background:#1d4ed8;
  border:2px solid rgba(219,234,254,.62);
  box-shadow:0 0 0 1px rgba(15,23,42,.2);
}

.page-knight-duel .knight-sword{
  position:absolute;
  right:-14px;
  top:28px;
  width:26px;
  height:78px;
  transform:rotate(16deg);
  transform-origin:8px 58px;
  transition:transform .12s ease;
}

.page-knight-duel .duel-fighter.attack .knight-sword{
  transform:rotate(80deg);
}

.page-knight-duel .duel-fighter.attack .knight-arm.front{
  transform:rotate(-50deg);
}

.page-knight-duel .knight-sword .blade{
  position:absolute;
  left:10px;
  top:0;
  width:5px;
  height:56px;
  border-radius:3px;
  background:#f8fafc;
}

.page-knight-duel .knight-sword .guard{
  position:absolute;
  left:4px;
  top:53px;
  width:18px;
  height:5px;
  border-radius:3px;
  background:#f59e0b;
}

.page-knight-duel .knight-sword .hilt{
  position:absolute;
  left:9px;
  top:57px;
  width:7px;
  height:18px;
  border-radius:4px;
  background:#7c2d12;
}

@keyframes knight-idle{
  0%, 100% { transform:translateY(0); }
  50% { transform:translateY(-2px); }
}

@keyframes knight-strike{
  0% { transform:translateX(0) scale(1); }
  20% { transform:translateX(-4px) scale(1); }
  50% { transform:translateX(20px) scale(1.06); }
  100% { transform:translateX(0) scale(1); }
}

@keyframes knight-hit{
  0% { transform:translateX(0) rotate(0); }
  25% { transform:translateX(-16px) rotate(-6deg); }
  60% { transform:translateX(-8px) rotate(-2deg); }
  100% { transform:translateX(0) rotate(0); }
}

.page-knight-duel .duel-fighter.hit .knight-sword{
  transform:rotate(-20deg);
}

.page-knight-duel .duel-slash{
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%) rotate(-30deg) scale(0);
  width:60px;
  height:4px;
  border-radius:4px;
  background:rgba(251,191,36,.9);
  opacity:0;
  z-index:5;
  pointer-events:none;
}

.page-knight-duel .duel-slash.show{
  animation:slash-impact .4s ease-out forwards;
}

.page-knight-duel .duel-slash::before,
.page-knight-duel .duel-slash::after{
  content:'';
  position:absolute;
  height:4px;
  border-radius:4px;
}

.page-knight-duel .duel-slash::before{
  top:-10px;
  left:4px;
  width:48px;
  background:rgba(251,191,36,.7);
  transform:rotate(18deg);
}

.page-knight-duel .duel-slash::after{
  top:10px;
  left:4px;
  width:48px;
  background:rgba(251,191,36,.7);
  transform:rotate(-18deg);
}

@keyframes slash-impact{
  0% { transform:translate(-50%,-50%) rotate(-30deg) scale(0); opacity:0; }
  30% { transform:translate(-50%,-50%) rotate(-30deg) scale(1.4); opacity:1; }
  60% { transform:translate(-50%,-50%) rotate(-30deg) scale(1.1); opacity:.8; }
  100% { transform:translate(-50%,-50%) rotate(-30deg) scale(.6); opacity:0; }
}

.page-knight-duel .duel-fighter.defeated{
  animation:knight-fall .6s ease-in forwards;
}

@keyframes knight-fall{
  0% { transform:rotate(0) translateY(0); opacity:1; }
  40% { transform:rotate(30deg) translateY(8px); opacity:1; }
  100% { transform:rotate(75deg) translateY(40px); opacity:.3; }
}

.page-knight-duel .duel-words-card{
  border:1px solid rgba(148,163,184,.2);
  border-radius:16px;
  background:rgba(28,28,27,.52);
  padding:14px;
}

.page-knight-duel .duel-progress{
  font-weight:700;
  margin-bottom:10px;
}

.page-knight-duel .duel-words{
  display:flex;
  justify-content:center;
  align-items:center;
  margin-bottom:14px;
  min-height:84px;
}

.page-knight-duel .duel-word{
  border:1px solid rgba(148,163,184,.25);
  border-radius:10px;
  padding:6px 10px;
  font-weight:600;
  color:#cbd5e1;
}

.page-knight-duel .duel-word.active{
  border-color:#38bdf8;
  color:#f8fafc;
  background:rgba(14,165,233,.2);
}

.page-knight-duel .duel-word.done{
  border-color:rgba(34,197,94,.55);
  color:#86efac;
  background:rgba(34,197,94,.15);
}

.page-knight-duel .duel-word-single{
  width:100%;
  max-width:760px;
  min-height:72px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  font-size:40px;
  line-height:1.1;
  font-weight:800;
  letter-spacing:.02em;
  text-transform:uppercase;
  padding:12px 18px;
}

@media (max-width: 740px){
  .page-knight-duel .duel-word-single{
    min-height:60px;
    font-size:30px;
  }
}

.page-knight-duel .duel-input{
  width:100%;
  height:46px;
  border-radius:12px;
  border:1px solid rgba(148,163,184,.3);
  background:rgba(28,28,27,.7);
  color:#f8fafc;
  font-size:16px;
  padding:0 12px;
  outline:none;
}

.page-knight-duel .duel-input:focus{
  border-color:#38bdf8;
  box-shadow:0 0 0 3px rgba(56,189,248,.25);
}

.page-knight-duel .duel-input.error{
  border-color:#ef4444;
  box-shadow:0 0 0 3px rgba(239,68,68,.2);
}

[data-theme="light"] .page-knight-duel{
  color:#0f172a;
}

[data-theme="light"] .page-knight-duel .duel-subtitle,
[data-theme="light"] .page-knight-duel .duel-hp-label{
  color:#475569;
}

[data-theme="light"] .page-knight-duel .duel-status{
  background:rgba(255,255,255,.82);
  border-color:rgba(148,163,184,.3);
  color:#0f172a;
}

[data-theme="light"] .page-knight-duel .duel-player,
[data-theme="light"] .page-knight-duel .duel-words-card{
  background:rgba(255,255,255,.88);
  border-color:rgba(148,163,184,.35);
}

[data-theme="light"] .page-knight-duel .knight-shadow{
  background:rgba(71,85,105,.2);
}

[data-theme="light"] .page-knight-duel .duel-word{
  color:#334155;
}

[data-theme="light"] .page-knight-duel .duel-input{
  background:#fff;
  color:#0f172a;
}

@media (max-width: 740px){
  .page-knight-duel .duel-title{ font-size:28px; }
  .page-knight-duel .duel-hud{ grid-template-columns:1fr; }
  .page-knight-duel .duel-field{ min-height:200px; }
  .page-knight-duel .duel-fighter.self{ left:12%; }
  .page-knight-duel .duel-fighter.opponent{ right:12%; }
  .page-knight-duel .duel-fighter.self.advance{ left:32%; }
  .page-knight-duel .duel-fighter.opponent.advance{ right:32%; }
}
