/* Mobile-First Design */
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
:root{--bg:#f1f1f1;--fg:#1a1a1a;--accent:#2150E8;--muted:#666666;--card-bg:#ffffff;--border:#d0d0d0}

.hidden{display:none!important}

/* Loading Screen */
.loading-screen{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100vh;
  background:#032753;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;
}

.loading-container{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:20px;
  padding:20px;
  max-width:400px;
  width:90%;
}

.loading-title{
  font-size:20px;
  font-weight:700;
  color:#ffffff;
  font-family:'Press Start 2P', cursive;
  text-align:center;
  letter-spacing:2px;
  line-height:1.5;
  margin:0;
  text-shadow:3px 3px 6px rgba(0,0,0,0.4);
}

.loading-spinner{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:center;
}

.spinner-dot{
  width:12px;
  height:12px;
  background:#ffffff;
  border-radius:50%;
  animation:bounce 1.4s infinite ease-in-out both;
}

.spinner-dot:nth-child(1){
  animation-delay:-0.32s;
}

.spinner-dot:nth-child(2){
  animation-delay:-0.16s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform:scale(0);
    opacity:0.5;
  }
  40% {
    transform:scale(1);
    opacity:1;
  }
}

.loading-text{
  font-size:12px;
  color:#ffffff;
  font-family:'Press Start 2P', cursive;
  text-align:center;
  margin:0;
  opacity:0.9;
  line-height:1.5;
}

.loading-progress{
  width:100%;
  height:8px;
  background:rgba(255,255,255,0.2);
  border-radius:4px;
  overflow:hidden;
  box-shadow:inset 0 2px 4px rgba(0,0,0,0.2);
}

.loading-progress-bar{
  height:100%;
  background:linear-gradient(90deg, #32d583 0%, #28b56f 100%);
  border-radius:4px;
  width:0%;
  transition:width 0.3s ease;
  box-shadow:0 2px 4px rgba(50,213,131,0.4);
}

.loading-percentage{
  font-size:14px;
  color:#ffffff;
  font-family:'JetBrains Mono', monospace;
  font-weight:700;
  margin:0;
  text-shadow:2px 2px 4px rgba(0,0,0,0.3);
}

/* Base styles optimized for mobile */
html,body{
  width:100%;
  height:100%;
  margin:0;
  padding:0;
  background:var(--bg);
  color:var(--fg);
  font-family:'Press Start 2P', cursive;
  overflow:hidden;
  touch-action:manipulation;
  -webkit-user-select:none;
  user-select:none;
}

.wrap{
  width:100%;
  min-height:100vh;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  background:#032753;
  overflow-y:auto;
  overflow-x:hidden;
}

.animated-powerups-container{
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:100%;
  pointer-events:none;
  z-index:10;
}

.animated-powerup-gif{
  image-rendering:auto;
  object-fit:contain;
}

.game-container{
  position:relative;
  width:100%;
  min-height:100%;
  margin:0;
  padding:0;
  padding-top:80px;
  padding-bottom:60px;
  display:flex;
  align-items:flex-start;
  justify-content:center;
}

canvas{
  width:100%;
  height:auto;
  max-width:700px;
  image-rendering:pixelated;
  border:none;
  display:block;
  background:transparent;
  touch-action:none;
  margin-top:0;
}

/* Game Header Layout - Centered */
.game-header{
  position:absolute;
  top:0;
  left:0;
  right:0;
  bottom:0;
  display:flex;
  justify-content:center;
  align-items:center;
  padding:0;
  z-index:10;
  background:transparent !important;
  box-shadow:none !important;
  border:none !important;
  pointer-events:none;
}

.game-header.character-select-header{
  position:absolute;
  top:0;
  left:0;
  right:0;
  bottom:auto;
  height:auto;
  pointer-events:auto;
  align-items:center;
  justify-content:flex-start;
  background:#1b3a6d !important;
  padding:8px 15px 6px;
}

.game-header.character-select-header .game-info-center{
  position:absolute;
  bottom:0;
  left:50%;
  transform:translateX(-50%) translateY(100%);
  pointer-events:none;
}

.game-header.game-header-logo{
  position:absolute;
  top:0;
  left:0;
  right:0;
  bottom:auto;
  height:auto;
  pointer-events:auto;
  align-items:center;
  justify-content:center;
  background:transparent !important;
  padding:20px 15px 10px;
  flex-direction:row;
  z-index:20;
}

.game-header.game-header-logo .decidechile-logo-horizontal{
  margin:0;
}

.game-header.game-header-logo .mute-btn-select{
  position:absolute;
  right:10px;
  bottom:8px;
}

.game-info-center{
  position:absolute;
  top:50%;
  left:50%;
  transform:translateX(-50%) translateY(-50%);
  display:flex;
  flex-direction:column;
  gap:6px;
  align-items:center;
  text-align:center;
  background:transparent !important;
  pointer-events:none;
  z-index:15;
}

.game-title-center{
  font-size:12px;
  font-weight:700;
  color:#f1f1f1;
  font-family:'Press Start 2P', cursive;
  letter-spacing:0.5px;
  line-height:1.4;
  margin:0;
  text-shadow:2px 2px 4px rgba(0,0,0,0.8);
}


.hud{
  position:absolute;
  top:0;
  left:0;
  right:0;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  flex-wrap:wrap;
  padding:16px 12px;
  background:rgba(0,0,0,0.5);
  z-index:10;
}

.vote-counter-center{
  font-size:14px;
  font-weight:700;
  color:#32d583;
  font-family:'JetBrains Mono', monospace;
  letter-spacing:0.5px;
  background:transparent;
  padding:8px 12px;
  border-radius:6px;
  border:2px solid rgba(50,213,131,0.4);
  display:inline-flex;
  gap:6px;
  align-items:center;
}

.vote-label{
  font-size:9px;
  color:#f1f1f1;
}

.score{
  font-weight:400;
  letter-spacing:.5px;
  font-size:11px;
  flex:1;
  text-align:center;
  color:#e6e6e6;
}

.status{
  font-size:28px;
  font-weight:700;
  color:#ffffff;
  text-align:center;
  font-family:'Press Start 2P', cursive;
  background:transparent;
  padding:8px 12px;
  border-radius:4px;
  line-height:1.5;
  text-shadow:2px 2px 4px rgba(0,0,0,0.8);
  letter-spacing:2px;
  animation:blink 1.2s ease-in-out infinite;
  pointer-events:none;
  user-select:none;
}

.game-controls{
  display:flex;
  gap:6px;
  align-items:center;
  flex-wrap:wrap;
}

button{
  background:var(--accent);
  border:none;
  color:#ffffff;
  padding:12px 20px;
  border-radius:12px;
  font-weight:400;
  cursor:pointer;
  font-size:10px;
  font-family:'Press Start 2P', cursive;
  min-height:44px;
  min-width:44px;
  touch-action:manipulation;
  transition:transform 0.1s ease, background 0.2s ease;
}

button:active{
  transform:scale(0.95);
  background:#28b56f;
}

button:focus{
  outline:3px solid #2150E8;
  outline-offset:2px;
}

button:focus:not(:focus-visible){
  outline:none;
}

button.hidden{display:none}

button.bg-switch{
  background:#032753;
  color:#fff;
  border:2px solid #021b3a;
  padding:8px 12px;
  border-radius:6px;
  cursor:pointer;
  font-size:8px;
  font-weight:700;
  transition:all 0.2s ease;
  font-family:'JetBrains Mono', monospace;
  letter-spacing:0.3px;
  display:flex;
  align-items:center;
  gap:4px;
  box-shadow:0 2px 6px rgba(3,39,83,0.4);
}

button.bg-switch:hover{
  background:#021b3a;
  transform:translateY(-1px);
  box-shadow:0 3px 8px rgba(3,39,83,0.5);
}

button.bg-switch:active{
  background:#021b3a;
  transform:scale(0.95);
}

/* Touch control area */
.touch-controls{
  position:absolute;
  bottom:0;
  left:0;
  right:0;
  display:flex;
  justify-content:center;
  padding:20px;
  background:rgba(0,0,0,0.5);
  z-index:10;
}

.touch-btn{
  background:#032753;
  border:3px solid #021b3a;
  color:#ffffff;
  padding:24px 48px;
  border-radius:20px;
  font-size:16px;
  font-weight:700;
  text-align:center;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:8px;
  font-family:'Press Start 2P', cursive;
  letter-spacing:1px;
  box-shadow:0 4px 12px rgba(3,39,83,0.4);
}

.touch-btn:active{
  background:#021b3a;
  transform:scale(0.95);
  box-shadow:0 2px 6px rgba(3,39,83,0.3);
}

.touch-btn .icon{
  font-size:24px;
  line-height:1;
}

/* Results Screen */
.results-screen{
  width:100%;
  min-height:100vh;
  height:auto;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  padding:0;
  padding-bottom:40px;
  background:#f1f1f1;
  overflow-y:auto;
  position:relative;
  /* background-image:url('terrain/sky/moneda-sky.png'); - not used but kept for reference */
}

.results-screen .character-select-header{
  flex-shrink:0;
}

.results-content-wrapper{
  flex:1;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  width:100%;
  max-width:960px;
  margin:0 auto;
  padding:40px 16px;
  gap:20px;
}

.results-screen::before{
  content:'';
  position:absolute;
  top:0;
  left:0;
  right:0;
  bottom:0;
  width:100%;
  min-height:100%;
  background:rgba(0,0,0,0.6);
  z-index:0;
  pointer-events:none;
}

.results-container{
  width:90%;
  max-width:800px;
  padding:20px;
}

.results-title{
  font-size:16px;
  font-weight:700;
  color:var(--fg);
  font-family:'Press Start 2P', cursive;
  text-align:center;
  margin:0 0 20px 0;
  letter-spacing:1px;
  line-height:1.5;
}

.results-ranking{
  display:grid;
  grid-template-columns:repeat(2, 1fr);
  gap:12px;
  margin-bottom:24px;
}

.results-item{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  background:var(--card-bg);
  border:1px solid var(--border);
  border-radius:8px;
  padding:12px;
  transition:all 0.3s ease;
  box-shadow:0 1px 3px rgba(0,0,0,0.1);
}

.results-item.winner{
  background:var(--card-bg);
  border:2px solid #32d583;
  padding:16px;
  box-shadow:0 4px 12px rgba(50,213,131,0.3);
}

.results-item-avatar{
  width:50px;
  height:75px;
  flex-shrink:0;
  image-rendering:pixelated;
  background:var(--card-bg);
  border-radius:4px;
}

.results-item.winner .results-item-avatar{
  width:70px;
  height:105px;
}

.results-item-info{
  width:100%;
  display:flex;
  flex-direction:column;
  gap:4px;
  align-items:center;
  text-align:center;
}

.results-item-position{
  font-size:10px;
  font-weight:700;
  color:#FFD700;
  font-family:'Press Start 2P', cursive;
}

.results-item-name{
  font-size:12px;
  font-weight:700;
  color:var(--fg);
  font-family:'Press Start 2P', cursive;
  line-height:1.3;
}

.results-item-votes{
  font-size:9px;
  color:#32d583;
  font-family:'JetBrains Mono', monospace;
}

.results-game-over{
  display:flex;
  justify-content:center;
  align-items:center;
  width:100%;
  padding:0;
  margin:0;
  position:relative;
  z-index:1;
}

.results-game-over-text{
  font-size:24px;
  font-weight:700;
  color:#ffffff;
  font-family:'Press Start 2P', cursive;
  text-align:center;
  margin:0;
  letter-spacing:2px;
}

.results-character-container{
  display:flex;
  justify-content:center;
  align-items:center;
  width:100%;
  padding:0;
  margin:0;
  position:relative;
  z-index:1;
}

.results-character-image{
  max-width:300px;
  max-height:400px;
  width:auto;
  height:auto;
  image-rendering:pixelated;
  object-fit:contain;
}

.results-score{
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  width:100%;
  padding:0;
  margin:0;
  position:relative;
  z-index:1;
}

.results-score-text{
  font-size:20px;
  font-weight:700;
  color:#ffffff;
  font-family:'Press Start 2P', cursive;
  text-align:center;
  margin:0;
  letter-spacing:1px;
}

.results-motivational-text{
  font-size:12px;
  font-weight:400;
  color:#bdbdbd;
  font-family:'Press Start 2P', cursive;
  text-align:center;
  margin:12px 0 0 0;
  letter-spacing:0.5px;
  line-height:1.5;
}

.results-share{
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  width:100%;
  padding:0;
  margin:0;
  position:relative;
  z-index:1;
  gap:16px;
}

.results-share-text{
  font-size:14px;
  font-weight:700;
  color:#ffffff;
  font-family:'Press Start 2P', cursive;
  text-align:center;
  margin:0;
  letter-spacing:1px;
}

.results-share-buttons{
  display:flex;
  gap:16px;
  justify-content:center;
  align-items:center;
  flex-wrap:wrap;
}

.share-btn{
  background:#032753;
  border:none;
  color:#ffffff;
  padding:10px;
  border-radius:50%;
  cursor:pointer;
  transition:all 0.2s ease;
  display:flex;
  align-items:center;
  justify-content:center;
  width:40px;
  height:40px;
  min-width:40px;
  min-height:40px;
}

.share-btn i{
  width:20px;
  height:20px;
  stroke-width:2;
}

.share-btn svg{
  width:20px;
  height:20px;
}

.share-btn:active{
  transform:scale(0.95);
}

.share-whatsapp{
  background:#032753;
  color:#ffffff;
}

.share-whatsapp:hover{
  background:#021b3a;
  transform:translateY(-2px);
  box-shadow:0 4px 8px rgba(3,39,83,0.4);
}

.share-twitter{
  background:#032753;
  color:#ffffff;
}

.share-twitter:hover{
  background:#021b3a;
  transform:translateY(-2px);
  box-shadow:0 4px 8px rgba(3,39,83,0.4);
}

.share-copy{
  background:#032753;
  color:#ffffff;
}

.share-copy:hover{
  background:#021b3a;
  transform:translateY(-2px);
  box-shadow:0 4px 8px rgba(3,39,83,0.4);
}

.results-cta{
  display:flex;
  justify-content:center;
  align-items:center;
  width:100%;
  padding:0;
  margin:0;
  position:relative;
  z-index:1;
}

.results-cta-text{
  font-size:10px;
  font-weight:400;
  color:#bdbdbd;
  font-family:'Press Start 2P', cursive;
  text-align:center;
  margin:0;
  letter-spacing:0.5px;
  line-height:1.5;
  max-width:90%;
}

.results-question{
  display:flex;
  justify-content:center;
  align-items:center;
  width:100%;
  padding:0;
  margin:0;
  position:relative;
  z-index:1;
}

.results-question-text{
  font-size:18px;
  font-weight:700;
  color:#ffffff;
  font-family:'Press Start 2P', cursive;
  text-align:center;
  margin:0;
  letter-spacing:1px;
}

.results-buttons{
  display:flex;
  gap:20px;
  justify-content:center;
  flex-wrap:wrap;
  margin:0;
  padding:0;
  position:relative;
  z-index:1;
}

.results-btn{
  background:#ffffff;
  border:2px solid var(--accent);
  color:var(--accent);
  padding:14px 20px;
  border-radius:12px;
  font-size:10px;
  font-weight:700;
  font-family:'Press Start 2P', cursive;
  text-transform:uppercase;
  cursor:pointer;
  transition:all 0.2s ease;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:44px;
  min-width:120px;
}

.results-btn:hover{
  background:#f0f0f0;
  transform:translateY(-2px);
  box-shadow:0 4px 8px rgba(0,0,0,0.1);
}

.results-btn:active{
  transform:scale(0.95);
  background:#e0e0e0;
}

/* Pause Menu */
.pause-menu{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:1000;
}

.pause-overlay{
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background:rgba(0, 0, 0, 0.7);
}

.pause-container{
  position:relative;
  z-index:1001;
  background:var(--card-bg);
  border:2px solid var(--border);
  border-radius:16px;
  padding:30px;
  max-width:400px;
  width:90%;
  box-shadow:0 8px 32px rgba(0,0,0,0.3);
}

.pause-title{
  font-size:18px;
  font-weight:700;
  color:var(--fg);
  font-family:'Press Start 2P', cursive;
  text-align:center;
  margin:0 0 24px 0;
  letter-spacing:1px;
  line-height:1.5;
}

.pause-buttons{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.pause-btn{
  background:#032753;
  border:none;
  color:#fff;
  padding:14px 20px;
  border-radius:12px;
  font-size:10px;
  font-weight:700;
  font-family:'Press Start 2P', cursive;
  text-transform:uppercase;
  cursor:pointer;
  transition:all 0.2s ease;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  box-shadow:0 2px 8px rgba(3,39,83,0.4);
  min-height:44px;
}

.pause-btn:hover{
  background:#043a6b;
  transform:translateY(-2px);
  box-shadow:0 4px 12px rgba(3,39,83,0.6);
}

.pause-btn:active{
  transform:scale(0.95);
}

/* Tablet and larger screens */
@media (min-width: 768px) {
  .game-container{
    padding-top:100px;
    padding-bottom:80px;
  }

  .loading-title{
    font-size:24px;
  }

  .loading-text{
    font-size:14px;
  }

  .loading-percentage{
    font-size:16px;
  }

  .game-header{
    padding:16px 12px;
  }

  .game-title-center{
    font-size:14px;
  }

  .vote-counter-center{
    font-size:16px;
    padding:10px 16px;
  }

  .vote-label{
    font-size:10px;
  }

  .score{font-size:13px}

  .status{
    font-size:24px;
    padding:8px 12px;
  }

  button{font-size:12px;padding:12px 24px}

  button.bg-switch{
    font-size:10px;
    padding:10px 16px;
  }

  .mute-btn-game-bottom{
    top:12px;
    right:70px;
    bottom:auto;
    font-size:24px;
    width:56px;
    height:56px;
  }

  .touch-controls{display:none}

  .results-ranking{
    grid-template-columns:repeat(3, 1fr);
    gap:16px;
  }

  .results-title{
    font-size:20px;
  }

  .results-item{
    padding:14px;
  }

  .results-item-position{
    font-size:12px;
  }

  .results-item-name{
    font-size:13px;
  }

  .results-item-votes{
    font-size:10px;
  }

  .results-btn{
    font-size:12px;
    padding:14px 24px;
  }
}

/* Desktop screens */
@media (min-width: 1024px) {
  .game-container{
    padding-bottom:100px;
  }

  .game-header{
    padding:20px 16px;
  }

  .game-title-center{
    font-size:16px;
  }

  .vote-counter-center{
    font-size:18px;
    padding:12px 18px;
  }

  .vote-label{
    font-size:11px;
  }

  .status{
    font-size:20px;
    padding:8px 12px;
  }

  button.bg-switch{
    font-size:11px;
    padding:12px 20px;
  }

  .mute-btn-game-bottom{
    top:20px;
    right:80px;
    bottom:auto;
    font-size:28px;
    padding:12px;
    width:64px;
    height:64px;
  }

  .results-ranking{
    grid-template-columns:repeat(4, 1fr);
    gap:20px;
  }

  .results-title{
    font-size:24px;
  }

  .results-item{
    padding:16px;
  }

  .results-item-position{
    font-size:14px;
  }

  .results-item-name{
    font-size:14px;
  }

  .results-item-votes{
    font-size:11px;
  }

  .results-btn{
    font-size:14px;
    padding:16px 28px;
  }

  .select-title{font-size:28px}
  .character-grid{grid-template-columns:repeat(4, 1fr)}
}

/* Character Selection Screen - Mobile First */
.character-select{
  width:100%;
  margin:0;
  padding:0;
  height: 100vh;
  max-height:100vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  overflow-y:auto;
  overflow-x:hidden;
  position:relative;
  background:#c7c7c7 url('https://d2m5iocgeay5nm.cloudfront.net/assets/otros/moneda-home.png');
  background-size:250% auto;
  background-position:center bottom;
  background-repeat:no-repeat;
  box-sizing:border-box;
}

.character-select-loading{
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background:rgba(199, 199, 199, 0.95);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:1000;
}

.character-select-loading-content{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:20px;
}

.character-select-loading .loading-text{
  font-size:12px;
  font-weight:700;
  color:#1B3A6D;
  font-family:'Press Start 2P', cursive;
  text-align:center;
  text-transform:uppercase;
  letter-spacing:1px;
}

.mute-btn-select{
  position:absolute;
  bottom:8px;
  right:10px;
  z-index:100;
  padding:4px;
  font-size:12px;
  background:rgba(255,255,255,0.9);
  color:#1B3A6D;
  border:none;
  box-shadow:0 1px 4px rgba(0,0,0,0.15);
  cursor:pointer;
  transition:transform 0.2s ease, opacity 0.2s ease;
  line-height:1;
  min-height:24px;
  min-width:24px;
  width:24px;
  height:24px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
}

.mute-btn-select:hover{
  opacity:0.7;
  transform:scale(1.1);
}

.mute-btn-select:active{
  transform:scale(0.95);
  opacity:0.5;
}

.mute-btn-select img{
  width:16px;
  height:16px;
  display:block;
}

.mute-btn-game-bottom{
  position:absolute;
  bottom:10px;
  right:10px;
  z-index:200;
  padding:10px;
  font-size:20px;
  background:rgba(0,0,0,0.6);
  color:#f1f1f1;
  border:2px solid rgba(255,255,255,0.3);
  border-radius:8px;
  box-shadow:0 2px 8px rgba(0,0,0,0.3);
  cursor:pointer;
  transition:transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
  line-height:1;
  min-height:auto;
  min-width:auto;
  width:48px;
  height:48px;
  display:flex;
  align-items:center;
  justify-content:center;
  pointer-events:auto;
  touch-action:manipulation;
}

.mute-btn-game-bottom:hover{
  opacity:0.9;
  background:rgba(0,0,0,0.8);
  transform:scale(1.1);
}

.mute-btn-game-bottom:active{
  transform:scale(0.95);
  opacity:0.7;
}

.mute-btn-game-bottom img{
  width:24px;
  height:24px;
  display:block;
}

.pause-btn-game-top{
  position:absolute;
  top:10px;
  right:10px;
  z-index:100;
  padding:8px;
  background:rgba(0,0,0,0.6);
  border:2px solid rgba(255,255,255,0.3);
  border-radius:8px;
  box-shadow:0 2px 8px rgba(0,0,0,0.3);
  cursor:pointer;
  transition:transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
  line-height:1;
  min-height:44px;
  min-width:44px;
  width:auto;
  height:auto;
  display:flex;
  align-items:center;
  justify-content:center;
  pointer-events:auto;
  touch-action:manipulation;
}

.pause-btn-game-top img{
  width:24px;
  height:24px;
  display:block;
}

.pause-btn-game-top:hover{
  opacity:0.9;
  background:rgba(0,0,0,0.8);
  transform:scale(1.05);
}

.pause-btn-game-top:active{
  transform:scale(0.95);
  opacity:0.7;
}

.pause-btn-game-top.hidden{
  display:none;
}

@media (min-width: 768px) {
  .pause-btn-game-top{
    top:12px;
    right:12px;
    padding:10px;
  }

  .pause-btn-game-top img{
    width:28px;
    height:28px;
  }
}

@media (min-width: 1024px) {
  .pause-btn-game-top{
    top:20px;
    right:20px;
    padding:0;
    background:transparent;
    border:none;
    box-shadow:none;
  }

  .pause-btn-game-top img{
    width:30px;
    height:30px;
  }

  .mute-btn-game-bottom{
    top:20px;
    right:70px;
    bottom:auto;
    font-size:28px;
    padding:12px;
    width:64px;
    height:64px;
    background:rgba(0,0,0,0.6);
    border:2px solid rgba(255,255,255,0.3);
    border-radius:50%;
  }
}

.select-title{
  font-size:11px;
  font-weight:700;
  letter-spacing:1px;
  margin:0;
  text-align:center;
  color:#FFFFFF;
  line-height:1.2;
  padding:0;
  font-family:'Press Start 2P', cursive;
  text-shadow:none;
}

.select-slogan{
  font-size:6px;
  font-weight:400;
  text-align:center;
  color:#BDBDBD;
  margin:4px 0 0 0;
  padding:0 10px;
  font-family:'Press Start 2P', cursive;
  text-transform:uppercase;
  letter-spacing:0.3px;
  line-height:1.3;
}

.loading-msg{
  text-align:center;
  font-size:8px;
  color:var(--muted);
  margin-bottom:12px;
  animation:pulse 1.5s ease-in-out infinite;
  display:none;
  padding:10px;
  font-family:'Press Start 2P', cursive;
  font-weight:700;
}

.footer-text{
  text-align:center;
  font-size:12px;
  color:var(--muted);
  margin-top:16px;
  padding:12px 10px;
  font-family:'Hanken Grotesk', sans-serif;
  font-weight:300;
}

/* New header styles for main page */
.character-select-header{
  width:100%;
  background:#1b3a6d;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:8px 15px 6px;
  position:relative;
  z-index:1;
}

.decidechile-logo-horizontal{
  max-width:150px;
  width:auto;
  height:auto;
  margin-bottom:8px;
  display:block;
}

.decidechile-logo{
  font-size:8px;
  font-weight:700;
  color:#FFFFFF;
  font-family:'Press Start 2P', cursive;
  text-align:center;
  margin-bottom:8px;
  letter-spacing:1px;
  border:2px solid #FFFFFF;
  padding:4px 10px;
  display:inline-block;
}

.decidechile-subtitle{
  font-size:5px;
  color:#FFFFFF;
  font-family:'Hanken Grotesk', sans-serif;
  font-weight:300;
  margin-top:3px;
  letter-spacing:0.5px;
}

.selection-instructions{
  width:100%;
  padding:15px;
  padding-top:25px;
  text-align:center;
}

.selection-text{
  font-size:7px;
  font-weight:700;
  color:#2150E8;
  font-family:'Press Start 2P', cursive;
  text-transform:uppercase;
  letter-spacing:0.3px;
  line-height:1.4;
  margin:0;
}

.ranking-label{
  font-size:7px;
  font-weight:400;
  color:#999999;
  font-family:'Press Start 2P', cursive;
  text-transform:uppercase;
  letter-spacing:0.3px;
  margin:5px 0 8px 0;
  text-align:center;
}

.total-nacional{
  font-size:7px;
  font-weight:400;
  color:#ffffff;
  font-family:'Press Start 2P', cursive;
  text-transform:uppercase;
  letter-spacing:0.3px;
  margin:4px auto 4px auto;
  text-align:center;
  padding:6px 12px;
  background:rgba(3,39,83,0.85);
  border:1px solid rgba(255,255,255,0.6);
  border-radius:4px;
  box-shadow:0 2px 6px rgba(0,0,0,0.2);
  max-width:700px;
  width:calc(100% - 30px);
  margin-left:auto;
  margin-right:auto;
  display:block !important;
  visibility:visible !important;
  opacity:1 !important;
  position:relative;
  z-index:10;
  box-sizing:border-box;
}


@keyframes pulse {
  0%, 100% { opacity:1; }
  50% { opacity:0.5; }
}

@keyframes titlePulse {
  0%, 100% { transform:scale(1); }
  50% { transform:scale(1.02); }
}

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

.character-grid{
  display:flex;
  flex-direction:column;
  gap:3px;
  width:100%;
  max-width:700px;
  padding:0 15px 8px;
  margin-top:4px;
}

.decidechile-link-button{
  display:flex;
  align-items:center;
  justify-content:center;
  width:auto;
  max-width:600px;
  margin:16px auto 0;
  padding:14px 30px;
  background-color:#032753;
  color:#FFFFFF;
  text-decoration:none;
  font-family:'Press Start 2P', cursive;
  font-size:9px;
  letter-spacing:0.75px;
  text-align:center;
  border-radius:6px;
  box-shadow:0 2px 6px rgba(0,0,0,0.15);
  transition:all 0.2s ease;
  touch-action:manipulation;
  cursor:pointer;
  white-space:nowrap;
  min-height:18px;
}

.decidechile-link-button:hover{
  transform:translateY(-1px);
  box-shadow:0 3px 8px rgba(0,0,0,0.2);
}

.decidechile-link-button:active{
  transform:translateY(0);
  box-shadow:0 1px 4px rgba(0,0,0,0.15);
}

.character-card{
  background:#FFFFFF;
  border:none;
  border-radius:4px;
  padding:0;
  padding-left:8px;
  cursor:pointer;
  transition:all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position:relative;
  overflow:hidden;
  touch-action:pan-y;
  box-shadow:0 1px 4px rgba(0,0,0,0.08);
  display:flex;
  flex-direction:row;
  align-items:stretch;
  gap:6px;
  outline:none;
}

.character-card:nth-child(1),
.character-card:nth-child(2){
  padding:0;
  padding-left:8px;
  gap:8px;
  min-height:30px;
}

.character-card:nth-child(n+3){
  min-height:28px;
  max-height:28px;
}

.character-card:nth-child(n+3) .character-preview,
.character-card:nth-child(n+3) .character-preview-small{
  max-height:28px;
  height:28px;
}

.character-card:focus{
  outline:3px solid var(--accent);
  outline-offset:2px;
}

.character-card::before{
  content:'';
  position:absolute;
  top:0;
  left:0;
  right:0;
  bottom:0;
  background:transparent;
  opacity:0;
  transition:opacity 0.2s ease;
  z-index:1;
  pointer-events:none;
}

.character-card:active{
  transform:scale(0.98);
  box-shadow:0 2px 8px rgba(0,0,0,0.15);
}

.character-card:active::before{
  opacity:1;
}

.character-preview,
.character-preview-small{
  width:18px;
  height:100%;
  min-height:14px;
  flex-shrink:0;
  image-rendering:pixelated;
  display:block;
  position:relative;
  z-index:2;
  background:var(--card-bg);
  border-radius:0;
  object-fit:contain;
  object-position:center;
  align-self:stretch;
}

.character-info{
  width:100%;
  display:flex;
  flex-direction:row;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  position:relative;
  z-index:2;
  align-self:center;
}

.character-name-container{
  display:flex;
  flex-direction:column;
  gap:3px;
  flex:1;
}

.character-name{
  text-align:left;
  font-weight:700;
  font-size:7px;
  letter-spacing:0.2px;
  color:#1a1a1a;
  transition:color 0.2s ease;
  line-height:1.1;
  font-family:'Press Start 2P', cursive;
  text-transform:uppercase;
}

.character-card:nth-child(1) .character-name,
.character-card:nth-child(2) .character-name{
  font-size:9px;
  letter-spacing:0.3px;
}

.character-party{
  text-align:left;
  font-weight:700;
  font-size:5px;
  letter-spacing:-0.2px;
  color:#999999;
  line-height:1.1;
  font-family:'Press Start 2P', cursive;
  white-space:nowrap;
}

.vote-percentage{
  font-size:0.7em;
  margin-left:0px;
  opacity:0.8;
  letter-spacing:-0.5px;
}

.character-card:nth-child(1) .character-party,
.character-card:nth-child(2) .character-party{
  color:#2150E8;
  font-size:6px;
}


/* Tablet screens */
@media (min-width: 600px) {
  .character-select{
    padding:0;
    padding-bottom:40px;
    justify-content:flex-start;
  }

  .character-select-header{
    padding:20px 20px;
  }

  .decidechile-logo-horizontal{
    max-width:180px;
    margin-bottom:12px;
  }

  .select-title{
    font-size:28px;
    margin:0;
  }

  .select-slogan{
    font-size:11px;
    margin-top:6px;
  }

  .selection-instructions{
    padding-top:55px;
  }

  .selection-text{
    font-size:16px;
  }

  .ranking-label{
    font-size:14px;
  }

  .total-nacional{
    font-size:11px;
    padding:8px 15px;
    margin:4px auto 4px auto;
    max-width:700px;
    width:calc(100% - 30px);
    font-weight:400;
    background:rgba(3,39,83,0.85);
    border:1px solid rgba(255,255,255,0.6);
    box-shadow:0 2px 6px rgba(0,0,0,0.2);
  }

  .character-grid{
    gap:6px;
    max-width:700px;
    margin-top:4px;
  }

  .decidechile-link-button{
    max-width:675px;
    margin-top:20px;
    margin-bottom:50px;
    padding:20px 48px;
    font-size:18px;
    min-height:50px;
  }

  .character-card{
    padding:0;
    padding-left:8px;
    gap:16px;
  }

  .character-card:nth-child(1),
  .character-card:nth-child(2){
    min-height:56px;
  }

  .character-card:nth-child(n+3){
    min-height:52px;
    max-height:52px;
  }

  .character-card:nth-child(n+3) .character-preview,
  .character-card:nth-child(n+3) .character-preview-small{
    max-height:52px;
    height:52px;
  }

  .character-preview,
  .character-preview-small{
    width:45px;
    height:100%;
    min-height:38px;
  }

  .mute-btn-select{
    font-size:16px;
    bottom:20px;
    right:20px;
    width:32px;
    height:32px;
    min-width:32px;
    min-height:32px;
  }

  .character-name{
    font-size:20px;
  }

  .character-card:nth-child(1) .character-name,
  .character-card:nth-child(2) .character-name{
    font-size:24px;
  }

  .character-party{
    font-size:14px;
  }

  .vote-percentage{
    font-size:0.65em;
    margin-left:0px;
    letter-spacing:-0.5px;
  }

  .character-card:nth-child(1) .character-party,
  .character-card:nth-child(2) .character-party{
    font-size:17px;
  }
}

/* Desktop screens */
@media (min-width: 1024px) {
  .results-character-image{
    height:200px;
    max-height:200px;
    width:auto;
  }

  .character-select{
    max-width:1000px;
    margin:0 auto;
    padding:0;
    padding-bottom:60px;
    background-size:100% auto;
  }

  .character-select-header{
    padding:20px 20px;
  }

  .decidechile-logo-horizontal{
    max-width:190px;
    margin-bottom:12px;
  }

  .mute-btn-select{
    font-size:18px;
    bottom:25px;
    right:25px;
    width:36px;
    height:36px;
    min-width:36px;
    min-height:36px;
  }

  .select-title{
    font-size:28px;
    margin:0;
  }

  .select-slogan{
    font-size:12px;
    margin-top:6px;
  }

  .selection-instructions{
    padding-top:65px;
  }

  .selection-text{
    font-size:16px;
  }

  .ranking-label{
    font-size:14px;
  }

  .total-nacional{
    font-size:11px;
    padding:8px 15px;
    margin:4px auto 4px auto;
    max-width:700px;
    width:calc(100% - 30px);
    font-weight:400;
    background:rgba(3,39,83,0.85);
    border:1px solid rgba(255,255,255,0.6);
    box-shadow:0 2px 6px rgba(0,0,0,0.2);
  }

  .character-grid{
    gap:7px;
    max-width:700px;
    margin-top:4px;
  }

  .decidechile-link-button{
    max-width:600px;
    margin-top:20px;
    margin-bottom:60px;
    padding:24px 56px;
    font-size:20px;
    min-height:60px;
  }

  .character-card{
    padding:0;
    padding-left:8px;
    gap:16px;
  }

  .character-card:nth-child(1),
  .character-card:nth-child(2){
    min-height:56px;
  }

  .character-card:nth-child(n+3){
    min-height:52px;
    max-height:52px;
  }

  .character-card:nth-child(n+3) .character-preview,
  .character-card:nth-child(n+3) .character-preview-small{
    max-height:52px;
    height:52px;
  }

  .character-card:hover{
    transform:translateY(-2px);
    box-shadow:0 4px 16px rgba(0,0,0,0.15);
  }

  .character-card:active{
    transform:translateY(-1px) scale(0.98);
  }

  .character-preview,
  .character-preview-small{
    width:46px;
    height:100%;
    min-height:40px;
  }

  .character-name{
    font-size:19px;
  }

  .character-card:nth-child(1) .character-name,
  .character-card:nth-child(2) .character-name{
    font-size:24px;
  }

  .character-party{
    font-size:14px;
  }

  .vote-percentage{
    font-size:0.65em;
    margin-left:0px;
    letter-spacing:-0.5px;
  }

  .character-card:nth-child(1) .character-party,
  .character-card:nth-child(2) .character-party{
    font-size:16px;
  }
}

/* === RESPONSIVE CANVAS - Ajuste para mobile === */

/* Para móviles en portrait - hacer el canvas más grande */
@media (max-width: 600px) {
  canvas {
    width: 100vw !important;
    height: auto !important;
    max-width: none !important;
  }

  .game-container {
    max-height: none !important;
  }

  .game-info-center {
    top: 45%;
  }
}

/* Fix home screen for screens smaller than 600px */
@media (max-width: 599px) {
  .character-select {
    padding:0;
    width:100%;
    box-sizing:border-box;
    justify-content:flex-start;
  }

  .character-select-header{
    padding:12px 20px;
  }

  .decidechile-logo-horizontal{
    max-width:120px;
    margin-bottom:8px;
  }

  .decidechile-logo{
    font-size:12px;
    padding:4px 12px;
    border:2px solid #FFFFFF;
  }

  .decidechile-subtitle{
    font-size:6px;
  }

  .select-title{
    font-size:16px;
    letter-spacing:1.5px;
  }

  .select-slogan{
    font-size:8px;
    letter-spacing:0.4px;
  }

  .selection-instructions{
    padding:12px;
    padding-top:30px;
  }

  .selection-text{
    font-size:11px;
    line-height:1.4;
  }

  .ranking-label{
    font-size:9px;
    margin:4px 0 8px 0;
  }

  .total-nacional{
    font-size:7px;
    margin:4px auto 4px auto;
    padding:6px 12px;
    max-width:600px;
    width:calc(100% - 24px);
    font-weight:400;
    background:rgba(3,39,83,0.85);
    border:1px solid rgba(255,255,255,0.6);
    box-shadow:0 2px 6px rgba(0,0,0,0.2);
  }

  .character-grid{
    max-width:600px;
    width:100%;
    padding:0 12px 12px;
    box-sizing:border-box;
    gap:4px;
    margin-top:4px;
  }

  .decidechile-link-button{
    max-width:630px;
    width:auto;
    margin:20px auto 0;
    padding:18px 36px;
    font-size:11.25px;
    min-height:27px;
  }

  .character-card{
    padding:0;
    padding-left:8px;
    gap:8px;
  }

  .character-card:nth-child(1),
  .character-card:nth-child(2){
    min-height:44px;
  }

  .character-card:nth-child(n+3){
    min-height:42px;
    max-height:42px;
  }

  .character-card:nth-child(n+3) .character-preview,
  .character-card:nth-child(n+3) .character-preview-small{
    max-height:42px;
    height:42px;
  }

  .character-preview,
  .character-preview-small{
    width:38px !important;
    height:100% !important;
    min-height:26px !important;
  }

  .character-name{
    font-size:14px;
  }

  .character-card:nth-child(1) .character-name,
  .character-card:nth-child(2) .character-name{
    font-size:17px;
  }

  .character-party{
    font-size:9px;
  }

  .vote-percentage{
    font-size:0.7em;
    margin-left:0px;
    letter-spacing:-0.5px;
  }

  .results-character-image{
    height:120px !important;
    max-height:120px !important;
    width:auto;
  }

  .character-card:nth-child(1) .character-party,
  .character-card:nth-child(2) .character-party{
    font-size:11px;
  }

  .mute-btn-select{
    bottom:12px;
    right:20px;
    width:28px;
    height:28px;
    min-width:28px;
    min-height:28px;
    font-size:14px;
  }

  .mute-btn-game-bottom{
    bottom:0px;
  }
}

/* Para pantallas más altas que anchas (móviles en portrait) */
@media (max-aspect-ratio: 700/667) {
  canvas {
    width: 100vw;
    height: auto;
    max-width: none;
  }
}

/* Para pantallas más anchas que altas (tablets landscape, desktop) */
@media (min-aspect-ratio: 700/667) {
  canvas {
    width: auto;
    height: 100vh;
    max-height: 667px;
  }
}
