/* Modern Cyber-Aquatic Design System for Aquatic Clash */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700;900&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --bg-primary: #060b17;
  --bg-card: rgba(13, 24, 46, 0.75);
  --bg-card-hover: rgba(19, 36, 68, 0.85);
  --border-cyan: rgba(0, 242, 254, 0.25);
  --border-cyan-glow: rgba(0, 242, 254, 0.6);
  --cyan-neon: #00f2fe;
  --blue-neon: #4facfe;
  --purple-neon: #9b51e0;
  --pink-neon: #ff007f;
  --gold-neon: #fcd34d;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: radial-gradient(circle at 50% 20%, #0c1a30 0%, #060b17 100%), url('image/a.webp');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  background-attachment: fixed;
  background-blend-mode: overlay;
  color: var(--text-main);
  font-family: var(--font-main);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Glassmorphism backdrop wrapper */
.app-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  width: 100%;
}

/* Header */
.game-header {
  text-align: center;
  margin-bottom: 1.5rem;
  position: relative;
}

.title-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cyan-neon);
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid var(--border-cyan);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 0.5rem;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
}

.game-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #ffffff 0%, var(--cyan-neon) 50%, var(--blue-neon) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(0, 242, 254, 0.3);
  line-height: 1.1;
  margin-bottom: 0.3rem;
}

.game-subtitle {
  color: var(--text-muted);
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  font-weight: 400;
}

/* Top bar controls */
.top-bar {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.icon-btn {
  background: rgba(13, 24, 46, 0.8);
  border: 1px solid var(--border-cyan);
  color: var(--cyan-neon);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.1rem;
}

.icon-btn:hover {
  background: var(--cyan-neon);
  color: #060b17;
  box-shadow: 0 0 15px var(--cyan-neon);
  transform: translateY(-2px);
}

/* Pixel Canvas Container */
.pixel-box {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.pixel-box canvas {
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.3);
  border: 2px solid var(--border-cyan);
  background: #000;
  image-rendering: pixelated;
}

/* Carousel Section */
.carousel-wrapper {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-cyan);
  border-radius: 24px;
  padding: 1.5rem 1rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.section-label {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--cyan-neon);
  margin-bottom: 1rem;
}

/* Character Card */
.char-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
}

.avatar-frame {
  position: relative;
  width: 170px;
  height: 170px;
  border-radius: 20px;
  padding: 5px;
  background: linear-gradient(135deg, var(--border-cyan-glow), transparent 70%);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  margin-bottom: 1.25rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
  display: block;
}

.char-card:hover .avatar-frame {
  transform: scale(1.04);
  box-shadow: 0 15px 35px rgba(0, 242, 254, 0.35);
}

.char-info {
  text-align: center;
  width: 100%;
  max-width: 380px;
}

.char-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.4rem;
}

.char-badges {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.badge-level {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

.badge-diff {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  text-transform: uppercase;
}

.diff-easy { background: rgba(34, 197, 94, 0.2); color: #4ade80; border: 1px solid rgba(74, 222, 128, 0.3); }
.diff-med { background: rgba(234, 179, 8, 0.2); color: #facc15; border: 1px solid rgba(250, 204, 21, 0.3); }
.diff-hard { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.3); }
.diff-god { background: rgba(168, 85, 247, 0.3); color: #c084fc; border: 1px solid rgba(192, 132, 252, 0.5); box-shadow: 0 0 10px rgba(168, 85, 247, 0.4); }

.win-rate-box {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  padding: 0.6rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.win-rate-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.win-rate-val {
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--cyan-neon);
}

.win-rate-bar-bg {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  overflow: hidden;
}

.win-rate-bar-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, var(--blue-neon), var(--cyan-neon));
  transition: width 0.4s ease;
}

/* Carousel Controls */
.carousel-control-prev,
.carousel-control-next {
  width: 44px;
  height: 44px;
  background: rgba(13, 24, 46, 0.7);
  border: 1px solid var(--border-cyan);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.9;
  transition: all 0.2s ease;
}

.carousel-control-prev { left: 10px; }
.carousel-control-next { right: 10px; }

.carousel-control-prev:hover,
.carousel-control-next:hover {
  background: var(--cyan-neon);
  opacity: 1;
  box-shadow: 0 0 15px var(--cyan-neon);
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  filter: invert(1);
  width: 1.25rem;
  height: 1.25rem;
}

/* Bottom Action Buttons */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

@media (min-width: 576px) {
  .action-buttons {
    flex-direction: row;
    justify-content: center;
  }
}

.btn-cyber-primary {
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  color: #060b17;
  font-family: var(--font-main);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0.9rem 2.2rem;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 242, 254, 0.4);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
}

.btn-cyber-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 242, 254, 0.6);
  color: #000;
}

.btn-cyber-secondary {
  background: rgba(13, 24, 46, 0.8);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.9rem 1.8rem;
  border-radius: 14px;
  border: 1px solid var(--border-cyan);
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-cyber-secondary:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--cyan-neon);
  color: var(--cyan-neon);
  transform: translateY(-2px);
}

/* Modal Styling */
.modal-content {
  background: #0d1a30;
  border: 1px solid var(--border-cyan);
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8);
  color: var(--text-main);
}

.modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.25rem 1.5rem;
}

.modal-title {
  font-weight: 700;
  color: var(--cyan-neon);
}

.modal-body {
  padding: 1.5rem;
  line-height: 1.7;
}

.modal-rule-item {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}

.rule-num {
  background: rgba(0, 242, 254, 0.2);
  color: var(--cyan-neon);
  font-family: var(--font-mono);
  font-weight: 700;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
}

.modal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive tweaks for mobile */
@media (max-width: 576px) {
  .app-container {
    padding: 1rem 0.75rem 2rem;
  }
  .avatar-frame {
    width: 140px;
    height: 140px;
  }
  .char-name {
    font-size: 1.25rem;
  }
}
