/* Reimplementación completa del tema cibernético / hacker en verde + UI layout */

/* Paleta más visible: luces más brillantes y paneles más contrastados */
:root{
  --bg: #000000;                         /* fondo negro puro */
  --panel: rgba(4,6,4,0.88);             /* panel más sólido */
  --panel-contrast: rgba(10,14,10,0.95); /* borde interior */
  --neon-green: #7CFF66;                 /* verde más brillante */
  --neon-green-strong: rgba(124,255,102,0.30);
  --neon-green-soft: rgba(124,255,102,0.10);
  --text-primary: #F1FFEF;               /* texto más claro */
  --text-muted: #AED7A8;                 /* subtítulos más legibles */
  --accent: #7CFF66;
  --glass: rgba(8,10,8,0.82);
}

/* Fondo general algo más definido (sutil vignette verde) */
html, body {
  background:
    radial-gradient(900px 400px at 10% 12%, rgba(124,255,102,0.015), transparent 6%),
    radial-gradient(700px 300px at 88% 86%, rgba(124,255,102,0.008), transparent 6%),
    linear-gradient(180deg, #000000, #030301);
  color: var(--text-primary);
}

/* Base */
*{box-sizing:border-box;font-family: "Roboto Mono", monospace;}
html,body{height:100%;margin:0;background:var(--bg);color:var(--text-primary);-webkit-font-smoothing:antialiased;position:relative;}

/* subtle scanlines and green vignette */
body::before{
  content:"";pointer-events:none;position:fixed;inset:0;
  background-image: repeating-linear-gradient(transparent 0 2px, rgba(255,255,255,0.01) 2px 3px);
  mix-blend-mode: overlay; opacity:0.7; z-index:1; box-shadow: inset 0 0 140px rgba(57,255,20,0.008);
}

/* app root container card */
#root{padding:18px;z-index:2;position:relative;}
.app-card{
  background: linear-gradient(180deg, var(--panel), rgba(10,12,10,0.82));
  border: 1px solid var(--panel-contrast);
  box-shadow:
    0 22px 70px rgba(0,0,0,0.75),
    0 0 40px rgba(124,255,102,0.03) inset;
  max-width:1100px;margin:40px auto;padding:18px;border-radius:14px;
}

/* header/title */
.header{display:flex;justify-content:space-between;align-items:center}
.title{font-weight:900;font-size:18px;color:var(--text-primary);font-family:"Roboto Mono",monospace}
.small{color:var(--text-muted);font-size:13px}

/* card inner */
.card, .body-card{background:linear-gradient(180deg, rgba(3,5,4,0.72), rgba(6,8,6,0.62));border-radius:10px;padding:14px;border:1px solid rgba(57,255,20,0.04);box-shadow:0 6px 18px rgba(0,0,0,0.55);}

/* question area with subtle green grid */
.question-area{border-radius:10px;padding:14px;background:linear-gradient(180deg, rgba(0,0,0,0.6), rgba(2,3,2,0.55));border:1px solid rgba(57,255,20,0.06);box-shadow:0 6px 18px rgba(0,0,0,0.45),0 0 20px rgba(57,255,20,0.02) inset;position:relative;overflow:hidden}
.question-area::after{content:"";position:absolute;inset:0;background-image:linear-gradient(transparent 0 28px, rgba(57,255,20,0.01) 28px 29px);opacity:0.3;pointer-events:none}
.question-text {
  font-size: 17px;
  color: var(--text-primary);
  font-weight: 800;
  margin-bottom:12px
}

/* answers: matrix green borders */
.answers-list{display:flex;flex-direction:column;gap:10px}
.answer{
  display:block;width:100%;text-align:left;padding:12px 14px;border-radius:8px;
  background: linear-gradient(90deg, rgba(10,12,10,0.76), rgba(20,24,18,0.72));
  border: 1px solid var(--neon-green-soft);
  color: var(--text-primary);
  box-shadow: 0 8px 26px rgba(0,0,0,0.66);
  transition: transform .12s ease, box-shadow .18s ease, border-color .12s ease, background .12s ease;
  cursor:pointer;
  position:relative;
  z-index:2
}
.answer:hover, .answer:focus {
  transform: translateY(-3px);
  border-color: var(--neon-green);
  box-shadow:
    0 30px 90px rgba(124,255,102,0.08),
    0 8px 26px rgba(0,0,0,0.66);
  background: linear-gradient(90deg, rgba(30,40,28,0.9), rgba(14,18,12,0.82));
}
.answer.correct {
  border-color: var(--neon-green-strong);
  box-shadow: 0 28px 80px rgba(124,255,102,0.12);
  background: linear-gradient(90deg, rgba(124,255,102,0.02), rgba(8,10,8,0.8));
}
.answer.wrong {
  border-color: rgba(255,90,100,0.28);
  box-shadow: 0 22px 60px rgba(255,90,100,0.06);
  background: linear-gradient(90deg, rgba(255,90,100,0.02), rgba(8,10,8,0.8));
}
.answer.disabled{opacity:0.5;pointer-events:none;transform:none}

/* Efecto "Matrix" en el borde de las respuestas */
.answer {
  position: relative;
  overflow: hidden;
  z-index: 2;
}

/* brillo/halo animado en el borde */
.answer::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  pointer-events: none;
  /* gradiente fino que recorre el borde */
  background: linear-gradient(90deg,
    rgba(0,0,0,0) 0%,
    rgba(124,255,102,0.18) 20%,
    rgba(124,255,102,0.28) 50%,
    rgba(124,255,102,0.18) 80%,
    rgba(0,0,0,0) 100%);
  box-shadow: 0 0 28px rgba(124,255,102,0.06) inset;
  animation: border-glow 1600ms linear infinite;
  opacity: 0.95;
}

/* líneas/ruido verde que se desplazan (pequeña ilusión de caída) */
.answer::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 6px;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(90deg, rgba(0,0,0,0) 0 6px, rgba(57,255,20,0.02) 6px 7px),
    linear-gradient(180deg, rgba(57,255,20,0.02), rgba(57,255,20,0.00) 60%);
  mix-blend-mode: screen;
  opacity: 0.8;
  transform: translateY(-35%);
  animation: matrix-fall 1600ms linear infinite;
  z-index: 1;
}

/* keyframes */
@keyframes border-glow {
  0%   { filter: drop-shadow(0 0 0 rgba(57,255,20,0)); background-position: 0% 0%; }
  50%  { filter: drop-shadow(0 0 20px rgba(57,255,20,0.16)); background-position: 100% 100%; }
  100% { filter: drop-shadow(0 0 0 rgba(57,255,20,0)); background-position: 0% 0%; }
}
@keyframes matrix-fall {
  0%   { transform: translateY(-35%); opacity: 0.25; }
  50%  { transform: translateY(0%);    opacity: 0.95; }
  100% { transform: translateY(35%);   opacity: 0.25; }
}

/* Ajustes móviles: atenuar animación para rendimiento */
@media (max-width:720px){
  .answer::before, .answer::after { animation-duration: 2800ms; opacity: 0.65; }
}

/* info pills */
.info-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:12px;
  font-weight:700;
  background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  color:var(--text-primary);
  border:1px solid rgba(57,255,20,0.04);
  font-size:13px;
  background: linear-gradient(180deg, rgba(10,12,10,0.6), rgba(18,22,16,0.5));
  border: 1px solid var(--neon-green-soft);
  color: var(--text-primary);
  font-weight: 800;
}

/* streak badge */
.streak-badge{background:linear-gradient(180deg,#2a6b4f,#19664b);color:#fff;border-radius:999px;padding:6px 10px;font-weight:800;display:inline-flex;align-items:center;gap:8px}

/* buttons */
.btn{
  border:0;
  padding:10px 16px;
  border-radius:10px;
  cursor:pointer;
  font-weight:700;
  background:rgba(255,255,255,0.03);
  color:var(--text-primary);
  font-size: 14px;
}

/* welcome layout */
.welcome-header{text-align:center;margin-bottom:14px}
.welcome-title{font-size:34px;line-height:1.05;font-weight:900;color:var(--neon-green);text-align:center;margin-bottom:6px}
.welcome-sub{color:var(--text-muted)}
.welcome-story{display:flex;gap:18px;align-items:center;justify-content:center;flex-wrap:wrap}
.welcome-santa{width:160px;height:160px;object-fit:cover;border-radius:12px;box-shadow:0 10px 30px rgba(0,0,0,0.5);animation:float 3s ease-in-out infinite}
.welcome-text{max-width:740px;color:var(--text-primary);font-size:15px;line-height:1.45}
.welcome-actions{display:flex;justify-content:center;align-items:center}

/* powerups sidebar (vertical) */
.powerups-sidebar{position:fixed;right:18px;top:120px;z-index:1200;display:flex;flex-direction:column;gap:10px;pointer-events:auto;background:linear-gradient(180deg, rgba(2,6,4,0.12), rgba(2,6,4,0.06));padding:6px;border-radius:12px;border:1px solid rgba(57,255,20,0.06);box-shadow:0 10px 30px rgba(0,0,0,0.6)}
.powerups-bar.vertical{display:flex;flex-direction:column;gap:8px;align-items:stretch}
.sidebar-pwr{
  display:flex;
  align-items:center;
  gap:8px;
  width:160px;
  padding:8px 10px;
  border-radius:10px;
  justify-content:flex-start;
  background:linear-gradient(180deg, rgba(255,255,255,0.012), rgba(255,255,255,0.008));
  border:1px solid rgba(57,255,20,0.06);
  cursor:pointer;
  color:var(--text-primary);
  font-weight:800;
  text-align:left;
  border: 1px solid var(--neon-green-soft);
  box-shadow: 0 10px 28px rgba(0,0,0,0.6);
}
.sidebar-pwr:disabled{opacity:0.5;cursor:not-allowed}
.sidebar-pwr:hover {
  border-color: var(--neon-green);
  box-shadow: 0 22px 60px rgba(124,255,102,0.08);
  transform: translateX(-6px);
}
.sidebar-pwr .pwr-icon{width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center}
.sidebar-pwr .pwr-icon svg{width:18px;height:18px;stroke:currentColor;fill:currentColor;opacity:0.95}
.sidebar-pwr .pwr-label{flex:1;font-size:13px;text-transform:none;color:var(--text-primary)}
.sidebar-pwr .pwr-count{font-size:12px;opacity:0.9;color:var(--text-muted)}

/* store items */
.store-item{background:linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.005))}
.store-icon{width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;color:var(--text-primary);opacity:0.95}
.store-icon svg{width:28px;height:28px;stroke:currentColor;fill:currentColor}

/* final overlay */
.final-overlay{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;z-index:2000;pointer-events:none}
.final-card{pointer-events:auto;max-width:920px;margin:0 20px;background:linear-gradient(180deg, rgba(2,4,2,0.96), rgba(6,10,6,0.98));border:1px solid rgba(57,255,20,0.08);box-shadow:0 30px 100px rgba(0,0,0,0.8);padding:32px 28px;border-radius:14px;text-align:center;animation:final-appear .32s ease}
.final-title{font-size:34px;font-weight:900;color:var(--text-primary);margin-bottom:12px}
.final-sub{font-size:18px;color:var(--text-primary);line-height:1.35}
.final-hide{animation:final-hide .26s ease forwards}
@keyframes final-hide{to{opacity:0;transform:translateY(8px) scale(.995)}}
@keyframes final-appear{from{opacity:0;transform:translateY(8px) scale(.995)}to{opacity:1;transform:none}}
.screen-flash{animation:screen-flash-anim .7s ease}
@keyframes screen-flash-anim{0%{filter:brightness(1)}30%{filter:brightness(1.9)}100%{filter:brightness(1)}}

/* Decoración UI: circuito / líneas neon debajo de la sección de preguntas */
.ui-decor {
  margin-top: 18px;
  padding: 8px 14px;
  height: 120px;
  width: 100%;
  display: block;
  pointer-events: none;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(0,0,0,0.0), rgba(0,0,0,0.02));
  border: 1px solid rgba(57,255,20,0.02);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6), inset 0 0 40px rgba(57,255,20,0.01);
}

.ui-decor-svg { width:100%; height:100%; display:block; }

/* líneas neon con movimiento sutil (usa stroke-dashoffset animado para ilusión de flujo) */
.ui-decor .line {
  stroke: rgba(57,255,20,0.10);
  stroke-linecap: round;
  stroke-dasharray: 480;
  stroke-dashoffset: 480;
  mix-blend-mode: screen;
}
.ui-decor .line.slow { animation: dash-move 5.6s linear infinite; opacity:0.9; }
.ui-decor .line.mid  { animation: dash-move 3.6s linear infinite reverse; opacity:0.75; }

/* nodos/chips con pulso */
.ui-decor .node {
  fill: rgba(57,255,20,0.06);
  stroke: rgba(57,255,20,0.35);
  stroke-width: 1.2;
  filter: drop-shadow(0 6px 18px rgba(57,255,20,0.03));
  transform-origin: center;
  animation: node-pulse 2.6s ease-in-out infinite;
}

/* animaciones */
@keyframes dash-move {
  0%   { stroke-dashoffset: 480; opacity: 0.5; }
  50%  { stroke-dashoffset: 240; opacity: 1; }
  100% { stroke-dashoffset: 0;   opacity: 0.5; }
}
@keyframes node-pulse {
  0%   { transform: translateY(0) scale(1); fill: rgba(57,255,20,0.05); }
  40%  { transform: translateY(-2px) scale(1.06); fill: rgba(57,255,20,0.22); }
  100% { transform: translateY(0) scale(1); fill: rgba(57,255,20,0.06); }
}

/* modo móvil: reducir altura y animaciones */
@media (max-width: 720px) {
  .ui-decor { height: 70px; margin-top:12px; padding:6px; }
  .ui-decor .line { stroke-dasharray: 320; }
  .ui-decor .node { animation-duration: 3.6s; }
}

/* Hack HUD (decoración adicional debajo de la UI) */
.hack-hud {
  margin-top: 18px;
  padding: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(0,0,0,0.48), rgba(0,0,0,0.36));
  border: 1px solid rgba(57,255,20,0.04);
  box-shadow: 0 18px 40px rgba(0,0,0,0.6), inset 0 0 30px rgba(57,255,20,0.01);
  overflow: hidden;
}

/* canvas pequeño con lluvia matrix */
.hack-canvas {
  width: 160px;
  height: 110px;
  flex: 0 0 160px;
  border-radius: 6px;
  background: rgba(0,0,0,0.75);
  border: 1px solid var(--neon-green-soft);
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}

/* log area */
.hack-log {
  flex: 1;
  min-height: 110px;
  max-height: 110px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  color: var(--neon-green);
  font-family: "Roboto Mono", monospace;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.0));
  color: var(--neon-green);
  font-weight:700;
}
.hack-log .log-inner {
  display:flex;
  flex-direction:column;
  gap:6px;
  width:100%;
}

/* each log line animated */
.log-line {
  color: rgba(57,255,20,0.9);
  opacity: 0;
  transform: translateY(6px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: logIn .48s ease forwards;
}
@keyframes logIn {
  to { opacity: 1; transform: translateY(0); }
}

/* responsive: stack on small screens */
@media (max-width: 720px) {
  .hack-hud { flex-direction: column; align-items: stretch; padding:8px; gap:8px; }
  .hack-canvas { width:100%; height:70px; flex: none; }
  .hack-log { min-height:70px; max-height:70px; }
}

/* utilities and misc */
.center{display:flex;justify-content:center;align-items:center}
.center-column{display:flex;flex-direction:column;align-items:center;gap:8px}
.fade-in{animation:fadeIn .7s ease}
@keyframes fadeIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
@keyframes float{0%{transform:translateY(0)}50%{transform:translateY(-6px)}100%{transform:translateY(0)}}

/* responsive */
@media (max-width:720px){
  .welcome-title{font-size:26px}
  .welcome-santa{width:120px;height:120px}
  .welcome-text{padding:0 8px;font-size:14px}
  .powerups-sidebar{right:12px;bottom:14px;top:auto;flex-direction:row}
  .sidebar-pwr{width:auto;padding:8px}
  .app-card{margin:18px;padding:12px}
}