/* 米歇尔2 · 开场机制 */
@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700&family=Noto+Serif+SC:wght@400;600;700&display=swap");
@import url("michel2-attacks.css");

:root {
  --ink: #0d0b08;
  --gold: #c9a227;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --player-size: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
  background: var(--ink);
  color: #f2ead8;
  font-family: "Noto Serif SC", "Songti SC", serif;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.practice {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 2rem;
}

.practice__bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(160, 50, 55, 0.18), transparent 55%),
    radial-gradient(ellipse at 70% 80%, rgba(201, 162, 39, 0.08), transparent 50%),
    linear-gradient(165deg, #1a1210 0%, #0d0b08 60%, #16100c 100%);
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1rem, 3vw, 1.6rem) clamp(1.2rem, 4vw, 2.5rem);
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem;
  letter-spacing: 0.18em;
  color: rgba(242, 234, 216, 0.78);
  border-bottom: 1px solid transparent;
  transition: color 0.3s, border-color 0.3s;
}

.back::before {
  content: "←";
  font-family: "Cinzel", serif;
}

.back:hover {
  color: #f7efd6;
  border-color: var(--gold);
}

.topbar__mark {
  font-family: "Cinzel", "Noto Serif SC", serif;
  font-size: 0.82rem;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  color: rgba(201, 162, 39, 0.85);
}

.practice__main {
  position: relative;
  z-index: 2;
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  display: grid;
  gap: 0.9rem;
}

.hit-count {
  text-align: center;
  font-size: 1rem;
  letter-spacing: 0.14em;
  color: rgba(255, 170, 160, 0.92);
  min-height: 1.4em;
}

.stage-list {
  list-style: none;
  display: grid;
  gap: 0.45rem;
  width: min(420px, 100%);
  margin: 0 auto;
  padding: 0.2rem 0;
}

.stage-list__item {
  position: relative;
  padding: 0.45rem 0.9rem 0.45rem 1.7rem;
  font-size: 0.92rem;
  letter-spacing: 0.12em;
  color: rgba(242, 234, 216, 0.55);
  border-left: 2px solid rgba(201, 162, 39, 0.18);
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}

.stage-list__item:hover {
  color: rgba(255, 236, 190, 0.9);
  border-left-color: rgba(201, 162, 39, 0.55);
  background: linear-gradient(90deg, rgba(201, 162, 39, 0.1), transparent 85%);
}

.stage-list__item::before {
  content: "";
  position: absolute;
  left: 0.65rem;
  top: 50%;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  transform: translateY(-50%);
  background: rgba(201, 162, 39, 0.28);
  transition: background 0.25s, box-shadow 0.25s;
}

.stage-list__item.is-active {
  color: rgba(255, 236, 190, 0.96);
  border-left-color: rgba(220, 90, 90, 0.75);
  background: linear-gradient(90deg, rgba(180, 40, 50, 0.18), transparent 85%);
}

.stage-list__item.is-active::before {
  background: rgba(255, 140, 120, 0.95);
  box-shadow: 0 0 10px rgba(255, 100, 90, 0.55);
}

.stage-list__item.is-done {
  color: rgba(242, 234, 216, 0.58);
  border-left-color: rgba(201, 162, 39, 0.4);
}

.stage-list__item.is-done::before {
  background: rgba(201, 162, 39, 0.65);
}

.arena {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(62vh, 620px);
  margin-inline: auto;
  /* bg2-tile 已裁掉右缘黑边；显示为原图约 1/4 */
  background-color: #262028;
  background-image: url("../img/bg2-tile.png");
  background-repeat: repeat;
  background-size: 174px 140px;
  border: 1px solid rgba(201, 162, 39, 0.28);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  outline: none;
  touch-action: none;
}

.arena:focus-visible {
  border-color: rgba(220, 100, 100, 0.7);
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.5),
    0 0 0 2px rgba(180, 60, 60, 0.25);
}

.atk-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.player-wrap {
  position: absolute;
  width: var(--player-size);
  height: calc(var(--player-size) * 1.15);
  transform: translate(-50%, -50%);
  z-index: 5;
  pointer-events: none;
}

.player {
  display: block;
  width: 100%;
  height: var(--player-size);
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5));
}

.player-wrap.is-left .player {
  transform: scaleX(-1);
}

.player-wrap.is-hit .player {
  filter: drop-shadow(0 0 16px rgba(255, 80, 80, 0.9)) brightness(1.3);
}

.controls {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.btn {
  appearance: none;
  border: 1px solid rgba(201, 162, 39, 0.4);
  background: rgba(26, 18, 16, 0.85);
  color: #f2ead8;
  font-family: inherit;
  font-size: 0.92rem;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  padding: 0.7rem 1.4rem;
  cursor: pointer;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.btn--primary {
  background: linear-gradient(180deg, rgba(96, 36, 40, 0.92), rgba(36, 14, 16, 0.94));
  border-color: rgba(200, 90, 90, 0.55);
}

.btn:hover,
.btn:focus-visible {
  border-color: rgba(240, 140, 140, 0.85);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  outline: none;
}

@media (max-width: 520px) {
  :root {
    --player-size: 52px;
  }

  .practice__main {
    width: min(100% - 1.2rem, 1100px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none !important;
  }
}
