@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Inter:wght@400;700;900&display=swap');

body {
  align-items: flex-start;
}
.floating-memes, .twitch-chat, .spotify-player { display: none; }

.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}

.bg-overlay.active {
  opacity: 1;
}

.bg-overlay.bean {
  background: linear-gradient(135deg, #0d0008, #1a000f, #0d0008, #150012);
}

.bg-overlay.mene {
  background: linear-gradient(135deg, #0a1a0a, #0d200d, #0a1a0a, #0f1f0f);
}

.bg-overlay.travi {
  background: linear-gradient(135deg, #1a0f00, #2a1500, #1a0f00, #201200);
}

.game-container {
  width: 100%;
  max-width: 1400px;
  margin: 2rem auto;
  padding: 2rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.game-title {
  font-family: 'Press Start 2P', cursive;
  font-size: clamp(1.2rem, 4vw, 2rem);
  color: #bf5af2;
  text-shadow: 0 0 20px #bf5af2, 0 0 60px #bf5af288;
  margin-bottom: 0.5rem;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

.game-title.swap {
  transform: scale(1.1) translateY(-5px);
  opacity: 0;
}

/* Start Menu */
.start-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 2rem;
}

/* TV Frame */
.tv-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tv-antenna {
  position: relative;
  width: 100px;
  height: 60px;
}

.tv-antenna-left,
.tv-antenna-right {
  position: absolute;
  bottom: 0;
  width: 4px;
  height: 60px;
  background: #555;
  border-radius: 2px;
}

.tv-antenna-left {
  left: 20px;
  transform: rotate(-20deg);
}

.tv-antenna-right {
  right: 20px;
  transform: rotate(20deg);
}

.tv-screen {
  position: relative;
  background: #0a0a0f;
  border: 12px solid #2a2a2a;
  border-radius: 20px;
  padding: 2.5rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  box-shadow:
    inset 0 0 40px #00000088,
    0 0 15px #bf5af233,
    0 8px 30px #00000088;
  overflow: hidden;
}

.tv-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.03) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 1;
}

.tv-scanline {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.05);
  animation: scanline 4s linear infinite;
  pointer-events: none;
  z-index: 2;
}

@keyframes scanline {
  0% { top: 0; }
  100% { top: 100%; }
}

.tv-base {
  width: 120px;
  height: 20px;
  background: #2a2a2a;
  border-radius: 0 0 10px 10px;
  margin-top: -2px;
}

.start-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 300px;
}

.start-menu .game-title {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  color: #fff;
  text-shadow:
    0 0 10px #bf5af2,
    0 0 20px #bf5af2,
    0 0 40px #bf5af2,
    0 0 80px #7b2ff7,
    0 0 120px #7b2ff7;
  animation: neonPulse 2s ease-in-out infinite;
}

@keyframes neonPulse {
  0%, 100% {
    text-shadow:
      0 0 10px #bf5af2,
      0 0 20px #bf5af2,
      0 0 40px #bf5af2,
      0 0 80px #7b2ff7,
      0 0 120px #7b2ff7;
  }
  50% {
    text-shadow:
      0 0 5px #bf5af2,
      0 0 10px #bf5af2,
      0 0 20px #bf5af2,
      0 0 40px #7b2ff7,
      0 0 60px #7b2ff7;
  }
}

.start-avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #bf5af2;
  box-shadow: 0 0 20px #bf5af244;
}

.start-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s;
}

.btn-start-menu {
  padding: 1rem 2rem;
  background: #1f1f23;
  border: 2px solid #bf5af2;
  color: #fff;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 0 10px #bf5af244, inset 0 0 10px #bf5af211;
  text-shadow: 0 0 8px #bf5af2;
}

.btn-start-menu:hover {
  background: #bf5af2;
  transform: scale(1.05);
  box-shadow:
    0 0 10px #bf5af2,
    0 0 20px #bf5af2,
    0 0 40px #7b2ff7,
    0 0 80px #7b2ff7;
  text-shadow: 0 0 10px #fff;
}

.btn-start-menu:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

.info-modal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 1.5rem;
}

.info-modal.hidden { display: none; }

.info-text {
  color: #ffffffaa;
  font-size: 0.9rem;
}

.disclaimer-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 1.5rem;
}

.disclaimer-screen.hidden { display: none; }

/* Windows Alert */
.win-alert {
  background: #f0f0f0;
  border: 1px solid #999;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  min-width: 420px;
  max-width: 500px;
  overflow: hidden;
}

.win-alert-titlebar {
  background: linear-gradient(180deg, #0078d4, #005a9e);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.win-alert-icon {
  font-size: 0.9rem;
}

.win-alert-title {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}

.win-alert-close {
  color: #fff;
  font-size: 0.75rem;
  cursor: default;
}

.win-alert-body {
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.win-alert-body .info-text {
  color: #333;
  text-align: center;
}

.win-alert-body .highlight-text {
  color: #cc0000;
  text-shadow: none;
}

.start-menu.hidden { display: none; }

.game-subtitle {
  color: #ffffff88;
  margin-bottom: 2rem;
  font-size: 0.95rem;
  transition: opacity 0.4s ease;
}

.select-section .game-title {
  color: #fff;
  text-shadow:
    0 0 10px #bf5af2,
    0 0 20px #bf5af2,
    0 0 40px #bf5af2,
    0 0 80px #7b2ff7,
    0 0 120px #7b2ff7;
  animation: neonPulse 2s ease-in-out infinite;
}

.select-section .game-subtitle {
  color: #fff;
  text-shadow:
    0 0 8px #bf5af2,
    0 0 15px #bf5af288;
}

.chatters-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chatter-card {
  background: #1f1f23;
  border: 2px solid #ffffff15;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  min-width: 420px;
  overflow: visible;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.chatter-card:hover {
  transform: translateY(-4px);
  border-color: #bf5af2;
  box-shadow: 0 0 20px #bf5af244;
}

.chatter-card.selected {
  border-color: #bf5af2;
  background: #2a1a3e;
  box-shadow: 0 0 30px #bf5af266;
  transform: translateY(-6px) scale(1.02);
  animation: selectPop 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes selectPop {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.04); }
  100% { transform: translateY(-6px) scale(1.02); }
}

.chatter-card.selected.rainbow {
  border-image: linear-gradient(135deg, red, orange, yellow, green, blue, indigo, violet) 1;
  box-shadow: 0 0 20px rgba(255,0,0,0.3), 0 0 20px rgba(0,255,0,0.3), 0 0 20px rgba(0,0,255,0.3);
}

.chatter-card.selected.forest {
  border-color: transparent;
  border-width: 3px;
  border-style: solid;
  border-image: none;
  background:
    linear-gradient(#1a2e1a, #1a2e1a) padding-box,
    linear-gradient(135deg, #228B22, #32CD32, #006400, #2E8B57, #228B22) border-box;
  border-color: transparent;
  border-radius: 16px;
  box-shadow: 0 0 20px rgba(34,139,34,0.4), 0 0 40px rgba(34,139,34,0.2);
  position: relative;
  overflow: visible;
}

.chatter-card.selected.forest::before {
  content: '🌿';
  position: absolute;
  top: -10px;
  left: -10px;
  font-size: 1.2rem;
}

.chatter-card.selected.forest::after {
  content: '🌿';
  position: absolute;
  bottom: -10px;
  right: -10px;
  font-size: 1.2rem;
  transform: rotate(180deg);
}

body.mene-bg, body.travi-bg, body.bean-bg {
  /* handled by overlay */
}

.chatter-card.selected.cowboy {
  border: 3px dashed #8B4513;
  border-radius: 16px;
  box-shadow: 0 0 15px rgba(139,69,19,0.4), inset 0 0 10px rgba(139,69,19,0.1);
  background: linear-gradient(135deg, #1a1008, #2a1a0a);
  position: relative;
}

.chatter-card.selected.cowboy::before {
  content: '🪢';
  position: absolute;
  top: -12px;
  left: -12px;
  font-size: 1.3rem;
}

.chatter-card.selected.cowboy::after {
  content: '🪢';
  position: absolute;
  bottom: -12px;
  right: -12px;
  font-size: 1.3rem;
  transform: rotate(180deg);
}



.flying-eggplant {
  position: fixed;
  top: -50px;
  z-index: 0;
  pointer-events: none;
  animation: fallDown linear forwards;
  opacity: 0;
  animation-fill-mode: forwards;
}

@keyframes fallDown {
  0% { transform: translateY(0) rotate(0deg); opacity: 0.8; }
  90% { opacity: 0.7; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

.bean-spotify {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 280px;
  background: #181818;
  border: 1px solid #ffffff15;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 50;
  box-shadow: 0 0 20px #00000066;
  animation: slideInLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

.bean-spotify .sp-album-placeholder {
  width: 100%;
  height: 140px;
  background: linear-gradient(135deg, #1db954, #191414);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}



.rainbow-text {
  display: inline-block;
}

.rainbow-text-inner {
  background: linear-gradient(90deg, red, orange, yellow, green, blue, indigo, violet);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.highlight-text {
  color: #ff69b4;
  font-weight: 700;
  text-shadow: 0 0 10px #ff69b488;
}

.chatter-card.selected::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 12px;
  color: #bf5af2;
  font-size: 1.2rem;
  font-weight: bold;
}

.chatter-emoji {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

/* Avatar 3D */
.avatar-3d {
  width: 100%;
  height: 420px;
  margin: 0 auto 0.5rem;
  position: relative;
  cursor: move;
}

.avatar-3d:active { cursor: move; }

.avatar-3d canvas {
  width: 100% !important;
  height: 100% !important;
  border-radius: 12px;
}

.avatar-3d .drag-hint {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 1rem;
  color: #ffffff44;
  animation: hintPulse 2s ease-in-out infinite;
  pointer-events: none;
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  z-index: 10;
}

.avatar-3d .drag-hint::before {
  content: '\f0ec';
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

.chatter-name {
  font-weight: 900;
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.chatter-lore {
  font-size: 0.72rem;
  color: #ffffff77;
  font-style: italic;
  line-height: 1.4;
  margin-bottom: 0.8rem;
  padding: 0 0.5rem;
}

.chatter-trait {
  font-size: 0.75rem;
  color: #ffffff66;
  font-style: italic;
}

.chatter-stats {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

.chatter-stat {
  background: #ffffff10;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  color: #ffffffaa;
}

.chatter-stats-bars {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.stat-row .stat-label {
  font-size: 0.7rem;
  color: #ffffffaa;
  min-width: 80px;
  text-align: left;
}

.stat-bar {
  flex: 1;
  height: 10px;
  background: #333;
  border-radius: 5px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.5s;
}

.stat-value {
  font-size: 0.7rem;
  color: #ffffffcc;
  min-width: 20px;
  text-align: right;
  font-weight: 700;
}

.stat-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  background: #ffffff22;
  border-radius: 50%;
  font-size: 0.55rem;
  color: #ffffffaa;
  cursor: help;
  vertical-align: middle;
  margin-left: 2px;
}

/* Batalha */
.battle-section {
  display: none;
  animation: fadeIn 0.5s;
}

.battle-section.active {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #000;
  animation: none;
}
.select-section.hidden { display: none; }

.fps-container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  cursor: crosshair;
}

.fps-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.fps-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.fps-hp {
  position: absolute;
  bottom: 20px;
  left: 20px;
  font-family: 'Press Start 2P', cursive;
  font-size: 1rem;
  color: #ff4444;
  text-shadow: 0 0 10px #ff000088;
}

.fps-score {
  position: absolute;
  top: 20px;
  left: 20px;
  font-family: 'Press Start 2P', cursive;
  font-size: 1.2rem;
  color: #ffd700;
  text-shadow: 0 0 10px #ffd70088, 0 0 20px #ffd70044;
}

.fps-player-name {
  position: absolute;
  top: 20px;
  right: 20px;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.9rem;
  text-shadow: 0 0 10px currentColor;
}

.fps-coords {
  position: absolute;
  top: 50px;
  right: 20px;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.55rem;
  color: #ffffffaa;
}

.fps-counter {
  position: absolute;
  top: 70px;
  right: 20px;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.55rem;
  color: #1db954;
}

.fps-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  color: #ffffff88;
  font-weight: 100;
}

.fps-reload-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(15px, -50%);
  width: 20px;
  height: 20px;
  border: 3px solid #ffffff33;
  border-top: 3px solid #bf5af2;
  border-radius: 50%;
  animation: reloadSpin 0.6s linear infinite;
  display: none;
}

.fps-reload-spinner.active {
  display: block;
}

@keyframes reloadSpin {
  to { transform: translate(15px, -50%) rotate(360deg); }
}

.fps-ammo {
  position: absolute;
  bottom: 20px;
  right: 20px;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.8rem;
  color: #fff;
  text-shadow: 0 0 10px #ffffff44;
}

.fps-grenades {
  position: absolute;
  bottom: 50px;
  right: 20px;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.7rem;
  color: #66ff66;
  text-shadow: 0 0 10px #66ff6644;
}

.fps-weapons {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.55rem;
}

.fps-weapon-slot {
  padding: 6px 10px;
  background: #ffffff15;
  border: 1px solid #ffffff33;
  border-radius: 4px;
  color: #ffffff88;
}

.fps-weapon-slot.active {
  background: #bf5af233;
  border-color: #bf5af2;
  color: #fff;
  text-shadow: 0 0 8px #bf5af2;
}

.fps-streak {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Press Start 2P', cursive;
  font-size: 1.3rem;
  color: transparent;
  pointer-events: none;
  transition: transform 0.2s;
}

.fps-streak.active {
  color: #ff4444;
  text-shadow: 0 0 15px #ff0000, 0 0 30px #ff000088, 0 0 50px #ff000044;
  animation: streakPulse 0.5s ease;
}

@keyframes streakPulse {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(2); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.fps-result {
  text-align: center;
  padding: 2rem;
}

.fps-result.hidden { display: none; }

.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 1.5rem;
}

.loading-slideshow {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #bf5af2;
  box-shadow: 0 0 30px #bf5af244;
  position: relative;
}

.loading-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.loading-photo.active {
  opacity: 1;
}

.loading-title {
  font-family: 'Press Start 2P', cursive;
  font-size: 1.2rem;
  color: #bf5af2;
  text-shadow: 0 0 15px #bf5af288;
}

.loading-bar-container {
  width: 300px;
  height: 16px;
  background: #333;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #bf5af244;
}

.loading-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #bf5af2, #7b2ff7);
  border-radius: 8px;
  transition: width 0.3s;
}

.loading-text {
  font-size: 0.75rem;
  color: #ffffffaa;
  font-family: 'Press Start 2P', cursive;
}

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


.btn-action {
  padding: 1.5rem 4rem;
  background: linear-gradient(135deg, #bf5af2, #7b2ff7);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 30px;
  position: sticky;
  bottom: 20px;
  z-index: 10;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.btn-action.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.btn-action:hover { transform: scale(1.05); box-shadow: 0 0 15px #bf5af244; }
.btn-action:disabled { opacity: 0; cursor: not-allowed; transform: translateY(20px); pointer-events: none; }
.btn-action.attack { background: linear-gradient(135deg, #ff6b6b, #cc0000); }
.btn-action.special { background: linear-gradient(135deg, #ffd700, #ff8c00); color: #000; }
.btn-action.heal { background: linear-gradient(135deg, #1db954, #0a8f3f); }

.btn-restart {
  padding: 0.8rem 2rem;
  background: #1f1f23;
  border: 1px solid #bf5af2;
  color: #bf5af2;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 1rem;
  transition: all 0.2s;
}

.btn-restart:hover { background: #bf5af2; color: #fff; }

.result-msg {
  font-family: 'Press Start 2P', cursive;
  font-size: 1.2rem;
  margin: 1rem 0;
  animation: pulse 1.5s infinite;
}

.result-msg.win { color: #1db954; }
.result-msg.lose { color: #ff6b6b; }
