/* ==========================================================================
   Sami poseído — juego 4.
   Un televisor y un video abajo. Todo lo que se ve pasa adentro del vidrio.
   ========================================================================== */

.sam-intro {
  padding: clamp(34px, 6vw, 66px) 0 clamp(14px, 2.4vw, 22px);
  background: linear-gradient(180deg, #14090b, transparent 90%);
}

.sam-intro h1 {
  font-size: clamp(1.9rem, 5.2vw, 2.9rem);
  line-height: 1.06;
  letter-spacing: -.024em;
  margin: .18em 0 .5em;
}

.sam-intro .lead { max-width: 62ch; }
.sam-intro .eyebrow a { color: inherit; }

.sam-seccion { padding: 0 0 clamp(44px, 6vw, 76px); }

.sam {
  max-width: 720px;
  margin: 0 auto;
}

/* ------------------------------------------------------------- la barra -- */

.sam-barra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sam-acciones { display: flex; gap: 7px; }

.sam-btn {
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-0);
  color: var(--text-secondary);
  font: inherit;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sam-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.sam-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sam-btn[aria-pressed="true"] { border-color: var(--brand); color: var(--brand); }

/* ---------------------------------------------------------- el televisor -- */

.tele { display: block; }

.tele-marco {
  position: relative;
  padding: 18px 18px 30px;
  border-radius: 18px 18px 10px 10px;
  background: linear-gradient(180deg, #2b2725, #171413 62%, #0f0d0c);
  box-shadow: 0 20px 46px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .07);
}

/* El vidrio es el que redondea: una tele de tubo no tiene esquinas. */
.tele-vidrio {
  position: relative;
  overflow: hidden;
  border-radius: 26px / 20px;
  background: #05060a;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .95), 0 0 0 3px #0a0908;
}

.tele-vidrio canvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

/* Brillo del tubo y curvatura. No toca los eventos del mouse. */
.tele-vidrio::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, .1), transparent 46%),
    radial-gradient(130% 110% at 50% 50%, transparent 52%, rgba(0, 0, 0, .72) 100%);
}

.tele-marca {
  position: absolute;
  left: 50%;
  bottom: 9px;
  transform: translateX(-50%);
  font-size: .56rem;
  letter-spacing: .42em;
  color: #6b5f59;
}

/* ------------------------------------------------------ texto en pantalla -- */

.osd {
  position: absolute;
  top: 14px; left: 18px;
  margin: 0;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: clamp(.72rem, 2.1vw, .92rem);
  letter-spacing: .1em;
  color: #cfe8ff;
  text-shadow: 0 0 8px rgba(120, 190, 255, .55);
  pointer-events: none;
}

.osd[hidden] { display: none; }

.subtitulo {
  position: absolute;
  left: 6%; right: 6%; bottom: 7%;
  margin: 0;
  text-align: center;
  font-size: clamp(.8rem, 2.4vw, 1rem);
  line-height: 1.45;
  font-weight: 600;
  color: #f4ead8;
  text-shadow: 0 2px 0 #000, 0 0 12px rgba(0, 0, 0, .95);
  pointer-events: none;
}

.subtitulo[hidden] { display: none; }
.subtitulo.mal { color: #ff9a8f; font-style: italic; }

/* --------------------------------------------------------------- saltar -- */
/* Va adentro del vidrio, arriba a la derecha: es la única cosa de la
   interfaz que no pertenece al televisor, así que se queda discreta hasta
   que la apuntás. */

.saltar {
  position: absolute;
  top: 12px; right: 14px;
  z-index: 2;
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid rgba(226, 216, 200, .3);
  border-radius: 999px;
  background: rgba(10, 8, 8, .62);
  color: #d8cdbd;
  font: inherit;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .62;
  transition: opacity .16s ease, border-color .16s ease, color .16s ease;
}

.saltar[hidden] { display: none; }

.saltar:hover { opacity: 1; border-color: #e2d8c8; color: #fff; }
.saltar:focus-visible { opacity: 1; outline: 2px solid #6ef2a8; outline-offset: 2px; }

@media (max-width: 480px) {
  .saltar { top: 9px; right: 10px; padding: 6px 10px; font-size: .66rem; }
}

/* --------------------------------------------------------- las pantallas -- */

.pant {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 5%;
  background: rgba(4, 3, 3, .93);
  z-index: 3;
}

/* La regla del agente de usuario para [hidden] pierde contra display:grid,
   que es igual de específica y viene después. Sin esto la pantalla nunca se
   esconde y se come todos los clics del juego. */
.pant[hidden] { display: none; }

.pant-caja {
  max-width: 46ch;
  text-align: center;
  color: #e8ded0;
}

.pant-kicker {
  margin: 0 0 6px;
  font-size: .66rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: #a8352c;
}

.pant-caja h2 {
  margin: 0 0 12px;
  font-size: clamp(1.2rem, 4vw, 1.7rem);
  line-height: 1.16;
  color: #fff;
}

.pant-caja p, .pant-texto p {
  margin: 0 0 12px;
  font-size: clamp(.82rem, 2.3vw, .94rem);
  line-height: 1.62;
  color: #c3b7a8;
}

.pant-texto em { color: #e0d3c2; }
.pant-texto strong { color: #fff; }

.pant-aviso {
  padding: 9px 12px;
  border: 1px solid rgba(168, 53, 44, .5);
  border-radius: 6px;
  background: rgba(168, 53, 44, .12);
  color: #e79a90 !important;
  font-weight: 600;
}

.pant-cta {
  appearance: none;
  cursor: pointer;
  margin-top: 4px;
  padding: 11px 22px;
  border: 0;
  border-radius: 6px;
  background: #a8352c;
  color: #fff;
  font: inherit;
  font-weight: 700;
  letter-spacing: .02em;
}

.pant-cta:hover { background: #c04236; }
.pant-cta:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.pant-cta[hidden] { display: none; }

.pant-cta-2 {
  margin-left: 8px;
  background: transparent;
  border: 1px solid #6a5b52;
  color: #d7cabb;
}

.pant-cta-2:hover { background: rgba(255, 255, 255, .08); }

.pant-pie { margin: 14px 0 0; font-size: .78rem; }
.pant-pie a { color: #9d8d80; }

.final-botones { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; }

.pant-final.es-peor { background: rgba(30, 3, 3, .95); }
.pant-final.es-peor .pant-kicker { color: #ff6a5a; }

/* ------------------------------------------------------------ el aparato -- */

.deck { margin-top: 12px; }

.deck-cara {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  padding: 14px 16px;
  border-radius: 10px;
  background: linear-gradient(180deg, #232120, #141211);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .06);
}

.deck-contador {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 12px;
  border-radius: 5px;
  background: #07100c;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, .9);
  min-width: 108px;
}

.contador-num {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 1.06rem;
  letter-spacing: .06em;
  color: #6ef2a8;
  text-shadow: 0 0 10px rgba(110, 242, 168, .5);
}

.contador-modo {
  font-size: .56rem;
  letter-spacing: .2em;
  color: #3f8f66;
}

.deck-botones { display: flex; flex-wrap: wrap; gap: 6px; }

.tecla {
  appearance: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 52px;
  padding: 8px 9px 6px;
  border: 1px solid #3a3532;
  border-radius: 5px;
  background: linear-gradient(180deg, #37322f, #221f1d);
  color: #c8bdb4;
  font: inherit;
  font-size: .54rem;
  letter-spacing: .14em;
}

.tecla:hover { background: linear-gradient(180deg, #453f3b, #2a2624); color: #fff; }
.tecla:active { transform: translateY(1px); }
.tecla:focus-visible { outline: 2px solid #6ef2a8; outline-offset: 2px; }
.tecla[hidden] { display: none; }
.tecla[disabled] { opacity: .4; cursor: default; }

.tecla-apretada,
.tecla-play.tecla-apretada { border-color: #6ef2a8; color: #6ef2a8; }

.tecla-marcar { border-color: #a8352c; color: #e79a90; }
.tecla-marcar:hover { color: #fff; }

.deck-perillas { display: flex; flex-wrap: wrap; gap: 12px 16px; flex: 1; min-width: 200px; }

.perilla { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 130px; }
.perilla[hidden] { display: none; }

.perilla-rot {
  font-size: .54rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #8d827a;
}

.perilla input[type="range"] {
  width: 100%;
  accent-color: #6ef2a8;
  cursor: pointer;
}

.perilla-audio input[type="range"] { accent-color: #d9705f; }

.deck-pista {
  margin: 10px 0 0;
  font-size: .84rem;
  line-height: 1.55;
  color: var(--text-secondary);
  min-height: 2.6em;
}

.deck-pista strong { color: var(--text-primary); }

/* -------------------------------------------------------- mando táctil -- */

.mandos { display: none; gap: 8px; margin-top: 10px; }

.mando {
  appearance: none;
  cursor: pointer;
  flex: 1;
  padding: 15px 0;
  border: 1px solid #3a3532;
  border-radius: 8px;
  background: #221f1d;
  color: #c8bdb4;
  font-size: 1.1rem;
}

.mando:active { background: #37322f; }

@media (hover: none) and (pointer: coarse) {
  .mandos:not([hidden]) { display: flex; }
}

/* ------------------------------------------------------------ el cuaderno -- */

.sam-cuaderno {
  max-width: 720px;
  margin: clamp(30px, 5vw, 52px) auto 0;
  padding-top: clamp(22px, 3.4vw, 32px);
  border-top: 1px solid var(--border);
}

.sam-cuaderno h2 {
  margin: 0 0 16px;
  font-size: 1.16rem;
  letter-spacing: -.012em;
}

.cuaderno-cols {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.cuaderno-cols h3 {
  margin: 0 0 6px;
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cuaderno-cols p {
  margin: 0;
  font-size: .88rem;
  line-height: 1.62;
  color: var(--text-secondary);
}

.cuaderno-pie {
  margin: 22px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: .78rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ------------------------------------------------------------ sólo lector -- */

.sam-sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .tecla:active { transform: none; }
  .saltar { transition: none; }
}
