:root {
  --green: #5aa300;
  --green-dark: #4b8c00;
  --green-light: #eaf5d6;
  --bg-soft: #f7fbf0;
  --text-dark: #1f2937;
  --muted: #6b7280;
  /* Accent bar for headers/titles */
  --accent-bar-width: 300px;
  --accent-bar-height: 10px;
  --accent-bar-gradient: linear-gradient(90deg,#34d399,#2fbf87);
} 

/* Types header title styling (no underline) */
.types-header h2 { position: relative; padding-bottom: 18px; }
/* Prevent accidental green bar under the 'Selecciona un juego' H2 */
.types-header h2::after { content: none !important; display: none !important; }

/* Global accent bar: SOLO para headers con clase header--bar */
/* Solo el header principal/banner debe tener la barra verde */
.site-header.header--bar::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 6px;
  width: var(--accent-bar-width);
  height: var(--accent-bar-height);
  background: var(--accent-bar-gradient);
  border-radius: 6px;
  box-shadow: 0 6px 14px rgba(34,197,94,0.12);
  pointer-events: none;
  z-index: 9999;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-dark);
  background: #ffffff;
}

/* ---------------- HEADER ---------------- */
.site-header {
  padding: 16px 0;
  background: var(--green);
  color: #fff;
  position: relative;
  overflow: visible;
}


/* Header/banner button styles: más grandes */
.site-header .btn,
#crear-top,
#create-back,
.wordle-header .btn {
  background: var(--green-dark);
  color: #fff;
  border: none;
  padding: 16px 32px;
  font-size: 1.18rem;
  border-radius: 999px;
  height: 48px;
  min-width: 120px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(16,185,129,0.12);
  transition: background .12s ease, transform .08s ease, box-shadow .12s ease;
}

.site-header .btn:hover,
#crear-top:hover,
#crear-top:active,
#crear-top:focus-visible,
#create-back:hover,
#create-back:active,
#create-back:focus-visible,
.wordle-header .btn:hover,
.wordle-header .btn:active,
.wordle-header .btn:focus-visible {
  background: var(--green);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(16,185,129,0.18), 0 0 0 2px rgba(255,255,255,0.9);
  outline: none;
}

/* Botones generales más pequeños */
.btn, button {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  background: #f3f4f6;
  transition: transform .15s ease, background .15s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--green);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--green-dark);
}

/* Ajuste para el botón del banner de Wordle (usa .wordle-header .btn) */
/* Si el banner de Wordle tiene otra clase, ajusta aquí */

/* Prevent h2 and other elements from having unwanted bars */
h2, h3, h4, h5, h6 {
  position: relative;
}
h2::after, h3::after, h4::after, h5::after, h6::after {
  display: none !important;
}

/* Logo styles */
.logo {
  font-weight: 800;
  font-size: 1.4rem;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
}

.logo:hover,
.logo:visited,
.logo:active,
.logo:focus {
  color: #fff;
  text-decoration: none;
  outline: none;
}

/* Accent bar for in-game titles */
.title.title--bar {
  color: transparent;
  position: relative;
}
.title.title--bar::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 6px;
  width: var(--accent-bar-width);
  height: var(--accent-bar-height);
  background: var(--accent-bar-gradient);
  border-radius: 6px;
  box-shadow: 0 6px 14px rgba(34,197,94,0.12);
  pointer-events: none;
  z-index: 9999;
}

/* Buttons */
.site-header .btn {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  padding: 8px 14px;
  border-radius: 999px;
  min-width: 0;
}

.site-header .btn:hover {
  background: rgba(255,255,255,0.06);
  transform: translateY(-1px);
}

/* If a primary button is used in the header, make it white with green text */
.site-header .btn.btn-primary {
  background: #fff;
  color: var(--green);
  border: none;
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ---------------- GLOBAL ---------------- */
.container {
  max-width: 1200px;
  margin: auto;
  padding: 0 24px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.85rem;
}

/* ---------------- BUTTONS ---------------- */
/* Ensure button text is never underlined */
.btn, button {
  border: none;
  border-radius: 999px;
  padding: 16px 32px;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  background: #f3f4f6;
  transition: transform .15s ease, background .15s ease;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--green);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--green-dark);
}

/* Disabled button state (used for play if not enough custom words) */
.btn.btn-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---------------- HERO ---------------- */
.hero {
  min-height: calc(70vh - 64px);
  display: flex;
  align-items: flex-start; /* align top so title sits higher */
  padding-top: 40px; /* give more top space so text isn't clipped */
  padding-bottom: 18px; /* ensure some bottom spacing */
  background:
    radial-gradient(circle at 1px 1px, #d9efc2 1px, transparent 0);
  background-size: 26px 26px;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto; /* left content and right button */
  align-items: start;
  width: 100%;
  gap: 12px;
}

.hero-left { padding-right: 0; }

.hero h1, .hero-title {
  font-size: 2.4rem; /* keep requested font size */
  font-weight: 800;
  line-height: 1.2; /* increase line-height to prevent descender clipping inside iframe */
  margin-bottom: 10px;
  max-width: 100%;
  white-space: nowrap; /* keep it in a single line on wide screens */
  /* allow descenders to be visible when the container is tight */
  overflow: visible;
  display: inline-block;
  padding-bottom: 6px;
  text-align: left;
}

@media (max-width: 720px) {
  .hero h1, .hero-title {
    font-size: 2rem;
    white-space: normal; /* allow wrapping on small screens */
    line-height: 1.25;
    padding-bottom: 2px;
  }
}


.hero .sub {
  font-size: 1.25rem;
  color: #6b7280;
  max-width: 420px;
  margin-bottom: 36px;
  text-align: left;
}

.hero .btn-primary {
  padding: 10px 18px;         /* shorter horizontal padding */
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(90,163,0,0.35);
  align-self: flex-start;
  min-width: 0;              /* avoid huge pill width */
}

.hero .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(90,163,0,0.45);
}




/* ---------------- GAME TYPES ---------------- */
.game-types {
  margin-top: 60px;
}

.types-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* ---------------- GAME CARD ---------------- */
.game-card {
  background: #ffffff;
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform .2s ease, box-shadow .2s ease;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.12);
}

.game-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.game-card-meta h3 {
  margin: 0 0 4px;
  font-size: 1.2rem;
}

.game-logo {
  flex-shrink: 0;
}

.game-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

/* Make action buttons (play/config) more prominent: larger, more circular, darker on interaction */
.game-actions .btn {
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
  min-width: 52px;
  text-align: center;
}

.game-actions .btn:focus,
.game-actions .btn:hover {
  background: var(--green-dark);
  color: #fff;
}

.game-actions .btn.btn-primary:hover {
  background: var(--green-dark);
  color: #fff;
}

/* ---------------- TOKEN INPUTS ---------------- */
.card-preview-input,
.card-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  font-size: 0.9rem;
}

/* spacing for token title and config label */
.card-token-title {
  display: block;
  margin-bottom: 10px; /* un poco más de espacio antes del input */
  font-weight: 600;
}

.config-top-tokens label.small {
  display: block;
  margin-bottom: 10px; /* un poco más de separación en el panel de configuración */
}

.token-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

/* Styled token chip: grey rounded rectangle with a circular X button */
.token-list .word-chip {
  background: #f3f4f6; /* light grey box */
  color: #374151; /* dark grey text */
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e5e7eb; /* subtle border to mimic a grey box */
  text-decoration: underline; /* underline text in light grey */
  text-decoration-color: #e5e7eb;
  text-underline-offset: 3px;
  /* subtle entrance animation */
  opacity: 0;
  transform: translateY(-6px);
  animation: chipIn 180ms ease-out forwards;
}

@keyframes chipIn {
  to { opacity: 1; transform: translateY(0); }
}

.token-list .word-chip .chip-remove {
  margin-left: 4px;
  background: #e5e7eb; /* grey circular remove button */
  border-radius: 50%;
  width: 22px;
  height: 22px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  color: #374151;
  font-weight: 700;
  cursor: pointer;
}

.token-list .word-chip .chip-remove:hover {
  background: #d1d5db;
}

.token-list .word-chip .chip-remove:focus {
  outline: 3px solid rgba(59,130,246,0.2);
  outline-offset: 2px;
}

.config-error {
  color: #dc2626;
  font-size: 0.85rem;
}

/* ---------------- CONFIG PANEL ---------------- */
.game-config {
  margin-top: 60px;
}

.config-body {
  background: #ffffff;
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(0,0,0,.08);
}

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-inner > * {
    grid-column: auto;
  }

  .hero h1 {
    font-size: 2.4rem;
    text-align: center;
  }

  .hero .sub {
    text-align: center;
  }

  .hero .btn-primary {
    align-self: center;
  }
}
