/* === Radio 10 Córdoba Game Plugin - Frontend === */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Nunito:wght@400;600;700;900&display=swap');

:root {
  --r10cg-red: #e8000d;
  --r10cg-dark: #0d0d0d;
  --r10cg-card: #1a1a1a;
  --r10cg-text: #ffffff;
  --r10cg-muted: #888;
  --r10cg-gold: #f5c518;
  --r10cg-radius: 16px;
}

/* ── LAUNCH BUTTON ── */
.r10cg-btn-wrap {
  display: flex;
  justify-content: center;
  margin: 40px 0 24px;
}

.r10cg-launch-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 36px;
  background: var(--r10cg-color, #e8000d);
  color: #fff;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.45rem;
  letter-spacing: 2px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 6px 32px rgba(232,0,13,.45), 0 2px 8px rgba(0,0,0,.3);
  transition: transform .2s, box-shadow .2s;
  z-index: 1;
}
.r10cg-launch-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 40px rgba(232,0,13,.6), 0 4px 12px rgba(0,0,0,.3);
}
.r10cg-launch-btn:active { transform: scale(.97); }
.r10cg-btn-icon { font-size: 1.4rem; }
.r10cg-btn-wave {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.15) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: r10cg-wave 2.5s ease infinite;
}
@keyframes r10cg-wave {
  0%   { transform: translateX(-100%); }
  60%  { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

/* ── OVERLAY & MODAL ── */
.r10cg-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.82);
  backdrop-filter: blur(6px);
  z-index: 999999;
  align-items: center;
  justify-content: center;
  animation: r10cg-fade-in .25s ease;
}
.r10cg-overlay.r10cg-active { display: flex; }
@keyframes r10cg-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.r10cg-modal {
  background: var(--r10cg-dark);
  border: 1px solid #2a2a2a;
  border-radius: var(--r10cg-radius);
  width: min(92vw, 800px);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 80px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.05);
  animation: r10cg-modal-in .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes r10cg-modal-in {
  from { transform: scale(.88) translateY(30px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

/* ── HEADER ── */
.r10cg-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, #1a0000 0%, #2d0005 100%);
  border-bottom: 2px solid var(--r10cg-red);
}
.r10cg-modal-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  color: #fff;
  letter-spacing: 2px;
}
.r10cg-radio-wave { font-size: 1.5rem; }
.r10cg-close {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
  width: 34px; height: 34px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background .2s;
  display: flex; align-items: center; justify-content: center;
}
.r10cg-close:hover { background: var(--r10cg-red); }

/* ── SCREENS ── */
.r10cg-screen { flex: 1; overflow-y: auto; }
.r10cg-hidden { display: none !important; }

/* ── VIDEO ── */
.r10cg-video-wrap {
  position: relative;
  background: #000;
}
.r10cg-video-wrap iframe {
  width: 100%;
  aspect-ratio: 16/9;
  display: block;
}
.r10cg-skip-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  background: #111;
  border-top: 1px solid #222;
  position: relative;
}
.r10cg-skip-progress {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: rgba(232,0,13,.18);
  width: 0%;
  transition: width 1s linear;
}
.r10cg-skip-bar span { color: #ccc; font-family: 'Nunito', sans-serif; font-size: .9rem; flex: 1; position: relative; z-index: 1; }
.r10cg-skip-btn {
  background: var(--r10cg-red);
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  position: relative; z-index: 1;
  transition: background .2s, transform .15s;
  animation: r10cg-pulse-btn 1.5s ease infinite;
}
.r10cg-skip-btn:hover { background: #c0000b; transform: scale(1.05); }
@keyframes r10cg-pulse-btn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,0,13,.4); }
  50%       { box-shadow: 0 0 0 8px rgba(232,0,13,0); }
}

/* ── GAME SELECT ── */
.r10cg-game-select {
  padding: 28px 24px;
  text-align: center;
}
.r10cg-game-select-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  color: #fff;
  letter-spacing: 3px;
  margin: 0 0 24px;
}
.r10cg-games-grid-select {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  max-width: 640px;
  margin: 0 auto;
}
.r10cg-game-card {
  background: var(--r10cg-card);
  border: 2px solid #2a2a2a;
  border-radius: 14px;
  padding: 28px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.r10cg-game-card:hover {
  border-color: var(--r10cg-red);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(232,0,13,.2);
}
.r10cg-game-emoji { font-size: 2.8rem; }
.r10cg-game-name  { font-family: 'Bebas Neue', sans-serif; font-size: 1.3rem; color: #fff; letter-spacing: 1px; }
.r10cg-game-desc  { font-family: 'Nunito', sans-serif; font-size: .8rem; color: var(--r10cg-muted); }

/* ── GAME SCREEN ── */
.r10cg-game-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  background: #111;
  border-bottom: 1px solid #222;
}
.r10cg-back-btn {
  background: #2a2a2a;
  border: 1px solid #333;
  color: #ccc;
  padding: 6px 16px;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-size: .85rem;
  cursor: pointer;
  transition: background .2s;
}
.r10cg-back-btn:hover { background: var(--r10cg-red); color: #fff; }
#r10cg-game-title-bar {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  color: var(--r10cg-gold);
  letter-spacing: 2px;
}

/* ── PREGUNTADOS ── */
#r10cg-game-container { padding: 20px; font-family: 'Nunito', sans-serif; }
.r10cg-quiz-question {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 20px;
  line-height: 1.5;
  text-align: center;
}
.r10cg-quiz-cat {
  text-align: center;
  margin-bottom: 16px;
  font-size: .85rem;
  color: var(--r10cg-gold);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.r10cg-quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.r10cg-quiz-opt {
  background: #1e1e1e;
  border: 2px solid #333;
  color: #ddd;
  padding: 14px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-size: .95rem;
  transition: all .2s;
  text-align: left;
}
.r10cg-quiz-opt:hover:not(:disabled) { border-color: var(--r10cg-red); background: #2a0003; color: #fff; }
.r10cg-quiz-opt.correct  { border-color: #22c55e; background: #052d14; color: #22c55e; }
.r10cg-quiz-opt.wrong    { border-color: #ef4444; background: #2d0505; color: #ef4444; }
.r10cg-quiz-score {
  text-align: center;
  margin-top: 18px;
  font-size: .9rem;
  color: var(--r10cg-muted);
}
.r10cg-quiz-score strong { color: var(--r10cg-gold); }
.r10cg-next-btn {
  display: block;
  margin: 18px auto 0;
  background: var(--r10cg-red);
  color: #fff;
  border: none;
  padding: 12px 32px;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
}
.r10cg-next-btn:hover { background: #c0000b; }

/* ── PASAPALABRA ── */
.r10cg-rosco-wrap { text-align: center; }
.r10cg-rosco-svg { margin: 0 auto; display: block; }
.r10cg-rosco-clue {
  background: #1e1e1e;
  border-radius: 12px;
  padding: 16px 20px;
  margin: 16px 0;
  font-size: 1rem;
  color: #eee;
  line-height: 1.5;
}
.r10cg-rosco-clue strong { color: var(--r10cg-gold); font-size: 1.2rem; }
.r10cg-rosco-input-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.r10cg-rosco-input {
  flex: 1;
  background: #111;
  border: 2px solid #333;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 1.1rem;
  outline: none;
  transition: border-color .2s;
  text-transform: uppercase;
}
.r10cg-rosco-input:focus { border-color: var(--r10cg-red); }
.r10cg-rosco-btn {
  background: var(--r10cg-red);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  cursor: pointer;
}
.r10cg-rosco-skip-btn {
  background: #333;
  color: #ccc;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
}
.r10cg-rosco-msg { margin: 10px 0; font-size: .9rem; height: 20px; }

/* ── SUDOKU ── */
.r10cg-sudoku-wrap { text-align: center; }
.r10cg-sudoku-grid {
  display: inline-grid;
  grid-template-columns: repeat(9, 1fr);
  border: 3px solid #fff;
  border-radius: 4px;
  overflow: hidden;
  margin: 8px auto;
}
.r10cg-sudoku-cell {
  width: 38px; height: 38px;
  border: 1px solid #333;
  background: #1a1a1a;
  color: #fff;
  text-align: center;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  outline: none;
  transition: background .15s;
  caret-color: var(--r10cg-red);
}
.r10cg-sudoku-cell:focus { background: #2d0005; }
.r10cg-sudoku-cell.given { color: var(--r10cg-gold); background: #111; pointer-events: none; }
.r10cg-sudoku-cell.error { background: #2d0505; color: #ef4444; }
.r10cg-sudoku-cell.correct-cell { background: #052d14; color: #22c55e; }
/* thick borders at box boundaries */
.r10cg-sudoku-cell:nth-child(3n+1)  { border-left: 3px solid #555; }
.r10cg-sudoku-cell:nth-child(3n)    { border-right: 3px solid #555; }
.r10cg-sudoku-grid > .r10cg-sudoku-cell:nth-child(n+19):nth-child(-n+27),
.r10cg-sudoku-grid > .r10cg-sudoku-cell:nth-child(n+46):nth-child(-n+54) {
  border-bottom: 3px solid #555;
}
.r10cg-sudoku-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}
.r10cg-sudoku-btn {
  background: #222;
  border: 1px solid #444;
  color: #ccc;
  padding: 8px 18px;
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  transition: background .2s;
}
.r10cg-sudoku-btn:hover { background: var(--r10cg-red); color: #fff; border-color: var(--r10cg-red); }
.r10cg-sudoku-msg { font-family: 'Nunito', sans-serif; font-size: .9rem; color: #aaa; margin-top: 8px; min-height: 22px; }

/* ── RESPONSIVE ── */
@media (max-width: 540px) {
  .r10cg-quiz-options { grid-template-columns: 1fr; }
  .r10cg-sudoku-cell { width: 30px; height: 30px; font-size: .8rem; }
  .r10cg-games-grid-select { grid-template-columns: 1fr; }
  .r10cg-launch-btn { font-size: 1.1rem; padding: 13px 22px; }
}
