/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Pirata+One&family=Roboto:wght@300;400;500;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css');

:root {
  --one-piece-red: #B22222;
  --one-piece-yellow: #FFD700;
  --one-piece-blue: #1E3A8A;
  --one-piece-sand: #F5DEB3;
  --one-piece-black: #0A0A0A;
}

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

body {
  font-family: 'Roboto', sans-serif;
  background: url('https://wallpapers.com/images/featured-full/one-piece-c0pujiakubq5rwas.jpg') no-repeat center center fixed;
  background-size: cover;
  padding: 0; /* <- quitar padding */
  text-align: center;
  color: #fff;
  min-height: 100vh; /* <- asegurar 100% de altura */
  margin: 0;
  position: relative;
  line-height: 1.6;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed; /* <- cambiar a fixed para cubrir toda la pantalla */
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: -1;
}

.container-character {
  max-width: 2000px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  padding: 15px; /* <- mover padding aquí */
  min-height: 100vh; /* <- igual que body */
  display: flex;
  flex-direction: column;
}

.container-fruit {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  padding: 20px; /* <- mover padding aquí */
  min-height: 100vh; /* <- igual que body */
  display: flex;
  flex-direction: column;
}


header {
  margin-bottom: 30px;
  animation: fadeInDown 1s ease-out;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

footer {
  margin-top: 40px;
  padding: 20px;
  font-size: 0.9em;
  color: rgba(255, 255, 255, 0.7);
  animation: fadeInUp 1s ease-out;
}

/* Typography */
h1 {
  color: var(--one-piece-yellow);
  margin: 10px 0 5px;
  font-family: 'Pirata One', cursive;
  font-size: 4em;
  text-shadow: 3px 3px 0 var(--one-piece-red), -1px -1px 0 var(--one-piece-red), 1px -1px 0 var(--one-piece-red), -1px 1px 0 var(--one-piece-red), 1px 1px 0 var(--one-piece-red);
  letter-spacing: 3px;
  position: relative;
  display: inline-block;
  margin-left: auto;
  margin-right: auto;
}

h1::after {
  content: '';
  display: block;
  width: 100px;
  height: 4px;
  margin: 10px auto;
  border-radius: 2px;
}

.subtitle {
  font-size: 1.2em;
  color: #fdfdfd;
  margin-bottom: 30px;
  font-weight: 300;
  text-shadow: 0px 0px 6px rgba(255, 215, 0, 0.5); /* glow dorado */
  animation: fadeIn 1.5s ease-out;
}


/* Game Container */
.game-container {
  background: rgba(10, 10, 10, 0.7);
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 2px solid var(--one-piece-yellow);
  backdrop-filter: blur(5px);
  animation: fadeInUp 1s ease-out;
  max-width: 98%;
  margin: 0 auto;
  z-index: 10;
}

.searchWrap {
  position: relative;
  max-width: 700px;
  margin: 0 auto 30px;
  width: 100%;
}

.input-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

#guessInput {
  flex: 1;
  min-width: 250px;
  max-width: 600px;
  padding: 15px 25px;
  font-size: 18px;
  border: 3px solid var(--one-piece-yellow);
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--one-piece-black);
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  font-family: 'Roboto', sans-serif;
}

#guessInput:focus {
  outline: none;
  box-shadow: 0 0 15px var(--one-piece-yellow);
}

#guessBtn {
  padding: 0 30px;
  font-size: 18px;
  cursor: pointer;
  background: linear-gradient(145deg, #C41E3A, #8B0000);
  color: white;
  border: none;
  border-radius: 50px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 0 #600, 0 6px 15px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

#guessBtn:hover {
  background: linear-gradient(145deg, #D22B2B, #A52A2A);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #600, 0 8px 20px rgba(0, 0, 0, 0.4);
}

#guessBtn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #600, 0 3px 10px rgba(0, 0, 0, 0.3);
}

#guessBtn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}

#guessBtn:hover::before {
  left: 100%;
}

#guessBtn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #8B0000;
}

#btnEasier, #btnHarder{
  visibility: hidden;
  cursor: pointer;
  font-weight: 500;
}

#btnEasier::before{
  content: "⇦"; /* flecha unicode */
  margin-right: 8px;
  font-size: 2rem;
}

#btnHarder::after{
  content: "⇨"; /* flecha unicode */
  margin-left: 8px;
  font-size: 2rem;
}

@media (max-width: 480px) {
  .btn-level {
    line-height: 1;
    padding-top: 0;
    padding-bottom: 0;
  }
  #btnEasier::before,
  #btnHarder::after {
    display: inline-block;
    font-size: 1.7em;
    margin-right: 2px;
    margin-left: 2px;
    vertical-align: middle;
    position: relative;
    top: -4px; /* Ajusta este valor si quieres más arriba/abajo */
  }
}


/* Autocomplete */
#autocomplete {
  position: absolute;
  left: 0;
  right: 0;
  top: 65px;
  background: rgba(10, 10, 20, 0.98);
  text-align: left;
  z-index: 1000;
  max-height: 400px;
  overflow: auto;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  transform-origin: top;
  animation: scaleIn 0.2s ease-out;
  backdrop-filter: blur(5px);
  scrollbar-width: thin;
  scrollbar-color: var(--one-piece-yellow) rgba(0, 0, 0, 0.3);
}

#autocomplete::-webkit-scrollbar {
  width: 8px;
}

#autocomplete::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 0 10px 10px 0;
}

#autocomplete::-webkit-scrollbar-thumb {
  background-color: var(--one-piece-yellow);
  border-radius: 4px;
}

@keyframes scaleIn {
  from { opacity: 0; transform: scaleY(0.95); }
  to { opacity: 1; transform: scaleY(1); }
}

#autocomplete > div {
  padding: 12px 25px;
  cursor: pointer;
  color: #fff;
  border-bottom: 1px solid rgba(255, 215, 0, 0.1);
  transition: all 0.2s ease;
  font-size: 16px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

#autocomplete > div::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: var(--one-piece-yellow);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

#autocomplete > div:hover::before {
  transform: scaleY(1);
}

#autocomplete > div:last-child {
  border-bottom: none;
}

#autocomplete > div:hover {
  background: rgba(30, 58, 138, 0.5);
  padding-left: 30px;
  color: var(--one-piece-yellow);
}

#autocomplete > div.highlighted {
  background: rgba(30, 58, 138, 0.7);
  color: var(--one-piece-yellow);
  font-weight: 500;
}

#autocomplete > div.highlighted::before {
  transform: scaleY(1);
}

/* Game Board */
.game-board {
  width: 100%;
  overflow-x: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: fadeIn 1s ease-out;
  -webkit-overflow-scrolling: touch;
  display: block;
  position: relative;
  background: rgba(10, 10, 20, 0.9);
  padding: 5px;
}

/* Contenedor de la tabla */
.table-container {
  width: 100%;
  overflow-x: auto;
  margin: 20px 0;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  border: 2px solid var(--one-piece-yellow);
  background: rgba(10, 10, 10, 0.9);
  -webkit-overflow-scrolling: touch;
}

/* Tabla principal */
#results {
  width: 100%;
  min-width: 1000px;
  border-collapse: collapse;
  table-layout: auto;
  margin: 0;
  padding: 0;
  border-spacing: 0;
  background: rgba(10, 10, 10, 0.9);
}

/* Cabeceras de la tabla */
thead {
  display: table;
  width: 100%;
  table-layout: fixed;
}

/* Cuerpo de la tabla */
tbody {
  display: table;
  width: 100%;
  table-layout: fixed;
}

/* Filas de la tabla */
tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

/* Forzar que las celdas tengan el mismo ancho que sus encabezados */
thead {
  display: table;
  table-layout: fixed;
  width: 100%;
}

tbody {
  display: table;
  width: 100%;
  table-layout: fixed;
}

tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

th {
  background: linear-gradient(145deg, #1E3A8A, #0F1C44);
  color: var(--one-piece-yellow);
  font-weight: 700;
  text-transform: uppercase;
  padding: 8px 12px !important;
  font-size: 15.5px;
  letter-spacing: 0.5px;
  border: none !important;
  position: sticky;
  top: 0;
  z-index: 10;
  white-space: normal;
  text-align: center;
  min-width: 100px;
  max-width: 200px;
  height: 40px;
  vertical-align: middle;
  word-wrap: break-word;
  line-height: 1.2;
  overflow: visible;
  text-overflow: clip;
}

th::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  opacity: 0.7;
}

td {
  padding: 8px 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  color: #fff;
  font-size: 15px;
  transition: all 0.3s ease;
  position: relative;
  overflow: visible;
  white-space: normal;
  word-wrap: break-word;
  text-align: center;
  vertical-align: middle;
  min-width: 100px;
  max-width: 200px;
  height: auto;
  min-height: 40px;
  line-height: 1.2;
  display: table-cell;
}

td::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255, 215, 0, 0.03) 100%);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

tr:hover td {
  background: rgba(30, 58, 138, 0.2);
}

tr:hover td::before {
  opacity: 1;
}

tr:nth-child(even) {
  background: rgba(30, 58, 138, 0.1);
}

tr:nth-child(odd) {
  background: rgba(10, 20, 50, 0.1);
}

/* Ensure proper table structure */
thead, tbody {
  display: table;
  width: 100%;
}

tr {
  display: table-row;
}

/* Ensure table cells are properly aligned */
td, th {
  display: table-cell;
  vertical-align: middle;
  text-align: center;
}

/* Estilos para móviles */
@media (max-width: 768px) {
  .game-board {
    margin: 10px 0;
    padding: 5px;
    border-radius: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .results-fruta {
    min-width: 0;
    width: 100%;
    table-layout: auto;
    white-space: nowrap;
    margin: 0;
    font-size: 0.9em;
  }

  #results {
    min-width: 1000;
    width: 100%;
    table-layout: auto;
    white-space: nowrap;
    margin: 0;
    font-size: 0.9em;
  }

  th, td {
    min-width: 80px !important;
    max-width: 150px !important;
    height: auto !important;
    min-height: 35px !important;
    font-size: 13px !important;
    padding: 4px 6px !important;
    white-space: normal;
    word-break: break-word;
    overflow: visible;
    line-height: 1.2;
  }

  th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(145deg, #1E3A8A, #0F1C44);
    font-size: 9px !important;
    padding: 6px 4px !important;
    min-height: 30px !important;
  }

  /* Make sure the table takes full width of its container */
  .container {
    padding: 0 10px;
    max-width: 100%;
    overflow-x: auto;
  }
}

.error-message {
  background-color: #ffe5e5;
  color: #b20000;
  border: 1px solid #ffb3b3;
  padding: 10px 15px;
  margin-bottom: 25px;
  border-radius: 8px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  text-align: center;
}

.error-message::before {
  content: "⚠️";
  font-size: 16px;
}


/* Result States */
.correct {
  background: linear-gradient(145deg, rgba(46, 139, 87, 0.8), rgba(34, 102, 68, 0.8)) !important;
  color: white !important;
  font-weight: 500;
  position: relative;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.incorrect {
  background: linear-gradient(145deg, rgba(178, 34, 34, 0.8), rgba(120, 20, 20, 0.8)) !important;
  color: white !important;
  position: relative;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

/* Win Message */
#winMsg {
  margin: 40px auto 20px;
  padding: 0;
  max-width: 90%;
  background: rgba(30, 58, 138, 0.9);
  border-radius: 15px;
  border: 3px solid var(--one-piece-yellow);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: bounceIn 1s ease-out, pulse 2s infinite 1s;
  transform-origin: center;
}

#looseMsg {
  margin: 40px auto 20px;
  padding: 0;
  max-width: 90%;
  background: rgba(30, 58, 138, 0.9);
  border-radius: 15px;
  border: 3px solid var(--one-piece-yellow);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: bounceIn 1s ease-out, pulse 2s infinite 1s;
  transform-origin: center;
}

.win-content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  flex-wrap: wrap;
  gap: 20px;
}

.loose-content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  flex-wrap: wrap;
  gap: 20px;
}

.jolly-roger {
  font-size: 80px;
  animation: swing 3s ease-in-out infinite;
  transform-origin: top center;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}

#winMsg h2 {
  color: var(--one-piece-yellow);
  font-family: 'Pirata One', cursive;
  font-size: 2.5em;
  margin-bottom: 10px;
  letter-spacing: 2px;
}

#winMsg p {
  color: white;
  font-size: 1.2em;
  margin: 0;
  font-weight: 300;
  max-width: 500px;
}

#looseMsg h2 {
  color: var(--one-piece-yellow);
  font-family: 'Pirata One', cursive;
  font-size: 2.5em;
  margin-bottom: 10px;
  letter-spacing: 2px;
}

#looseMsg p {
  color: white;
  font-size: 1.2em;
  margin: 0;
  font-weight: 300;
  max-width: 500px;
}

@keyframes swing {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  70% {
    opacity: 1;
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Animations */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

.hidden {
  display: none;
}

/* Particles */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .game-container {
    padding: 20px 15px;
  }

  th, td {
    padding: 12px 8px;
    font-size: 14px;
  }
}

@media (max-width: 992px) {
  h1 {
    font-size: 3em;
  }

  .subtitle {
    font-size: 1.1em;
  }

  .game-board {
    margin: 15px -10px;
  }

  #winMsg h2 {
    font-size: 2em;
  }

  #looseMsg h2 {
    font-size: 2em;
  }

  .jolly-roger {
    font-size: 60px;
  }
}

@media (max-width: 768px) {
  body {
    padding: 15px 10px;
  }

  .container {
    padding: 10px;
  }

  h1 {
    font-size: 2.2em;
    margin-bottom: 5px;
  }

  .subtitle {
    font-size: 1em;
    margin-bottom: 20px;
  }

  .game-container {
    padding: 15px 10px;
    border-radius: 10px;
  }

  .searchWrap {
    margin-bottom: 20px;
  }

  #guessInput, #guessBtn {
    width: 100%;
    margin: 5px 0;
    font-size: 16px;
  }

  #guessBtn {
    padding: 12px 20px;
    justify-content: center;
  }

  #winMsg {
    margin: 20px auto;
  }

  #looseMsg {
    margin: 20px auto;
  }

  .win-content {
    flex-direction: column;
    text-align: center;
    padding: 20px 15px;
  }

  .loose-content {
    flex-direction: column;
    text-align: center;
    padding: 20px 15px;
  }

  .jolly-roger {
    font-size: 50px;
    margin-bottom: 10px;
  }

  #winMsg h2 {
    font-size: 1.8em;
    margin-bottom: 8px;
  }

  #winMsg p {
    font-size: 1em;
  }

  #looseMsg h2 {
    font-size: 1.8em;
    margin-bottom: 8px;
  }

  #looseMsg p {
    font-size: 1em;
  }

  footer {
    font-size: 0.8em;
    padding: 15px 10px;
  }

  .credits {
    font-size: 0.9em;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.8em;
  }

  .subtitle {
    font-size: 0.9em;
  }

  #guessInput, #guessBtn {
    font-size: 15px;
  }

  #winMsg h2 {
    font-size: 1.5em;
  }

  #winMsg p {
    font-size: 0.9em;
  }

  #looseMsg h2 {
    font-size: 1.5em;
  }

  #looseMsg p {
    font-size: 0.9em;
  }

  .jolly-roger {
    font-size: 40px;
  }

  footer {
    font-size: 0.75em;
  }

  .credits {
    font-size: 0.8em;
  }
}

/* Flechas de pistas */
td.hint-up::after {
  content: "▲";
  margin-left: 4px;
  font-size: 0.9em;
  color: var(--one-piece-yellow);
}

td.hint-down::after {
  content: "▼";
  margin-left: 4px;
  font-size: 0.9em;
  color: var(--one-piece-yellow);
}

/* ============================= */
/* Estilos modernos solo para menú principal */
/* ============================= */

/* Contenedor para centrar vertical y horizontalmente el menú */
.container-menu {
  display: flex;
  justify-content: center; /* centra horizontalmente */
  align-items: center;     /* centra verticalmente */
  min-height: 70vh;        /* ocupa la mayor parte de la pantalla */
  flex-direction: column;  /* mantener menú en columna */
  gap: 30px;               /* separación entre opciones */
}


.menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  margin-bottom: 50px;
}

.menu-option {
  background: rgba(0, 0, 0, 0.75);
  border: 2px solid var(--one-piece-yellow);
  border-radius: 20px;
  padding: 25px 30px;
  width: 320px;
  max-width: 90%;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
  cursor: pointer;

  /* mantener botón abajo */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.menu-option:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.7);
}

.menu-option h2 {
  font-family: 'Pirata One', cursive;
  font-size: 1.8em;
  margin-bottom: 10px;
  color: var(--one-piece-yellow);
  text-shadow: 2px 2px 0 var(--one-piece-red);
}

.menu-option p {
  font-size: 0.95em;
  margin-bottom: 20px;
  color: #fff;
  line-height: 1.4;
}

.menu-option form,
.menu-option a.btn-play {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.menu-option select {
  padding: 10px 15px;
  border-radius: 15px;
  border: 2px solid var(--one-piece-yellow);
  background: rgba(255, 255, 255, 0.95);
  font-size: 16px;
  color: var(--one-piece-black);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.menu-option select:hover,
.menu-option select:focus {
  border-color: var(--one-piece-blue);
  box-shadow: 0 0 10px var(--one-piece-yellow);
  outline: none;
}

.menu-option button.btn-play,
.menu-option a.btn-play {
  padding: 12px 25px;
  font-size: 16px;
  font-weight: bold;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(145deg, #C41E3A, #8B0000);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-decoration: none; /* <- importante para <a> */

  /*  ocupar todo el ancho */
  width: 100%;
  box-sizing: border-box;
}

.menu-option button.btn-play:hover,
.menu-option a.btn-play:hover {
  background: linear-gradient(145deg, #D22B2B, #A52A2A);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}

/* Fondo diferenciado para cada opción */
.menu-option.option-character {
  background: rgba(30, 58, 138, 0.85); /* azul */
}

.menu-option.option-fruta {
  background: rgba(178, 34, 34, 0.85); /* rojo */
}

/* ============================= */
/* Estilo moderno para select de dificultad */
/* ============================= */

#dificultad {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 12px 40px 12px 20px;
  font-size: 16px;
  font-weight: 500;
  color: #FFD700; /* amarillo */
  background: rgba(0, 0, 0, 0.75); /* oscuro, como el menú */
  border: 2px solid var(--one-piece-yellow);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  width: 100%;
  max-width: 300px;
  text-align: left;
  font-family: 'Roboto', sans-serif;
  position: relative;
  z-index: 2;

  /* Flecha personalizada */
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 5' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolygon points='0,0 10,0 5,5' fill='%23FFD700'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 12px 6px;
}

#dificultad:hover,
#dificultad:focus {
  border-color: var(--one-piece-blue);
  box-shadow: 0 0 12px var(--one-piece-yellow);
  outline: none;
}

#dificultad option {
  background: rgba(0, 0, 0, 0.85);
  color: #FFD700;
  padding: 8px 15px;
}

/* Animación al desplegar: simulada con focus */
#dificultad:focus {
  animation: fadeInSelect 0.3s ease-out;
}

#dificultad option:hover {
  background: rgba(30, 58, 138, 0.85);
  color: var(--one-piece-yellow);
}

@keyframes fadeInSelect {
  0% { opacity: 0; transform: translateY(-10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ============================= */
/* Estilos modernos para fruta.php */
/* ============================= */

.fruit-name {
  font-size: 1.5rem;
  font-weight: bold;
  color: #FFD700;
  text-align: center;
  margin-bottom: 15px;
  text-shadow: 1px 1px 2px #000;
}


/* Aumentar tamaño de títulos */
#tituloJuego {
  font-size: 2.2rem;
}

#tituloWhatPiece {
  font-size: 2.4rem;
}

.levels-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  flex-wrap: nowrap;
}

.btn-level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 8px;
  font-size: 1.5rem;
  font-weight: 700;
  color: #000;
  background-color: rgba(255, 255, 255, 0.65); /* fondo semitransparente como recuadro del juego */
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  text-decoration: none;
  backdrop-filter: blur(4px); /* efecto difuminado */
  transition: all 0.2s ease;
}

.levels-container .btn-fruta {
  flex: 0 1 20%;
  max-width: 20%;
  width: 20%;
  min-width: 200px;
  margin-top: 20px;
  padding: 10px 10px;
  font-size: 18px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

/* Responsive para móviles */
@media (max-width: 480px) {
  .levels-container {
    flex-direction: row;
    gap: 2px;
  }
  .levels-container .btn-level {
    flex: 0 1 45%;
    max-width: 45%;
    width: 45%;
    font-size: 15px;
    padding: 8px 5px;
    margin-top: 10px;
    min-width: 0px;
    box-sizing: border-box;
  }
}

/* Contenedor de botones de dificultad */
.back-container {
  display: flex;               /* habilita flexbox */
  justify-content: end;
  width: 100%;
  align-items: center;         /* centrado vertical si tienen diferente altura */
  margin: 10px 0;              /* espacio superior e inferior */
  flex-wrap: wrap;             /* para que no se rompa en móviles */
  gap: 10px;                   /* espacio entre botones si se envuelven */
}

/* Contenedor de botones de dificultad */
.back-container .btn-fruta{
  font-size: 20px;
}

/* Input del nombre del personaje */
#frutaInput {
  width: 100%;
  padding: 12px 16px;
  font-size: 1.1rem;
  border: 2px solid var(--one-piece-yellow);
  border-radius: 12px;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  margin-bottom: 15px;
  background: rgba(255,255,255,0.95);
  color: var(--one-piece-black);
  font-weight: 500;
}

#frutaInput:focus {
  border-color: var(--one-piece-blue);
  box-shadow: 0 4px 10px rgba(30, 58, 138, 0.3);
}

/* Botón Jugar */
#frutaBtn {
  width: 100%;
  padding: 14px 0;
  margin-bottom: 20px;
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #4CAF50, #43A047);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

#frutaBtn:hover {
  background: linear-gradient(135deg, #43A047, #388E3C);
  transform: translateY(-2px);
  box-shadow: 0 6px 10px rgba(0,0,0,0.3);
}

/* Aumentar tamaño de títulos */
header h1 {
  font-size: 3.6rem; /* WhatPiece */
}

header .subtitle {
  font-size: 2.2rem; /* Adivina la fruta */
}

/* Contenedor de intentos con margen inferior */
#results-fruta {
  margin-bottom: 25px;
}

/* Contenedor de intentos con margen inferior */
#results-fruta {
  margin-bottom: 25px;
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse; /* 🔹 añadir esto */
}

/* Anchos de columnas */
#results-fruta th:nth-child(1),
#results-fruta td:nth-child(1) {
  width: 75%;
}

#results-fruta th:nth-child(2),
#results-fruta td:nth-child(2) {
  width: 25%;
}

/* Estilo de filas y celdas */
#results-fruta-body td {
  font-size: 1.4rem; /* texto más grande en intentos */
  padding: 10px 15px;
  border-bottom: 1px solid #ccc; /* 🔹 aplicar borde aquí */
}

/* Quitar borde de la última fila */
#results-fruta-body tr:last-child td {
  border-bottom: none;
}

.btn-fruta {
  margin-bottom: 20px;
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px; /* espacio entre icono y texto */
  padding: 8px 16px;
  font-size: 1.5rem;
  font-weight: 500;
  color: #000;
  background-color: rgba(255, 255, 255, 0.65); /* fondo semitransparente como recuadro del juego */
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  text-decoration: none;
  backdrop-filter: blur(4px); /* efecto difuminado */
  transition: all 0.2s ease;
}

.btn-fruta:hover {
  background-color: rgba(255, 255, 255);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-fruta:active {
  transform: translateY(1px);
}

.btn-character-img{
  height: 70px;
  width: 50px;
}

.btn-fruta-img{
  height: 70px;
  width: 50px;
}

.btn-wordle-img{
  height: 70px;
  width: 75px;
}

/* ==================== WORDLE ==================== */
.wordle-board {
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  gap: 10px;
  margin: 20px auto;
  max-width: 300px;
}

.wordle-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}

/* ==================== CONTAINER WORDLE ==================== */
.container-wordle {
  max-width: 1200px;       /* igual que container-fruit */
  margin: 0 auto;
  position: relative;
  z-index: 1;
  padding: 20px;           /* separaciones internas */
  min-height: 100vh;       /* ocupar toda la altura de la ventana */
  display: flex;
  flex-direction: column;
  align-items: center;     /* centrar horizontalmente el contenido */
}


.cell {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  font-size: 2rem;
  width: 50px;
  height: 50px;
  margin: 2px;
  border: 2px solid #999;
  text-transform: uppercase;

  background-color: #fff;
  color: black;

  /* Animación flip */
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: transform 0.6s ease, background-color 0.3s ease, color 0.3s ease;
}

.cell.flip {
  transform: rotateX(90deg);
}

.cell.correct {
  background-color: #6aaa64;
  color: #fff;
  border-color: #6aaa64;
}

.cell.present {
  background-color: #e4a81d;
  color: #fff;
  border-color: #e4a81d;
}

.cell.absent {
  background-color: #757575;
  color: #fff;
  border-color: #757575;
}

/* Teclado virtual */
.keyboard {
  margin: 20px auto;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.key-row {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.key {
  width: 40px;
  height: 50px;
  border: none;
  background: #d3d6da;
  font-size: 18px;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.key.correct {
  background-color: #6aaa64 !important;
  color: #fff;
}

.key.present {
  background-color: #c9b458 !important;
  color: #fff;
}

.key.absent {
  background-color: #787c7e !important;
  color: #fff;
}

.key:hover {
  filter: brightness(1.1);
}

.key.key-action {
  background-color: #b0b0b0;
}

@media (max-width: 480px) {
  .container-wordle {
    max-width: 100%;
    width: 100%;
    padding: 0 2vw;
    box-sizing: border-box;
  }
  .wordle-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
  }

  .wordle-board {
    max-width: 100%;
    width: 100%;
    gap: 15px;
  }
  .cell {
    width: 54px;
    height: 54px;
    font-size: 1.6rem;
    margin: 0;
  }
  .keyboard {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    overflow-x: auto;
    padding-bottom: 6px;
  }
  .key-row {
    gap: 4px; /* Más separación entre teclas */
  }
  .key {
    width: 25px;
    height: 33px;
    font-size: 1rem; /* Letras más pequeñas */
    padding: 0 1px;
  }

  .key[data-key="ENTER"],
  .key[data-key="DEL"] {
    width: 38px; /* 1.5 veces el ancho normal */
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
}
