/* Estilos Balatro Retro Pixel Art para Rabbit R1 - Enfoque & Controles Multicanal */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #120914;
  background: radial-gradient(circle at 50% 50%, #2a1130 0%, #0d040e 100%);
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace, sans-serif;
  font-size: 11px;
  outline: none;
}

/* Contenedor Principal r1 */
.r1-container {
  width: 100%;
  height: 100vh;
  max-width: 240px;
  max-height: 282px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px;
  position: relative;
  overflow: hidden;
  outline: none;
}

/* Efecto CRT Scanlines sin bloquear toques */
.r1-container::before {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
  background-size: 100% 3px;
  z-index: 100;
  pointer-events: none !important;
  opacity: 0.5;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #ff0055;
  padding-bottom: 2px;
}

.title-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.chip-icon {
  font-size: 13px;
}

.header h1 {
  font-size: 11px;
  font-weight: 900;
  color: #ffcc00;
  letter-spacing: 0.5px;
  text-shadow: 0 0 6px rgba(255, 204, 0, 0.6);
}

.mult-badge {
  background: linear-gradient(135deg, #ff0055 0%, #b3003b 100%);
  color: #ffffff;
  font-size: 8px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(255, 0, 85, 0.6);
}

/* Stats Bar */
.stats-bar {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}

.stat-pill {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: bold;
}

.stat-pill small {
  font-size: 7px;
  opacity: 0.8;
}

.stat-pill.red {
  background: #2b0b14;
  border: 1px solid #ff2a55;
  color: #ff7799;
}

.stat-pill.blue {
  background: #0b1a2b;
  border: 1px solid #00aaff;
  color: #77ccff;
}

/* Content & Card Stage */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 2px;
  position: relative;
}

.card-stage {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 600px;
  position: relative;
}

.deck-shadow {
  position: absolute;
  width: 118px;
  height: 154px;
  border-radius: 8px;
  background: #14051d;
  border: 1px solid rgba(255, 0, 85, 0.4);
  transition: transform 0.3s ease;
  pointer-events: none;
}

.deck-left {
  transform: translate(-5px, 2px) rotate(-3deg);
  opacity: 0.6;
}

.deck-right {
  transform: translate(5px, 2px) rotate(3deg);
  opacity: 0.6;
}

.card-stage.shuffling-active .deck-left {
  animation: fanLeft 0.4s ease-in-out infinite alternate;
}

.card-stage.shuffling-active .deck-right {
  animation: fanRight 0.4s ease-in-out infinite alternate;
}

@keyframes fanLeft {
  0% { transform: translate(-5px, 2px) rotate(-3deg); }
  100% { transform: translate(-30px, -6px) rotate(-16deg); }
}

@keyframes fanRight {
  0% { transform: translate(5px, 2px) rotate(3deg); }
  100% { transform: translate(30px, -6px) rotate(16deg); }
}

.tarot-card {
  width: 122px;
  height: 158px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  z-index: 5;
  outline: none;
}

.tarot-card.face-down {
  transform: rotateY(0deg);
}

.tarot-card.face-up {
  transform: rotateY(180deg);
}

.tarot-card.shuffling {
  animation: shuffleAnim 0.3s ease-in-out infinite alternate;
}

@keyframes shuffleAnim {
  0% { transform: rotate(-6deg) scale(0.94); }
  100% { transform: rotate(6deg) scale(1.06); }
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.8);
}

.card-back {
  background: #1e092b;
  border: 2px solid #ff0055;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, #3d0c52 0%, #150221 100%);
}

.neon-pattern {
  position: absolute;
  inset: 4px;
  border: 1px dashed rgba(255, 0, 85, 0.5);
  border-radius: 6px;
}

.card-center-seal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  z-index: 2;
}

.eye-symbol {
  font-size: 24px;
  filter: drop-shadow(0 0 8px #ff0055);
}

.card-center-seal small {
  font-size: 7px;
  color: #ffaa00;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.card-front {
  transform: rotateY(180deg);
  border: 2px solid #ffcc00;
  background: #000;
}

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

.card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.4) 70%, transparent 100%);
  padding: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.result-badge {
  font-size: 13px;
  font-weight: 900;
  padding: 1px 10px;
  border-radius: 4px;
  letter-spacing: 1px;
  box-shadow: 0 0 10px currentColor;
}

.result-badge.yes {
  background: #00e676;
  color: #003311;
  box-shadow: 0 0 10px #00e676;
}

.result-badge.no {
  background: #ff1744;
  color: #33000a;
  box-shadow: 0 0 10px #ff1744;
}

.card-name {
  font-size: 8px;
  font-weight: 800;
  color: #ffcc00;
}

/* Prompt Box */
.prompt-box {
  background: rgba(20, 10, 30, 0.9);
  border: 1px solid rgba(255, 204, 0, 0.4);
  border-radius: 5px;
  padding: 3px 5px;
  text-align: center;
}

.prompt-text {
  font-size: 8px;
  font-weight: 700;
  color: #ffdd66;
}

/* Barra de Controles Táctiles y Hardware */
.control-bar {
  display: flex;
  gap: 3px;
  margin-top: 1px;
}

.ctrl-btn {
  flex: 1;
  background: #1f0a2d;
  border: 1px solid #ff0055;
  color: #ffcc00;
  font-size: 8px;
  font-weight: 800;
  padding: 4px 2px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.ctrl-btn:active {
  background: #ff0055;
  color: #fff;
  transform: scale(0.95);
}

.ctrl-btn.main-btn {
  background: linear-gradient(135deg, #ff0055 0%, #aa0044 100%);
  color: #ffffff;
  border-color: #ffcc00;
  box-shadow: 0 0 6px rgba(255, 0, 85, 0.6);
}

/* LLM Modal Persistente */
.llm-box {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #19092b;
  border: 2px solid #ff0055;
  border-radius: 8px;
  padding: 5px;
  font-size: 9px;
  color: #f3e8ff;
  max-height: 135px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.95);
  z-index: 20;
}

.llm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 0, 85, 0.4);
  padding-bottom: 2px;
  font-weight: 800;
  color: #ff6699;
}

.close-btn {
  background: none;
  border: none;
  color: #aaa;
  font-size: 14px;
  cursor: pointer;
}

.llm-question-bar {
  background: rgba(255, 0, 85, 0.15);
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 8px;
  color: #ffcc00;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#llm-text {
  overflow-y: auto;
  max-height: 80px;
  line-height: 1.3;
  font-size: 8px;
  color: #e9d5ff;
}

.hidden {
  display: none !important;
}
