:root {
  color-scheme: dark;
  font-family: "Segoe UI", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #12121a;
  color: #f4f1ea;
  touch-action: none;
  user-select: none;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
}

#game-root {
  width: 100%;
  height: 100%;
}

#hud {
  position: absolute;
  z-index: 5;
  top: calc(8px + env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  display: flex;
  gap: 16px;
  pointer-events: none;
  font-size: 16px;
}

.hud-block {
  display: flex;
  flex-direction: column;
  min-width: 64px;
}

.hud-block[hidden] {
  display: none !important;
}

.hud-block span {
  opacity: 0.65;
  font-size: 12px;
}

#hud button {
  pointer-events: auto;
}

#m1-banner {
  pointer-events: auto;
  margin-left: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid #f7dc6f;
  background: rgba(12, 28, 40, 0.92);
}

#m1-banner[hidden] {
  display: none !important;
}

#m1-banner strong {
  color: #f7dc6f;
  font-size: 14px;
}

#m1-banner span {
  opacity: 0.9;
  font-size: 13px;
}

#m1-banner button {
  min-height: 36px;
  border: 0;
  background: #4ecdc4;
  color: #12121a;
  cursor: pointer;
}

#seal-progress {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: calc(64px + env(safe-area-inset-top));
  transform: translateX(-50%);
  padding: 6px 12px;
  border: 1px solid #7ec8e3;
  background: rgba(8, 24, 36, 0.8);
  pointer-events: none;
}

#seal-progress[hidden] {
  display: none !important;
}

#choice-reroll-row {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

#choice-reroll {
  min-height: 44px;
  min-width: 160px;
  padding: 0 20px;
  border: 1px dashed #7ec8e3;
  background: #242433;
  color: inherit;
  cursor: pointer;
}

#choice-reroll:disabled {
  opacity: 0.45;
  cursor: default;
}

#choice-overlay,
#end-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  background: rgba(8, 8, 12, 0.55);
}

#choice-overlay[hidden],
#end-overlay[hidden] {
  display: none;
}

.panel,
.choice-stage {
  width: min(720px, calc(100vw - 24px));
  padding: 20px;
  border: 1px solid #4ecdc4;
  background: #1b1b26;
}

#choice-list {
  display: grid;
  gap: 12px;
}

.choice-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border: 0;
  background: #2a2a38;
  color: inherit;
  text-align: left;
  min-height: 64px;
  cursor: pointer;
}

.choice-card__icon {
  display: none;
}

.choice-card__tag {
  font-size: 12px;
  opacity: 0.75;
}

.choice-card__name {
  font-size: 16px;
}

.choice-card__desc {
  font-size: 13px;
  opacity: 0.9;
}

.choice-card__note[hidden] {
  display: none !important;
}

.choice-card:hover,
.choice-card:focus-visible {
  outline: 2px solid #f7dc6f;
}

/* —— Ocean Mage upgrade choice v0.4 — diagnostic fix + vertical composition —— */
body.ocean-mage-run #choice-overlay.choice-overlay--ocean {
  background:
    radial-gradient(ellipse at 50% 36%, rgba(8, 18, 28, 0.26), transparent 56%),
    rgba(2, 4, 8, 0.66);
  align-items: center;
  justify-items: center;
  align-content: center;
  padding: max(18px, 4vh) 16px max(24px, 5vh);
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-stage {
  width: min(1000px, calc(100vw - 36px));
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  margin-top: 0;
  transform: translateY(-2vh);
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  margin: 0 0 18px;
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-header__mark {
  display: block;
  width: min(240px, 36vw);
  height: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  line-height: 0;
  opacity: 0.62;
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-header__ornament {
  display: block;
  width: 100%;
  height: auto;
  max-height: 56px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean #choice-title {
  margin: 0;
  text-align: center;
  font-size: 29px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #f7fafc;
  text-shadow: 0 0 24px rgba(120, 190, 230, 0.1);
  position: relative;
  padding: 0;
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-subtitle {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: rgba(175, 200, 215, 0.48);
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-footer {
  display: block;
  margin: 12px 0 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(160, 185, 200, 0.28);
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean #choice-list {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;
  gap: 22px;
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card {
  --choice-card-w: 304px;
  position: relative;
  display: block;
  width: var(--choice-card-w);
  aspect-ratio: 480 / 700;
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #f4f7f9;
  outline: none;
  overflow: visible;
  transform: translateY(0) scale(1);
  filter: brightness(1);
  transition:
    transform 180ms ease,
    filter 180ms ease;
  cursor: pointer;
}

/* Formal PNG frame — no CSS cyan border simulation */
body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card__frame {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--choice-frame);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--choice-frame-hover);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  opacity: 0;
  transition: opacity 180ms ease;
}

/*
  Vertical composition:
  ~42% emblem · ~38% text · ~20% role
*/
body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card__body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 42% 38% 20%;
  align-items: stretch;
  justify-items: center;
  text-align: center;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 6% 10% 7%;
  gap: 0;
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card__emblem {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 0;
}

/* Emblem zone */
body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none;
  overflow: visible;
  color: inherit;
}

/* Soft rune glow — CSS only, never a solid square plate */
body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card__icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100px;
  height: 100px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(140, 210, 240, 0.14) 0%, rgba(80, 150, 190, 0.05) 38%, transparent 68%);
  box-shadow: none;
  pointer-events: none;
  z-index: 0;
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card__glyph {
  position: relative;
  z-index: 1;
  width: 86px;
  height: 86px;
  display: block;
  object-fit: contain;
  background: transparent !important;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 0 10px rgba(120, 200, 235, 0.22));
}

/* Text zone */
body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 0;
  padding-top: 2px;
  box-sizing: border-box;
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card__tag {
  align-self: center;
  margin: 0 0 10px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(150, 200, 230, 0.14);
  background: transparent;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: rgba(200, 220, 235, 0.58);
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card__name {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #ffffff;
  line-height: 1.25;
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card__desc {
  margin-top: 14px;
  max-width: 14.5em;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: rgba(215, 226, 234, 0.78);
}

/* Role zone */
body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card__role {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  min-height: 0;
  box-sizing: border-box;
  padding-bottom: 2px;
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card__note {
  margin: 0;
  padding: 0;
  width: 100%;
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: rgba(150, 185, 205, 0.52);
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card:hover,
body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card:focus-visible {
  outline: none;
  transform: translateY(-3px) scale(1.01);
  filter: brightness(1.05);
  border: 0;
  box-shadow: none;
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card:hover .choice-card__frame::after,
body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card:focus-visible .choice-card__frame::after {
  opacity: 1;
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card:active {
  transform: translateY(-1px) scale(1.004);
  filter: brightness(1.03);
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean #choice-reroll-row {
  margin-top: 24px;
  display: flex;
  justify-content: center;
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean #choice-reroll.choice-reroll--asset,
body.ocean-mage-run #choice-overlay.choice-overlay--ocean #choice-reroll {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 200px;
  height: 76px;
  min-width: 0;
  min-height: 0;
  padding: 0 20px;
  border: 0;
  border-radius: 0;
  clip-path: none;
  background-color: transparent;
  background-image: var(--choice-reroll-frame);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  color: rgba(225, 236, 245, 0.88);
  font-size: 13px;
  letter-spacing: 0.14em;
  transition: filter 140ms ease, opacity 140ms ease, transform 140ms ease;
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean #choice-reroll .choice-reroll__icon,
body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-reroll__icon {
  display: none !important;
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean #choice-reroll:not(:disabled):hover,
body.ocean-mage-run #choice-overlay.choice-overlay--ocean #choice-reroll:not(:disabled):focus-visible {
  border: 0;
  background-color: transparent;
  filter: brightness(1.06);
  color: #ffffff;
  transform: translateY(-1px);
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean #choice-reroll:disabled {
  opacity: 0.35;
  filter: grayscale(0.15);
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean.choice-overlay--enter {
  animation: ocean-choice-mask-in 240ms ease-out;
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean.choice-overlay--enter .choice-card {
  animation: ocean-choice-card-in 380ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: var(--choice-stagger, 0ms);
}

@keyframes ocean-choice-mask-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes ocean-choice-card-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(1);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 980px) {
  body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card {
    --choice-card-w: clamp(250px, 28vw, 280px);
  }

  body.ocean-mage-run #choice-overlay.choice-overlay--ocean #choice-list {
    gap: 16px;
  }
}

@media (max-width: 900px) {
  body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card {
    --choice-card-w: clamp(220px, 30vw, 260px);
  }

  body.ocean-mage-run #choice-overlay.choice-overlay--ocean #choice-list {
    gap: 14px;
  }

  body.ocean-mage-run #choice-overlay.choice-overlay--ocean #choice-title {
    font-size: 26px;
  }

  body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card__glyph {
    width: 72px;
    height: 72px;
  }
}

@media (max-width: 720px) {
  body.ocean-mage-run #choice-overlay.choice-overlay--ocean {
    padding-top: max(20px, 4vh);
  }

  body.ocean-mage-run #choice-overlay.choice-overlay--ocean #choice-list {
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }

  body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card {
    --choice-card-w: min(304px, 78vw);
  }

  body.ocean-mage-run #choice-overlay.choice-overlay--ocean #choice-title {
    font-size: 24px;
    letter-spacing: 0.12em;
  }

  body.ocean-mage-run #choice-overlay.choice-overlay--ocean #choice-reroll {
    width: 190px;
    height: 72px;
  }
}

/* Hide ocean-only chrome on non-ocean recipes */
.choice-subtitle,
.choice-footer,
.choice-header__mark,
.choice-reroll__icon {
  display: none;
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-subtitle,
body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-footer {
  display: block;
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-header__mark {
  display: block;
}

#touch-stick {
  position: absolute;
  z-index: 6;
  left: calc(24px + env(safe-area-inset-left));
  bottom: calc(24px + env(safe-area-inset-bottom));
  width: 120px;
  height: 120px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
}

#touch-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: rgba(78, 205, 196, 0.9);
}

#aim-pad {
  position: absolute;
  z-index: 6;
  right: calc(24px + env(safe-area-inset-right));
  bottom: calc(24px + env(safe-area-inset-bottom));
  width: 120px;
  height: 120px;
  border: 2px solid rgba(93, 173, 226, 0.45);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
}

#aim-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: rgba(93, 173, 226, 0.95);
}

#dodge-button {
  position: absolute;
  z-index: 6;
  right: calc(28px + env(safe-area-inset-right));
  bottom: calc(28px + env(safe-area-inset-bottom));
  width: 88px;
  height: 88px;
  padding: 0;
  border: 2px solid rgba(126, 200, 227, 0.85);
  border-radius: 50%;
  background: rgba(8, 28, 40, 0.55);
  cursor: pointer;
  touch-action: none;
}

#dodge-button[hidden] {
  display: none !important;
}

#dodge-fill {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: rgba(126, 200, 227, 0.55);
  transform: scale(1);
  pointer-events: none;
}

#dodge-icon {
  position: absolute;
  inset: 22px;
  border-radius: 0;
  background: transparent center / contain no-repeat;
  background-image: url("/assets/ui/dodge.png");
  pointer-events: none;
  opacity: 0.95;
}

#dodge-button.cooling {
  opacity: 0.45;
}

body.ocean-mage-run #aim-pad {
  display: none !important;
}

@media (pointer: fine) {
  #touch-stick,
  #aim-pad,
  #dodge-button {
    display: none !important;
  }
}

#restart-button {
  margin-top: 12px;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  background: #4ecdc4;
  color: #12121a;
  font-size: 18px;
  cursor: pointer;
}

/* ─── Ocean Mage · Shallow Demo HUD ───────────────────────────────── */
body.ocean-mage-run:not(.om-debug) #hud {
  display: none;
}

body.ocean-mage-run #end-overlay:not([hidden]) {
  animation: om-fade-in 420ms ease 1.1s both;
  background: rgba(2, 14, 24, 0.62);
}

body.ocean-mage-run #end-overlay .panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: auto;
  padding: 28px 40px;
  border: 1px solid rgba(255, 140, 140, 0.45);
  border-radius: 14px;
  background: rgba(6, 28, 42, 0.9);
  font-family: "Segoe UI", "PingFang SC", sans-serif;
}

body.ocean-mage-run #end-overlay #end-text {
  margin: 0;
  font-size: 24px;
  color: #ffd0d0;
  letter-spacing: 0.06em;
}

body.ocean-mage-run #end-overlay #restart-button {
  min-height: 44px;
  padding: 0 26px;
  border: 0;
  border-radius: 8px;
  background: #4ecdc4;
  color: #0c1c24;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}

.om-hud {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  font-family: "Segoe UI", "PingFang SC", sans-serif;
  color: #eaf7fb;
  text-shadow: 0 1px 2px rgba(0, 10, 20, 0.85);
}

.om-hud [hidden] {
  display: none !important;
}

.om-hud__bl {
  position: absolute;
  left: calc(16px + env(safe-area-inset-left));
  bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 10px 7px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(6, 30, 44, 0.42), rgba(6, 22, 34, 0.62));
}

.om-hearts {
  display: flex;
  flex-wrap: wrap;
  max-width: 260px;
  gap: 2px;
}

.om-heart {
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5));
}

.om-hearts.is-flash .om-heart {
  filter: brightness(1.8) drop-shadow(0 0 5px rgba(255, 90, 90, 0.95));
}

.om-hearts.is-shake {
  animation: om-shake 260ms ease;
}

.om-lv {
  display: flex;
  align-items: center;
  gap: 7px;
}

.om-lv__label {
  min-width: 38px;
  font-size: 13px;
  font-weight: 700;
  color: #ffe9a8;
}

.om-xp {
  position: relative;
  width: 150px;
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(0, 16, 26, 0.75);
  box-shadow: inset 0 0 0 1px rgba(255, 220, 140, 0.25);
}

.om-xp__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, #f1b84b, #ffe28a);
  transition: width 140ms linear;
}

.om-stats {
  display: flex;
  gap: 10px;
}

.om-stat {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
}

.om-stat__icon {
  width: 18px;
  height: 18px;
}

.om-hud__br {
  position: absolute;
  right: calc(18px + env(safe-area-inset-right));
  bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.om-shards,
.om-key {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px 4px 5px;
  border-radius: 16px;
  background: rgba(6, 26, 38, 0.55);
  font-size: 14px;
  font-weight: 700;
}

.om-shards__icon,
.om-key__icon {
  width: 26px;
  height: 26px;
}

.om-shards.is-full {
  color: #9ff3ff;
  box-shadow: 0 0 10px rgba(111, 227, 255, 0.55);
}

.om-key {
  padding: 4px;
  box-shadow: 0 0 12px rgba(255, 211, 107, 0.6);
  animation: om-pop 360ms ease;
}

.om-dash {
  --p: 1;
  position: relative;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(6, 24, 36, 0.6);
  pointer-events: auto;
  cursor: pointer;
  touch-action: none;
  transition: transform 120ms ease;
}

.om-dash__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(rgba(111, 227, 255, 0.85) calc(var(--p) * 360deg), rgba(20, 40, 52, 0.7) 0);
  -webkit-mask: radial-gradient(circle, transparent 26px, #000 27px);
  mask: radial-gradient(circle, transparent 26px, #000 27px);
}

.om-dash__icon {
  position: absolute;
  inset: 6px;
  width: 52px;
  height: 52px;
}

.om-dash__time {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}

.om-dash.is-cooling .om-dash__icon {
  filter: grayscale(0.7) brightness(0.55);
}

.om-dash.is-locked {
  opacity: 0.35;
}

.om-dash.is-locked .om-dash__icon {
  filter: grayscale(1) brightness(0.6);
}

.om-dash.is-ready {
  box-shadow: 0 0 14px rgba(111, 227, 255, 0.7);
  animation: om-glow 1.6s ease-in-out infinite;
}

.om-dash.is-used {
  transform: scale(0.86);
}

.om-dash.is-pulse {
  animation: om-pop 420ms ease, om-glow 1.6s ease-in-out 420ms infinite;
}

.om-hud__br > .is-appear {
  animation: om-appear 320ms cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
}

.om-hud__br > .om-dash.is-appear.is-ready {
  animation: om-appear 320ms cubic-bezier(0.2, 0.9, 0.3, 1.3) both, om-glow 1.6s ease-in-out 320ms infinite;
}

.om-boss {
  position: absolute;
  left: 50%;
  top: calc(12px + env(safe-area-inset-top));
  transform: translateX(-50%);
  width: min(520px, calc(100vw - 40px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.om-boss__name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #cfefff;
}

.om-boss__track {
  position: relative;
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(4, 14, 22, 0.85);
  box-shadow: inset 0 0 0 1px rgba(160, 230, 255, 0.35);
}

.om-boss__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  background: linear-gradient(90deg, #2bb3d8, #8ff0ff);
  transition: width 160ms linear;
}

.om-boss.is-enraged .om-boss__fill {
  background: linear-gradient(90deg, #d84b3a, #ffb36b);
}

.om-toast {
  position: absolute;
  left: 50%;
  top: 24%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 22px;
  border-radius: 10px;
  background: rgba(4, 20, 32, 0.6);
  text-align: center;
  white-space: nowrap;
}

.om-toast.is-in {
  animation: om-fade-in 260ms ease;
}

.om-toast__line {
  font-size: 14px;
}

strong.om-toast__line {
  font-size: 19px;
  color: #bff3ff;
}

.om-prompt {
  position: absolute;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 6px 14px;
  border: 1px solid rgba(126, 200, 227, 0.35);
  border-radius: 14px;
  background: rgba(4, 20, 32, 0.6);
  color: #d8f3fb;
  font-size: 13px;
  pointer-events: none;
}

.om-prompt.is-action {
  border-color: rgba(255, 220, 140, 0.85);
  color: #ffe9a8;
  font-size: 15px;
  font-weight: 700;
  pointer-events: auto;
  cursor: pointer;
  animation: om-glow 1.4s ease-in-out infinite;
}

.om-ending {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: grid;
  place-items: center;
  background: rgba(2, 14, 24, 0.62);
  pointer-events: auto;
  animation: om-fade-in 600ms ease;
}

.om-ending__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 40px;
  border: 1px solid rgba(143, 240, 255, 0.45);
  border-radius: 14px;
  background: rgba(6, 28, 42, 0.9);
}

.om-ending__title {
  font-size: 26px;
  color: #bff3ff;
  letter-spacing: 0.08em;
}

.om-ending__sub {
  font-size: 15px;
  opacity: 0.9;
}

.om-ending__btn {
  margin-top: 8px;
  min-height: 44px;
  padding: 0 26px;
  border: 0;
  border-radius: 8px;
  background: #4ecdc4;
  color: #0c1c24;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}

.om-debug-line {
  position: absolute;
  left: 12px;
  top: calc(64px + env(safe-area-inset-top));
  padding: 3px 8px;
  background: rgba(0, 0, 0, 0.5);
  font: 12px/1.4 Consolas, monospace;
}

@keyframes om-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes om-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
}

@keyframes om-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

@keyframes om-appear {
  0% { opacity: 0; transform: scale(0.6); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes om-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(111, 227, 255, 0.45); }
  50% { box-shadow: 0 0 18px rgba(111, 227, 255, 0.9); }
}

/* Rarity accents on the existing Ocean cards — restrained glow + chip color. */
body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card {
  --rarity: #e8eef2;
  --rarity-glow: 0;
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card--rarity-uncommon {
  --rarity: #6fdc8c;
  --rarity-glow: 0.35;
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card--rarity-rare {
  --rarity: #5aa9ff;
  --rarity-glow: 0.5;
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card--rarity-epic {
  --rarity: #f5c451;
  --rarity-glow: 0.6;
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card--rarity-legendary {
  --rarity: #ff5a5a;
  --rarity-glow: 0.75;
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card[data-rarity] .choice-card__frame {
  filter: drop-shadow(0 0 1.5px var(--rarity)) drop-shadow(0 0 calc(4px + 14px * var(--rarity-glow)) var(--rarity));
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card[data-rarity]::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: 1.2%;
  left: 30%;
  right: 30%;
  height: 4px;
  border-radius: 4px;
  background: var(--rarity);
  box-shadow: 0 0 10px var(--rarity);
  pointer-events: none;
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card[data-rarity] .choice-card__frame::before {
  content: "";
  position: absolute;
  inset: 3.5% 6%;
  border: 2px solid var(--rarity);
  border-radius: 14px;
  opacity: calc(0.25 + var(--rarity-glow) * 0.6);
  pointer-events: none;
}

body.ocean-mage-run #choice-overlay.choice-overlay--ocean .choice-card[data-rarity] .choice-card__tag {
  color: var(--rarity);
}
