/* =========================================================
   ⚔️ Μονομαχία κλικ (js/clickfight.js): μπάρες ζωής παίκτη/αντιπάλου, ροή εντολών
   (3 πριν · τωρινή · 3 μετά) ΠΑΝΩ από την αρένα, αρένα με τον αντίπαλο (συννεφάκι
   ομιλίας, σήμα έκφρασης, ετοιμασία/όρμηση γαργαλητού, τούμπες) και τον
   ήρωα-avatar με μαγικό ραβδί (χοροπηδά, πετάγεται στο σωστό κλικ, γελά στο γαργαλητό).
   ========================================================= */
.cf-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; }

/* ---- πάνω: μπάρες ζωής + στατιστικά ---- */
.cf-top { display: flex; align-items: center; gap: 14px; padding: 6px 16px; background: rgba(255,255,255,.88); border-bottom: 3px solid #d1c4e9; z-index: 2; }
.cf-side { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.cf-side svg { width: 44px; height: 44px; border-radius: 50%; flex: none; box-shadow: 0 3px 0 rgba(0,0,0,.15); }
.cf-foe-emoji { font-size: 40px; line-height: 1; flex: none; }
.cf-bar-box { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cf-bar-box b { font-size: 15px; color: #4527a0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-foe .cf-bar-box b { text-align: right; }
.cf-bar { position: relative; height: 22px; background: #eceff1; border-radius: 12px; border: 3px solid #b0bec5; overflow: hidden; }
.cf-bar i { display: block; height: 100%; width: 100%; border-radius: 8px; background: #43a047; transition: width .25s, background .25s; }
.cf-bar-foe i { margin-left: auto; }
.cf-bar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; color: #263238; text-shadow: 0 0 4px #fff; }
.cf-stats { display: flex; gap: 8px; font-weight: 800; font-size: 16px; color: #37474f; flex: none; }
.cf-stats span { background: #fff; border: 2px solid #e0e0e0; border-radius: 12px; padding: 3px 9px; white-space: nowrap; }
.cf-combo.hot { background: #fff3c4; border-color: #ffb300; color: #e65100; animation: cf-hot .6s infinite alternate; }
@keyframes cf-hot { to { transform: scale(1.1); box-shadow: 0 0 12px #ffb300; } }

/* ---- ροή εντολών (πάνω από την αρένα) ---- */
.cf-flow { background: rgba(255,255,255,.92); border-bottom: 3px solid #d1c4e9; padding: 6px 14px 8px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; z-index: 2; box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.cf-flow-label { font-weight: 800; font-size: 18px; color: #4527a0; }
.cf-slots { flex: 1; display: flex; justify-content: center; align-items: center; gap: 8px; min-width: 0; }
.cf-slot { position: relative; width: 70px; height: 82px; border-radius: 16px; border: 3px solid #e0e0e0; background: #fafafa; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; transition: transform .2s, opacity .2s; }
.cf-slot.empty { border-style: dashed; opacity: .3; }
.cf-slot .cf-mi { width: 32px; height: 40px; }
.cf-slot-name { font-size: 12px; font-weight: 800; color: #607d8b; }
.cf-slot.next { opacity: .75; }
.cf-slot.next + .cf-slot.next { opacity: .55; }
.cf-slot.next + .cf-slot.next + .cf-slot.next { opacity: .4; }
.cf-slot.past { opacity: .55; transform: scale(.9); }
.cf-slot.past.ok { border-color: #a5d6a7; background: #e8f5e9; }
.cf-slot.past.bad { border-color: #ef9a9a; background: #ffebee; }
.cf-res { position: absolute; top: -10px; right: -10px; width: 24px; height: 24px; border-radius: 50%; font-style: normal; font-weight: 900; font-size: 14px; display: flex; align-items: center; justify-content: center; color: #fff; }
.cf-slot.ok .cf-res { background: #43a047; }
.cf-slot.bad .cf-res { background: #e53935; }
.cf-slot.now { width: 104px; height: 116px; border: 5px solid #ffb300; background: linear-gradient(#fffde7, #ffe082); box-shadow: 0 0 0 6px rgba(255,179,0,.25), 0 8px 20px rgba(0,0,0,.2); animation: cf-now .8s infinite alternate; margin: 0 6px; }
.cf-slot.now .cf-mi { width: 52px; height: 62px; }
.cf-slot.now .cf-slot-name { font-size: 16px; color: #5d4037; }
.cf-slot.now .mouse-icon .hl { animation: pulse-fill .5s infinite alternate; }
@keyframes cf-now { to { transform: scale(1.06); box-shadow: 0 0 0 10px rgba(255,179,0,.35), 0 10px 24px rgba(0,0,0,.25); } }
.cf-timer { width: 100%; height: 9px; background: #eceff1; border-radius: 6px; overflow: hidden; }
.cf-timer i { display: block; height: 100%; width: 100%; background: #42a5f5; border-radius: 6px; }
.cf-timer i.late { background: #ef5350; }

/* ---- αρένα ---- */
.cf-arena { position: relative; flex: 1; min-height: 0; overflow: hidden; background: linear-gradient(#1a237e, #4a148c 60%, #6a1b9a); cursor: crosshair; }
.cf-hero { position: absolute; left: 4%; bottom: 8%; width: 110px; height: 110px; pointer-events: none; z-index: 2; }
.cf-hero svg { width: 90px; height: 90px; border-radius: 50%; box-shadow: 0 6px 0 rgba(0,0,0,.3); animation: cf-hop 1.1s infinite ease-in-out; }   /* ο ήρωας χοροπηδά συνεχώς */
@keyframes cf-hop { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-14px) rotate(3deg); } }
.cf-wand { position: absolute; right: -8px; top: 4px; font-size: 44px; line-height: 1; transform-origin: 20% 90%; transform: rotate(-25deg); filter: drop-shadow(0 4px 4px rgba(0,0,0,.4)); animation: cf-wand-idle 1.1s infinite ease-in-out; }
@keyframes cf-wand-idle { 50% { transform: rotate(-10deg) translateY(-8px); } }
/* σωστό κλικ: ο ήρωας πετάγεται προς τον αντίπαλο (--dx/--dy) και το ραβδί κάνει κύκλο */
.cf-hero.dash { animation: cf-dash .45s ease-out; }
@keyframes cf-dash { 45% { transform: translate(var(--dx, 200px), var(--dy, -80px)) scale(1.15); } 100% { transform: translate(0, 0); } }
.cf-hero.dash .cf-wand { animation: cf-wand-cast .45s; }
@keyframes cf-wand-cast { 50% { transform: rotate(40deg) scale(1.4); filter: drop-shadow(0 0 14px #ffeb3b); } }
/* γαργαλητό: ο ήρωας κουνιέται γελώντας */
.cf-hero.tickled { animation: cf-tickled .7s; }
@keyframes cf-tickled { 15%, 45%, 75% { transform: translateX(-10px) rotate(-12deg); } 30%, 60%, 90% { transform: translateX(10px) rotate(12deg); } }
.cf-hero.down { transform: rotate(60deg) translateY(16px); transition: transform .8s; }
.cf-hero.down svg, .cf-hero.down .cf-wand { animation: none; }
.cf-spark { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 70px; line-height: 1; z-index: 6; pointer-events: none; }
.cf-spark.zap { animation: cf-zap .5s forwards; }
@keyframes cf-zap { 0% { transform: translate(-50%, -50%) scale(.3) rotate(0); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1.8) rotate(90deg); opacity: 0; } }

.cf-enemy { position: absolute; width: 170px; height: 170px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.28), rgba(255,255,255,.05) 70%); box-shadow: 0 0 0 4px rgba(255,255,255,.25), 0 0 40px rgba(179,157,219,.6); cursor: pointer; transition: left 1s ease-in-out, top 1s ease-in-out; z-index: 3; user-select: none; -webkit-user-select: none; }
.cf-enemy-emoji { font-size: 110px; line-height: 1; filter: drop-shadow(0 8px 8px rgba(0,0,0,.4)); animation: cf-bob 1.6s infinite ease-in-out; display: block; }
@keyframes cf-bob { 50% { transform: translateY(-10px) rotate(-3deg); } }
.cf-enemy:hover .cf-enemy-emoji { animation-duration: .8s; }
/* τούμπα / κούνημα πού και πού (ζωντάνια) */
.cf-enemy.flip .cf-enemy-emoji { animation: cf-flip .9s ease-in-out; }
@keyframes cf-flip { 50% { transform: translateY(-30px) rotate(180deg); } 100% { transform: rotate(360deg); } }
.cf-enemy.wiggle .cf-enemy-emoji { animation: cf-wiggle .9s ease-in-out; }
@keyframes cf-wiggle { 20% { transform: rotate(-14deg) scaleX(1.1); } 40% { transform: rotate(12deg) scaleY(1.1); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(6deg); } }
/* λίγη ενέργεια: τρέμει από τα γέλια· ετοιμασία γαργαλητού: τινάζεται και μεγαλώνει */
.cf-enemy.scared .cf-enemy-emoji { animation: cf-tremble .25s infinite; filter: drop-shadow(0 8px 8px rgba(0,0,0,.4)) hue-rotate(40deg); }
@keyframes cf-tremble { 25% { transform: translate(-4px, 2px) rotate(-4deg); } 75% { transform: translate(4px, -2px) rotate(4deg); } }
.cf-enemy.charge { box-shadow: 0 0 0 6px rgba(255,167,38,.7), 0 0 50px #ffa726; }
.cf-enemy.charge .cf-enemy-emoji { animation: cf-charge .2s infinite; filter: drop-shadow(0 0 14px #ffa726) brightness(1.15); }
@keyframes cf-charge { 25% { transform: translateX(-6px) scale(1.12); } 75% { transform: translateX(6px) scale(1.12); } }
.cf-enemy.lunge { animation: cf-lunge .7s ease-in-out; z-index: 4; }
@keyframes cf-lunge { 45% { transform: translate(var(--dx, -200px), var(--dy, 100px)) scale(1.15) rotate(-15deg); } 60% { transform: translate(var(--dx, -200px), var(--dy, 100px)) scale(1.05) rotate(10deg); } }
.cf-enemy.hurt { animation: cf-hurt .4s; }
@keyframes cf-hurt { 25% { transform: translateX(-14px) rotate(-8deg); filter: brightness(2) saturate(0); } 60% { transform: translateX(12px) rotate(6deg); } }
.cf-enemy.healed { animation: cf-heal .6s; }
@keyframes cf-heal { 50% { box-shadow: 0 0 0 10px rgba(105,240,174,.7), 0 0 60px #69f0ae; transform: scale(1.12); } }
.cf-enemy.dead { transition: transform .8s, opacity .8s; transform: scale(.3) rotate(360deg); opacity: .35; pointer-events: none; }
.cf-enemy.dead .cf-enemy-emoji { animation: none; }
/* συννεφάκι ομιλίας & σήμα έκφρασης */
.cf-bubble { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: #fff; color: #37474f; font-weight: 800; font-size: 17px; padding: 6px 14px; border-radius: 16px; white-space: nowrap; box-shadow: 0 4px 12px rgba(0,0,0,.3); z-index: 5; pointer-events: none; }
.cf-bubble::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -8px; border: 8px solid transparent; border-top-color: #fff; }
.cf-bubble.hurt, .cf-bubble.scared { color: #c62828; }
.cf-bubble.heal { color: #2e7d32; }
.cf-bubble.charge, .cf-bubble.attack { color: #4e342e; background: #ffe082; }
.cf-bubble.charge::after, .cf-bubble.attack::after { border-top-color: #ffe082; }
.cf-bubble.pop, .cf-face.pop { animation: popin .3s; }
.cf-face { position: absolute; top: -4px; right: -4px; font-size: 40px; line-height: 1; z-index: 5; pointer-events: none; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
.cf-float { position: absolute; left: 50%; top: 0; transform: translateX(-50%); font-size: 40px; font-weight: 900; pointer-events: none; animation: cf-float .9s forwards; text-shadow: 0 2px 6px rgba(0,0,0,.5); z-index: 6; white-space: nowrap; }
.cf-float.dmg { color: #ffeb3b; }
.cf-float.heal { color: #69f0ae; }
@keyframes cf-float { to { transform: translate(-50%, -70px); opacity: 0; } }

@media (max-height: 720px) { .cf-slot { width: 58px; height: 70px; } .cf-slot.now { width: 86px; height: 98px; } .cf-slot.now .cf-mi { width: 42px; height: 52px; } .cf-slot .cf-mi { width: 26px; height: 32px; } .cf-enemy { width: 130px; height: 130px; } .cf-enemy-emoji { font-size: 84px; } .cf-flow { padding: 4px 12px 6px; } .cf-top { padding: 4px 14px; } }
html.mobile .cf-slot { width: 50px; height: 60px; } html.mobile .cf-slot .cf-slot-name { display: none; } html.mobile .cf-slot.now { width: 74px; height: 84px; } html.mobile .cf-stats { display: none; }
