/* Retro Arcade Theme */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  background-color: #0b0813;
  color: #f5f6fa;
  font-family: "Press Start 2P", -apple-system, BlinkMacSystemFont, "Segoe UI", monospace;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 16px;
  overflow-x: hidden;
}

#game-wrapper {
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Header */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 12px;
  background: #140d21;
  border: 2px solid #ff2a6d;
  border-radius: 6px;
  box-shadow: 0 0 15px rgba(255, 42, 109, 0.3);
}

.game-logo {
  font-size: 16px;
  letter-spacing: 2px;
  color: #05d9e8;
  text-shadow: 2px 2px #d1124b;
}

.top-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  background: #201335;
  color: #f5f6fa;
  border: 2px solid #56277d;
  font-family: inherit;
  font-size: 10px;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease-in-out;
}

.btn:hover {
  background: #ff2a6d;
  border-color: #ff2a6d;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(255, 42, 109, 0.4);
}

.btn-active {
  background: #05d9e8;
  color: #0b0813;
  border-color: #05d9e8;
  font-weight: bold;
}

/* Screen & Canvas Container */
#screen-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 4px solid #3d1a58;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(113, 39, 186, 0.4);
}

#screen-container:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: 177.78vh;
  max-height: 56.25vw;
  aspect-ratio: 16 / 9;
  margin: auto;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

#screen-container::backdrop {
  background-color: #000000;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
}

/* CRT Scanlines Shader */
.scanlines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.35) 50%
  ), linear-gradient(
    90deg,
    rgba(255, 0, 0, 0.04),
    rgba(0, 255, 0, 0.02),
    rgba(0, 0, 255, 0.04)
  );
  background-size: 100% 4px, 6px 100%;
  z-index: 10;
}

/* Fighting HUD Overlay */
#hud {
  position: absolute;
  top: 16px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0 24px;
  z-index: 20;
  pointer-events: none;
}

.fighter-hud {
  width: 38%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fighter-name {
  font-size: 13px;
  color: #ffea00;
  letter-spacing: 1px;
  text-shadow: 2px 2px #c0392b;
}

.health-bar-container {
  border: 3px solid #f1c40f;
  background: #111;
  padding: 3px;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

.health-bar-bg {
  width: 100%;
  height: 18px;
  background: #8b0000;
  border-radius: 2px;
  overflow: hidden;
}

.health-bar-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #2ecc71, #27ae60);
  transition: width 0.1s linear;
}

.health-bar-fill.reversed {
  margin-left: auto;
}

/* Super / Ultimate Meter Bars */
.super-bar-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
}

.super-bar-bg {
  flex: 1;
  height: 12px;
  background: rgba(10, 5, 20, 0.85);
  border: 2px solid #05d9e8;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 8px rgba(5, 217, 232, 0.35);
}

.super-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #05d9e8, #3b82f6);
  transition: width 0.1s linear;
}

.super-bar-fill.reversed {
  margin-left: auto;
  background: linear-gradient(270deg, #05d9e8, #3b82f6);
}

.super-text {
  font-size: 11px;
  color: #05d9e8;
  letter-spacing: 0.8px;
  min-width: 105px;
  text-shadow: 1.5px 1.5px #0b0813;
  font-weight: bold;
}

.p2-hud .super-text {
  text-align: right;
}

/* Glowing Pulsing State when Super / Ultimate Meter is MAX / 100% */
.super-ready .super-bar-bg {
  border-color: #ffe600;
  box-shadow: 0 0 12px #ffea00, 0 0 20px #ff2a6d;
  animation: superPulse 0.5s infinite alternate;
}

.super-ready .super-bar-fill {
  background: linear-gradient(90deg, #ffea00, #ff2a6d, #05d9e8);
}

.super-ready .super-text {
  font-size: 11.5px;
  color: #ffea00;
  text-shadow: 0 0 10px #ffea00, 2px 2px #d1124b;
  font-weight: bold;
}

@keyframes superPulse {
  0% { box-shadow: 0 0 6px #05d9e8; }
  100% { box-shadow: 0 0 14px #ffea00, 0 0 22px #ff2a6d; }
}

/* Round Win Dots */
.rounds-container {
  display: flex;
  gap: 6px;
}

.round-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #f1c40f;
  background: rgba(0, 0, 0, 0.4);
}

.round-dot.active {
  background: #e74c3c;
  box-shadow: 0 0 8px #e74c3c;
}

/* Center Arcade Timer */
.timer-container {
  width: 70px;
  height: 48px;
  background: #1e1335;
  border: 3px solid #ff2a6d;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 6px;
  box-shadow: 0 0 12px rgba(255, 42, 109, 0.6);
}

.timer-digit {
  font-size: 24px;
  color: #ffffff;
  text-shadow: 2px 2px #d1124b;
}

.timer-urgent {
  color: #ff0055;
  animation: pulse 0.5s infinite alternate;
}

@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.15); }
}

/* Announcements (ROUND 1, FIGHT, K.O., CHAMPION) */
.announcement {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 30;
  pointer-events: auto;
  transition: opacity 0.2s ease-in-out;
}

.announcement h2 {
  font-size: 42px;
  color: #ffea00;
  text-shadow: 4px 4px #c0392b, 0 0 25px rgba(255, 234, 0, 0.7);
  letter-spacing: 4px;
  margin-bottom: 12px;
}

.announcement p {
  font-size: 20px;
  color: #ffffff;
  text-shadow: 2px 2px #ff2a6d;
  letter-spacing: 2px;
}

.restart-btn {
  margin-top: 24px;
  font-size: 14px;
  padding: 12px 24px;
  background: #ff2a6d;
  border-color: #ffffff;
  animation: pulse 1s infinite alternate;
}

/* Pause Banner Overlay */
.pause-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(11, 8, 19, 0.92);
  border: 3px solid #05d9e8;
  border-radius: 8px;
  padding: 24px 36px;
  text-align: center;
  box-shadow: 0 0 30px rgba(5, 217, 232, 0.5), inset 0 0 15px rgba(5, 217, 232, 0.2);
  z-index: 50;
  pointer-events: none;
  animation: pausePulse 1s infinite alternate;
}

.pause-banner h2 {
  font-size: 32px;
  color: #ffea00;
  letter-spacing: 4px;
  text-shadow: 3px 3px #d1124b, 0 0 16px #ffea00;
  margin-bottom: 12px;
}

.pause-banner p {
  font-size: 11px;
  color: #05d9e8;
  letter-spacing: 1.5px;
}

@keyframes pausePulse {
  0% { transform: translate(-50%, -50%) scale(0.98); }
  100% { transform: translate(-50%, -50%) scale(1.02); }
}

/* Controls Guide Footer */
.controls-guide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background: #140d21;
  border: 2px solid #3d1a58;
  border-radius: 6px;
  padding: 14px 18px;
  font-size: 10px;
  line-height: 1.8;
}

.control-col h3 {
  color: #05d9e8;
  margin-bottom: 6px;
  font-size: 12px;
}

.key {
  display: inline-block;
  background: #2c1a45;
  color: #ffea00;
  border: 1px solid #7c3aed;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: bold;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.modal-content {
  background: #1a0f2e;
  border: 3px solid #ff2a6d;
  border-radius: 8px;
  padding: 24px;
  max-width: 420px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 0 25px rgba(255, 42, 109, 0.5);
}

.modal-content h2 {
  font-size: 14px;
  color: #05d9e8;
  text-align: center;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 10px;
}

/* Screen Overlays (Title & Character Select) */
.screen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at center, rgba(26, 15, 46, 0.92) 0%, rgba(8, 4, 16, 0.97) 100%);
  z-index: 35;
  transition: opacity 0.3s ease, visibility 0.3s;
}

.screen-overlay.hidden {
  display: none !important;
}

/* Title Screen Styling */
.title-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 680px;
  padding: 20px;
}

.title-badge {
  font-size: 9px;
  color: #05d9e8;
  letter-spacing: 3px;
  border: 1px solid #05d9e8;
  padding: 4px 12px;
  border-radius: 12px;
  background: rgba(5, 217, 232, 0.1);
  margin-bottom: 14px;
}

.title-heading {
  font-size: 34px;
  color: #ffea00;
  text-shadow: 4px 4px #c0392b, 0 0 25px rgba(255, 234, 0, 0.7);
  letter-spacing: 3px;
  margin-bottom: 8px;
  animation: titleGlow 1.5s infinite alternate;
}

.title-subheading {
  font-size: 13px;
  color: #ff2a6d;
  letter-spacing: 4px;
  text-shadow: 2px 2px #000;
  margin-bottom: 28px;
}

.title-menu-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  background: rgba(18, 10, 32, 0.85);
  border: 2px solid #582a88;
  padding: 24px 36px;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
}

.arcade-play-btn {
  font-family: "Press Start 2P", monospace;
  font-size: 16px;
  padding: 14px 36px;
  background: linear-gradient(180deg, #ff2a6d 0%, #b80d46 100%);
  color: #ffffff;
  border: 3px solid #ffea00;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 2px;
  box-shadow: 0 0 15px rgba(255, 42, 109, 0.6), inset 0 0 10px rgba(255, 234, 0, 0.4);
  transition: transform 0.1s, box-shadow 0.1s;
  animation: pulse 1.2s infinite alternate;
}

.arcade-play-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px #ffea00, 0 0 35px #ff2a6d;
}

.mode-buttons-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.mode-btn {
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
  padding: 13px 24px;
  color: #ffffff;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 1.5px;
  transition: transform 0.15s, box-shadow 0.15s;
  width: 100%;
  text-align: center;
}

#mode-2p-btn {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  border: 3px solid #60a5fa;
  box-shadow: 0 0 15px rgba(37, 99, 235, 0.6);
  animation: none;
}

#mode-2p-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 0 25px #60a5fa, 0 0 35px #2563eb;
  border-color: #93c5fd;
}

#mode-cpu-btn {
  background: linear-gradient(180deg, #ff2a6d 0%, #b80d46 100%);
  border: 3px solid #ffea00;
  box-shadow: 0 0 15px rgba(255, 42, 109, 0.6);
  animation: pulse 1.2s infinite alternate;
}

#mode-cpu-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 0 25px #ffea00, 0 0 35px #ff2a6d;
}

/* Difficulty Select Screen */
.difficulty-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 94%;
  max-width: 860px;
  padding: 10px;
}

.difficulty-title {
  font-size: 18px;
  color: #ffea00;
  letter-spacing: 3px;
  text-shadow: 3px 3px #c0392b;
  margin-bottom: 4px;
}

.difficulty-subtitle {
  font-size: 9px;
  color: #05d9e8;
  letter-spacing: 1.5px;
  margin-bottom: 20px;
}

.difficulty-cards-grid {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 18px;
  width: 100%;
}

.difficulty-card {
  flex: 1;
  max-width: 260px;
  background: rgba(20, 12, 34, 0.92);
  border: 3px solid #3d1a58;
  border-radius: 10px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.difficulty-card:hover, .difficulty-card:focus {
  transform: translateY(-5px);
}

.diff-level-badge {
  font-size: 8px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: bold;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.diff-name {
  font-size: 16px;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.diff-stars {
  font-size: 14px;
  letter-spacing: 3px;
  margin-bottom: 12px;
}

.diff-perks {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
  font-size: 8.5px;
  line-height: 1.6;
  color: #cbd5e1;
  text-align: left;
  width: 100%;
  flex: 1;
}

.diff-perks li {
  margin-bottom: 4px;
}

.diff-select-btn {
  font-family: inherit;
  font-size: 10px;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 1px;
  font-weight: bold;
  width: 100%;
  border: 2px solid transparent;
  transition: transform 0.1s, box-shadow 0.15s;
}

/* Easy Theme */
#diff-easy { border-color: #27ae60; }
#diff-easy:hover, #diff-easy:focus { border-color: #2ecc71; box-shadow: 0 0 20px rgba(46, 204, 113, 0.6); }
.easy-badge { background: #27ae60; color: #fff; }
#diff-easy .diff-name { color: #2ecc71; }
#diff-easy .diff-stars { color: #2ecc71; }
.easy-btn { background: #2ecc71; color: #000; border-color: #27ae60; }
.easy-btn:hover { background: #58d68d; }

/* Medium Theme */
#diff-medium { border-color: #d35400; }
#diff-medium:hover, #diff-medium:focus { border-color: #f39c12; box-shadow: 0 0 20px rgba(243, 156, 18, 0.6); }
.medium-badge { background: #d35400; color: #fff; }
#diff-medium .diff-name { color: #f39c12; }
#diff-medium .diff-stars { color: #f39c12; }
.medium-btn { background: #f39c12; color: #000; border-color: #d35400; }
.medium-btn:hover { background: #f5b041; }

/* Hard Theme */
#diff-hard { border-color: #b80d46; }
#diff-hard:hover, #diff-hard:focus { border-color: #ff2a6d; box-shadow: 0 0 20px rgba(255, 42, 109, 0.7); }
.hard-badge { background: #ff2a6d; color: #fff; }
#diff-hard .diff-name { color: #ff2a6d; }
#diff-hard .diff-stars { color: #ff2a6d; }
.hard-btn { background: #ff2a6d; color: #fff; border-color: #ffea00; }
.hard-btn:hover { background: #ff5287; }

.title-toggles {
  display: flex;
  gap: 24px;
  justify-content: center;
}

.arcade-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.arcade-toggle input {
  display: none;
}

.toggle-custom {
  width: 16px;
  height: 16px;
  border: 2px solid #05d9e8;
  border-radius: 3px;
  background: #0d0618;
  display: inline-block;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}

.arcade-toggle input:checked + .toggle-custom {
  background: #05d9e8;
}

.arcade-toggle input:checked + .toggle-custom::after {
  content: "✔";
  position: absolute;
  top: -2px;
  left: 1px;
  font-size: 12px;
  color: #0b0813;
  font-weight: bold;
}

.arcade-toggle-label {
  font-size: 10px;
  color: #e2e8f0;
  letter-spacing: 1px;
}

.title-prompt {
  margin-top: 24px;
  font-size: 9px;
  color: #94a3b8;
  letter-spacing: 1.5px;
  animation: blink 1s infinite alternate;
}

/* Character Select Screen */
.char-select-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 92%;
  max-width: 820px;
  padding: 10px;
}

.char-select-title {
  font-size: 20px;
  color: #ffea00;
  letter-spacing: 3px;
  text-shadow: 3px 3px #c0392b;
  margin-bottom: 4px;
}

.char-select-subtitle {
  font-size: 9px;
  color: #05d9e8;
  letter-spacing: 1.5px;
  margin-bottom: 18px;
}

.char-cards-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  width: 100%;
}

.fighter-select-card {
  flex: 1;
  max-width: 280px;
  background: rgba(20, 12, 34, 0.9);
  border: 3px solid #3d1a58;
  border-radius: 10px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

#card-maria:hover, #card-maria:focus {
  border-color: #ff0055;
  box-shadow: 0 0 20px rgba(255, 0, 85, 0.6);
  transform: translateY(-4px);
}

#card-pavlos:hover, #card-pavlos:focus {
  border-color: #05d9e8;
  box-shadow: 0 0 20px rgba(5, 217, 232, 0.6);
  transform: translateY(-4px);
}

.fighter-badge {
  position: absolute;
  top: -10px;
  font-size: 8px;
  background: #ffea00;
  color: #111;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 1px;
}

.fighter-avatar-box {
  width: 130px;
  height: 150px;
  border-radius: 8px;
  overflow: hidden;
  background: radial-gradient(circle, #271442 0%, #0c0818 100%);
  border: 2px solid #552784;
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.fighter-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.fighter-details {
  width: 100%;
  text-align: center;
}

.fighter-card-name {
  font-size: 16px;
  color: #ffffff;
  margin-bottom: 4px;
  letter-spacing: 1.5px;
}

#card-maria .fighter-card-name {
  color: #ff70a6;
  text-shadow: 2px 2px #d1124b;
}

#card-pavlos .fighter-card-name {
  color: #05d9e8;
  text-shadow: 2px 2px #0f4c81;
}

.fighter-card-class {
  font-size: 7.5px;
  color: #94a3b8;
  display: block;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.fighter-stats {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 7.5px;
  color: #cbd5e1;
}

.stat-bar {
  width: 120px;
  height: 6px;
  background: #110920;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid #3d1a58;
}

.stat-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffea00, #ff2a6d);
}

.select-hero-btn {
  width: 100%;
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  padding: 10px;
  background: #2563eb;
  color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: background 0.15s, transform 0.1s;
}

#card-maria .select-hero-btn {
  background: #d1124b;
}

#card-pavlos .select-hero-btn {
  background: #0284c7;
}

.select-hero-btn:hover {
  filter: brightness(1.2);
  transform: scale(1.02);
}

.select-vs-divider {
  font-size: 22px;
  font-weight: bold;
  color: #ffea00;
  text-shadow: 3px 3px #c0392b;
  letter-spacing: 2px;
}

@keyframes titleGlow {
  0% { text-shadow: 4px 4px #c0392b, 0 0 15px rgba(255, 234, 0, 0.4); }
  100% { text-shadow: 4px 4px #c0392b, 0 0 35px rgba(255, 234, 0, 0.9); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.form-group input {
  font-family: inherit;
  font-size: 12px;
  padding: 10px;
  background: #0d0718;
  border: 2px solid #56277d;
  color: #ffffff;
  border-radius: 4px;
  outline: none;
}

.form-group input:focus {
  border-color: #05d9e8;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.btn-save {
  background: #2ecc71;
  border-color: #27ae60;
  color: #000;
  font-weight: bold;
}

.hidden {
  display: none !important;
}
