/* «Cómo se juega» on the big screen (screen/tutorial.js): the TV studio is a
   canvas filling the stage; the board, one card at a time on the right, the
   minigames' cards, the name plates and the host's words lie over it. Sizes
   follow the screen (vw/vh); the plates, bubbles and points follow the
   characters (--tut-unit: one world unit in pixels, set every frame). */

.tut { flex: 1; position: relative; overflow: hidden; min-height: 0; }
.tut__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tut__shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 9, 22, 0.7) 0%, rgba(8, 9, 22, 0) 16%),
    linear-gradient(0deg, rgba(8, 9, 22, 0.75) 0%, rgba(8, 9, 22, 0) 30%);
}

/* the band: the show, the explanation, the chapter it is in */
.tut__band {
  position: absolute; left: 2.4vw; top: 2.2vh; right: 2.4vw;
  display: flex; align-items: center; gap: 1.4vw;
  opacity: 0; transform: translateY(-1vh); transition: opacity 0.5s, transform 0.5s var(--p-motion-ease);
}
.tut__band.is-on { opacity: 1; transform: none; }
.tut__brand { color: #ffd23f; font-size: clamp(0.9rem, 1.6vw, 2rem); letter-spacing: 0.04em; text-shadow: 0 0.3vh 1.4vh rgba(255, 140, 60, 0.55); }
.tut__title { font-weight: var(--p-font-weight-bold); font-size: clamp(0.85rem, 1.45vw, 1.8rem); color: #fff; opacity: 0.9; }
.tut__chapters { margin-left: 1.4vw; display: flex; gap: 0.6vw; }   /* (left: the corner is the pause badge's) */
.tut-chapter {
  padding: 0.5vh 0.9vw; border-radius: var(--p-border-radius-full);
  font-size: clamp(0.65rem, 0.95vw, 1.15rem); font-weight: var(--p-font-weight-semibold);
  color: rgba(255, 255, 255, 0.55); background: rgba(14, 16, 30, 0.6); border: 1px solid rgba(255, 255, 255, 0.14);
  transition: background 0.3s, color 0.3s, transform 0.3s var(--p-motion-ease-bounce);
}
.tut-chapter.is-done { color: rgba(255, 255, 255, 0.82); }
.tut-chapter.is-done::before { content: '✓ '; color: #7dffa9; }
.tut-chapter.is-now { color: #1c2030; background: #ffd23f; border-color: #ffd23f; transform: scale(1.08); }

/* the example question, as the big screen shows one */
.tut-board { position: absolute; left: 3vw; top: 9.5vh; width: 56vw; display: flex; flex-direction: column; gap: 1.4vh; animation: opt-in 0.5s var(--p-motion-ease) backwards; }
.tut-board .qview__timebar { margin: 0; height: 1.3vh; border-radius: var(--p-border-radius-full); overflow: hidden; }
.tut-board .qview__timebar-fill { transition: transform 0.25s linear; }
.tut-board__card { position: relative; margin-top: 0; min-height: 9vh; font-size: clamp(1rem, 2.1vw, 2.6rem); padding: 1.6vh 2vw; }
.tut-board__sticker {
  position: absolute; right: 1.4vw; bottom: -2vh; z-index: 2;
  padding: 0.7vh 1vw; border-radius: var(--p-border-radius-300);
  background: #ffca3a; color: #1c2030; box-shadow: var(--p-shadow-300);
  font-family: var(--p-font-family-display); font-size: clamp(0.8rem, 1.3vw, 1.6rem);
  transform: rotate(-3deg); animation: tut-pop 0.45s var(--p-motion-ease-bounce) backwards;
}
.tut-board__options { margin-top: 0; gap: 1.2vh 1vw; }
.tut-board .opt { min-height: 7vh; font-size: clamp(0.9rem, 1.65vw, 2rem); transition: filter 0.35s, transform 0.3s var(--p-motion-ease-bounce), box-shadow 0.3s; }
.tut-board .opt__letter { font-size: clamp(0.9rem, 1.6vw, 1.9rem); }
.tut-board .opt.is-dim { filter: brightness(0.42) saturate(0.55); }
.tut-board .opt.is-lit { transform: scale(1.06); box-shadow: var(--opt-edge), 0 0 0 0.45vh #fff, 0 0 2.4vw rgba(255, 255, 255, 0.55); }
.tut-board .opt__teams { display: none; }
.tut-board .opt.is-revealed .opt__teams { display: flex; }
.tut-board.is-drumroll .opt { animation: opt-chase 0.72s linear infinite; }
.tut-board.is-drumroll .opt:nth-child(2) { animation-delay: 0.18s; }
.tut-board.is-drumroll .opt:nth-child(4) { animation-delay: 0.36s; }
.tut-board.is-drumroll .opt:nth-child(3) { animation-delay: 0.54s; }

/* the side panel: one card at a time */
.tut__panel {
  position: absolute; right: 2.4vw; top: 9.5vh; bottom: 19.5vh; width: 34vw;
  display: flex; align-items: center; justify-content: center;
}
.tut-card {
  width: 100%; max-height: 100%; padding: 2.2vh 1.6vw;
  display: flex; flex-direction: column; gap: 1.6vh;
  background: rgba(14, 16, 30, 0.9); border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--p-border-radius-400); box-shadow: var(--p-shadow-300);
  animation: tut-card-in 0.5s var(--p-motion-ease-bounce) backwards;
}
@keyframes tut-card-in { from { opacity: 0; transform: translateX(4vw) scale(0.94); } }
.tut-card__title { color: #ffe08a; font-size: clamp(0.85rem, 1.35vw, 1.7rem); letter-spacing: 0.06em; text-align: center; }
.tut-card__lead { margin: 0; font-size: clamp(0.85rem, 1.35vw, 1.7rem); font-weight: var(--p-font-weight-bold); text-align: center; }
.tut-card__note { margin: 0; color: rgba(255, 255, 255, 0.78); font-size: clamp(0.72rem, 1.05vw, 1.3rem); line-height: 1.3; text-align: center; animation: opt-in 0.4s var(--p-motion-ease) backwards; }

/* a phone, drawn as the players hold it (play.css's answer buttons, at screen size) */
.tut-phone { position: relative; width: 15vw; display: flex; flex-direction: column; align-items: center; gap: 0.8vh; }
.tut-phone--mini { width: 9.4vw; }
.tut-phone__label { font-weight: var(--p-font-weight-bold); font-size: clamp(0.7rem, 1vw, 1.25rem); color: #fff; }
.tut-phone__screen {
  width: 100%; padding: 1.4vh 0.7vw 1.6vh; display: flex; flex-direction: column; gap: 0.9vh;
  background: #10131f; border: 0.45vw solid #2a2f45; border-radius: 1.6vw;
  box-shadow: 0 1.4vh 3vh rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.tut-phone__head { display: flex; justify-content: center; }
.tut-phone__head .team-chip { font-size: clamp(0.6rem, 0.85vw, 1.05rem); padding: 0.3vh 0.6vw; max-width: 100%; white-space: nowrap; }
.tut-phone--mini .tut-phone__head .team-chip { font-size: clamp(0.5rem, 0.62vw, 0.8rem); }
.tut-chip__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tut-phone__q { padding: 0.8vh 0.6vw; border-radius: var(--p-border-radius-200); background: #eef0fb; color: #1c2030; font-weight: var(--p-font-weight-bold); font-size: clamp(0.62rem, 0.9vw, 1.1rem); line-height: 1.2; }
.tut-phone__answers { display: flex; flex-direction: column; gap: 0.75vh; }
.tut-btn {
  --tut-edge: inset 0 -0.45vh 0 var(--answer-deep, transparent);
  display: flex; align-items: center; gap: 0.6vw; min-height: 5vh; padding: 0.5vh 0.6vw 0.8vh;
  border-radius: var(--p-border-radius-300);
  background-color: var(--answer-fill); color: var(--answer-text);
  font-weight: var(--p-font-weight-bold); font-size: clamp(0.65rem, 1vw, 1.25rem);
  box-shadow: var(--tut-edge);
  transition: box-shadow 0.2s, background-image 0.2s;
}
.tut-phone--mini .tut-btn { min-height: 3.5vh; justify-content: center; padding: 0.4vh 0.3vw 0.6vh; }
.tut-btn .answer-medallion { font-size: clamp(0.7rem, 1.1vw, 1.35rem); }
.tut-phone--mini .tut-btn .answer-medallion { font-size: clamp(0.55rem, 0.8vw, 1rem); }
.tut-btn__text { flex: 1; min-width: 0; }
.tut-btn__check { display: none; }
.tut-btn.is-picked { box-shadow: var(--tut-edge), 0 0 0 0.25vw #10131f, 0 0 0 0.5vw #fff; }
.tut-btn.is-picked .tut-btn__check {
  display: grid; place-items: center; flex-shrink: 0; width: 1.6vw; height: 1.6vw; border-radius: 50%;
  background: var(--p-color-bg-answer-medallion); color: #fff; font-size: 0.95vw; font-weight: 900;
  box-shadow: 0 0 0 2px var(--p-color-border-answer-medallion);
}
.tut-phone--mini .tut-btn.is-picked .tut-btn__check { position: absolute; right: -0.5vw; width: 1.2vw; height: 1.2vw; font-size: 0.7vw; }
.tut-phone--mini .tut-btn { position: relative; }
.tut-btn.is-unpicked { background-image: linear-gradient(rgba(14, 16, 24, 0.6), rgba(14, 16, 24, 0.6)); color: rgba(255, 255, 255, 0.85); box-shadow: none; }
.tut-btn.is-star .answer-medallion, .tut-phone.is-glow .answer-medallion { animation: tut-medallion 0.8s ease-in-out infinite alternate; }
@keyframes tut-medallion { to { box-shadow: 0 0 0 0.16em #ffd23f, 0 0 1.6vw rgba(255, 210, 63, 0.95); transform: scale(1.15); } }
.tut-phone__status { color: rgba(255, 255, 255, 0.75); font-size: clamp(0.55rem, 0.78vw, 0.95rem); line-height: 1.25; text-align: center; min-height: 2.4em; }
.tut-phone.is-synced .tut-phone__screen { animation: tut-sync 0.9s ease-out; }
@keyframes tut-sync { 0% { box-shadow: 0 0 0 0 rgba(125, 255, 169, 0.9); } 100% { box-shadow: 0 0 0 1.6vw rgba(125, 255, 169, 0); } }
.tut-finger {
  position: absolute; right: -1.6vw; z-index: 3;
  font-size: clamp(1.4rem, 2.6vw, 3.2rem); line-height: 1; pointer-events: none;
  transform: translateY(-20%) rotate(-25deg);
  animation: tut-tap 0.7s ease-in-out infinite;
  filter: drop-shadow(0 0.4vh 0.8vh rgba(0, 0, 0, 0.6));
}
.tut-phone--mini .tut-finger { right: -1.2vw; font-size: clamp(1.1rem, 2vw, 2.4rem); }
@keyframes tut-tap { 50% { transform: translate(-0.6vw, -10%) rotate(-25deg) scale(0.9); } }
.tut-mates { display: flex; justify-content: center; gap: 1.1vw; }

.tut-stack { position: relative; display: flex; justify-content: center; padding: 3.2vh 0 0 7.5vw; }
.tut-stack > .tut-phone--mini { position: absolute; left: 0; top: 7vh; transform: rotate(-7deg); opacity: 0.94; animation: tut-card-in 0.5s var(--p-motion-ease-bounce) backwards; }
.tut-stack > .tut-phone:not(.tut-phone--mini) { z-index: 1; }
.tut-say {
  position: absolute; right: -0.6vw; top: 0; z-index: 2;
  padding: 0.8vh 1vw; border-radius: var(--p-border-radius-400);
  background: #fff; color: #1c2030; box-shadow: var(--p-shadow-300);
  font-family: var(--p-font-family-display); font-size: clamp(0.85rem, 1.35vw, 1.7rem);
  transform: rotate(4deg); animation: tut-pop 0.45s var(--p-motion-ease-bounce) backwards;
}
.tut-say--rival { left: 0.4vw; right: auto; top: auto; bottom: -1vh; background: #3a4060; color: #fff; transform: rotate(-5deg); font-family: var(--p-font-family-body); font-weight: 900; }
.tut-last {
  align-self: center; padding: 0.8vh 1.1vw; border-radius: var(--p-border-radius-full);
  background: rgba(255, 202, 58, 0.16); border: 2px solid #ffca3a; color: #ffe08a;
  font-weight: var(--p-font-weight-bold); font-size: clamp(0.72rem, 1.1vw, 1.35rem);
  animation: tut-pop 0.45s var(--p-motion-ease-bounce) backwards;
}

/* the points: what an answer is worth as the clock runs */
.tut-gauge {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label label" "track value" "ends value";
  column-gap: 1vw; row-gap: 0.5vh; align-items: center;
  animation: opt-in 0.4s var(--p-motion-ease) backwards;
}
.tut-gauge__label { grid-area: label; font-weight: var(--p-font-weight-bold); font-size: clamp(0.8rem, 1.2vw, 1.5rem); }
.tut-gauge__track { grid-area: track; position: relative; height: 2.2vh; border-radius: var(--p-border-radius-full); background: rgba(255, 255, 255, 0.12); }
.tut-gauge__fill { position: absolute; inset: 0; border-radius: inherit; transform-origin: left; transform: scaleX(0); }
.tut-gauge--right .tut-gauge__fill { background: linear-gradient(90deg, #22c55e, #a3e635); }
.tut-gauge--wrong .tut-gauge__fill { background: linear-gradient(90deg, #fca5a5, #ef4444); }
.tut-gauge__marker {
  position: absolute; top: -0.7vh; width: 0.5vw; height: 3.6vh; border-radius: var(--p-border-radius-full);
  background: #fff; box-shadow: 0 0 1vw rgba(255, 255, 255, 0.7); transform: translateX(-50%);
}
.tut-gauge__ends { grid-area: ends; display: flex; justify-content: space-between; color: rgba(255, 255, 255, 0.65); font-size: clamp(0.6rem, 0.85vw, 1.05rem); }
.tut-gauge__value { grid-area: value; min-width: 5.4vw; text-align: right; font-family: var(--p-font-family-display); font-size: clamp(1.3rem, 2.6vw, 3.2rem); font-variant-numeric: tabular-nums; }
.tut-gauge--right .tut-gauge__value { color: #7dffa9; }
.tut-gauge--wrong .tut-gauge__value { color: #ff8f8f; }
.tut-gauge--none { grid-template-areas: "label value"; }
.tut-gauge--none .tut-gauge__value { color: #e4e8f6; }

/* the table: the real standings' rows, reordering */
.tut-rows { position: relative; height: 31vh; }
.tut-row.stand-row { height: 22%; font-size: clamp(0.8rem, 1.3vw, 1.6rem); padding: 0 1vw; gap: 0.8vw; }
.tut-row .team-chip { background: rgba(10, 12, 24, 0.35) !important; color: #fff !important; font-size: 0.9em; }
.tut-row .stand-row__rank { width: 2.8vw; }
.tut-rows--static { height: auto; display: flex; flex-direction: column; gap: 1vh; }
.tut-rows--static .stand-row { position: static; height: 5.6vh; }
.tut-row.is-hidden .stand-row__pts { font-family: var(--p-font-family-display); letter-spacing: 0.1em; opacity: 0.85; }

/* the game master */
.tut-gm__name { text-align: center; font-size: clamp(2rem, 5vw, 6.4rem); color: #ffd23f; line-height: 1; text-shadow: 0 0.5vh 0 #b4361f, 0 0 3vw rgba(255, 150, 60, 0.6); }
.tut-gm__list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 1.2vh; }
.tut-gm__list li { padding: 1vh 1vw; border-radius: var(--p-border-radius-300); background: rgba(255, 255, 255, 0.07); font-size: clamp(0.8rem, 1.3vw, 1.6rem); font-weight: var(--p-font-weight-semibold); animation: tut-pop 0.45s var(--p-motion-ease-bounce) backwards; }

/* tonight's minigames: their painted cards */
.tut-montage { position: absolute; left: 3vw; right: 3vw; top: 9.5vh; display: flex; flex-direction: column; align-items: center; gap: 1.6vh; }
.tut-montage__row { display: flex; justify-content: center; gap: 1.1vw; width: 100%; padding-bottom: 1.8vh; }
.tut-game {
  position: relative; flex: 0 1 17vw; aspect-ratio: 16 / 9; border-radius: var(--p-border-radius-400);
  background: linear-gradient(135deg, #3b1d7a, #1b1048); box-shadow: var(--p-shadow-300), 0 0 0 3px rgba(255, 255, 255, 0.85);
  opacity: 0; transform: translateY(-6vh) scale(0.6) rotate(-6deg);
  transition: opacity 0.35s, transform 0.55s var(--p-motion-ease-bounce);
}
.tut-game.is-in { opacity: 1; transform: none; }
.tut-montage.is-same .tut-game.is-in { transform: scale(0.88); }
.tut-game__art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.tut-game__fallback { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 0.5vh; font-size: clamp(1rem, 2.2vw, 2.6rem); text-align: center; }
.tut-game__fallback b { font-size: 0.5em; }
.tut-game__title {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 0.4vh 0.6vw;
  background: linear-gradient(0deg, rgba(8, 9, 22, 0.85), rgba(8, 9, 22, 0)); color: #fff; border-radius: 0 0 var(--p-border-radius-400) var(--p-border-radius-400);
  font-weight: var(--p-font-weight-bold); font-size: clamp(0.6rem, 0.95vw, 1.15rem); text-align: center;
}
.tut-game__badge {
  position: absolute; left: 50%; bottom: -1.6vh; transform: translateX(-50%); white-space: nowrap; padding: 0.3vh 0.7vw; border-radius: var(--p-border-radius-full);
  background: #16a34a; color: #fff; font-weight: 900; font-size: clamp(0.55rem, 0.85vw, 1.05rem);
  box-shadow: var(--p-shadow-200); animation: tut-pop 0.45s var(--p-motion-ease-bounce) backwards;
}
.tut-game__badge.is-risky { background: linear-gradient(90deg, #16a34a 50%, #dc2626 50%); }
.tut-montage__same {
  padding: 1vh 1.6vw; border-radius: var(--p-border-radius-full);
  background: #ffd23f; color: #1c2030; box-shadow: var(--p-shadow-300);
  font-family: var(--p-font-family-display); font-size: clamp(0.8rem, 1.45vw, 1.8rem);
  animation: tut-pop 0.5s var(--p-motion-ease-bounce) backwards;
}

/* plates under the feet, bubbles over the heads, points by the head */
.tut__labels { position: absolute; inset: 0; pointer-events: none; }
.tut-plate { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 0.4vh; will-change: transform; }
.tut-plate .team-chip { white-space: nowrap; font-size: clamp(0.62rem, calc(var(--tut-unit, 80px) * 0.17), 1.4rem); box-shadow: var(--p-shadow-200); }
.tut-plate__medal { font-size: clamp(1rem, calc(var(--tut-unit, 80px) * 0.36), 3rem); line-height: 1; }
.tut-plate__medal:empty { display: none; }
.tut-plate--host .team-chip { font-size: clamp(0.6rem, calc(var(--tut-unit, 80px) * 0.15), 1.25rem); }
.tut-bubble { position: absolute; left: 0; top: 0; will-change: transform; font-size: clamp(1.2rem, calc(var(--tut-unit, 80px) * 0.46), 3.6rem); line-height: 1; filter: drop-shadow(0 0.4vh 0.8vh rgba(0, 0, 0, 0.6)); }
.tut-bubble > span { display: inline-block; opacity: 0; }
.tut-bubble.is-on > span { opacity: 1; animation: tut-pop 0.4s var(--p-motion-ease-bounce) backwards; }
.tut-points { position: absolute; left: 0; top: 0; will-change: transform; font-family: var(--p-font-family-display); font-size: clamp(1rem, calc(var(--tut-unit, 80px) * 0.42), 3.2rem); text-shadow: 0 0.3vh 0 rgba(0, 0, 0, 0.6), 0 0 1.2vw rgba(0, 0, 0, 0.6); }
.tut-points > span { display: inline-block; animation: tut-float 0.7s var(--p-motion-ease-bounce) backwards; }
.tut-points.is-good { color: #7dffa9; }
.tut-points.is-bad { color: #ff8f8f; }
@keyframes tut-pop { from { opacity: 0; transform: scale(0.3); } }
@keyframes tut-float { from { opacity: 0; transform: translateY(2vh) scale(0.5); } }

/* the end: ¡A JUGAR! */
.tut-banner {
  position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%) rotate(-4deg);
  font-size: clamp(2.6rem, 9vw, 12rem); color: #ffd23f; line-height: 1; pointer-events: none;
  text-shadow: 0 0.7vh 0 #b4361f, 0 0 5vw rgba(255, 140, 60, 0.8);
  animation: tut-banner-in 0.8s var(--p-motion-ease-bounce) backwards;
}
@keyframes tut-banner-in { from { opacity: 0; transform: translate(-50%, -50%) rotate(-14deg) scale(0.3); } }

/* the pretend pause (the host shows what a pause looks like): the real badge's look, not its class — screen/main.js owns that one */
.tut-pause {
  position: fixed; top: calc(1.5vh + 14px); right: 2vw; z-index: 90;
  display: flex; align-items: center; gap: 0.6vw; padding: 1vh 1.5vw;
  border-radius: var(--p-border-radius-full); background: rgba(12, 14, 24, 0.86);
  border: 2px solid var(--p-color-bg-fill-warning); color: var(--p-color-text-warning);
  font-family: var(--p-font-family-display); font-size: clamp(1rem, 1.9vw, 1.7rem); letter-spacing: 0.06em;
  box-shadow: var(--p-shadow-300), 0 0 2vw rgba(255, 202, 58, 0.35);
  animation: pause-in 0.4s var(--p-motion-ease-bounce); pointer-events: none;
}
.tut .dl-ex__caption { z-index: 5; }
