/* Battle panel shared by the Dojo and the Dungeon (built by lib/battle-ui.js). */
.battle { display: flex; flex-direction: column; gap: 1rem; }
.battle [hidden] { display: none !important; }
.battle .small { font-size: 0.8rem; color: var(--muted); }

.arena { display: grid; grid-template-columns: 3fr 2fr; gap: 1rem; align-items: stretch; }
@media (max-width: 560px) { .arena { grid-template-columns: 1fr; } }
.fighter { position: relative; background: var(--card); border: 1px solid var(--card-edge); border-radius: 0.9rem; padding: 1rem; text-align: center; }
.fighter.hit, .bar.hit { animation: shake 0.35s; }
.monster.dead { opacity: 0.45; filter: grayscale(1); transition: opacity 0.4s, filter 0.4s; }
.avatar { font-size: 2.6rem; line-height: 1; }
.elite-badge { position: absolute; top: 0.7rem; right: 0.8rem; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: #fff; background: var(--accent); border-radius: 999px; padding: 0.1rem 0.5rem; }
.m-word { font-size: 3rem; line-height: 1.15; margin-top: 0.3rem; color: var(--accent); word-break: keep-all; }
.m-reading { font-size: 1rem; }
.m-meaning { font-size: 0.9rem; color: var(--muted); min-height: 1.2em; }
.p-name { font-size: 1rem; margin-top: 0.3rem; }
.p-practice { margin-top: 0.4rem; }
.bar { height: 0.6rem; border-radius: 999px; background: var(--card-edge); overflow: hidden; margin: 0.7rem auto 0.25rem; max-width: 16rem; }
.bar .fill { height: 100%; width: 100%; background: var(--accent); transition: width 0.4s ease; }
.p-bar .fill { background: #3f9a5b; }
.bar-text { font-size: 0.78rem; color: var(--muted); }
.weapon { margin-top: 0.6rem; font-size: 0.9rem; }
.damage { font-weight: 600; }
.damage.reduced { color: var(--accent); }

.strike { background: var(--card); border: 1px solid var(--card-edge); border-radius: 0.9rem; padding: 1rem; }
.prompt { margin: 0 0 0.7rem; }
.prompt strong { color: var(--accent); font-size: 1.15em; }
.strike-form { display: flex; gap: 0.5rem; }
.strike-form input {
  flex: 1; min-width: 0; height: 3rem; padding: 0 0.8rem; font-size: 1.2rem;
  border: 2px solid var(--card-edge); border-radius: 0.6rem; background: var(--bg); color: var(--ink);
}
.strike-form input:focus { outline: none; border-color: var(--accent); }
.battle button, .game-button {
  height: 3rem; padding: 0 1.2rem; font: inherit; border: 0; border-radius: 0.6rem; background: var(--accent); color: #fff; cursor: pointer;
}
.battle button:disabled { opacity: 0.5; cursor: default; }
.battle button.secondary, .game-button.secondary { height: 2.3rem; background: transparent; color: var(--ink); border: 1px solid var(--card-edge); font-size: 0.85rem; }
.battle button.secondary:hover, .game-button.secondary:hover { border-color: var(--accent); color: var(--accent); }
.battle button.link { height: auto; padding: 0; background: none; color: var(--muted); font-size: 0.8rem; text-decoration: underline; }
.battle button.link:hover { color: var(--accent); }
.strike-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-top: 0.6rem; }
.strike-actions .link { margin-left: auto; }
.m-edit { margin-top: 0.2rem; }

.feedback { display: flex; flex-direction: column; gap: 0.5rem; }
.feedback:empty { display: none; }
.verdict { border-radius: 0.8rem; padding: 0.8rem 1rem; border: 1px solid var(--card-edge); background: var(--card); line-height: 1.45; }
.verdict.pass { border-color: #3f9a5b; }
.verdict.fix { border-color: var(--accent); }
.verdict.error { border-style: dashed; }
.verdict .title { font-weight: 600; margin-bottom: 0.2rem; }
.verdict.pass .title { color: #3f9a5b; }
.verdict.fix .title { color: var(--accent); }
.verdict .label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-top: 0.4rem; }
.verdict .ja { font-size: 1.1rem; }
.history { list-style: none; margin: 0; padding: 0; font-size: 0.85rem; color: var(--muted); }
.history li::before { content: "✗ "; color: var(--accent); }
.log { font-size: 0.88rem; color: var(--muted); margin: 0; }

.debug { font-size: 0.75rem; color: var(--muted); }
.debug pre { white-space: pre-wrap; word-break: break-word; background: var(--card); border: 1px solid var(--card-edge); border-radius: 0.5rem; padding: 0.6rem; }

@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* Sentence power (design §5.10): the damage range, the tier legend, and stronger hit cards. */
.power-range { margin-top: 0.15rem; }
.power-legend { margin-top: 0.7rem; }
.power-legend summary { cursor: pointer; }
.power-legend ul { margin: 0.4rem 0 0; padding-left: 1.1rem; line-height: 1.5; }
.verdict.pass.tier-3 .title { font-size: 1.1rem; }
.verdict.pass.tier-4 { border-width: 2px; background: rgba(63, 154, 91, 0.1); }
.verdict.pass.tier-4 .title { font-size: 1.25rem; }
