/*
 * Penguin Revival: tema compartido (landing, página de play y páginas de Dash).
 * Se sirve como /theme/revival.css desde penguinrevival.lat y play.penguinrevival.lat.
 * Ojo: el launcher corre Electron 11 (Chromium 87), así que nada de :is(), :has(),
 * aspect-ratio ni nesting.
 */

:root {
  --rv-sky-900: #06326e;
  --rv-sky-800: #0a4f9e;
  --rv-sky-700: #0a6ebd;
  --rv-sky-500: #22a4f3;
  --rv-sky-300: #7fd3ff;
  --rv-sky-100: #d9f1ff;
  --rv-snow: #f4fbff;
  --rv-ink: #12305a;
  --rv-ink-soft: #4a6a8f;
  --rv-yellow-300: #ffe066;
  --rv-yellow-500: #ffc61a;
  --rv-yellow-700: #d99100;
  --rv-yellow-ink: #6a3d00;
  --rv-green: #3cc46b;
  --rv-red: #e5484d;
  --rv-radius: 18px;
  --rv-radius-lg: 26px;
  --rv-shadow: 0 10px 30px rgba(6, 50, 110, .22);
  --rv-font-display: 'Fredoka', 'Trebuchet MS', 'Arial Rounded MT Bold', sans-serif;
  --rv-font-body: 'Nunito', 'Segoe UI', Helvetica, Arial, sans-serif;
  --rv-header-h: 56px;
}

/* ---------- Base ---------- */

body.rv-site {
  margin: 0;
  min-height: 100%;
  font-family: var(--rv-font-body);
  color: var(--rv-ink);
  /* #e6e5ef es el color del borde inferior de bg-island.jpg: así el fondo no corta. */
  background: #e6e5ef url('/theme/img/bg-island.jpg') no-repeat 50% 0;
  background-size: 2000px auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.rv-site *,
.rv-site *::before,
.rv-site *::after { box-sizing: border-box; }

.rv-site h1, .rv-site h2, .rv-site h3,
.rv-display {
  font-family: var(--rv-font-display);
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.15;
}

.rv-site a { color: var(--rv-sky-700); }

.rv-container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.rv-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Nieve ---------- */

.rv-snow {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.95) 0 2px, transparent 2.5px),
    radial-gradient(circle, rgba(255,255,255,.75) 0 1.5px, transparent 2px),
    radial-gradient(circle, rgba(255,255,255,.6) 0 1px, transparent 1.5px);
  background-size: 180px 180px, 110px 110px, 70px 70px;
  background-position: 0 0, 40px 60px, 20px 30px;
  animation: rv-snowfall 22s linear infinite;
  opacity: .8;
}

@keyframes rv-snowfall {
  from { background-position: 0 0, 40px 60px, 20px 30px; }
  to   { background-position: 60px 720px, 100px 500px, 50px 350px; }
}

@media (prefers-reduced-motion: reduce) {
  .rv-snow { animation: none; }
  .rv-btn { transition: none; }
}

/* ---------- Header ---------- */

.rv-header {
  position: relative;
  z-index: 20;
  background: rgba(6, 50, 110, .78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 4px 18px rgba(6, 50, 110, .25);
}

.rv-header__bar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--rv-header-h);
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.rv-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none !important;
}

.rv-brand img { width: 38px; height: 38px; display: block; }

.rv-wordmark {
  font-family: var(--rv-font-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1;
  color: #fff;
  white-space: nowrap;
  text-shadow:
    -2px -2px 0 var(--rv-sky-900), 2px -2px 0 var(--rv-sky-900),
    -2px 2px 0 var(--rv-sky-900), 2px 2px 0 var(--rv-sky-900),
    0 3px 0 var(--rv-sky-900), 0 5px 8px rgba(0,0,0,.25);
}

.rv-wordmark b { color: var(--rv-yellow-500); font-weight: 700; }

/* Se resetean las reglas viejas de `header nav` que trae el CSS de Drupal en play. */
.rv-header nav.rv-nav {
  position: static;
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.rv-header nav.rv-nav::-webkit-scrollbar { display: none; }

.rv-header nav.rv-nav a {
  font-family: var(--rv-font-display);
  font-weight: 500;
  font-size: 16px;
  color: #fff;
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 999px;
  border: 0;
  white-space: nowrap;
  transition: background-color .2s ease, color .2s ease;
}

.rv-header nav.rv-nav a:hover,
.rv-header nav.rv-nav a:focus-visible {
  background: rgba(255,255,255,.14);
  color: var(--rv-yellow-300);
  border: 0;
}

.rv-header__right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

/* Selector de idioma.
   - Landing y play usan #bottom-languages (en play lo maneja el JS de snowball: #language-select a.top-level).
   - Dash usa .rv-lang__menu para no chocar con el #bottom-languages del CSS viejo de Drupal. */
.rv-lang { position: relative; }

.rv-lang > div { position: relative; }

.rv-lang a.top-level {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-family: var(--rv-font-display);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
}

.rv-lang a.top-level::after {
  content: '';
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
}

.rv-lang a.top-level:hover { background: rgba(255,255,255,.24); }

.rv-lang #bottom-languages,
.rv-lang .rv-lang__menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 160px;
  padding: 6px;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--rv-shadow);
  z-index: 50;
}

/* En play (.rv-lang--js) el bundle de snowball abre/cierra el menú con estilos inline. */
.rv-lang:not(.rv-lang--js):hover #bottom-languages,
.rv-lang:not(.rv-lang--js):hover .rv-lang__menu,
.rv-lang:not(.rv-lang--js):focus-within #bottom-languages,
.rv-lang:not(.rv-lang--js):focus-within .rv-lang__menu,
.rv-lang.is-open #bottom-languages,
.rv-lang.is-open .rv-lang__menu { display: block; }

/* Puente invisible para que el hover no se corte entre el botón y el menú. */
.rv-lang #bottom-languages::before,
.rv-lang .rv-lang__menu::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: -10px;
  height: 10px;
}

.rv-lang #bottom-languages a,
.rv-lang .rv-lang__menu a {
  display: block;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--rv-sky-800);
  font-family: var(--rv-font-display);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  text-transform: none;
}

.rv-lang #bottom-languages a:hover,
.rv-lang .rv-lang__menu a:hover { background: var(--rv-sky-100); }

.rv-lang #bottom-languages a.is-current,
.rv-lang .rv-lang__menu a.is-current { color: var(--rv-ink); font-weight: 700; }

/* ---------- Botones ---------- */

.rv-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 28px;
  border: 0;
  border-radius: 16px;
  font-family: var(--rv-font-display);
  font-weight: 600;
  font-size: 19px;
  line-height: 1;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
  transform: translateY(0);
  transition: transform .12s ease, box-shadow .12s ease, filter .2s ease;
}

.rv-btn:hover { filter: brightness(1.06); transform: translateY(-2px); }
.rv-btn:active { transform: translateY(3px); }
.rv-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.rv-btn--yellow {
  color: var(--rv-yellow-ink) !important;
  background: linear-gradient(180deg, var(--rv-yellow-300) 0%, var(--rv-yellow-500) 100%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.7), 0 5px 0 var(--rv-yellow-700), 0 10px 18px rgba(106,61,0,.25);
}
.rv-btn--yellow:active { box-shadow: inset 0 2px 0 rgba(255,255,255,.7), 0 2px 0 var(--rv-yellow-700), 0 4px 8px rgba(106,61,0,.2); }

.rv-btn--blue {
  color: #fff !important;
  background: linear-gradient(180deg, #49c0ff 0%, var(--rv-sky-700) 100%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.45), 0 5px 0 var(--rv-sky-900), 0 10px 18px rgba(6,50,110,.3);
  text-shadow: 0 1px 1px rgba(6,50,110,.5);
}
.rv-btn--blue:active { box-shadow: inset 0 2px 0 rgba(255,255,255,.45), 0 2px 0 var(--rv-sky-900), 0 4px 8px rgba(6,50,110,.25); }

.rv-btn--ghost {
  color: #fff !important;
  background: rgba(255,255,255,.16);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.55);
}

.rv-btn--sm { min-height: 38px; padding: 0 16px; font-size: 15px; border-radius: 12px; }
.rv-btn--lg { min-height: 62px; padding: 0 36px; font-size: 22px; border-radius: 18px; }

.rv-btn svg { width: 22px; height: 22px; flex-shrink: 0; }

/* ---------- Cards y secciones ---------- */

.rv-card {
  background: rgba(255,255,255,.94);
  border: 3px solid #fff;
  border-radius: var(--rv-radius-lg);
  box-shadow: var(--rv-shadow);
  padding: 24px;
}

.rv-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: var(--rv-font-display);
  font-weight: 500;
  font-size: 13px;
  background: var(--rv-sky-100);
  color: var(--rv-sky-800);
}

.rv-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--rv-green);
  box-shadow: 0 0 0 3px rgba(60,196,107,.25);
}

/* ---------- Footer ---------- */

.rv-footer {
  position: relative;
  z-index: 1;
  margin-top: 48px;
  padding: 28px 0 32px;
  background: var(--rv-sky-900);
  color: rgba(255,255,255,.78);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

.rv-footer a { color: #fff; text-decoration: none; font-weight: 700; }
.rv-footer a:hover { color: var(--rv-yellow-300); }

.rv-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
  margin-bottom: 10px;
}

.rv-footer__legal { font-size: 12.5px; opacity: .8; max-width: 720px; margin: 0 auto; }

/* =====================================================================
   Página de play (play.penguinrevival.lat/{lang}/)
   El CSS viejo de Drupal sigue cargado: maneja el tamaño del juego
   (#D_F_GameSection, #cp_flash, #mp_client). Acá solo se pisa lo visual
   del landing, que el JS borra (#billboards, #actions) al entrar al juego.
   ===================================================================== */

body.rv-play {
  --rv-header-h: 50px;
  height: 100%;
  line-height: 1.5;
  color: var(--rv-ink);
}

body.rv-play #page { height: 100%; }

body.rv-play .rv-snow { z-index: 0; }

body.rv-play header.rv-header { z-index: 20; }

/* En el juego: sin nieve ni footer, fondo cielo para el letterbox. */
body.rv-play.flash .rv-snow,
body.rv-play.flashUpgrade .rv-snow,
body.rv-play.mplarge .rv-snow,
body.rv-play.mpsmall .rv-snow,
body.rv-play.flash .rv-footer,
body.rv-play.flashUpgrade .rv-footer,
body.rv-play.mplarge .rv-footer,
body.rv-play.mpsmall .rv-footer { display: none; }

body.rv-play.flash,
body.rv-play.mplarge,
body.rv-play.mpsmall {
  background: var(--rv-sky-500) linear-gradient(180deg, var(--rv-sky-500) 0%, #5cc4ff 100%);
}

body.rv-play .logout {
  display: none;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-family: var(--rv-font-display);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
}

body.rv-play .logout:hover { background: var(--rv-red); }

body.rv-play main section#billboards {
  position: relative;
  z-index: 1;
  width: auto;
  max-width: 980px;
  min-height: 0;
  margin: 28px auto 0;
  padding: 0 16px;
}

body.rv-play .rv-hero-art {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--rv-radius-lg);
  border: 4px solid #fff;
  box-shadow: var(--rv-shadow);
  background: var(--rv-sky-300);
}

body.rv-play main section#actions {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px 24px;
  width: auto;
  min-width: 0;
  max-width: 860px;
  height: auto;
  margin: -44px 16px 0;
  padding: 22px 24px;
  background: rgba(255,255,255,.95);
  border: 3px solid #fff;
  border-radius: var(--rv-radius-lg);
  box-shadow: var(--rv-shadow);
  text-align: center;
}

/* El CSS viejo tiene `main section#actions div {top:-40px; height:143px; padding-top:62px}`
   y además posiciona #create/#login en absoluto con pingüinos de fondo. */
body.rv-play main section#actions div,
body.rv-play main section#actions div#create,
body.rv-play main section#actions div#login {
  position: static;
  top: auto;
  display: block;
  width: auto;
  height: auto;
  padding: 0;
  background: none;
  text-align: center;
}

body.rv-play main section#actions .rv-actions__copy {
  flex: 1 1 260px;
  text-align: left;
}

body.rv-play main section#actions .rv-actions__copy h1 {
  margin: 0 0 2px;
  font-size: 26px;
  color: var(--rv-sky-800);
}

body.rv-play main section#actions .rv-actions__copy p {
  margin: 0;
  color: var(--rv-ink-soft);
  font-size: 15px;
}

body.rv-play main section#actions .rv-actions__links {
  flex: 1 1 100%;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 14px;
}

body.rv-play main section#actions .rv-actions__links a {
  color: var(--rv-sky-700);
  font-weight: 700;
  text-decoration: none;
}

body.rv-play main section#actions .rv-actions__links a:hover { text-decoration: underline; }

/* #banner (aviso de activación) vive dentro del header; el JS lo muestra. */
@media (min-width: 892px) {
  body.rv-play main section#actions { margin-left: auto; margin-right: auto; }
}

/* El CSS viejo fija `footer {width:980px; font-size:10px}`. */
body.rv-play footer.rv-footer {
  width: auto;
  margin-top: 40px;
  padding: 24px 0 28px;
  font-size: 14px;
}

body.rv-play header #banner {
  width: auto;
  max-width: 980px;
  color: var(--rv-yellow-ink);
}

@media (max-width: 720px) {
  body.rv-play main section#actions { margin-top: 16px; }
  body.rv-play main section#actions .rv-actions__copy { text-align: center; }
}

/* =====================================================================
   Páginas de Dash (crear cuenta, activar, contraseña)
   ===================================================================== */

/* El CSS viejo fija `body {min-width:960px}` y `body.full-page-flow {background:#117ad0 !important}`. */
body.rv-dash { min-width: 0; }

body.rv-dash.full-page-flow {
  background-color: #e6e5ef !important;
  background-image: url('/theme/img/bg-island.jpg') !important;
  background-repeat: no-repeat !important;
  background-position: 50% 0 !important;
  background-size: 2000px auto !important;
}

/* Omega deja .grid-12 flotando a la izquierda; sin esto la tarjeta de contraseña no se centra. */
body.rv-dash .grid-12 { float: none; }

body.rv-dash #page { position: relative; z-index: 1; }

body.rv-dash .page,
body.rv-dash #section-content,
body.rv-dash #section-content #zone-content-wrapper,
body.rv-dash #section-content #zone-content-wrapper #zone-content {
  width: auto;
  background: transparent;
  box-shadow: none;
}

/* El formulario (crear cuenta / activar) pasa a ser una tarjeta centrada. */
body.rv-dash #overlay-wrapper {
  width: auto;
  max-width: 1020px;
  margin: 28px auto 0;
  border: 4px solid #fff;
  border-radius: var(--rv-radius-lg);
  box-shadow: var(--rv-shadow);
}

body.rv-dash #overlay-header { border-radius: 22px 22px 0 0; }

@media (max-width: 1052px) {
  body.rv-dash #overlay-wrapper { margin-left: 16px; margin-right: 16px; }
}

/* Contraseña: el texto y el form quedan en una tarjeta blanca. */
body.rv-dash #parent-tools {
  background: rgba(255,255,255,.95);
  border: 3px solid #fff;
  border-radius: var(--rv-radius-lg);
  box-shadow: var(--rv-shadow);
  padding: 28px;
  margin: 28px auto 0;
  max-width: 900px;
  color: var(--rv-ink);
}

@media (max-width: 932px) {
  body.rv-dash #parent-tools { margin-left: 16px; margin-right: 16px; }
}

body.rv-dash #page-title { display: none; }

body.rv-dash input.form-text,
body.rv-dash input[type="password"] {
  border-radius: 12px;
}

body.rv-dash input.form-text:focus,
body.rv-dash input[type="password"]:focus {
  outline: none;
  border-color: var(--rv-sky-500);
  box-shadow: 0 0 0 3px rgba(34,164,243,.25);
}

body.rv-dash #parent-tools .form-submit,
body.rv-dash #penguin-activate .form-submit {
  font-family: var(--rv-font-display);
}

/* ---------- Responsive general ---------- */

@media (max-width: 760px) {
  .rv-header nav.rv-nav { display: none; }
  .rv-wordmark { font-size: 19px; }
  .rv-btn--lg { min-height: 56px; padding: 0 26px; font-size: 20px; }
}

@media (max-width: 420px) {
  .rv-wordmark { display: none; }
}
