.action-ribbon {
  position: absolute;
  z-index: 16;
  top: 13px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 88px);
  min-height: 38px;
  padding: 7px 13px;
  transform: translateX(-50%);
  border: 1px solid #d5b271;
  border-radius: 999px;
  background: linear-gradient(135deg, #0d1b29f5, #1f2730f5);
  box-shadow: inset 0 1px #fff3, 0 10px 25px #000b, 0 0 24px #6bd6f444;
  color: #fff1ca;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .025em;
  text-align: center;
  white-space: nowrap;
  pointer-events: auto;
}
.action-ribbon.resolving { border-color: #83ddff; box-shadow: inset 0 1px #fff5, 0 10px 25px #000b, 0 0 28px #55caff88; }
.action-ribbon .action-glyph { color: #78dfff; font-size: 19px; line-height: 1; }
.action-ribbon button {
  border: 1px solid #a88150;
  border-radius: 999px;
  padding: 5px 10px;
  background: #36251d;
  color: #f8d79d;
  font-size: 11px;
  font-weight: 800;
}
.action-ribbon button:hover { background: #60402a; }
[role="button"]:focus-visible, button:focus-visible { outline: 3px solid #8ee2ff; outline-offset: 4px; }
.help-dialog { max-height: calc(100vh - 30px); overflow-y: auto; }
.help-steps { margin: 17px 0 23px; text-align: left; }
.help-steps p { margin: 0 0 11px; padding: 10px 12px; border-left: 2px solid #c49c5d; background: #0b1520a8; color: #d7e0e4; font-size: 12px; line-height: 1.4; }
.help-steps b { color: #f1d394; }
.enemy-hand { position: absolute; z-index: 8; top: 5px; left: calc(50% + 132px); display: flex; align-items: flex-start; height: 52px; pointer-events: none; }
.enemy-hand-card { display: grid; place-items: center; width: 34px; height: 47px; margin-left: -9px; border: 2px solid #c29c5f; border-radius: 6px; transform: rotate(var(--fan)); background: radial-gradient(circle,#7ad9f1 0 9%,#1d385a 10% 25%,#b88c4c 26% 29%,#322328 30% 66%,#172332); box-shadow: 0 3px 9px #000b, inset 0 0 0 2px #6f492d; color: #c6e9f3; font: 17px Cinzel,serif; }
.enemy-hand-card:first-child { margin-left: 0; }
.deck-info { position: relative; }
.player-deck-stack { position: absolute; top: -20px; right: -8px; z-index: 2; display: grid; place-items: center; width: 29px; height: 40px; border: 2px solid #c7a365; border-radius: 5px; transform: rotate(-9deg); background: radial-gradient(circle,#8ae5ff 0 8%,#1d3864 9% 25%,#ad824d 26% 29%,#3b272a 30% 62%,#142331); box-shadow: 0 3px 8px #000c, 3px 3px 0 #78502c; color: #c9f2fb; font: 17px Cinzel,serif; }
.fx-layer { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 80; overflow: hidden; pointer-events: none; }
.fx-hidden { opacity: .1 !important; }
.moving-piece { position: absolute !important; z-index: 3; transform-origin: center center; pointer-events: none !important; filter: drop-shadow(0 16px 19px #000d) drop-shadow(0 0 15px #ffda82) !important; }
.moving-piece.unit { animation: none !important; }
.moving-piece.card { overflow: visible; }
.played-card { position: absolute; z-index: 5; left: 50%; top: 46%; width: 190px; height: 258px; perspective: 950px; transform: translate(-50%,-50%); filter: drop-shadow(0 24px 28px #000e) drop-shadow(0 0 24px #f8bc63b0); }
.played-card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateY(0deg); }
.played-card-back, .played-card-face { position: absolute; inset: 0; overflow: hidden; border: 5px solid #b78a46; border-radius: 16px; backface-visibility: hidden; box-shadow: inset 0 0 0 3px #f4db9b, 0 0 0 2px #322013; }
.played-card-back { display: grid; place-items: center; background: radial-gradient(circle at center, #75b9d4 0 5%, #172f55 6% 17%, #d2b46f 18% 20%, #3c2928 21% 53%, #172334 80%); }
.played-card-back span { display: grid; place-items: center; width: 58px; height: 58px; border: 3px solid #f3cf83; border-radius: 50%; box-shadow: 0 0 19px #66dcff; color: #bdf2ff; font: 36px Cinzel,serif; }
.played-card-face { transform: rotateY(180deg); background: linear-gradient(#d7bc81,#a18459); }
.played-card-art { position: absolute; top: 8px; left: 8px; right: 8px; height: 59%; overflow: hidden; border: 3px solid #6d4827; border-radius: 45% 45% 8px 8px; }
.played-card-art img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.played-card-cost { position: absolute; top: 0; left: 0; width: 39px; height: 39px; display: grid; place-items: center; border: 3px solid #e8d28c; border-radius: 50%; background: #176ca8; box-shadow: 0 2px 7px #0009; color: white; font: 900 21px Inter,sans-serif; }
.played-card-name { position: absolute; top: 59%; left: 5px; right: 5px; padding: 5px 2px; border: 1px solid #f9e3ac; background: linear-gradient(90deg,#9a652e,#e4c48d 30% 70%,#9a652e); color: #301c11; font: 900 14px Cinzel,serif; text-align: center; }
.played-card-text { position: absolute; top: 74%; left: 12px; right: 12px; color: #352617; font: 700 11px/1.35 Inter,sans-serif; text-align: center; }
.played-card-stats { position: absolute; bottom: 2px; left: 4px; right: 4px; display: flex; justify-content: space-between; font: 900 16px Inter,sans-serif; color: #fff3df; text-shadow: 0 1px 3px #000; }
.played-card-stats span { display: grid; place-items: center; width: 30px; height: 30px; border: 2px solid #e9d19b; border-radius: 50%; background: #815327; }
.played-card-stats span:last-child { background: #a6423d; }
.drawn-card-back { position: absolute; width: 72px; height: 101px; display: grid; place-items: center; border: 4px solid #d9b56c; border-radius: 10px; background: radial-gradient(circle,#76d7f5 0 8%,#213e66 9% 20%,#c59a55 21% 23%,#352629 24% 60%,#12202c); box-shadow: 0 13px 25px #000d, 0 0 15px #77d9ff; color: #e9d28e; font: 40px Cinzel,serif; }
.unit-enter { animation: unitEnter .6s cubic-bezier(.15,.8,.25,1) both; }
.card-enter { animation: cardEnter .45s cubic-bezier(.13,.85,.2,1) both; }
.fx-target { filter: drop-shadow(0 0 15px #76d8ff) brightness(1.2) !important; }
.unit.targetable, .hero-frame.targetable { outline: 3px solid #8ee2ff; outline-offset: 4px; filter: drop-shadow(0 0 14px #57d2ff); animation: targetPulse 1.1s ease-in-out infinite; }
.unit.selected { outline: 3px solid #ffe2a2; outline-offset: 3px; z-index: 10; }
.unit:not(.targetable):not(.selected), .hero-frame:not(.targetable) { transition: filter .18s, transform .18s; }
.floating-value {
  position: absolute;
  transform: translate(-50%, -50%);
  color: #fff5de;
  font: 900 clamp(25px, 4vw, 48px) Cinzel, Georgia, serif;
  text-shadow: 0 3px 2px #2e0907, 0 0 12px #ff4c37, 0 0 25px #ff712a;
  animation: floatImpact .8s ease-out both;
  white-space: nowrap;
}
.floating-value.heal { color: #e0ffe6; text-shadow: 0 3px 2px #083619, 0 0 12px #48e378, 0 0 25px #5eff88; }
.impact-flash {
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #fff6c8;
  box-shadow: 0 0 0 8px #ffad4c8a, 0 0 35px 22px #f49040a1;
  animation: flashImpact .48s ease-out both;
}
.impact-flash.heal { background: #e2ffe9; box-shadow: 0 0 0 8px #70e9a78a, 0 0 35px 22px #4acf79a1; }
.impact-flash.spell { background: #e5faff; box-shadow: 0 0 0 8px #83daff8a, 0 0 35px 22px #54bdfca1; }
@keyframes unitEnter { 0% { opacity: 0; transform: translateY(-28px) scale(.42); filter: drop-shadow(0 0 24px #fff8a3); } 65% { opacity: 1; transform: translateY(4px) scale(1.13); } 100% { transform: translateY(0) scale(1); } }
@keyframes cardEnter { 0% { opacity: 0; transform: translateY(70px) scale(.48) rotate(17deg); } 65% { opacity: 1; transform: translateY(-10px) scale(1.1) rotate(-5deg); } 100% { transform: rotate(var(--tilt)); } }
@keyframes floatImpact { 0% { opacity: 0; transform: translate(-50%, -10%) scale(.45); } 20% { opacity: 1; transform: translate(-50%, -65%) scale(1.3); } 100% { opacity: 0; transform: translate(-50%, -145%) scale(1); } }
@keyframes flashImpact { from { opacity: 1; scale: .3; } to { opacity: 0; scale: 3.8; } }
@media (max-width: 830px) {
  .enemy-hand { left: 8px; top: 7px; height: 34px; }
  .enemy-hand-card { width: 20px; height: 31px; margin-left: -9px; border-width: 1px; border-radius: 3px; font-size: 10px; }
  .played-card { width: 156px; height: 224px; top: 44%; }
  .played-card-name { font-size: 11px; }
  .played-card-text { font-size: 9px; }
  .game-shell { grid-template-rows: 75px minmax(0,1fr) 70px 150px; }
  .hand { max-width: 100%; }
  .hand .card { width: clamp(78px, 20vw, 96px); height: clamp(116px, 16vh, 140px); margin-left: calc(-1 * var(--mobile-overlap, 8px)); }
  .hand .card:first-child { margin-left: 0; }
  .hand .card-name { font-size: 9px; }
  .hand .card-desc { font-size: 8px; }
  .action-ribbon { top: 8px; max-width: calc(100% - 62px); padding: 5px 8px; gap: 6px; font-size: 10px; white-space: normal; line-height: 1.2; }
  .action-ribbon .action-glyph { font-size: 15px; }
  .action-ribbon button { padding: 4px 7px; }
  .footer-tip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .unit.targetable, .hero-frame.targetable, .floating-value, .impact-flash, .played-card-inner, .unit-enter, .card-enter { animation: none; }
  .played-card-inner { transform: rotateY(180deg); }
}
