/* Огурчик Чак: Сад Искушений — ornate cartoon UI, mobile-first */

:root {
  --gold: #f0d078;
  --gold-deep: #b8862a;
  --gold-line: #ffe9a8;
  --cream: #fff4e6;
  --cream-dim: #e6cbb8;
  --rose: #ff90b8;
  --ink: #1a0814;
  --panel: #3a1634ee;
  --panel-solid: #2c1028;
  --hp: #ff5a7a;
  --hp-bg: #3a1528;
  --shield: #8ec8ff;
  --pink: #ff7eb3;
  --tap: 48px;
  --font-ui: "Manrope", "Segoe UI", system-ui, sans-serif;
  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --frame:
    0 0 0 2px var(--gold-deep),
    0 0 0 4px var(--gold),
    0 0 0 5px #7a3a18,
    inset 0 0 0 1px #fff4c866,
    0 8px 22px #0007;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  position: fixed;
  inset: 0;
  color: var(--cream);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.35;
  touch-action: manipulation;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-text-size-adjust: 100%;
  background:
    linear-gradient(rgba(22, 6, 18, 0.62), rgba(22, 6, 18, 0.62)),
    url("assets/bg-garden.jpg") center / cover no-repeat,
    #140812;
}

#app {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  height: 100%;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    url("assets/bg-garden.jpg") center top / cover no-repeat,
    #2a1020;
  padding: max(6px, env(safe-area-inset-top, 0px)) 8px max(6px, env(safe-area-inset-bottom, 0px));
}
#app::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(40, 10, 30, 0.18) 0%, rgba(20, 6, 18, 0.28) 36%, rgba(16, 4, 14, 0.52) 100%);
  z-index: 0;
}
#app > * { position: relative; z-index: 1; }
#app > .mute-btn {
  position: absolute;
  z-index: 40;
}

@media (min-width: 600px) {
  #app {
    box-shadow:
      0 0 0 3px var(--gold),
      0 0 0 6px #6a2a14,
      0 0 80px #000c,
      0 20px 80px #4a103040;
  }
}

.screen {
  display: none;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}
.screen.active { display: flex; }

/* ===== Splash / title / age / end ===== */
#screen-title,
#screen-end,
#screen-age {
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 12px 6px;
}

.splash-figure {
  height: min(34dvh, 240px);
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex: 0 0 auto;
  filter: drop-shadow(0 10px 16px #0008);
}
.splash-figure img,
.splash-figure svg {
  height: 100%;
  width: auto;
  max-width: 90%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.display-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 9vw, 44px);
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: var(--gold);
  text-shadow: 0 2px 0 #5a2010, 0 8px 20px #000a;
}
.display-title em {
  display: block;
  font-style: italic;
  font-weight: 500;
  font-size: 0.52em;
  color: var(--rose);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 6px;
}

.flavor {
  color: var(--cream-dim);
  font-size: 13.5px;
  max-width: 36em;
  text-wrap: pretty;
  text-shadow: 0 1px 4px #000a;
}

.btn {
  appearance: none;
  border: 2px solid var(--gold);
  background:
    linear-gradient(180deg, #ff8ab0 0%, #c43a6a 42%, #8a2048 100%);
  color: #fff8f0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  min-height: var(--tap);
  min-width: 220px;
  padding: 10px 26px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow:
    0 0 0 1px #7a2a14,
    inset 0 2px 0 #ffd0e088,
    0 6px 0 #5a1028,
    0 8px 18px #0007;
  touch-action: manipulation;
  text-shadow: 0 1px 2px #0008;
}
.btn:active {
  transform: translateY(2px);
  box-shadow:
    0 0 0 1px #7a2a14,
    inset 0 2px 0 #ffd0e088,
    0 4px 0 #5a1028,
    0 4px 12px #0006;
}
.btn.secondary {
  background: linear-gradient(180deg, #5a3a58 0%, #3a2040 100%);
  border-color: #e8c36a;
}
.btn:disabled { opacity: 0.5; cursor: default; }

.hint-muted { color: var(--cream-dim); font-size: 12px; text-shadow: 0 1px 3px #000a; }

.age-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}
.age-actions .btn { min-width: 128px; flex: 1 1 128px; max-width: 200px; }
.age-exit { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.age-actions[hidden],
.age-exit[hidden],
#age-question[hidden] { display: none !important; }
.badge-18 {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: 12px;
  border: 2px solid var(--gold);
  color: var(--gold);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 999px;
  background: #5a1840cc;
  box-shadow: 0 2px 8px #0006;
}

/* ===== Battle ===== */
#screen-battle {
  position: relative;
  gap: 5px;
}

/* Top third: big enemy stage */
.enemy-stage {
  position: relative;
  flex: 0 0 33%;
  max-height: 33%;
  min-height: 150px;
  min-width: 0;
  border-radius: 18px;
  border: 3px solid var(--gold);
  box-shadow: var(--frame);
  overflow: hidden;
  background: rgba(40, 12, 28, 0.12);
}
.enemy-stage.boss {
  border-color: #ffb0d0;
  box-shadow:
    0 0 0 2px #8a2048,
    0 0 0 4px var(--gold),
    0 0 24px #ff7eb344,
    inset 0 0 0 1px #fff4c866,
    0 8px 22px #0007;
}
.enemy-figure {
  position: absolute;
  inset: 0 0 18% 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1;
  transform-origin: 50% 80%;
  filter: drop-shadow(0 8px 10px #0007);
}
.enemy-figure img,
.enemy-figure svg {
  height: 100%;
  width: auto;
  max-width: 86%;
  object-fit: contain;
  object-position: bottom center;
  display: block;
  pointer-events: none;
}
.enemy-figure svg { height: 78%; margin-bottom: 4%; }

.enemy-fx {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.enemy-hud {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 4;
  padding: 8px 10px 8px;
  background: linear-gradient(180deg, transparent 0%, #1a0818cc 28%, #140610f0 100%);
}
.enemy-hud .hud-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.enemy-hud .where {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--gold);
  text-shadow: 0 1px 3px #000a;
}
.enemy-hud .floor {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream-dim);
}
.enemy-hud .who {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--cream);
  min-width: 0;
  text-shadow: 0 1px 3px #000a;
}
.enemy-hud .intent {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  color: var(--rose);
  white-space: nowrap;
}
.taunt {
  font-size: 11.5px;
  font-style: italic;
  color: var(--rose);
  min-height: 1.3em;
  max-height: 2.6em;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 3px #000a;
}

.bar {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: var(--hp-bg);
  overflow: hidden;
  box-shadow: inset 0 1px 3px #0008, 0 0 0 1px #e8c36a66;
  margin: 3px 0 3px;
}
.bar > .fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  transform-origin: left center;
  background: linear-gradient(180deg, #ffa0b0, var(--hp) 55%, #a02040);
  transition: transform 220ms ease;
}
.bar > .fill.shield {
  background: linear-gradient(180deg, #d0ecff, var(--shield) 60%, #4a80c0);
  opacity: 0.95;
}
.bar .label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 1px 2px #000c;
  z-index: 1;
}

/* Compact hero dock */
.hero-dock {
  position: relative;
  display: grid;
  grid-template-columns: 58px 1fr;
  column-gap: 8px;
  align-items: center;
  flex: 0 0 auto;
  background: linear-gradient(180deg, #4a2048ee, #2a1234ee);
  border: 2px solid var(--gold);
  border-radius: 16px;
  padding: 5px 8px 6px;
  box-shadow: var(--frame);
  min-height: 64px;
}
.hero-dock .portrait {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 2px #7a3a18, 0 3px 8px #0006;
  background: #2a1020;
  align-self: center;
}
.hero-dock .portrait img,
.hero-dock .portrait svg {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  object-fit: cover;
}
.hero-dock .portrait img.bust-hero {
  object-fit: cover;
  object-position: center top;
  transform: scale(2.1);
  transform-origin: 66% 40%;
}
.hero-dock .who {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--cream);
  min-width: 0;
}
.hero-dock .who .intent {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  color: var(--rose);
  white-space: nowrap;
}
.hero-info { min-width: 0; }

.mana-row {
  display: flex;
  gap: 4px;
  margin-top: 3px;
}
.mana-pip {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.mana-pip img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px #0008);
}
.mana-pip .n {
  font-size: 11px;
  font-weight: 800;
  color: var(--cream);
  line-height: 1;
  text-shadow: 0 1px 2px #000a;
}

/* Spells: every button stays fully on screen, wrapping instead of scrolling off */
.spells {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  overflow: visible;
  padding: 0;
}

.spell {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  padding: 4px 6px 4px;
  border-radius: 12px;
  border: 2px solid #e8c36a99;
  background: linear-gradient(180deg, #5a2a50, #321428);
  color: var(--cream);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 1px;
  touch-action: manipulation;
  box-shadow: inset 0 1px 0 #ffd0e044, 0 2px 0 #1a0814, 0 3px 8px #0005;
}
.spell .s-name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.05;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.spell .s-desc {
  font-size: 9.5px;
  color: var(--cream-dim);
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.spell .s-cost {
  display: flex;
  gap: 4px;
  margin-top: auto;
  padding-top: 2px;
  align-items: center;
}
.spell .cost-pip {
  display: flex;
  align-items: center;
  gap: 1px;
  font-size: 11px;
  font-weight: 800;
  color: var(--cream);
}
.spell .cost-pip img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}
.spell.ready {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px #e8c36a, 0 0 12px #e8c36a55, inset 0 1px 0 #ffd0e066, 0 3px 0 #1a0814;
}
.spell:disabled,
.spell.locked { opacity: 0.48; cursor: default; box-shadow: none; }
.spell:not(:disabled):active { transform: translateY(1px); }

/* Board */
.board-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}
.board-frame {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px;
  border-radius: 16px;
  border: 3px solid var(--gold);
  background: linear-gradient(180deg, #4a203488, #1a0818cc);
  box-shadow: var(--frame);
  touch-action: none;
}
.board-sizer {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}
#board {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  background:
    radial-gradient(circle at 30% 20%, #4a284488, transparent 50%),
    #24101c;
  border-radius: 8px;
  overflow: hidden;
  touch-action: none;
  box-shadow: inset 0 0 16px #0008;
}

.gem {
  position: absolute;
  width: 12.5%;
  height: 12.5%;
  left: calc(var(--c) * 12.5%);
  top: calc(var(--r) * 12.5%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 1;
  touch-action: none;
  will-change: top, left, transform;
}
.gem.falling,
.gem.swapping {
  transition: top 200ms ease-in, left 160ms ease;
  z-index: 2;
}
.gem img.gem-art {
  width: 88%;
  height: 88%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px #0007);
}
.gem.selected img.gem-art {
  transform: scale(1.12);
  filter: drop-shadow(0 0 8px #ffe08a) drop-shadow(0 2px 2px #0007);
}
.gem.popping img.gem-art {
  animation: pop 200ms ease forwards;
}
@keyframes pop {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.2); opacity: 0; }
}

.floaters {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}
.floater {
  position: absolute;
  font-weight: 800;
  font-size: 14px;
  text-shadow: 0 1px 3px #000c;
  animation: floatUp 700ms ease-out forwards;
  white-space: nowrap;
}
@keyframes floatUp {
  0% { transform: translate(-50%, 0); opacity: 1; }
  100% { transform: translate(-50%, -22px); opacity: 0; }
}
.floater.dmg { color: #ffd0d4; }
.floater.heal { color: #b8f5c0; }
.floater.mana { color: #ffe08a; }
.floater.combo {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 20px;
  left: 50% !important;
  top: 40% !important;
}

.actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  padding-top: 1px;
}
.actions .btn {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  font-size: 20px;
}
.actions .btn.waiting { animation: pulseGold 1.2s ease-in-out infinite; }
@keyframes pulseGold {
  0%, 100% { box-shadow: 0 0 0 1px #7a2a14, inset 0 2px 0 #ffd0e088, 0 6px 0 #5a1028, 0 0 0 0 #e8c36a00; }
  50% { box-shadow: 0 0 0 1px #7a2a14, inset 0 2px 0 #ffd0e088, 0 6px 0 #5a1028, 0 0 0 4px #e8c36a55; }
}

.toast {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  background: #1a0a16f2;
  border: 2px solid var(--gold);
  color: var(--cream);
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 14px;
  text-align: center;
  max-width: 84%;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms;
  box-shadow: 0 8px 20px #0008;
}
.toast.show { opacity: 1; }

.tutorial {
  position: absolute;
  z-index: 8;
  left: 6px;
  right: 6px;
  bottom: 54px;
  background: #2a1428f2;
  border: 2px solid var(--gold);
  border-radius: 14px;
  padding: 8px 10px;
  font-size: 12.5px;
  color: var(--cream);
  display: none;
  gap: 8px;
  align-items: flex-start;
  box-shadow: var(--frame);
  pointer-events: auto;
}
.tutorial.show { display: flex; }
.tutorial p { flex: 1; text-wrap: pretty; }
.tutorial button {
  appearance: none;
  border: 2px solid var(--gold);
  background: #5a2040;
  color: var(--cream);
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex: 0 0 auto;
  padding: 0 10px;
}

/* Reward */
#screen-reward {
  justify-content: center;
  align-items: stretch;
  gap: 10px;
  padding: 12px 4px;
  overflow: hidden;
}
#screen-reward h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 7vw, 34px);
  color: var(--gold);
  text-align: center;
  font-weight: 700;
  text-shadow: 0 2px 0 #5a2010;
}
#screen-reward .sub {
  text-align: center;
  color: var(--cream-dim);
  font-size: 13px;
  margin-top: -4px;
}
.rewards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.reward-card {
  appearance: none;
  border: 2px solid #e8c36acc;
  background: linear-gradient(180deg, #5a2a50, #2a1428);
  color: var(--cream);
  border-radius: 16px;
  padding: 12px 14px;
  text-align: left;
  min-height: 88px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--frame);
  touch-action: manipulation;
}
.reward-card:active { transform: translateY(1px); }
.reward-card .kind {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rose);
  font-weight: 700;
}
.reward-card .r-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.1;
}
.reward-card .r-desc { font-size: 13px; color: var(--cream-dim); }

/* ===== Combat FX ===== */
.fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
}
.fx-bit {
  position: absolute;
  left: 0; top: 0;
  font-size: 18px;
  line-height: 1;
  animation: fxFly 800ms ease-out forwards;
  filter: drop-shadow(0 2px 2px #0008);
  will-change: transform, opacity;
}
@keyframes fxFly {
  0% { transform: translate(-50%, -50%) scale(0.6) rotate(0deg); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.25) rotate(var(--rot)); opacity: 0; }
}

.enemy-figure.recoil { animation: recoil 420ms ease; }
@keyframes recoil {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  18% { transform: translate(10px, 2px) rotate(4deg); }
  40% { transform: translate(-12px, 3px) rotate(-5deg); }
  62% { transform: translate(7px, 0) rotate(2deg); }
}
.enemy-figure.lunge { animation: lunge 480ms ease; }
@keyframes lunge {
  0%, 100% { transform: translateY(0) scale(1); }
  40% { transform: translateY(16px) scale(1.07); }
}
.hero-dock.hit { animation: heroHit 380ms ease; }
@keyframes heroHit {
  0%, 100% { transform: translateX(0); filter: none; }
  25% { transform: translateX(-6px); filter: brightness(1.6) saturate(1.3); }
  50% { transform: translateX(5px); }
}

.fx-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}
.fx-flash.red { background: radial-gradient(circle at 50% 45%, #ff4a7088, transparent 60%); animation: fadeFlash 360ms ease; }
.fx-flash.blue { background: radial-gradient(circle at 50% 45%, #80c8ff66, transparent 60%); animation: fadeFlash 420ms ease; }
.fx-flash.gold { background: radial-gradient(circle at 50% 45%, #ffd76a66, transparent 60%); animation: fadeFlash 420ms ease; }
.fx-flash.violet { background: radial-gradient(circle at 50% 45%, #c060ff66, transparent 60%); animation: fadeFlash 420ms ease; }
@keyframes fadeFlash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.fx-slash {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 42%;
  height: 16px;
  border-radius: 8px;
  background: linear-gradient(90deg, transparent, #ff8ab0, #fff, #ff4a6a, transparent);
  box-shadow: 0 0 14px #ff6a9aaa;
  transform-origin: left center;
  animation: slash 380ms ease-out forwards;
}
@keyframes slash {
  0% { transform: rotate(-28deg) scaleX(0.15); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: rotate(-28deg) translate(12%, 40%) scaleX(1.15); opacity: 0; }
}

.fx-kiss, .fx-spark {
  position: absolute;
  font-size: 22px;
  animation: popFloat 700ms ease-out forwards;
  filter: drop-shadow(0 2px 2px #0008);
}
@keyframes popFloat {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
  30% { transform: translate(-50%, -60%) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -130%) scale(1); opacity: 0; }
}

.dmg-float {
  position: absolute;
  left: 50%;
  top: 30%;
  transform: translate(-50%, 0);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  color: #fff0f4;
  text-shadow: 0 2px 0 #8a1030, 0 0 10px #ff4a6a;
  animation: dmgPop 800ms ease-out forwards;
  z-index: 5;
  pointer-events: none;
}
.dmg-float.heal { color: #d8ffd8; text-shadow: 0 2px 0 #1a5a20, 0 0 10px #6fbf7a; }
@keyframes dmgPop {
  0% { transform: translate(-50%, 8px) scale(0.6); opacity: 0; }
  25% { transform: translate(-50%, 0) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -28px) scale(1); opacity: 0; }
}

@keyframes idleSway {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.splash-figure.flirt-idle { animation: idleSway 3s ease-in-out infinite; }
.portrait.flirt { animation: winkbounce 0.5s ease; }
@keyframes winkbounce {
  0%, 100% { transform: scale(1) rotate(0); }
  25% { transform: scale(1.1) rotate(-7deg); }
  55% { transform: scale(1.06) rotate(5deg); }
}

.mute-btn {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  left: 10px;
  z-index: 40;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 2px solid var(--gold);
  background: #3a1840ee;
  color: var(--cream);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px #0006;
  touch-action: manipulation;
}
.mute-btn:active { transform: translateY(1px); }

.particle {
  position: absolute;
  width: 7px;
  height: 7px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 6;
  animation: particleFly 460ms ease-out forwards;
}
@keyframes particleFly {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.25); opacity: 0; }
}

.spell-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  animation: fadeFlash 300ms ease forwards;
}

#app.shake { animation: appShake 280ms linear; }
#app.shake-big { animation: appShakeBig 320ms linear; }
@keyframes appShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}
@keyframes appShakeBig {
  0%, 100% { transform: translateX(0); }
  15% { transform: translate(-5px, 1px); }
  30% { transform: translate(5px, -1px); }
  45% { transform: translate(-4px, 0); }
  60% { transform: translate(4px, 1px); }
  75% { transform: translate(-2px, 0); }
}

.fx-hit { animation: hitFlash 280ms ease; }
@keyframes hitFlash {
  0% { filter: brightness(1.8); }
  100% { filter: none; }
}

@media (min-width: 800px) and (min-height: 800px) {
  .hero-dock { grid-template-columns: 66px 1fr; }
  .hero-dock .portrait { width: 62px; height: 62px; }
}
