.dungeon-wrap {
  width: 100%;
}

.dungeon-wrap [hidden] {
  display: none !important;
}

.dungeon-hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.dungeon-stat {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #101012;
}

.dungeon-stat span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: .63rem;
  font-weight: 850;
  letter-spacing: .12em;
}

.dungeon-stat strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 1rem;
  white-space: nowrap;
}

.hp-track {
  height: 8px;
  margin: 0 0 26px;
  overflow: hidden;
  border-radius: 999px;
  background: #242429;
}

.hp-track > span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width .25s ease, background .25s ease;
}

.hp-track > span.danger {
  background: #ff6b6b;
}

.dungeon-scene {
  margin-bottom: 18px;
  text-align: center;
}

.dungeon-scene h2 {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 5vw, 3rem);
  letter-spacing: -.05em;
}

.dungeon-scene p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.dungeon-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.dungeon-choice {
  min-height: 190px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: #171719;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-align: center;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
  touch-action: manipulation;
}

.dungeon-choice:hover {
  transform: translateY(-2px);
  border-color: #5b5b64;
  background: #1d1d20;
}

.dungeon-choice:active {
  transform: translateY(0);
}

.dungeon-choice:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.dungeon-choice:disabled {
  cursor: not-allowed;
  opacity: .42;
  transform: none;
}

.choice-number {
  position: absolute;
  top: 10px;
  left: 12px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 900;
}

.choice-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 900;
}

.dungeon-choice strong {
  font-size: 1.05rem;
}

.dungeon-choice small {
  max-width: 190px;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.45;
}

.dungeon-result {
  min-height: 220px;
  padding: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(200,255,72,.3);
  border-radius: 16px;
  background: rgba(200,255,72,.06);
  text-align: center;
}

.dungeon-result.bad {
  border-color: rgba(255,107,107,.35);
  background: rgba(255,107,107,.06);
}

.dungeon-result h2 {
  margin: 0 0 10px;
  font-size: clamp(1.65rem, 5vw, 2.8rem);
  letter-spacing: -.045em;
}

.dungeon-result p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.dungeon-actions {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.dungeon-action {
  min-height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #10110d;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.dungeon-action.secondary {
  border: 1px solid var(--line-strong);
  background: #1a1a1d;
  color: var(--text);
}

.dungeon-best {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-align: center;
}

.boss-status {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #101012;
}

.boss-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: .78rem;
}

.boss-label span {
  color: var(--muted);
  font-weight: 800;
  letter-spacing: .08em;
}

.boss-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #2a2020;
}

.boss-bar span {
  display: block;
  height: 100%;
  background: #ff6b6b;
  transition: width .25s ease;
}

.dungeon-rules {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.dungeon-rules h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.dungeon-rules p {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.8;
}

@media (max-width: 640px) {
  .game-shell {
    width: min(calc(100% - 24px), 900px);
    padding-top: 38px;
  }

  .play-area {
    min-height: 0;
    padding: 16px;
  }

  .dungeon-hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .dungeon-choices {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .dungeon-choice {
    min-height: 98px;
    padding: 14px 48px 14px 64px;
    align-items: flex-start;
    gap: 3px;
    text-align: left;
  }

  .choice-icon {
    width: 38px;
    height: 38px;
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.05rem;
  }

  .choice-number {
    top: 8px;
    right: 10px;
    left: auto;
  }

  .dungeon-choice small {
    max-width: none;
  }

  .boss-status {
    grid-column: auto;
  }

  .dungeon-actions {
    display: grid;
  }

  .dungeon-action {
    width: 100%;
  }
}
