@@ -287,8 +287,10 @@ const BattleComponent: React.FC<BattleComponentProps> = ({
287287 player . mana ,
288288 key as Location
289289 ) ;
290- const isSelected = player . selectedLocation === key ;
291- const isFocused = focusedIndex === index ;
290+ // Don't show persistent selection, only during tutorial or on hover
291+ const isSelected = false ;
292+ // Don't show focus effects during normal gameplay
293+ const isFocused = false ;
292294
293295 return (
294296 < button
@@ -454,8 +456,10 @@ const BattleComponent: React.FC<BattleComponentProps> = ({
454456
455457 < div className = 'element-grid' role = 'group' aria-label = 'Battle elements' >
456458 { elements . map ( ( [ key , element ] , index ) => {
457- const isSelected = player . selectedElement === key ;
458- const isFocused = focusedIndex === index ;
459+ // Don't show persistent selection, only during tutorial or on hover
460+ const isSelected = false ;
461+ // Don't show focus effects during normal gameplay
462+ const isFocused = false ;
459463
460464 return (
461465 < button
@@ -645,7 +649,8 @@ const BattleComponent: React.FC<BattleComponentProps> = ({
645649 selectedElement ,
646650 elemental . rarity
647651 ) ;
648- const isSelected = player . selectedElemental === elemental . rarity ;
652+ // Don't show persistent selection, only during tutorial or on hover
653+ const isSelected = false ;
649654 // Use static cooldown snapshot during elemental selection to prevent re-renders
650655 const isOnCooldown = gamePhase === 'elementalSelection'
651656 ? ( staticCooldownSnapshot [ elemental . id ] ?? false )
@@ -657,7 +662,8 @@ const BattleComponent: React.FC<BattleComponentProps> = ({
657662 const cooldownText = gamePhase === 'elementalSelection'
658663 ? '' // Don't show dynamic cooldown text during selection
659664 : formatCooldownTime ( cooldownRemaining ) ;
660- const isFocused = focusedIndex === index ;
665+ // Don't show focus effects during normal gameplay
666+ const isFocused = false ;
661667 const protection = Math . round ( elementalData . protection * 100 ) ;
662668
663669 // Force re-render for real-time cooldown updates (only outside elemental selection)
@@ -668,13 +674,16 @@ const BattleComponent: React.FC<BattleComponentProps> = ({
668674 return (
669675 < button
670676 key = { elemental . id }
671- className = { `elemental-btn ${ elemental . rarity } ${ isSelected ? 'selected' : '' } ${ isOnCooldown ? 'on-cooldown' : '' } ${ isFocused ? 'focused' : '' } ` }
677+ className = { `elemental-card-modern ${ elemental . rarity } ${ isSelected ? 'selected' : '' } ${ isOnCooldown ? 'on-cooldown' : '' } ${ isFocused ? 'focused' : '' } ` }
672678 data-elemental = { elemental . rarity }
673679 onClick = { ( ) => {
674680 // Allow clicks during tutorial even if on cooldown
675681 if ( ! isOnCooldown || showFocusOutlines ) {
676682 onSelectElemental ( elemental . rarity ) ;
677- onStartBattle ( ) ;
683+ // Auto-proceed to battle after selection
684+ setTimeout ( ( ) => {
685+ onStartBattle ( ) ;
686+ } , 100 ) ;
678687 }
679688 } }
680689 onFocus = { ( ) => {
@@ -711,74 +720,76 @@ const BattleComponent: React.FC<BattleComponentProps> = ({
711720 ? '2px solid var(--secondary-gold)'
712721 : 'none' ,
713722 outlineOffset : isFocused && showFocusOutlines ? '2px' : '0' ,
714- } }
723+ '--rarity-color' :
724+ elemental . rarity === 'common' ? '#6b7280' :
725+ elemental . rarity === 'rare' ? '#3b82f6' :
726+ elemental . rarity === 'epic' ? '#8b5cf6' :
727+ '#f59e0b' ,
728+ '--rarity-glow' :
729+ elemental . rarity === 'common' ? '#9ca3af' :
730+ elemental . rarity === 'rare' ? '#60a5fa' :
731+ elemental . rarity === 'epic' ? '#a78bfa' :
732+ '#fbbf24'
733+ } as React . CSSProperties }
715734 >
716- < span className = 'elemental-emoji' aria-hidden = 'true' >
717- { elementalData . emoji }
718- </ span >
719- < div className = 'elemental-info' >
720- < div
721- className = 'elemental-rarity-badge'
722- aria-label = { `${ elementalData . rarity } rarity` }
723- >
724- { elementalData . rarity }
725- </ div >
726- < div
727- className = 'elemental-level'
728- aria-label = { `Level ${ elemental . level } ` }
729- >
730- Lv.{ elemental . level }
731- </ div >
732- < div
733- className = 'elemental-protection'
734- aria-label = { `${ protection } % protection` }
735- >
736- 🛡️ { protection } %
735+ < div className = 'elemental-battle-card' >
736+ < img
737+ src = { `${ process . env . PUBLIC_URL } /resources/elmental/${ selectedElement === 'fire' ? 'Fire' : selectedElement === 'water' ? 'Water' : 'Earth' } _${ elemental . rarity === 'common' ? 'Common' : elemental . rarity === 'rare' ? 'Rare' : elemental . rarity === 'epic' ? 'Epic' : 'Immortal' } .png` }
738+ alt = { elementalData . name }
739+ className = 'elemental-battle-image'
740+ onError = { ( e ) => {
741+ // Fallback to emoji if image fails to load
742+ const target = e . currentTarget as HTMLImageElement ;
743+ target . style . display = 'none' ;
744+ const placeholder = target . nextElementSibling as HTMLElement ;
745+ if ( placeholder ) {
746+ placeholder . style . display = 'flex' ;
747+ }
748+ } }
749+ />
750+ < div className = 'elemental-battle-placeholder' style = { { display : 'none' } } >
751+ { elementalData . emoji }
737752 </ div >
738- < div
739- className = 'elemental-usage'
740- aria-label = { `Used ${ elemental . timesUsed } times` }
741- >
742- ⚔️ { elemental . timesUsed }
753+ < div className = 'elemental-battle-rarity' >
754+ { elemental . rarity . toUpperCase ( ) }
743755 </ div >
756+ </ div >
744757
745- { isOnCooldown && (
746- < div className = 'cooldown-indicator' aria-live = 'polite' >
747- < span className = 'cooldown-icon' aria-hidden = 'true' >
748- ⏱️
749- </ span >
750- < span
751- className = 'cooldown-text'
752- aria-label = { `Cooldown remaining: ${ cooldownText } ` }
753- >
754- { cooldownText }
755- </ span >
756- < div
757- className = 'cooldown-progress-bar'
758- role = 'progressbar'
759- aria-valuenow = { Math . round (
760- ( 1 -
761- cooldownRemaining /
762- ( getElementalCooldownHours ( elemental . rarity ) *
763- 60 *
764- 60 *
765- 1000 ) ) *
766- 100
767- ) }
768- aria-valuemin = { 0 }
769- aria-valuemax = { 100 }
770- aria-label = 'Cooldown progress'
771- >
772- < div
773- className = 'cooldown-progress-fill'
774- style = { {
775- width : `${ Math . round ( ( 1 - cooldownRemaining / ( getElementalCooldownHours ( elemental . rarity ) * 60 * 60 * 1000 ) ) * 100 ) } %` ,
776- } }
777- > </ div >
778- </ div >
758+ { isOnCooldown && (
759+ < div className = 'cooldown-overlay-modern' >
760+ < div className = 'cooldown-timer' >
761+ { ( ( ) => {
762+ const totalMs = cooldownRemaining ;
763+ const hours = Math . floor ( totalMs / ( 1000 * 60 * 60 ) ) ;
764+ const minutes = Math . floor ( ( totalMs % ( 1000 * 60 * 60 ) ) / ( 1000 * 60 ) ) ;
765+ const seconds = Math . floor ( ( totalMs % ( 1000 * 60 ) ) / 1000 ) ;
766+
767+ return (
768+ < >
769+ { hours > 0 && (
770+ < >
771+ < div className = 'cooldown-time-unit' >
772+ < span className = 'time-value' > { hours . toString ( ) . padStart ( 2 , '0' ) } </ span >
773+ < span className = 'time-label' > ч</ span >
774+ </ div >
775+ < span className = 'cooldown-separator' > :</ span >
776+ </ >
777+ ) }
778+ < div className = 'cooldown-time-unit' >
779+ < span className = 'time-value' > { minutes . toString ( ) . padStart ( 2 , '0' ) } </ span >
780+ < span className = 'time-label' > м</ span >
781+ </ div >
782+ < span className = 'cooldown-separator' > :</ span >
783+ < div className = 'cooldown-time-unit' >
784+ < span className = 'time-value' > { seconds . toString ( ) . padStart ( 2 , '0' ) } </ span >
785+ < span className = 'time-label' > с</ span >
786+ </ div >
787+ </ >
788+ ) ;
789+ } ) ( ) }
779790 </ div >
780- ) }
781- </ div >
791+ </ div >
792+ ) }
782793
783794 < div
784795 id = { `elemental-stats-${ elemental . id } ` }
0 commit comments