/* ============================================================
   RIMA CRUDA — styles.css
   Estética: Raw underground / graffiti / cassette tape
   ============================================================ */

/* ---- RESET & VARIABLES ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0a0a0a;
  --surface:  #111111;
  --surface2: #1a1a1a;
  --border:   #2a2a2a;
  --accent:   #e8ff00;       /* amarillo spray */
  --accent2:  #ff3c00;       /* rojo fuego */
  --accent3:  #00d4ff;       /* azul eléctrico */
  --text:     #f0ede6;
  --text-dim: #7a7a6e;
  --font-display: 'Bebas Neue', sans-serif;
  --font-mono:    'Space Mono', monospace;
  --font-body:    'Oswald', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- NOISE TEXTURE ---- */
.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- HEADER ---- */
#main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,10,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-img-placeholder {
  width: 44px;
  height: 44px;
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--surface2);
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.logo-rima {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--text);
  letter-spacing: 4px;
}

.logo-cruda {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--accent);
  letter-spacing: 4px;
}

.header-nav { display: flex; align-items: center; gap: 12px; }

/* ---- BUTTONS ---- */
.btn-primary {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 10px 22px;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: transform .1s, box-shadow .1s;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(232,255,0,.35); }
.btn-primary.full { width: 100%; margin-top: 8px; }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 9px 20px;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: none;
  padding: 9px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  transition: color .2s;
}
.btn-ghost:hover { color: var(--text); }

.btn-hero {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  padding: 14px 40px;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 4px;
  cursor: pointer;
  margin-top: 32px;
  transition: background .2s, color .2s;
  position: relative;
  overflow: hidden;
}
.btn-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
  z-index: -1;
}
.btn-hero:hover { color: #000; }
.btn-hero:hover::after { transform: scaleX(1); }

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  color: #222;
  border: none;
  padding: 11px;
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  transition: opacity .2s;
  margin-bottom: 4px;
}
.btn-google:hover { opacity: .9; }

/* ---- HERO ---- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 80px 24px;
}

.hero-bg-text {
  position: absolute;
  font-family: var(--font-display);
  font-size: clamp(120px, 22vw, 320px);
  color: rgba(255,255,255,.025);
  letter-spacing: 20px;
  user-select: none;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(56px, 10vw, 120px);
  line-height: .92;
  letter-spacing: 4px;
  color: var(--text);
}

.hero-title span { color: var(--accent); }

.hero-sub {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 18px;
  letter-spacing: 2px;
}

.hero-tape {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--accent) 0, var(--accent) 24px, transparent 24px, transparent 32px);
  opacity: .7;
}

/* ---- GAMES SECTION (home) ---- */
.games-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 4px;
  margin-bottom: 40px;
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}

/* ---- GAME TYPE CARDS (home grid) ---- */
.gametypes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2px;
}

.gametype-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 36px 28px;
  cursor: pointer;
  transition: border-color .2s, transform .2s;
  position: relative;
  overflow: hidden;
}
.gametype-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 0;
  background: var(--accent);
  transition: height .25s ease;
}
.gametype-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.gametype-card:hover::before { height: 100%; }

.gametype-card.coming-soon {
  opacity: .45;
  cursor: default;
}
.gametype-card.coming-soon:hover { transform: none; border-color: var(--border); }
.gametype-card.coming-soon::before { display: none; }

.gametype-icon {
  font-size: 36px;
  margin-bottom: 16px;
  display: block;
}
.gametype-name {
  font-family: var(--font-display);
  font-size: 34px;
  letter-spacing: 3px;
  color: var(--text);
  line-height: 1;
  margin-bottom: 10px;
}
.gametype-desc {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 20px;
}
.gametype-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}
.tag-soon {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 10px;
  letter-spacing: 2px;
}
.tag-levels {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* ---- LEVELS VIEW ---- */
.levels-section {
  max-width: 860px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

.levels-header {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 32px;
}

.btn-back {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 2px;
  padding: 10px 16px;
  cursor: pointer;
  transition: border-color .2s, color .2s;
  white-space: nowrap;
  margin-top: 6px;
}
.btn-back:hover { border-color: var(--accent); color: var(--accent); }

.levels-title {
  font-family: var(--font-display);
  font-size: 48px;
  letter-spacing: 4px;
  color: var(--text);
  line-height: 1;
}

/* ---- GUEST INFO BAR ---- */
.guest-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(232,255,0,.07);
  border: 1px solid rgba(232,255,0,.25);
  padding: 14px 18px;
  margin-bottom: 32px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}
.guest-info-bar strong { color: var(--accent); }
.guest-info-bar.hidden { display: none; }

.btn-small-accent {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity .2s;
}
.btn-small-accent:hover { opacity: .85; }

/* ---- LEVEL ROWS ---- */
.levels-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.level-row {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px 24px;
  gap: 20px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  position: relative;
}
.level-row:hover:not(.level-locked):not(.level-coming) {
  border-color: var(--accent);
  background: var(--surface2);
}

.level-row.level-locked {
  opacity: .5;
  cursor: default;
}
.level-row.level-coming {
  opacity: .35;
  cursor: default;
}

.level-num {
  font-family: var(--font-display);
  font-size: 36px;
  color: var(--accent);
  letter-spacing: 2px;
  min-width: 56px;
  line-height: 1;
}
.level-locked .level-num { color: var(--text-dim); }

.level-info { flex: 1; }
.level-name {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 2px;
  color: var(--text);
  margin-bottom: 4px;
}
.level-desc {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.level-status {
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: right;
  flex-shrink: 0;
}

.status-available  { color: var(--accent); }
.status-locked     { color: var(--text-dim); }
.status-played     { color: #00d464; }
.status-wait       { color: var(--accent2); }

/* countdown dentro del status */
.status-countdown  { color: var(--accent2); display: block; font-size: 13px; margin-top: 2px; }

/* ---- USER PANEL ---- */
.user-panel { display: flex; align-items: center; gap: 12px; }
.user-greeting {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}
.user-greeting strong { color: var(--accent); }

/* ---- MODALES ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .2s ease;
}

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

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

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  position: relative;
  animation: slideUp .25s ease;
}

@keyframes slideUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  transition: color .2s;
}
.modal-close:hover { color: var(--text); }

.modal-title {
  font-family: var(--font-display);
  font-size: 36px;
  letter-spacing: 4px;
  color: var(--accent);
  margin-bottom: 24px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.input-field {
  display: block;
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  margin-bottom: 10px;
  outline: none;
  transition: border-color .2s;
}
.input-field:focus { border-color: var(--accent); }
.input-field::placeholder { color: var(--text-dim); }

.error-msg {
  background: rgba(255,60,0,.15);
  border: 1px solid var(--accent2);
  color: var(--accent2);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  margin-bottom: 10px;
}
.error-msg.hidden { display: none; }

.modal-switch {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}
.modal-switch a { color: var(--accent); text-decoration: none; }
.modal-switch a:hover { text-decoration: underline; }

/* ---- GAME MODAL ---- */
.game-modal-box {
  max-width: 900px;
  padding: 32px 28px;
}

.game-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.game-timer {
  font-family: var(--font-mono);
  font-size: 28px;
  color: var(--accent);
  letter-spacing: 4px;
  transition: color 0.3s;
}

@keyframes pulse {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0.6; transform: scale(1.08); }
}

.game-instructions {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 24px;
  line-height: 1.6;
}
.game-instructions strong { color: var(--text); }

/* ---- GAME GRID ---- */
.game-grid-container {
  overflow-x: auto;
}

.game-grid-table {
  border-collapse: collapse;
  width: 100%;
}

/* Corner cell (vacía arriba-izquierda) */
.cell-corner {
  background: transparent;
}

/* Celdas de header (banderas / competiciones) */
.cell-header {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  letter-spacing: 1px;
  min-width: 80px;
}

.cell-flag { font-size: 24px; display: block; }
.cell-comp { font-size: 11px; color: var(--text-dim); display: block; margin-top: 4px; }

/* Celdas de respuesta */
.cell-answer {
  border: 1px solid var(--border);
  padding: 0;
  position: relative;
  min-width: 110px;
  min-height: 70px;
}

.cell-input {
  width: 100%;
  height: 100%;
  min-height: 70px;
  background: var(--surface);
  border: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 10px 12px;
  text-align: center;
  outline: none;
  transition: background .2s;
  resize: none;
}
.cell-input:focus { background: var(--surface2); border: none; box-shadow: inset 0 0 0 2px var(--accent); }
.cell-input::placeholder { color: var(--text-dim); font-size: 11px; }

.cell-input.correct { background: rgba(0,212,100,.15); box-shadow: inset 0 0 0 2px #00d464; color: #00d464; }
.cell-input.wrong   { background: rgba(255,60,0,.15);  box-shadow: inset 0 0 0 2px var(--accent2); color: var(--accent2); }

/* ---- AUTOCOMPLETE ---- */
.autocomplete-dropdown {
  position: fixed;
  background: var(--surface2);
  border: 1px solid var(--accent);
  z-index: 600;
  min-width: 200px;
  max-height: 200px;
  overflow-y: auto;
}
.autocomplete-dropdown.hidden { display: none; }

.autocomplete-item {
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.autocomplete-item:hover, .autocomplete-item.active { background: var(--accent); color: #000; }

/* ---- GAME ACTIONS ---- */
.game-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* ---- GAME RESULT ---- */
.game-result {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: center;
}
.game-result.hidden { display: none; }
.result-score {
  font-family: var(--font-display);
  font-size: 48px;
  color: var(--accent);
  display: block;
  margin-bottom: 8px;
}
.result-label { color: var(--text-dim); font-size: 11px; letter-spacing: 2px; }

/* ---- TOAST ---- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface2);
  border: 1px solid var(--accent);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 14px 24px;
  z-index: 700;
  animation: slideUp .2s ease;
  white-space: nowrap;
}
.toast.hidden { display: none; }
.toast.error { border-color: var(--accent2); color: var(--accent2); }

/* ---- AD SIDEBAR ---- */
.ad-sidebar {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.ad-sidebar.hidden { display: none; }
.ad-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 2px;
}
.ad-placeholder {
  width: 120px;
  height: 240px;
  background: var(--surface);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  text-align: center;
}

/* ---- FOOTER ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}
.footer-logo {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 4px;
  color: var(--text);
}

/* ---- UTILITIES ---- */
.hidden { display: none !important; }

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
  .header-inner { padding: 0 16px; }
  .btn-secondary { display: none; }
  .modal-box { padding: 28px 20px; }
  .game-modal-box { padding: 20px 14px; }
  .hero-title { font-size: clamp(40px, 14vw, 80px); }
  .ad-sidebar { display: none !important; }
}
