/**
 * Custom styles and animations for battleship game
 * DO NOT MODIFY style.css - this file contains our additions
 */

/* Error state for ships (matching original ship-box__placeholder_error) */
.ship-box__placeholder_error {
  border-color: red !important;
  background: rgba(255, 0, 0, 0.1) !important;
}

/* jQuery UI shake effect is used for animation, no CSS animation needed */

/* Ship visibility during drag - show with reduced opacity instead of hidden */
.ship-box__transparent {
  opacity: 0.3;
  visibility: visible !important;
}

/* Dragging helper should be fully visible */
.ui-draggable-dragging {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Ensure grids don't show red dots on initialization */
.battlefield__rival .battlefield-cell__hit .battlefield-cell-content .z:before,
.battlefield__rival .battlefield-cell__hit .battlefield-cell-content .z:after {
  display: none;
}

/* Only show hit markers during actual gameplay */
.battlefield__rival.battlefield__playing .battlefield-cell__hit .battlefield-cell-content .z:before,
.battlefield__rival.battlefield__playing .battlefield-cell__hit .battlefield-cell-content .z:after {
  display: block;
}

/* Fix responsiveness - don't block clicks on YOUR grid during ship placement */
/* The wait overlay should only block the OPPONENT'S grid when it's not your turn */
.body__with-pointerevents .battlefield__self.battlefield__wait {
  pointer-events: auto;
}

.body__with-pointerevents .battlefield__self.battlefield__wait .battlefield-table,
.body__with-pointerevents .battlefield__self.battlefield__wait .ship-box {
  pointer-events: auto;
  cursor: move;
}

/* During game, only block opponent's grid when it's not your turn */
.body__with-pointerevents .battlefield__rival.battlefield__wait:after {
  pointer-events: auto;
}

.battlefield__rival.battlefield__wait .battlefield-cell__empty {
  pointer-events: none;
}

/* Ensure invite URL input is properly styled and selectable */
.battlefield-start-choose_rival-variant-url-input {
  cursor: text !important;
  user-select: all;
  -webkit-user-select: all;
  -moz-user-select: all;
  -ms-user-select: all;
}

.battlefield-start-choose_rival-variant-url-input:focus {
  background: #fff;
  outline: 2px solid #4a90e2;
}

/* Hide chat-related elements completely */
.chat-gap,
.chat,
.chat-message,
.chat-teletype,
.chat-states,
#chat-container {
  display: none !important;
}

/* Ensure settings that reference chat are hidden */
.setting__compactchat {
  display: none !important;
}

/* Make rival type and game type selectors clickable (matching original link behavior) */
/* Non-selected items should look like blue underlined links */
.battlefield-start-choose_rival-variant-link,
.battlefield-start-ships_type-link {
  cursor: pointer !important;
  color: #0034ab !important;
  text-decoration: none;
  border-bottom: 1px dotted #0034ab;
}

.battlefield-start-choose_rival-variant-link:hover,
.battlefield-start-ships_type-link:hover {
  color: #00a405 !important;
  border-bottom-color: #00a405;
}

/* Selected/Active state - gray background, no border, black text */
.battlefield-start-choose_rival-variant__active .battlefield-start-choose_rival-variant-link,
.battlefield-start-ships_type__active .battlefield-start-ships_type-link {
  background: #eee !important;
  color: #000 !important;
  border-bottom: none !important;
  cursor: text !important;
}

/* Reset button inactive state (when manual placement is active) */
.placeships-variant__hands_inactive .placeships-variant-link {
  color: #999 !important;
  cursor: default !important;
  border-bottom: transparent !important;
}

