:root {
  --pirate-primary: #e63946;
  --pirate-glow: #ffd700;
  --pirate-dark: #a31621;
  --pirate-shadow: rgba(230, 57, 70, 0.8);
  --marine-primary: #2b7fe6;
  --marine-glow: #f0f0f0;
  --marine-dark: #0a2463;
  --marine-shadow: rgba(43, 127, 230, 0.8);
  --ocean-abyss: #000814;
  --ocean-deep: #001d3d;
  --ocean-mid: #003566;
  --storm-cloud: #1a1a2e;
  --lightning: #ffc947;
  --text-light: #ffffff;
  --text-gold: #ffd700;
  --cell-size: 70px;
  --piece-size: 62px;
  --gap: 10px;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: Impact, "Arial Black", sans-serif;
  background: var(--theme-bg, var(--ocean-abyss));
  color: var(--text-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  padding: 20px 0;
  transition:
    background 1.5s ease-in-out,
    filter 0.5s;
}
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  will-change: background-position, filter;
  transition: background 0.6s;
}
.bg-layer.theme-marineford-war {
  background: linear-gradient(
    180deg,
    #b3e5fc 0,
    #01579b 40%,
    #bf360c 80%,
    #4a0000 100%
  );
  background-size: 200% 200%;
  animation: 12s ease-in-out infinite alternate marinefordClash;
}
.bg-layer.theme-valley-of-end {
  background: linear-gradient(180deg, #1565c0 0, #546e7a 45%, #e65100 100%);
  background-size: 400% 400%;
  animation: 10s infinite alternate chakraClash;
}
.bg-layer.theme-namek-exploding {
  background: linear-gradient(180deg, #00acc1 0, #388e3c 45%, #e64a19 100%);
  background-size: 200% 200%;
  animation: 6s ease-in-out infinite alternate namekDying;
}
.bg-layer.theme-city-z-ruins {
  background: linear-gradient(
    180deg,
    #263238 0,
    #546e7a 40%,
    #bf360c 80%,
    #f57f17 100%
  );
  background-size: 200% 200%;
  animation: 8s ease-in-out infinite alternate seriousPunch;
}
.bg-layer.theme-wisteria-night {
  background: linear-gradient(180deg, #0a0014 0, #4a0080 50%, #7b1fa2 100%);
  background-size: 400% 400%;
  animation: 10s ease-in-out infinite alternate demonCastle;
}
.bg-layer.theme-shiganshina-district {
  background: linear-gradient(
    180deg,
    #37474f 0,
    #455a64 35%,
    #3e2723 70%,
    #b71c1c 100%
  );
  background-size: 100% 200%;
  animation: 20s ease-in-out infinite alternate titanBreach;
}
.bg-layer.theme-stadium-battle {
  background: linear-gradient(
    135deg,
    #0d47a1 0,
    #1a237e 45%,
    #b71c1c 80%,
    #7f0000 100%
  );
  background-size: 400% 400%;
  animation: 8s ease-in-out infinite alternate pokeContest;
}
.bg-layer.theme-malevolent-shrine {
  background: linear-gradient(180deg, #000 0, #880e4f 45%, #1a0000 100%);
  background-size: 400% 400%;
  animation: 8s ease-in-out infinite domainExpansion;
}
.bg-layer.theme-nen-forest {
  background: linear-gradient(135deg, #1a1a2e 0, #2e7d32 50%, #f57f17 100%);
  background-size: 400% 400%;
  animation: 12s infinite nenAura;
}
.bg-layer.theme-hueco-mundo {
  background: linear-gradient(
    180deg,
    #000 0,
    #1a237e 30%,
    #b0bec5 70%,
    #f5f5f5 100%
  );
  background-size: 100% 300%;
  animation: 18s ease-in-out infinite alternate huecoDrift;
}
.bg-layer.theme-eclipse-red {
  background: linear-gradient(
    180deg,
    #1a0000 0,
    #8b0000 40%,
    #3b0000 70%,
    #000 100%
  );
  background-size: 400% 400%;
  animation: 10s ease-in-out infinite alternate eclipseDoom;
}
body.pirate-theme .game-board {
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.9),
    inset 0 0 40px rgba(0, 0, 0, 0.7),
    inset 0 2px 0 rgba(212, 175, 55, 0.2),
    0 0 80px var(--pirate-shadow),
    0 0 120px rgba(255, 215, 0, 0.3);
  border-color: var(--pirate-primary);
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
body.marine-theme .game-board {
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.9),
    inset 0 0 40px rgba(0, 0, 0, 0.7),
    inset 0 2px 0 rgba(212, 175, 55, 0.2),
    0 0 80px var(--marine-shadow),
    0 0 120px rgba(240, 240, 240, 0.3);
  border-color: var(--marine-primary);
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
body.pirate-theme .game-controls {
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(212, 175, 55, 0.2),
    0 0 40px var(--pirate-shadow);
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
body.marine-theme .game-controls {
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(212, 175, 55, 0.2),
    0 0 40px var(--marine-shadow);
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.particle-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
.container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  width: 95%;
  padding: 30px;
}
.game-header {
  animation: 1s ease-out headerFade;
}
@keyframes headerFade {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.game-title {
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: 6px;
  margin-bottom: 15px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.8));
}
.title-marine,
.title-pirate {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.title-icon {
  position: absolute;
  top: -40px;
  filter: drop-shadow(0 0 15px rgba(244, 164, 96, 0.8));
}
.title-pirate .title-icon {
  left: 10px;
  transform: rotate(-15deg);
}
.title-marine .title-icon {
  right: 10px;
  transform: rotate(15deg);
  animation-name: iconHoverRight;
}
@keyframes iconHover {
  0%,
  100% {
    transform: translateY(0) rotate(-15deg);
  }
  50% {
    transform: translateY(-5px) rotate(-15deg);
  }
}
@keyframes iconHoverRight {
  0%,
  100% {
    transform: translateY(0) rotate(15deg);
  }
  50% {
    transform: translateY(-5px) rotate(15deg);
  }
}
.pirate-text {
  color: var(--pirate-primary);
  text-shadow:
    4px 4px 0 #000,
    -2px -2px 0 #000,
    2px -2px 0 #000,
    -2px 2px 0 #000,
    0 0 40px var(--pirate-glow),
    0 0 60px rgba(255, 215, 0, 0.5);
  animation: 3s ease-in-out infinite pirateGlow;
  -webkit-text-stroke: 2px black;
}
.marine-text {
  color: var(--marine-primary);
  text-shadow:
    4px 4px 0 #000,
    -2px -2px 0 #000,
    2px -2px 0 #000,
    -2px 2px 0 #000,
    0 0 40px var(--marine-glow),
    0 0 60px rgba(240, 240, 240, 0.5);
  animation: 3s ease-in-out infinite marineGlow;
  -webkit-text-stroke: 2px black;
}
.vs-icons {
  display: flex;
  align-items: center;
  gap: 15px;
  animation: 2s ease-in-out infinite iconPulse;
}
.icon-admiral,
.icon-roger {
  font-size: 3rem;
  filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8))
    drop-shadow(4px 4px 0 #000);
  animation: 3s ease-in-out infinite iconFloat;
}
.icon-roger {
  animation-delay: 0s;
}
.icon-admiral {
  animation-delay: 1.5s;
}
.vs-divider {
  font-size: 2.5rem;
  color: var(--text-gold);
  filter: drop-shadow(0 0 30px var(--text-gold)) drop-shadow(3px 3px 0 #000);
  animation: 4s linear infinite swordSpin;
}
@keyframes iconFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-8px) scale(1.1);
  }
}
@keyframes swordSpin {
  0% {
    transform: rotate(0);
  }
  100% {
    transform: rotate(360deg);
  }
}
@keyframes iconPulse {
  0%,
  100% {
    opacity: 0.95;
  }
  50% {
    opacity: 1;
  }
}
.game-subtitle {
  color: var(--text-gold);
  letter-spacing: 4px;
  text-transform: uppercase;
  text-shadow:
    3px 3px 0 #000,
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    0 0 20px var(--text-gold);
  font-weight: 700;
}
@keyframes pirateGlow {
  0%,
  100% {
    filter: drop-shadow(0 0 15px var(--pirate-shadow));
  }
  50% {
    filter: drop-shadow(0 0 25px var(--pirate-glow));
  }
}
@keyframes marineGlow {
  0%,
  100% {
    filter: drop-shadow(0 0 15px var(--marine-shadow));
  }
  50% {
    filter: drop-shadow(0 0 25px var(--marine-glow));
  }
}
@keyframes vsPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}
@keyframes pirateSceneShift {
  0%,
  100% {
    filter: hue-rotate(0deg) brightness(1) saturate(1);
  }
  25% {
    filter: hue-rotate(5deg) brightness(1.1) saturate(1.2);
  }
  50% {
    filter: hue-rotate(-5deg) brightness(0.95) saturate(1.3);
  }
  75% {
    filter: hue-rotate(3deg) brightness(1.05) saturate(1.1);
  }
}
@keyframes marineSceneShift {
  0%,
  100% {
    filter: hue-rotate(0deg) brightness(1) saturate(1);
  }
  25% {
    filter: hue-rotate(-5deg) brightness(1.1) saturate(1.2);
  }
  50% {
    filter: hue-rotate(5deg) brightness(0.95) saturate(1.3);
  }
  75% {
    filter: hue-rotate(-3deg) brightness(1.05) saturate(1.1);
  }
}
@keyframes pirateSmoke {
  0% {
    transform: translateX(0) translateY(0) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: translateX(-15%) translateY(-8%) scale(1.15);
    opacity: 1;
  }
  100% {
    transform: translateX(-25%) translateY(5%) scale(0.95);
    opacity: 0.9;
  }
}
@keyframes marineSmoke {
  0% {
    transform: translateX(0) translateY(0) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: translateX(15%) translateY(-8%) scale(1.15);
    opacity: 1;
  }
  100% {
    transform: translateX(25%) translateY(5%) scale(0.95);
    opacity: 0.9;
  }
}
.game-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: 20px;
  margin-bottom: 30px;
  padding: 0;
  gap: 0;
  background: linear-gradient(
    145deg,
    rgba(26, 26, 46, 0.85),
    rgba(20, 20, 35, 0.85)
  );
  border-radius: 15px;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(212, 175, 55, 0.4);
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(212, 175, 55, 0.2);
}
.game-layout-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  max-width: 850px;
}
.game-right-col {
  flex: 1 1 150px;
  max-width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-self: center;
}
.game-right-col .reset-btn {
  width: 100%;
  max-width: 160px;
  text-align: center;
  letter-spacing: 0.5px;
  margin-right: -55px;
  margin-left: 19px;
}
.player-indicator {
  flex: 1 1 150px;
  max-width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12% 10%;
  position: relative;
  align-self: center;
}
.turn-display {
  position: relative;
  display: block;
  text-align: left;
  margin-top: 25px;
  margin-right: 40px;
}
.turn-icon-above {
  display: block !important;
  font-size: 2.8rem;
  animation: 2s ease-in-out infinite floatIcon;
  position: absolute;
  top: -72px;
  left: -18px;
  transform: rotate(-15deg);
  margin: 0;
  pointer-events: none;
  text-align: left;
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.8));
  transition: 0.3s;
  flex-shrink: 0;
}
body.pirate-theme .turn-icon-above {
  filter: drop-shadow(0 0 15px rgba(230, 57, 70, 0.8))
    drop-shadow(0 0 25px rgba(255, 215, 0, 0.6));
}
body.marine-theme .turn-icon-above {
  filter: drop-shadow(0 0 15px rgba(43, 127, 230, 0.8))
    drop-shadow(0 0 25px rgba(240, 240, 240, 0.6));
  animation-name: floatIconMarine;
}
@keyframes floatIcon {
  0%,
  100% {
    transform: translateY(0) rotate(-15deg) scale(1);
  }
  50% {
    transform: translateY(-10px) rotate(-15deg) scale(1.1);
  }
}
@keyframes floatIconMarine {
  0%,
  100% {
    transform: translateY(0) rotate(15deg) scale(1);
  }
  50% {
    transform: translateY(-10px) rotate(15deg) scale(1.1);
  }
}
.turn-label {
  display: block;
  font-size: 2.3rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-align: left;
  line-height: 1.35;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
  max-width: 100%;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.player-indicator.pirate .turn-label,
body.pirate-theme .turn-label {
  color: var(--pirate-primary);
  text-shadow:
    2px 2px 0 #000,
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    0 0 20px var(--pirate-glow),
    0 0 35px rgba(255, 215, 0, 0.3);
  -webkit-text-stroke: 1px black;
}
.player-indicator.marine .turn-label,
body.marine-theme .turn-label {
  color: var(--marine-primary);
  text-shadow:
    2px 2px 0 #000,
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    0 0 20px var(--marine-glow),
    0 0 35px rgba(240, 240, 240, 0.3);
  -webkit-text-stroke: 1px black;
}
@keyframes pirateTextGlow {
  0%,
  100% {
    filter: drop-shadow(0 0 10px var(--pirate-shadow));
  }
  50% {
    filter: drop-shadow(0 0 20px var(--pirate-glow));
  }
}
@keyframes marineTextGlow {
  0%,
  100% {
    filter: drop-shadow(0 0 10px var(--marine-shadow));
  }
  50% {
    filter: drop-shadow(0 0 20px var(--marine-glow));
  }
}
.reset-btn {
  padding: 12px 24px;
  font-size: 2.3rem;
  font-weight: 800;
  background: linear-gradient(
    135deg,
    var(--pirate-dark),
    var(--pirate-primary)
  );
  color: #fff;
  border: 2px solid var(--text-gold);
  border-radius: 12px;
  cursor: pointer;
  transition: 0.3s;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow:
    0 4px 15px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(212, 175, 55, 0.2);
  min-width: 180px;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow:
    3px 3px 0 #000,
    -1px -1px 0 #000,
    0 0 10px rgba(255, 255, 255, 0.3);
}
.reset-btn:hover {
  transform: translateY(-3px);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.6),
    0 0 30px var(--text-gold);
  background: linear-gradient(135deg, var(--pirate-primary), #c42021);
}
.reset-btn span {
  font-size: 2.3rem;
  animation: 2s linear infinite spin;
}
@keyframes spin {
  0% {
    transform: rotate(0);
  }
  100% {
    transform: rotate(360deg);
  }
}
.game-board-wrapper {
  flex: 0 0 auto;
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding-top: 40px;
  padding-bottom: 40px;
}
.arrow-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}
.game-board {
  background: linear-gradient(145deg, #0d0d0d, #1a1a1a);
  padding: 18px;
  border-radius: 18px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.9),
    inset 0 0 40px rgba(0, 0, 0, 0.7),
    inset 0 2px 0 rgba(212, 175, 55, 0.2),
    0 0 30px rgba(212, 175, 55, 0.1);
  display: grid;
  grid-template-columns: repeat(7, var(--cell-size));
  grid-template-rows: repeat(6, var(--cell-size));
  gap: var(--gap);
  border: 3px solid rgba(212, 175, 55, 0.5);
  animation: 1s ease-out boardReveal;
  position: relative;
}
@keyframes boardReveal {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.cell {
  width: var(--cell-size);
  height: var(--cell-size);
  background: radial-gradient(circle at 50% 50%, #2a2a2a, #0f0f0f);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow:
    inset 0 8px 15px rgba(0, 0, 0, 0.9),
    inset 0 -2px 5px rgba(255, 255, 255, 0.05),
    0 2px 5px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(212, 175, 55, 0.15);
  cursor: pointer;
  transition: 0.2s;
}
.cell:hover:not(.filled) {
  transform: scale(1.08);
  box-shadow:
    inset 0 8px 15px rgba(0, 0, 0, 0.9),
    0 0 20px rgba(212, 175, 55, 0.4),
    0 2px 5px rgba(0, 0, 0, 0.5);
  border-color: rgba(212, 175, 55, 0.5);
}
.cell.filled {
  animation: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) cellPlace;
  cursor: not-allowed;
}
@keyframes cellPlace {
  0% {
    transform: scale(0.6);
  }
  60% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}
.piece {
  width: var(--piece-size);
  height: var(--piece-size);
  border-radius: 50%;
  position: absolute;
  animation: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) pieceAppear;
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: center;
}
.piece-icon {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  animation: 2s ease-in-out infinite symbolGlow;
  pointer-events: none;
}
.piece.pirate {
  background: radial-gradient(
    circle at 35% 35%,
    var(--pirate-primary),
    var(--pirate-dark)
  );
  box-shadow:
    0 0 35px var(--pirate-shadow),
    0 0 50px rgba(212, 175, 55, 0.3),
    0 6px 15px rgba(0, 0, 0, 0.8),
    inset -4px -4px 15px rgba(0, 0, 0, 0.7),
    inset 3px 3px 12px rgba(255, 255, 255, 0.1);
  border: 3px solid var(--pirate-glow);
  animation:
    0.4s cubic-bezier(0.34, 1.56, 0.64, 1) pieceAppear,
    2s ease-in-out infinite glowPirate;
  position: relative;
}
.piece.marine {
  background: radial-gradient(
    circle at 35% 35%,
    var(--marine-primary),
    var(--marine-dark)
  );
  box-shadow:
    0 0 35px var(--marine-shadow),
    0 0 50px rgba(192, 192, 192, 0.3),
    0 6px 15px rgba(0, 0, 0, 0.8),
    inset -4px -4px 15px rgba(0, 0, 0, 0.7),
    inset 3px 3px 12px rgba(255, 255, 255, 0.1);
  border: 3px solid var(--marine-glow);
  animation:
    0.4s cubic-bezier(0.34, 1.56, 0.64, 1) pieceAppear,
    2s ease-in-out infinite glowMarine;
  position: relative;
}
@keyframes pieceAppear {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  70% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes glowPirate {
  0%,
  100% {
    box-shadow:
      0 0 30px var(--pirate-shadow),
      0 0 45px rgba(212, 175, 55, 0.3),
      0 6px 15px rgba(0, 0, 0, 0.8),
      inset -4px -4px 15px rgba(0, 0, 0, 0.7),
      inset 3px 3px 12px rgba(255, 255, 255, 0.1);
  }
  50% {
    box-shadow:
      0 0 45px var(--pirate-shadow),
      0 0 70px rgba(212, 175, 55, 0.5),
      0 6px 15px rgba(0, 0, 0, 0.8),
      inset -4px -4px 15px rgba(0, 0, 0, 0.7),
      inset 3px 3px 12px rgba(255, 255, 255, 0.1);
  }
}
@keyframes glowMarine {
  0%,
  100% {
    box-shadow:
      0 0 30px var(--marine-shadow),
      0 0 45px rgba(192, 192, 192, 0.3),
      0 6px 15px rgba(0, 0, 0, 0.8),
      inset -4px -4px 15px rgba(0, 0, 0, 0.7),
      inset 3px 3px 12px rgba(255, 255, 255, 0.1);
  }
  50% {
    box-shadow:
      0 0 45px var(--marine-shadow),
      0 0 70px rgba(192, 192, 192, 0.5),
      0 6px 15px rgba(0, 0, 0, 0.8),
      inset -4px -4px 15px rgba(0, 0, 0, 0.7),
      inset 3px 3px 12px rgba(255, 255, 255, 0.1);
  }
}
@keyframes symbolGlow {
  0%,
  100% {
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }
}
.game-stats {
  display: flex;
  justify-content: center;
  gap: 60px;
  margin-top: 30px;
  animation: 1s ease-out 0.3s both statsReveal;
}
@keyframes statsReveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.stat-item {
  text-align: center;
  padding: 22px 40px;
  border-radius: 15px;
  background: linear-gradient(
    145deg,
    rgba(60, 40, 20, 0.8),
    rgba(40, 25, 10, 0.8)
  );
  border: 2px solid rgba(212, 175, 55, 0.5);
  box-shadow:
    0 8px 25px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(212, 175, 55, 0.3);
  transition: 0.3s;
}
.stat-item:hover {
  transform: translateY(-5px);
  box-shadow:
    0 12px 35px rgba(0, 0, 0, 0.8),
    0 0 30px rgba(212, 175, 55, 0.3);
}
.stat-label {
  display: block;
  font-size: 1rem;
  color: var(--text-gold);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 800;
  text-shadow:
    2px 2px 0 #000,
    -1px -1px 0 #000,
    0 0 15px var(--text-gold);
}
.stat-value {
  display: block;
  font-size: 3.2rem;
  font-weight: 900;
  -webkit-text-stroke: 2px rgba(0, 0, 0, 0.5);
}
.pirate-stat .stat-value {
  color: var(--pirate-primary);
  text-shadow:
    0 0 30px var(--pirate-shadow),
    4px 4px 0 #000,
    -2px -2px 0 #000,
    0 0 40px rgba(255, 215, 0, 0.3);
}
.marine-stat .stat-value {
  color: var(--marine-primary);
  text-shadow:
    0 0 30px var(--marine-shadow),
    4px 4px 0 #000,
    -2px -2px 0 #000,
    0 0 40px rgba(240, 240, 240, 0.3);
}
.victory-modal {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
}
.modal-content {
  background: linear-gradient(145deg, #1a1a1a, #0d0d0d);
  padding: 60px;
  border-radius: 20px;
  text-align: center;
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.95),
    inset 0 0 40px rgba(0, 0, 0, 0.6),
    0 0 50px rgba(212, 175, 55, 0.2);
  border: 3px solid rgba(212, 175, 55, 0.6);
  max-width: 650px;
  animation: 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) victoryReveal;
}
.victory-icon {
  font-size: 6.5rem;
  margin-bottom: 25px;
  animation: 1.5s ease-in-out infinite iconFloat;
  filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.5));
}
@keyframes iconFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}
.victory-title {
  font-size: 3.5rem;
  font-weight: 900;
  margin-bottom: 20px;
  letter-spacing: 4px;
  text-transform: uppercase;
  animation: 2s ease-in-out infinite titlePulse;
  -webkit-text-stroke: 3px black;
}
.victory-title.pirate {
  color: var(--pirate-primary);
  text-shadow:
    0 0 50px var(--pirate-shadow),
    6px 6px 0 #000,
    -2px -2px 0 #000,
    0 0 70px rgba(255, 215, 0, 0.4);
}
.victory-title.marine {
  color: var(--marine-primary);
  text-shadow:
    0 0 50px var(--marine-shadow),
    6px 6px 0 #000,
    -2px -2px 0 #000,
    0 0 70px rgba(240, 240, 240, 0.4);
}
@keyframes titlePulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}
.victory-message {
  font-size: 1.4rem;
  color: var(--text-gold);
  margin-bottom: 35px;
  line-height: 1.7;
  font-weight: 700;
  text-shadow:
    3px 3px 0 #000,
    -1px -1px 0 #000,
    0 0 20px var(--text-gold);
}
.play-again-btn {
  padding: 18px 50px;
  font-size: 1.2rem;
  font-weight: 900;
  background: linear-gradient(
    135deg,
    var(--pirate-dark),
    var(--pirate-primary)
  );
  color: #fff;
  border: 3px solid var(--text-gold);
  border-radius: 14px;
  cursor: pointer;
  transition: 0.3s;
  text-transform: uppercase;
  letter-spacing: 3px;
  box-shadow:
    0 8px 25px rgba(0, 0, 0, 0.6),
    inset 0 2px 0 rgba(212, 175, 55, 0.3);
  text-shadow:
    3px 3px 0 #000,
    -1px -1px 0 #000,
    0 0 15px rgba(255, 255, 255, 0.3);
}
.play-again-btn:hover {
  transform: translateY(-4px);
  box-shadow:
    0 12px 35px rgba(0, 0, 0, 0.7),
    0 0 40px var(--text-gold);
  background: linear-gradient(135deg, var(--pirate-primary), #c42021);
}
@keyframes victoryReveal {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
.arrow-line {
  stroke-width: 12;
  stroke-linecap: round;
  filter: url(#glow);
  opacity: 0;
  transition: opacity 0.2s;
  animation: 0.4s forwards arrowDraw;
}
.arrow-line.victory {
  stroke-width: 20;
  animation: 0.8s forwards victoryArrowDraw;
}
@keyframes arrowDraw {
  0% {
    stroke-dasharray: 1500;
    stroke-dashoffset: 1500;
    opacity: 0;
  }
  100% {
    stroke-dasharray: 1500;
    stroke-dashoffset: 0;
    opacity: 0.95;
    filter: url(#glow) drop-shadow(0 0 20px rgba(212, 175, 55, 0.8));
  }
}
@keyframes victoryArrowDraw {
  0% {
    stroke-dasharray: 1500;
    stroke-dashoffset: 1500;
    opacity: 0;
  }
  100% {
    stroke-dasharray: 1500;
    stroke-dashoffset: 0;
    opacity: 1;
    filter: url(#glow) drop-shadow(0 0 35px rgba(212, 175, 55, 1));
  }
}
.winner-text {
  font-size: 28px;
  font-weight: 900;
  fill: var(--text-gold);
  text-anchor: middle;
  letter-spacing: 4px;
  opacity: 0;
  filter: drop-shadow(0 0 12px rgba(0, 0, 0, 0.9));
  animation: 0.5s 0.6s forwards textReveal;
  text-transform: uppercase;
}
@keyframes textReveal {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
@media (max-width: 1024px) {
  .game-controls {
    flex-direction: column;
    gap: 20px;
  }
  .player-indicator,
  .reset-btn {
    width: 100%;
    justify-content: center;
  }
}
@media (max-width: 768px) {
  :root {
    --cell-size: 55px;
    --piece-size: 48px;
  }
  .game-title {
    font-size: 3rem;
    flex-direction: column;
    gap: 12px;
  }
  .game-stats {
    flex-direction: column;
    gap: 25px;
  }
}
@media (max-width: 480px) {
  :root {
    --cell-size: 45px;
    --piece-size: 39px;
  }
  .game-title {
    font-size: 2.5rem;
  }
}
.startup-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 8, 20, 0.95);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: 0.3s ease-out fadeIn;
}
.startup-modal.show {
  display: flex;
}
.startup-content {
  background: linear-gradient(
    135deg,
    var(--ocean-deep) 0,
    var(--storm-cloud) 100%
  );
  padding: 50px;
  border-radius: 20px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.9),
    0 0 80px rgba(255, 215, 0, 0.2);
  border: 2px solid rgba(255, 215, 0, 0.3);
  max-width: 600px;
  width: 90%;
  text-align: center;
}
.startup-title {
  background: linear-gradient(
    135deg,
    var(--pirate-primary),
    var(--text-gold),
    var(--marine-primary)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.5));
}
.startup-subtitle {
  color: var(--text-light);
  opacity: 0.9;
}
.mode-selection {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}
.mode-btn {
  background: linear-gradient(
    135deg,
    rgba(0, 53, 102, 0.6) 0,
    rgba(26, 26, 46, 0.6) 100%
  );
  border: 2px solid rgba(255, 215, 0, 0.3);
  padding: 30px 20px;
  border-radius: 15px;
  cursor: pointer;
  transition: 0.3s;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  font-family: Impact, "Arial Black", sans-serif;
}
.mode-btn:hover {
  transform: translateY(-5px);
  border-color: var(--text-gold);
  box-shadow:
    0 15px 40px rgba(255, 215, 0, 0.3),
    0 0 30px rgba(255, 215, 0, 0.2);
}
.mode-icon {
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}
.mode-title {
  color: var(--text-light);
  letter-spacing: 1px;
}
.mode-desc {
  color: rgba(255, 255, 255, 0.7);
  font-family: Arial, sans-serif;
}
.difficulty-selection,
.gamemode-selection {
  animation: 0.3s ease-out slideIn;
}
.difficulty-buttons,
.gamemode-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 30px 0;
}
.difficulty-btn,
.gamemode-btn {
  background: linear-gradient(
    135deg,
    rgba(0, 53, 102, 0.4) 0,
    rgba(26, 26, 46, 0.4) 100%
  );
  border: 2px solid rgba(255, 215, 0, 0.2);
  padding: 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.3s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: Impact, "Arial Black", sans-serif;
}
.difficulty-btn:hover,
.gamemode-btn:hover {
  border-color: var(--text-gold);
  transform: translateX(5px);
  box-shadow: 0 10px 30px rgba(255, 215, 0, 0.2);
}
.difficulty-btn.active,
.gamemode-btn.active {
  border-color: var(--pirate-primary);
  box-shadow: 0 0 30px rgba(230, 57, 70, 0.4);
  background: linear-gradient(
    135deg,
    rgba(230, 57, 70, 0.2) 0,
    rgba(26, 26, 46, 0.6) 100%
  );
}
.difficulty-btn span,
.gamemode-btn span {
  font-size: 1.3rem;
  color: var(--text-light);
}
.difficulty-btn small,
.gamemode-btn small {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  font-family: Arial, sans-serif;
}
.back-btn,
.start-game-btn {
  background: linear-gradient(
    135deg,
    var(--pirate-primary),
    var(--pirate-dark)
  );
  border: none;
  padding: 15px 40px;
  border-radius: 10px;
  color: var(--text-light);
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
  margin-top: 20px;
  transition: 0.3s;
  font-family: Impact, "Arial Black", sans-serif;
  letter-spacing: 1px;
}
.back-btn:hover,
.start-game-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(230, 57, 70, 0.5);
}
.hidden {
  display: none !important;
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.close-modal-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-light);
  font-size: 1.5rem;
  cursor: pointer;
  transition: 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.close-modal-btn:hover {
  background: rgba(255, 0, 0, 0.3);
  border-color: red;
  transform: rotate(90deg);
}
.victory-buttons {
  display: flex;
  gap: 15px;
  margin-top: 30px;
  justify-content: center;
}
.change-players-btn {
  background: linear-gradient(
    135deg,
    var(--marine-primary),
    var(--marine-dark)
  );
  border: none;
  padding: 15px 30px;
  border-radius: 12px;
  color: var(--text-light);
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
  transition: 0.3s;
  font-family: Impact, "Arial Black", sans-serif;
  letter-spacing: 1px;
}
.change-players-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(43, 127, 230, 0.5);
}
.settings-panel {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999;
}
.settings-toggle {
  background: linear-gradient(135deg, var(--ocean-deep), var(--storm-cloud));
  border: 2px solid rgba(255, 215, 0, 0.3);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 2rem;
  cursor: pointer;
  transition: 0.3s;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}
.settings-toggle:hover {
  transform: rotate(60deg) scale(1.1);
  box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
}
.settings-content {
  position: absolute;
  top: 70px;
  right: 0;
  background: linear-gradient(
    135deg,
    var(--ocean-deep) 0,
    var(--storm-cloud) 100%
  );
  padding: 25px;
  border-radius: 15px;
  box-shadow:
    0 15px 40px rgba(0, 0, 0, 0.8),
    0 0 60px rgba(255, 215, 0, 0.2);
  border: 2px solid rgba(255, 215, 0, 0.3);
  min-width: 280px;
  animation: 0.3s ease-out slideDown;
}
.settings-content h3 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  text-align: center;
  color: var(--text-gold);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.settings-header h3 {
  font-size: 1.5rem;
  margin: 0;
  color: var(--text-gold);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.settings-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s,
    transform 0.2s;
  flex-shrink: 0;
}
.settings-close-btn:hover {
  background: rgba(255, 80, 80, 0.5);
  transform: rotate(90deg) scale(1.1);
}
.setting-group {
  margin-bottom: 18px;
}
.setting-group label {
  display: block;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 8px;
  font-family: Arial, sans-serif;
}
.theme-selector,
input[type="color"] {
  width: 100%;
  padding: 10px;
  background: rgba(0, 29, 61, 0.6);
  border: 2px solid rgba(255, 215, 0, 0.2);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 1rem;
  cursor: pointer;
  transition: 0.3s;
}
.theme-selector:hover,
input[type="color"]:hover {
  border-color: var(--text-gold);
}
input[type="color"] {
  height: 45px;
  cursor: pointer;
}
.toggle-btn {
  width: 100%;
  padding: 10px;
  background: linear-gradient(
    135deg,
    var(--pirate-primary),
    var(--pirate-dark)
  );
  border: none;
  border-radius: 8px;
  color: var(--text-light);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.3s;
}
.toggle-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(230, 57, 70, 0.4);
}
input[type="range"] {
  width: 100%;
  height: 6px;
  background: rgba(255, 215, 0, 0.2);
  border-radius: 5px;
  outline: 0;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--text-gold);
  cursor: pointer;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--text-gold);
  cursor: pointer;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}
.custom-colors {
  animation: 0.3s ease-out slideIn;
}
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.timer-display {
  position: fixed;
  top: 50%;
  left: 50px;
  transform: translateY(-50%);
  background: linear-gradient(135deg, var(--ocean-deep), var(--storm-cloud));
  padding: 25px 30px;
  border-radius: 50%;
  border: 3px solid rgba(255, 215, 0, 0.3);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.7),
    0 0 40px rgba(255, 215, 0, 0.2);
  z-index: 998;
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--text-light);
  text-align: center;
  animation: 1s ease-in-out infinite pulse;
}
.timer-display.warning {
  border-color: var(--pirate-primary);
  animation: 0.5s ease-in-out infinite timerWarning;
  color: var(--pirate-primary);
}
@keyframes timerWarning {
  0%,
  100% {
    transform: translateY(-50%) scale(1);
    box-shadow:
      0 10px 30px rgba(0, 0, 0, 0.7),
      0 0 40px rgba(230, 57, 70, 0.5);
  }
  50% {
    transform: translateY(-50%) scale(1.1);
    box-shadow:
      0 15px 40px rgba(0, 0, 0, 0.9),
      0 0 60px rgba(230, 57, 70, 0.8);
  }
}
@keyframes pulse {
  0%,
  100% {
    transform: translateY(-50%) scale(1);
  }
  50% {
    transform: translateY(-50%) scale(1.05);
  }
}
.ai-thinking {
  position: absolute;
  top: 5px;
  right: 0;
  z-index: 20;
  margin: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 0.92rem;
  font-weight: 200;
  color: #fff;
  background: rgba(10, 8, 25, 0.88);
  border: 1.5px solid rgba(100, 120, 255, 0.45);
  border-radius: 20px;
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.ai-thinking.hidden {
  display: none;
}
.thinking-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--text-light);
  border-radius: 50%;
  animation: 1s linear infinite spin;
  flex-shrink: 0;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 768px) {
  .startup-content {
    padding: 35px 25px;
  }
  .startup-title {
    font-size: 2.5rem;
  }
  .mode-selection {
    grid-template-columns: 1fr;
  }
  .settings-panel {
    top: 15px;
    right: 15px;
  }
  .settings-toggle {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
  .ai-thinking,
  .timer-display {
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    top: 20px;
  }
  .timer-display.warning {
    transform: translate(-50%, -50%) scale(1);
  }
  @keyframes timerWarning {
    0%,
    100% {
      transform: translate(-50%, -50%) scale(1);
    }
    50% {
      transform: translate(-50%, -50%) scale(1.1);
    }
  }
  @keyframes pulse {
    0%,
    100% {
      transform: translate(-50%, -50%) scale(1);
    }
    50% {
      transform: translate(-50%, -50%) scale(1.05);
    }
  }
  .ai-thinking {
    top: 80px;
  }
}
@media (max-width: 480px) {
  .victory-buttons {
    flex-direction: column;
  }
  .settings-content {
    right: -80px;
    min-width: 250px;
  }
}
.player-names-section {
  margin-top: 30px;
  animation: 0.3s ease-out slideIn;
}
.player-names-section h3 {
  font-size: 1.2rem;
  color: var(--text-light);
  margin-bottom: 20px;
  text-align: center;
}
.name-inputs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}
.name-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.name-input-group label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  font-family: Arial, sans-serif;
}
.name-input-group input {
  padding: 12px;
  background: rgba(0, 29, 61, 0.6);
  border: 2px solid rgba(255, 215, 0, 0.2);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 1rem;
  transition: 0.3s;
}
.name-input-group input:focus {
  outline: 0;
  border-color: var(--text-gold);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}
.name-input-group input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}
.board-size-selection {
  margin-top: 25px;
  padding-top: 25px;
  border-top: 2px solid rgba(255, 215, 0, 0.2);
  animation: 0.3s ease-out slideIn;
}
.board-size-selection h4 {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 15px;
  text-align: center;
}
.size-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.size-btn {
  background: linear-gradient(
    135deg,
    rgba(0, 53, 102, 0.4) 0,
    rgba(26, 26, 46, 0.4) 100%
  );
  border: 2px solid rgba(255, 215, 0, 0.2);
  padding: 15px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 1.3rem;
  color: var(--text-light);
}
.size-btn small {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  font-family: Arial, sans-serif;
  font-weight: 400;
}
.size-btn:hover {
  border-color: var(--text-gold);
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3);
}
.size-btn.active {
  border-color: var(--pirate-primary);
  box-shadow: 0 0 25px rgba(230, 57, 70, 0.4);
  background: linear-gradient(
    135deg,
    rgba(230, 57, 70, 0.2) 0,
    rgba(26, 26, 46, 0.6) 100%
  );
}
.icon-back-btn {
  position: absolute;
  top: 15px;
  left: 15px;
  background: rgba(0, 29, 61, 0.6);
  border: 2px solid rgba(255, 215, 0, 0.3);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-light);
  font-size: 1.3rem;
  cursor: pointer;
  transition: 0.3s;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  z-index: 10;
  display: none;
}
.icon-back-btn:hover {
  background: rgba(43, 127, 230, 0.3);
  border-color: var(--marine-primary);
  transform: translateX(-3px);
  box-shadow: 0 4px 15px rgba(43, 127, 230, 0.4);
}
.difficulty-selection,
.gamemode-selection {
  padding-top: 50px;
}
@media (max-width: 768px) {
  .name-inputs {
    grid-template-columns: 1fr;
  }
  .size-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .size-buttons {
    grid-template-columns: 1fr;
  }
  .icon-back-btn {
    width: 35px;
    height: 35px;
    font-size: 1.1rem;
  }
}
.piece-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  line-height: 1;
  min-width: 1.6rem;
  min-height: 1.6rem;
}
@media (max-width: 480px) {
  .piece-icon {
    font-size: clamp(1.4rem, 5.5vw, 2rem);
  }
}
.mode-btn {
  font-weight: 400 !important;
  letter-spacing: 0.5px;
}
.mode-title {
  font-size: 1.4rem !important;
  font-weight: 500 !important;
  margin: 8px 0 !important;
}
.mode-desc {
  font-size: 0.95rem !important;
  font-weight: 300 !important;
  opacity: 0.9;
}
.mode-icon {
  font-size: 2.5rem !important;
}
.back-btn-bottom {
  position: absolute;
  bottom: 15px;
  left: 15px;
  background: rgba(0, 29, 61, 0.7);
  border: 2px solid rgba(255, 215, 0, 0.3);
  padding: 10px 20px;
  border-radius: 8px;
  color: var(--text-light);
  font-size: 1rem;
  cursor: pointer;
  transition: 0.3s;
  font-family: Arial, sans-serif;
}
.back-btn-bottom:hover {
  background: rgba(43, 127, 230, 0.3);
  border-color: var(--marine-primary);
  transform: translateX(-3px);
  box-shadow: 0 4px 15px rgba(43, 127, 230, 0.4);
}
.size-buttons-scroll {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 5px;
}
.size-buttons-scroll::-webkit-scrollbar {
  width: 6px;
}
.size-buttons-scroll::-webkit-scrollbar-track {
  background: rgba(0, 29, 61, 0.3);
  border-radius: 10px;
}
.size-buttons-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 0, 0.4);
  border-radius: 10px;
}
.size-buttons-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 215, 0, 0.6);
}
.theme-marineford-war {
  background: linear-gradient(
    180deg,
    #b3e5fc 0,
    #01579b 40%,
    #bf360c 80%,
    #4a0000 100%
  );
  background-size: 200% 200%;
  animation: 12s ease-in-out infinite alternate marinefordClash;
}
@keyframes marinefordClash {
  0% {
    background-position: 50% 0;
  }
  100% {
    background-position: 50% 100%;
  }
}
.theme-valley-of-end {
  background: linear-gradient(180deg, #1565c0 0, #546e7a 45%, #e65100 100%);
  background-size: 400% 400%;
  animation: 10s infinite alternate chakraClash;
}
@keyframes chakraClash {
  0% {
    background-position: 0 50%;
    filter: saturate(1);
  }
  100% {
    background-position: 100% 50%;
    filter: saturate(1.4) brightness(1.1);
  }
}
.theme-namek-exploding {
  background: linear-gradient(180deg, #00acc1 0, #388e3c 45%, #e64a19 100%);
  background-size: 200% 200%;
  animation: 6s ease-in-out infinite alternate namekDying;
}
@keyframes namekDying {
  0% {
    transform: scale(1);
    filter: contrast(1);
  }
  100% {
    transform: scale(1.02);
    filter: contrast(1.3) hue-rotate(5deg);
  }
}
.theme-city-z-ruins {
  background: linear-gradient(
    180deg,
    #263238 0,
    #546e7a 40%,
    #bf360c 80%,
    #f57f17 100%
  );
  background-size: 200% 200%;
  animation: 8s ease-in-out infinite alternate seriousPunch;
}
@keyframes seriousPunch {
  0% {
    filter: brightness(0.9) saturate(1.3);
    background-position: 0 50%;
  }
  100% {
    filter: brightness(1.15) saturate(1.6);
    background-position: 100% 50%;
  }
}
.theme-wisteria-night {
  background: linear-gradient(180deg, #0a0014 0, #4a0080 50%, #7b1fa2 100%);
  background-size: 400% 400%;
  animation: 10s ease-in-out infinite alternate demonCastle;
}
@keyframes demonCastle {
  0% {
    background-position: 50% 0;
    filter: brightness(0.85) hue-rotate(0deg);
  }
  100% {
    background-position: 50% 100%;
    filter: brightness(1.2) hue-rotate(20deg);
  }
}
.theme-shiganshina-district {
  background: linear-gradient(
    180deg,
    #37474f 0,
    #455a64 35%,
    #3e2723 70%,
    #b71c1c 100%
  );
  background-size: 100% 200%;
  animation: 20s ease-in-out infinite alternate titanBreach;
}
@keyframes titanBreach {
  0% {
    background-position: 0 0;
    filter: contrast(1);
  }
  100% {
    background-position: 0 40%;
    filter: contrast(1.15) brightness(0.9);
  }
}
.theme-stadium-battle {
  background: linear-gradient(
    135deg,
    #0d47a1 0,
    #1a237e 45%,
    #b71c1c 80%,
    #7f0000 100%
  );
  background-size: 400% 400%;
  animation: 8s ease-in-out infinite alternate pokeContest;
}
@keyframes pokeContest {
  0% {
    background-position: 0 50%;
    filter: brightness(0.9) saturate(1.2);
  }
  100% {
    background-position: 100% 50%;
    filter: brightness(1.1) saturate(1.5);
  }
}
.theme-malevolent-shrine {
  background: linear-gradient(180deg, #000 0, #880e4f 45%, #1a0000 100%);
  background-size: 400% 400%;
  animation: 8s ease-in-out infinite domainExpansion;
}
@keyframes domainExpansion {
  0%,
  100% {
    background-position: 50% 0;
    filter: brightness(0.85);
  }
  50% {
    background-position: 50% 100%;
    filter: brightness(1.2) saturate(1.3);
  }
}
.theme-nen-forest {
  background: linear-gradient(135deg, #1a1a2e 0, #2e7d32 50%, #f57f17 100%);
  background-size: 400% 400%;
  animation: 12s infinite nenAura;
}
@keyframes nenAura {
  0%,
  100% {
    background-position: 0 50%;
    filter: brightness(0.9);
  }
  50% {
    background-position: 100% 50%;
    filter: brightness(1.1) saturate(1.3);
  }
}
.theme-hueco-mundo {
  background: linear-gradient(
    180deg,
    #000 0,
    #1a237e 30%,
    #b0bec5 70%,
    #f5f5f5 100%
  );
  background-size: 100% 300%;
  animation: 18s ease-in-out infinite alternate huecoDrift;
}
@keyframes huecoDrift {
  0% {
    background-position: 0 0;
    filter: brightness(0.8);
  }
  100% {
    background-position: 0 80%;
    filter: brightness(1.05);
  }
}
.theme-eclipse-red {
  background: linear-gradient(
    180deg,
    #1a0000 0,
    #8b0000 40%,
    #3b0000 70%,
    #000 100%
  );
  background-size: 400% 400%;
  animation: 10s ease-in-out infinite alternate eclipseDoom;
}
@keyframes eclipseDoom {
  0% {
    background-position: 50% 0;
    filter: brightness(0.8);
  }
  100% {
    background-position: 50% 100%;
    filter: brightness(1.2) saturate(1.2);
  }
}
.theme-dark-fantasy .pirate-stat .theme-icon,
.theme-dark-fantasy .title-pirate .title-icon {
  transform: scaleX(-1);
  display: inline-block;
}
.theme-dark-fantasy .piece.pirate .piece-icon {
  animation-name: symbolGlowMirrored !important;
}
.theme-dark-fantasy .player-indicator.pirate .turn-icon-above {
  animation-name: bobIconMirrored !important;
}
.theme-dark-fantasy .victory-icon {
  animation-name: iconFloatMirrored !important;
}
@keyframes symbolGlowMirrored {
  0%,
  100% {
    transform: translate(-50%, -50%) scaleX(-1) scale(1);
    opacity: 0.95;
  }
  50% {
    transform: translate(-50%, -50%) scaleX(-1) scale(1.1);
    opacity: 1;
  }
}
@keyframes bobIconMirrored {
  0%,
  100% {
    transform: rotate(-15deg) scaleX(-1) scale(1);
  }
  50% {
    transform: rotate(-15deg) scaleX(-1) scale(1.1);
  }
}
@keyframes iconFloatMirrored {
  0%,
  100% {
    transform: translateY(0) scaleX(-1);
  }
  50% {
    transform: translateY(-12px) scaleX(-1);
  }
}
.game-container {
  transition: box-shadow 1s;
  max-width: 100%;
  width: min(90vw, 600px);
  margin: 0 auto;
}
.theme-ocean-pirate .game-board {
  box-shadow:
    0 0 40px rgba(220, 20, 60, 0.3),
    0 0 60px rgba(30, 64, 175, 0.2);
}
.theme-ninja-village .game-board {
  box-shadow:
    0 0 40px rgba(255, 107, 53, 0.3),
    0 0 60px rgba(26, 26, 46, 0.2);
}
.theme-space-battle .game-board {
  box-shadow:
    0 0 40px rgba(255, 140, 0, 0.3),
    0 0 60px rgba(75, 0, 130, 0.2);
}
.theme-hero-city .game-board {
  box-shadow:
    0 0 40px rgba(46, 204, 64, 0.3),
    0 0 60px rgba(177, 13, 201, 0.2);
}
.theme-demon-night .game-board {
  box-shadow:
    0 0 40px rgba(231, 76, 60, 0.4),
    0 0 60px rgba(44, 62, 80, 0.3);
}
.theme-wall-defense .game-board {
  box-shadow:
    0 0 40px rgba(22, 160, 133, 0.3),
    0 0 60px rgba(139, 69, 19, 0.2);
}
.theme-pokemon-arena .game-board {
  box-shadow:
    0 0 40px rgba(255, 203, 5, 0.4),
    0 0 60px rgba(59, 76, 202, 0.3);
}
.theme-cursed-realm .game-board {
  box-shadow:
    0 0 40px rgba(255, 255, 255, 0.2),
    0 0 60px rgba(0, 0, 0, 0.5);
}
.theme-hunter-exam .game-board {
  box-shadow:
    0 0 40px rgba(39, 174, 96, 0.3),
    0 0 60px rgba(230, 126, 34, 0.2);
}
.theme-alchemy-circle .game-board {
  box-shadow:
    0 0 40px rgba(243, 156, 18, 0.4),
    0 0 60px rgba(192, 57, 43, 0.3);
}
.theme-soul-society .game-board {
  box-shadow:
    0 0 40px rgba(52, 152, 219, 0.3),
    0 0 60px rgba(142, 68, 173, 0.2);
}
.difficulty-selection,
.gamemode-selection {
  position: relative;
  padding-bottom: 70px;
}
@media (max-width: 768px) {
  .piece-icon {
    font-size: 1.5rem;
  }
  .mode-title {
    font-size: 1.2rem !important;
  }
  .mode-desc {
    font-size: 0.85rem !important;
  }
}
@media (max-width: 480px) {
  .piece-icon {
    font-size: 1.2rem;
  }
  .back-btn-bottom {
    font-size: 0.9rem;
    padding: 8px 16px;
  }
  .size-buttons-scroll {
    max-height: 150px;
  }
}
[class*="theme-"] {
  transition:
    background 2s ease-in-out,
    background-color 2s ease-in-out !important;
}
body.theme-cursed-realm,
body.theme-demon-night,
body.theme-hero-city,
body.theme-hunter-exam,
body.theme-ninja-village,
body.theme-ocean-pirate,
body.theme-pokemon-arena,
body.theme-soul-society,
body.theme-space-battle,
body.theme-wall-defense {
  transition: 2s ease-in-out;
}
.game-board {
  width: 100%;
  max-width: 100%;
  display: grid;
  gap: clamp(4px, 1vw, 8px);
  padding: clamp(10px, 2vw, 20px);
}
.cell {
  width: 100%;
  aspect-ratio: 1;
  min-height: 40px;
  max-height: 80px;
}
.game-header {
  padding: clamp(10px, 2vw, 20px);
  flex-wrap: wrap;
  justify-content: center;
}
.game-title {
  font-size: clamp(1.2rem, 3vw, 2rem);
}
.startup-modal .modal-content {
  width: min(95vw, 600px);
  max-width: 95vw;
  overflow-y: auto;
}
.mode-btn {
  min-height: 140px;
  padding: clamp(15px, 3vw, 25px);
}
.game-stats {
  display: flex;
  gap: clamp(10px, 2vw, 30px);
  flex-wrap: wrap;
  justify-content: center;
}
@media (max-width: 768px) {
  .game-container {
    width: 95vw;
  }
  .cell {
    max-height: 60px;
  }
  .gamemode-buttons,
  .mode-selection {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  .game-board {
    gap: 3px;
    padding: 10px;
  }
  .cell {
    min-height: 35px;
    max-height: 50px;
  }
  .startup-modal .modal-content {
    width: 98vw;
    padding: 15px;
  }
  .difficulty-buttons,
  .gamemode-buttons {
    grid-template-columns: 1fr;
  }
}
@media (max-height: 600px) and (orientation: landscape) {
  .startup-modal .modal-content {
    max-height: 95vh;
    overflow-y: auto;
  }
  .mode-btn {
    min-height: 100px;
  }
}
@media (min-width: 481px) and (max-width: 1024px) {
  .game-container {
    width: 85vw;
  }
  .cell {
    max-height: 70px;
  }
}
@media (min-width: 1025px) {
  .game-container {
    width: 700px;
  }
  .cell {
    max-height: 85px;
  }
}
.theme-alchemy-circle {
  display: none !important;
}
.theme-hero-battle {
  background: linear-gradient(135deg, gold 0, #8b0000 50%, gold 100%);
  background-size: 400% 400%;
  animation: 15s ease-in-out infinite heroBattle;
}
@keyframes heroBattle {
  0%,
  100% {
    background-position: 0 50%;
    filter: brightness(1);
  }
  50% {
    background-position: 100% 50%;
    filter: brightness(1.2);
  }
}
.theme-dark-fantasy {
  background: linear-gradient(
    135deg,
    #2c2c2c 0,
    #8b0000 30%,
    #1a1a1a 60%,
    #8b0000 100%
  );
  background-size: 400% 400%;
  animation: 20s ease-in-out infinite darkFantasy;
}
@keyframes darkFantasy {
  0%,
  100% {
    background-position: 0 50%;
    filter: brightness(0.8);
  }
  50% {
    background-position: 100% 50%;
    filter: brightness(1);
  }
}
.theme-hero-battle .game-board {
  box-shadow:
    0 0 40px rgba(255, 215, 0, 0.4),
    0 0 60px rgba(139, 0, 0, 0.3);
}
.theme-dark-fantasy .game-board {
  box-shadow:
    0 0 40px rgba(139, 0, 0, 0.5),
    0 0 60px rgba(44, 44, 44, 0.4);
}
.marine-text,
.pirate-text {
  display: inline-block;
  margin-left: 8px;
}
.title-marine,
.title-pirate {
  display: flex;
  align-items: center;
  gap: 8px;
}
.title-icon {
  margin-right: 15px !important;
  display: inline-block;
  min-width: 40px;
  font-size: 2rem;
  animation: 2s ease-in-out infinite pulseIcon;
}
@keyframes pulseIcon {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }
}
.title-marine,
.title-pirate {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 15px;
}
.marine-text,
.pirate-text {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 2px;
}
.game-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  margin-bottom: 20px;
}
.game-title {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  width: 100%;
  flex-wrap: wrap;
}
.game-subtitle {
  text-align: center;
  width: 100%;
  display: block;
  margin-top: 10px;
  font-size: 1.2rem;
  padding: 0 10px;
}
.startup-modal .modal-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 85vh;
  padding: 0;
}
.startup-header {
  padding: 20px 20px 15px;
  flex-shrink: 0;
  z-index: 2;
  background: inherit;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.startup-title {
  margin: 0;
  font-size: 2rem;
  padding: 0;
}
.startup-subtitle {
  margin: 0;
  padding: 0;
  border: none;
  font-size: 1rem;
  opacity: 0.8;
}
.scrollable-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--pirate-primary) rgba(0, 0, 0, 0.3);
}
.scrollable-modal-body::-webkit-scrollbar {
  width: 6px;
}
.scrollable-modal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
  margin: 10px 0;
}
.scrollable-modal-body::-webkit-scrollbar-thumb {
  background: var(--pirate-primary);
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(230, 57, 70, 0.6);
}
body.pirate-theme .scrollable-modal-body::-webkit-scrollbar-thumb {
  background: var(--pirate-primary);
  box-shadow: 0 0 8px var(--pirate-shadow);
}
body.marine-theme .scrollable-modal-body::-webkit-scrollbar-thumb {
  background: var(--marine-primary);
  box-shadow: 0 0 8px var(--marine-shadow);
}
.victory-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 8, 20, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: 0.3s ease-out fadeIn;
}
.victory-modal.show {
  display: flex;
}
.player-indicator .timer-display {
  position: absolute;
  top: 8px;
  left: 10px;
  margin: 0;
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--text-gold);
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.7);
  letter-spacing: 1.5px;
  background: rgba(0, 0, 0, 0.45);
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid rgba(255, 215, 0, 0.35);
  line-height: 1.5;
  white-space: nowrap;
}
.timer-display.hidden {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .bg-layer,
  .bg-layer[class*="theme-"],
  body {
    animation: none !important;
    transition: background !important;
  }
}
.theme-carousel-section {
  margin-bottom: 24px;
}
.theme-carousel-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
  font-family: Arial, sans-serif;
  font-weight: 600;
  text-align: center;
}
.theme-carousel {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 8px 4px 14px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 215, 0, 0.3) transparent;
}
.theme-carousel::-webkit-scrollbar {
  height: 4px;
}
.theme-carousel::-webkit-scrollbar-track {
  background: 0 0;
}
.theme-carousel::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 0, 0.3);
  border-radius: 2px;
}
.theme-card {
  flex: 0 0 auto;
  scroll-snap-align: start;
  position: relative;
  width: 72px;
  height: 96px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 6px;
  transition:
    transform 0.2s,
    border-color 0.2s,
    box-shadow 0.2s,
    filter 0.2s;
  background: 0 0;
  font-family: Arial, sans-serif;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 4px 12px rgba(0, 0, 0, 0.4);
}
.theme-card-bg {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  filter: saturate(1.6) brightness(1.2);
  transition: filter 0.2s;
}
.theme-card.active .theme-card-bg,
.theme-card:hover .theme-card-bg {
  filter: saturate(1.8) brightness(1.35);
}
.theme-card-icon {
  position: relative;
  z-index: 2;
  font-size: 1.6rem;
  margin-bottom: 2px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
  line-height: 1;
}
.theme-card-name {
  position: relative;
  z-index: 2;
  font-size: 0.55rem;
  font-weight: 700;
  color: #fff;
  text-shadow:
    0 1px 4px rgba(0, 0, 0, 0.9),
    0 0 8px rgba(0, 0, 0, 0.9);
  text-align: center;
  letter-spacing: 0.3px;
  line-height: 1.2;
  max-width: 64px;
  word-break: break-word;
}
.theme-card.active {
  border-color: gold;
  box-shadow:
    0 0 0 2px gold,
    0 0 16px rgba(255, 215, 0, 0.6),
    0 10px 28px rgba(255, 215, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-4px) scale(1.06);
}
.theme-card:not(.active):hover {
  border-color: rgba(255, 255, 255, 0.75);
  transform: translateY(-4px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 10px 24px rgba(0, 0, 0, 0.5);
}
@media (min-width: 480px) {
  .theme-card {
    width: 84px;
    height: 108px;
  }
  .theme-card-icon {
    font-size: 1.8rem;
  }
  .theme-card-name {
    font-size: 0.6rem;
  }
}
.difficulty-btn[data-difficulty="extreme"] {
  background: linear-gradient(135deg, rgba(90, 0, 0, 0.7), rgba(30, 0, 0, 0.9));
  border-color: rgba(200, 0, 0, 0.6);
  color: #f44;
}
.difficulty-btn[data-difficulty="extreme"].active,
.difficulty-btn[data-difficulty="extreme"]:hover {
  background: linear-gradient(135deg, rgba(140, 0, 0, 0.9), #3c0000);
  border-color: #f22;
  box-shadow:
    0 0 18px rgba(255, 50, 50, 0.6),
    0 8px 24px rgba(0, 0, 0, 0.5);
  color: #f66;
}
.difficulty-btn[data-difficulty="extreme"] span {
  animation: 1.8s ease-in-out infinite skullPulse;
}
@keyframes skullPulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.12);
  }
}
.hint-btn {
  position: absolute;
  top: 5px;
  left: 0;
  z-index: 20;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 20px;
  font-size: 0.83rem;
  font-weight: 700;
  background: rgba(20, 16, 0, 0.85);
  color: var(--text-gold, gold);
  border: 1.5px solid rgba(255, 215, 0, 0.5);
  border-radius: 20px;
  cursor: pointer;
  letter-spacing: 0.4px;
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  transition: 0.2s;
  white-space: nowrap;
}
.hint-btn:hover:not(:disabled) {
  background: rgba(50, 40, 0, 0.95);
  border-color: rgba(255, 215, 0, 0.85);
  box-shadow:
    0 0 10px rgba(255, 215, 0, 0.3),
    0 4px 12px rgba(0, 0, 0, 0.5);
  transform: translateY(-1px);
}
.hint-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.ai-explanation {
  position: static;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: rgba(15, 12, 30, 0.88);
  border: 1px solid rgba(255, 215, 0, 0.28);
  border-radius: 24px;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
  letter-spacing: 0.2px;
  max-width: 420px;
  text-align: center;
  line-height: 1.4;
  word-break: break-word;
  animation: 0.3s slideUpFadeIn;
  transition: opacity 0.4s;
}
.ai-explanation.fade-out {
  opacity: 0;
}
@keyframes slideUpFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.cell.hint-highlight {
  background: rgba(100, 160, 255, 0.12);
  animation: 0.8s ease-in-out infinite alternate hintColumnPulse;
}
@keyframes hintColumnPulse {
  from {
    box-shadow: inset 0 0 8px rgba(100, 160, 255, 0.3);
  }
  to {
    box-shadow:
      inset 0 0 18px rgba(100, 180, 255, 0.6),
      0 0 10px rgba(100, 160, 255, 0.2);
  }
}
.cell.hint-landing {
  background: rgba(255, 215, 0, 0.18) !important;
  box-shadow:
    inset 0 0 20px rgba(255, 215, 0, 0.5),
    0 0 15px rgba(255, 215, 0, 0.3) !important;
  animation: 0.6s ease-in-out infinite alternate hintLandingPulse;
}
@keyframes hintLandingPulse {
  from {
    background: rgba(255, 215, 0, 0.15) !important;
  }
  to {
    background: rgba(255, 215, 0, 0.3) !important;
  }
}
