/* Cyberpunk Design System for 'Guess the Code' */

:root {
  --bg-dark: #07070c;
  --bg-panel: rgba(14, 14, 26, 0.65);
  --border-color: rgba(0, 240, 255, 0.15);
  
  --neon-cyan: #00f0ff;
  --neon-orange: #ff5f00;
  --neon-green: #39ff14;
  --neon-pink: #ff0055;
  --neon-blue: #0044ff;
  
  --glow-cyan: 0 0 10px rgba(0, 240, 255, 0.5), 0 0 20px rgba(0, 240, 255, 0.2);
  --glow-orange: 0 0 10px rgba(255, 95, 0, 0.5), 0 0 20px rgba(255, 95, 0, 0.2);
  --glow-green: 0 0 10px rgba(57, 255, 20, 0.6), 0 0 20px rgba(57, 255, 20, 0.2);
  --glow-pink: 0 0 10px rgba(255, 0, 85, 0.5), 0 0 20px rgba(255, 0, 85, 0.2);
  
  --font-cyber: 'Orbitron', system-ui, -apple-system, sans-serif;
  --font-mono: 'Share Tech Mono', monospace;
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  background-color: var(--bg-dark);
  color: #e0e0f0;
  font-family: var(--font-cyber);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

/* Background grid and glowing spots */
.cyber-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center;
  pointer-events: none;
  z-index: -2;
}

.cyber-grid::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, transparent 20%, var(--bg-dark) 85%);
  pointer-events: none;
}

.glow-sphere {
  position: absolute;
  width: 50vw;
  height: 50vw;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.12;
  pointer-events: none;
  z-index: -1;
  animation: float 20s infinite alternate;
}

.glow-sphere.orange {
  background: var(--neon-orange);
  top: -10%;
  left: -10%;
}

.glow-sphere.cyan {
  background: var(--neon-cyan);
  bottom: -10%;
  right: -10%;
  animation-delay: -10s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, 30px) scale(1.1); }
  100% { transform: translate(-30px, -50px) scale(0.9); }
}

/* Floating Audio Control */
.audio-control-panel {
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 100;
}

.cyber-btn-mini {
  background: rgba(14, 14, 26, 0.8);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: #fff;
  font-family: var(--font-mono);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  box-shadow: 0 0 5px rgba(0, 240, 255, 0.1);
}

.cyber-btn-mini:hover {
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
  transform: translateY(-1px);
}

.cyber-btn-mini:active {
  transform: translateY(1px);
}

.cyber-btn-mini.active {
  border-color: var(--neon-cyan) !important;
  background: rgba(0, 240, 255, 0.15) !important;
  color: var(--neon-cyan) !important;
  box-shadow: var(--glow-cyan) !important;
}

/* Glassmorphism Panel base */
.glass {
  background: var(--bg-panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  border-radius: 12px;
}

/* Game Container & Header */
.game-container {
  width: 92%;
  max-width: 1000px;
  margin-top: 50px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-grow: 1;
}

.game-header {
  text-align: center;
  margin-bottom: 30px;
}

.glitch-text {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 4px;
  color: #fff;
  position: relative;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3), var(--glow-cyan);
}

.subtitle {
  font-family: var(--font-mono);
  color: var(--neon-cyan);
  letter-spacing: 3px;
  font-size: 0.9rem;
  margin-top: 5px;
  text-shadow: 0 0 5px rgba(0, 240, 255, 0.5);
}

/* Screens System */
.game-screen {
  width: 100%;
  display: none;
  padding: 30px 40px;
  animation: fadeIn 0.4s ease-out forwards;
}

.game-screen.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Title & Description */
h2 {
  font-size: 1.6rem;
  text-align: center;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.setup-hint, .panel-desc {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #8fa0ba;
  margin-bottom: 30px;
}

.panel-desc {
  margin-bottom: 15px;
  text-align: left;
}

/* Code Slots Styling */
.code-slots {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 30px auto;
  max-width: 450px;
}

.slot {
  width: 60px;
  height: 70px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: bold;
  font-family: var(--font-mono);
  color: #fff;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Setup & Guess Active Slots */
.slot.active {
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan), inset 0 0 10px rgba(0, 240, 255, 0.1);
  transform: scale(1.05);
}

.slot.filled {
  border-color: var(--neon-orange);
  color: var(--neon-orange);
  text-shadow: 0 0 8px rgba(255, 95, 0, 0.4);
}

.slot.matched {
  background: rgba(57, 255, 20, 0.08);
  border-color: var(--neon-green) !important;
  color: var(--neon-green) !important;
  text-shadow: var(--glow-green) !important;
  box-shadow: var(--glow-green), inset 0 0 8px rgba(57, 255, 20, 0.1) !important;
}

.slot.locked {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.05);
  color: #4b5263;
  text-shadow: none;
}

/* Buttons */
.cyber-btn {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 20px auto 0 auto;
  padding: 14px 28px;
  font-family: var(--font-cyber);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 2px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.cyber-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transition: 0.5s;
}

.cyber-btn:hover::before {
  left: 100%;
}

.cyber-btn:hover {
  transform: translateY(-2px);
}

.cyber-btn:active {
  transform: translateY(1px);
}

/* Button colors */
.neon-cyan {
  border: 1px solid var(--neon-cyan);
  box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.2);
}
.neon-cyan:hover {
  background: var(--neon-cyan);
  color: #000;
  box-shadow: var(--glow-cyan);
}

.neon-orange {
  border: 1px solid var(--neon-orange);
  box-shadow: inset 0 0 10px rgba(255, 95, 0, 0.2);
}
.neon-orange:hover {
  background: var(--neon-orange);
  color: #000;
  box-shadow: var(--glow-orange);
}

.neon-green {
  border: 1px solid var(--neon-green);
  box-shadow: inset 0 0 10px rgba(57, 255, 20, 0.2);
}
.neon-green:hover {
  background: var(--neon-green);
  color: #000;
  box-shadow: var(--glow-green);
}

/* Hidden elements */
.hidden {
  display: none !important;
}

/* Error Messages */
.error-msg {
  color: var(--neon-pink);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin-top: 10px;
  height: 20px;
  opacity: 0;
  transition: opacity 0.2s ease;
  text-shadow: 0 0 5px rgba(255, 0, 85, 0.3);
}

.error-msg.visible {
  opacity: 1;
}

/* INTERMISSION SCREEN (TRANSITION) */
#transition-screen {
  text-align: center;
  padding: 40px 20px;
}

.pulse-icon {
  font-size: 3.5rem;
  margin-bottom: 15px;
  animation: pulse 1.5s infinite;
  text-shadow: var(--glow-orange);
}

.transition-desc {
  font-family: var(--font-mono);
  max-width: 400px;
  margin: 10px auto 30px auto;
  line-height: 1.5;
  color: #9ab3d1;
}

@keyframes pulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 2px var(--neon-orange)); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 12px var(--neon-orange)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 2px var(--neon-orange)); }
}

/* GAMEPLAY SYSTEM GRID */
.player-turn-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding: 0 5px;
}

.badge {
  font-size: 1.1rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 4px;
  border: 1px solid var(--neon-orange);
  color: #fff;
  text-shadow: var(--glow-orange);
  box-shadow: inset 0 0 10px rgba(255, 95, 0, 0.15);
}

.turns-count {
  font-family: var(--font-mono);
  color: var(--neon-cyan);
  font-size: 1.1rem;
  text-shadow: var(--glow-cyan);
}

.game-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 25px;
}

.grid-panel {
  padding: 25px;
  background: rgba(14, 14, 26, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}

.grid-panel h3 {
  font-size: 1.1rem;
  letter-spacing: 1px;
  margin-bottom: 5px;
  border-left: 3px solid var(--neon-cyan);
  padding-left: 10px;
}

/* Virtual Numpad styling */
.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 15px;
}

.num-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #e0e2ed;
  font-family: var(--font-cyber);
  font-size: 1.3rem;
  font-weight: 700;
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  touch-action: manipulation;
}

.num-btn:hover {
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.4);
  color: var(--neon-cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.15);
}

.num-btn:active {
  transform: scale(0.96);
  background: rgba(0, 240, 255, 0.2);
}

.num-btn.disabled {
  opacity: 0.2;
  pointer-events: none;
  border-color: rgba(255, 255, 255, 0.03);
  box-shadow: none;
  background: transparent;
  color: #4b5263;
}

.num-btn.special-btn {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.6);
}

.num-btn.special-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.07);
}

#btn-clear {
  color: var(--neon-pink);
}

#btn-clear:hover {
  border-color: rgba(255, 0, 85, 0.4);
  background: rgba(255, 0, 85, 0.08);
}

/* Submit Turn Wrapper */
.submit-action-wrapper {
  margin-top: 15px;
}

.submit-action-wrapper .cyber-btn {
  margin-top: 8px;
  max-width: 100%;
}

/* Radar & Right Column Panel Details */
.enemy-reveal-slots {
  gap: 8px;
  margin: 15px auto 15px auto;
  max-width: 320px;
}

.enemy-reveal-slot {
  width: 42px;
  height: 50px;
  font-size: 1.4rem;
  border-color: rgba(255, 255, 255, 0.08);
}

.radar-status {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 25px;
}

.neon-text-orange {
  color: var(--neon-orange);
  text-shadow: 0 0 5px rgba(255, 95, 0, 0.3);
}

.blink-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--neon-orange);
  box-shadow: var(--glow-orange);
  animation: blink 1s steps(2, start) infinite;
}

@keyframes blink {
  to { visibility: hidden; }
}

.own-code-reminder {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  padding: 12px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.own-code-reminder span:first-child {
  color: #7d889c;
}

.code-badge {
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: bold;
  letter-spacing: 2px;
  font-family: var(--font-mono);
  font-size: 1rem;
}

.code-badge.neon-green {
  border-color: var(--neon-green);
  color: var(--neon-green);
  background: rgba(57, 255, 20, 0.08);
  text-shadow: var(--glow-green);
}

/* History logs */
.guess-history-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.guess-history-wrapper h4 {
  font-size: 0.9rem;
  letter-spacing: 1px;
  color: #7d889c;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.history-list {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  flex-grow: 1;
  max-height: 180px;
  overflow-y: auto;
  padding: 10px;
}

/* Custom Scrollbar for history logs */
.history-list::-webkit-scrollbar {
  width: 5px;
}
.history-list::-webkit-scrollbar-track {
  background: transparent;
}
.history-list::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.2);
  border-radius: 3px;
}
.history-list::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.5);
}

.history-placeholder {
  color: #4b5263;
  font-family: var(--font-mono);
  text-align: center;
  font-size: 0.85rem;
  margin-top: 20px;
}

.history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  animation: slideIn 0.25s ease-out forwards;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.history-row:last-child {
  border-bottom: none;
}

.history-guess-digits {
  display: flex;
  gap: 4px;
}

.history-digit {
  width: 20px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  color: #fff;
  font-weight: bold;
}

.history-digit.matched {
  background: rgba(57, 255, 20, 0.2);
  color: var(--neon-green);
  border: 1px solid var(--neon-green);
}

.history-result {
  color: #7d889c;
  font-size: 0.85rem;
}

/* VICTORY SCREEN DETAILS */
#victory-screen {
  text-align: center;
  padding: 50px 30px;
}

.victory-decor {
  font-size: 4rem;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 10px var(--neon-green));
}

.winner-announcement {
  font-size: 1.3rem;
  color: #e0e2ed;
  margin: 15px auto 30px auto;
  font-family: var(--font-cyber);
}

.winner-announcement span {
  font-weight: bold;
  color: var(--neon-orange);
  text-shadow: var(--glow-orange);
}

.victory-stats {
  max-width: 400px;
  margin: 0 auto 35px auto;
  padding: 20px;
  background: rgba(0, 255, 100, 0.03);
  border-color: rgba(57, 255, 20, 0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 1.1rem;
}

.victory-stats p {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.neon-text-green {
  color: var(--neon-green);
  text-shadow: var(--glow-green);
}

.neon-text-cyan {
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
}

/* Footer style */
.game-footer {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #3f4756;
  padding: 25px 0 15px 0;
  width: 100%;
}

/* Responsive Scaling */
@media (max-width: 820px) {
  .game-grid {
    grid-template-columns: 1fr;
  }
  
  .game-screen {
    padding: 20px;
  }
  
  .glitch-text {
    font-size: 2.2rem;
  }
  
  .slot {
    width: 48px;
    height: 58px;
    font-size: 1.8rem;
  }
}

/* Comm Link Sidebar and Chat Styles */
.comm-panel.active {
  right: 0 !important;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
}

.voice-indicator.disconnected {
  background-color: #4b5263 !important;
  box-shadow: none !important;
}

.voice-indicator.connecting {
  background-color: var(--neon-orange) !important;
  box-shadow: var(--glow-orange) !important;
  animation: blink 1s steps(2, start) infinite;
}

.voice-indicator.connected {
  background-color: var(--neon-green) !important;
  box-shadow: var(--glow-green) !important;
}

.chat-msg-row {
  margin-bottom: 4px;
  line-height: 1.4;
  word-break: break-word;
  animation: slideIn 0.2s ease-out forwards;
}

.chat-msg-sender {
  font-weight: bold;
}

.chat-msg-sender.self {
  color: var(--neon-cyan);
}

.chat-msg-sender.opponent {
  color: var(--neon-orange);
}

.chat-msg-text {
  color: #e0e2ed;
}

.chat-badge {
  font-size: 0.75rem;
  background: var(--neon-pink);
  color: white;
  border-radius: 50%;
  padding: 1px 6px;
  font-family: var(--font-mono);
  box-shadow: var(--glow-pink);
  display: inline-block;
}

.chat-badge.hidden {
  display: none !important;
}

/* ==========================================
   BATTLESHIP STYLES
   ========================================== */

.battleship-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.battleship-boards {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
  width: 100%;
}

.board-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.board-container h4 {
  font-family: var(--font-cyber);
  font-size: 1rem;
  letter-spacing: 2px;
  margin-bottom: 10px;
  text-transform: uppercase;
  color: #fff;
  text-shadow: var(--glow-cyan);
}

.board-container.enemy h4 {
  text-shadow: var(--glow-orange);
}

.battleship-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(10, 1fr);
  gap: 2px;
  width: 290px;
  height: 290px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-color);
  padding: 3px;
  border-radius: 8px;
  box-shadow: inset 0 0 15px rgba(0, 240, 255, 0.05);
}

.enemy .battleship-grid {
  border-color: rgba(255, 95, 0, 0.25);
  box-shadow: inset 0 0 15px rgba(255, 95, 0, 0.05);
}

.battleship-cell {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(0, 240, 255, 0.06);
  aspect-ratio: 1;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: bold;
}

.battleship-cell:hover {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 5px rgba(0, 240, 255, 0.2);
}

.enemy .battleship-cell:hover {
  background: rgba(255, 95, 0, 0.12);
  border-color: var(--neon-orange);
  box-shadow: 0 0 5px rgba(255, 95, 0, 0.2);
}

.battleship-cell.ship {
  background: rgba(0, 240, 255, 0.18);
  border-color: rgba(0, 240, 255, 0.6);
  box-shadow: inset 0 0 8px rgba(0, 240, 255, 0.3);
}

.battleship-cell.hit {
  background: rgba(255, 95, 0, 0.25) !important;
  border-color: var(--neon-orange) !important;
  color: var(--neon-orange);
  text-shadow: var(--glow-orange);
  animation: hitBlink 0.3s ease-out;
}

.battleship-cell.miss {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #515b6d;
}

.battleship-cell.sunk {
  background: rgba(255, 0, 85, 0.25) !important;
  border-color: var(--neon-pink) !important;
  color: var(--neon-pink) !important;
  text-shadow: var(--glow-pink) !important;
  animation: hitBlink 0.5s ease-out;
}

@keyframes hitBlink {
  0% { transform: scale(1.1); filter: brightness(2); }
  100% { transform: scale(1); filter: brightness(1); }
}

.battleship-cell.placement-valid {
  background: rgba(57, 255, 20, 0.2);
  border-color: var(--neon-green);
}

.battleship-cell.placement-invalid {
  background: rgba(255, 0, 85, 0.2);
  border-color: var(--neon-pink);
}

.battleship-setup-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  max-width: 320px;
  width: 100%;
}

.battleship-ship-pool {
  background: rgba(255,255,255,0.01);
  border: 1px dashed rgba(0, 240, 255, 0.15);
  border-radius: 6px;
  padding: 10px 15px;
  width: 100%;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #7d889c;
}

.combat-log-panel {
  width: 100%;
  max-width: 620px;
  margin-top: 15px;
}

.combat-log-panel h4 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #7d889c;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.combat-log-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  height: 100px;
  overflow-y: auto;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.combat-log-box::-webkit-scrollbar {
  width: 4px;
}
.combat-log-box::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.2);
  border-radius: 2px;
}

.log-entry {
  line-height: 1.3;
  animation: slideIn 0.15s ease-out forwards;
}

.log-entry.player-shot {
  color: var(--neon-cyan);
}

.log-entry.enemy-shot {
  color: var(--neon-orange);
}

.log-entry.system {
  color: #7d889c;
  font-style: italic;
}

.log-entry.hit-event {
  font-weight: bold;
}

.log-entry.sunk-event {
  color: var(--neon-pink);
  font-weight: bold;
  text-shadow: var(--glow-pink);
}

@media (max-width: 720px) {
  .battleship-boards {
    gap: 20px;
  }
  .battleship-grid {
    width: 260px;
    height: 260px;
  }
}

/* Virtual keyboard styles for Guess the Word */
.cyber-keyboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 15px;
  width: 100%;
}

.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.key-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: #e0e2ed;
  font-family: var(--font-cyber);
  font-size: 1rem;
  font-weight: 700;
  padding: 8px 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-grow: 1;
  text-align: center;
  min-width: 24px;
  max-width: 42px;
  touch-action: manipulation;
}

.key-btn:hover:not(.disabled) {
  background: rgba(255, 95, 0, 0.08);
  border-color: rgba(255, 95, 0, 0.4);
  color: var(--neon-orange);
  box-shadow: 0 0 8px rgba(255, 95, 0, 0.15);
}

.key-btn:active:not(.disabled) {
  transform: scale(0.95);
  background: rgba(255, 95, 0, 0.2);
}

.key-btn.disabled {
  opacity: 0.15;
  cursor: default;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.02);
  color: #4b5263;
}

.key-btn.hit {
  background: rgba(0, 255, 136, 0.12) !important;
  border-color: rgba(0, 255, 136, 0.5) !important;
  color: var(--neon-green) !important;
  text-shadow: var(--glow-green) !important;
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.2) !important;
}

.key-btn.miss {
  background: rgba(255, 0, 85, 0.08) !important;
  border-color: rgba(255, 0, 85, 0.3) !important;
  color: var(--neon-pink) !important;
  text-shadow: var(--glow-pink) !important;
  opacity: 0.4;
}

.word-used-letter {
  display: inline-block;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-size: 0.9rem;
}
.word-used-letter.hit {
  border-color: var(--neon-green);
  color: var(--neon-green);
  text-shadow: var(--glow-green);
}
.word-used-letter.miss {
  border-color: var(--neon-pink);
  color: var(--neon-pink);
  text-shadow: var(--glow-pink);
  opacity: 0.5;
}

/* Cyberpunk Memory Grid Styles */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.memory-card {
  aspect-ratio: 1;
  perspective: 1000px;
  cursor: pointer;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
}

.memory-card.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.card-back {
  background: radial-gradient(circle, rgba(0, 240, 255, 0.05) 0%, rgba(0, 0, 0, 0.8) 100%);
  border-color: rgba(0, 240, 255, 0.25);
  display: flex;
  justify-content: center;
  align-items: center;
}

.card-back::before {
  content: "⚡";
  font-size: 2.2rem;
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
  animation: pulseGlow 2s infinite ease-in-out;
}

.card-front {
  background: rgba(25, 28, 41, 0.95);
  border-color: rgba(255, 95, 0, 0.3);
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 6px;
}

.card-image-wrapper {
  width: 100%;
  height: 80%;
  overflow: hidden;
  border-radius: 6px;
  position: relative;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-name-badge {
  font-family: var(--font-cyber);
  font-size: 0.75rem;
  color: #fff;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 0;
  width: 100%;
  text-align: center;
  background: rgba(0,0,0,0.5);
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* Card matched state */
.memory-card.matched .card-front {
  border-color: rgba(0, 255, 136, 0.5) !important;
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.25) !important;
}

.memory-card.matched .card-name-badge {
  color: var(--neon-green) !important;
  text-shadow: var(--glow-green) !important;
}

@keyframes pulseGlow {
  0%, 100% {
    transform: scale(0.95);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

@media (max-width: 480px) {
  .memory-grid {
    gap: 8px;
    max-width: 340px;
  }
  .card-back::before {
    font-size: 1.5rem;
  }
  .card-name-badge {
    font-size: 0.6rem;
  }
}
