/* ==========================================================================
   EL CAGANER OCULT — Estètica Àlbum Il·lustrat estil "On és en Wally?"
   Paleta: Crema paper, Vermell barretina, Verd avet, Daurat pessebre, Tinta còmic
   ========================================================================== */

:root {
  --cream: #FDF6E9;
  --cream-dark: #F3E6CE;
  --red: #D62229;
  --red-dark: #A9161C;
  --green: #1B4332;
  --green-mid: #2D6A4F;
  --gold: #E0B12B;
  --gold-soft: #FFF1C2;
  --ink: #231F20;
  --ink-muted: #554C44;
  --whatsapp: #25D366;
  --whatsapp-dark: #1BA950;

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-pill: 999px;

  --shadow-comic: 0 8px 0 var(--ink);
  --shadow-float: 0 6px 0 var(--ink), 0 12px 24px rgba(19, 34, 56, 0.3);

  --font-display: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #142847;
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

.is-hidden {
  display: none !important;
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 90;
}

/* ==================== PANTALLES ==================== */
.screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s ease;
}

.screen.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* ==================== 1. PORTADA ESTIL LLIBRE D'EN WALLY ==================== */
.screen-start {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(18px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  overflow-y: auto;
}

.start-scene-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.start-preview-svg {
  width: 100%;
  height: 100%;
  display: block;
  transform: scale(1.06);
  filter: saturate(1.1) brightness(0.92);
}

.start-scene-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 45%, rgba(20, 40, 71, 0.25) 0%, rgba(20, 40, 71, 0.72) 100%);
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
}

.start-topbar {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 16px;
  right: 16px;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 5;
}

.brand-pill {
  background: var(--cream);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 0 var(--ink);
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  background: var(--cream);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.15rem;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.icon-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--ink);
}

/* Targeta portada tipus àlbum il·lustrat */
.start-book-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 470px;
  background: var(--cream);
  border: 3.5px solid var(--ink);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 0 var(--ink), 0 24px 55px rgba(0, 0, 0, 0.42);
  margin-top: 28px;
}

/* Franja icònica estil Wally (ratlles diagonals vermell-crema) */
.wally-ribbon {
  background: repeating-linear-gradient(
    -45deg,
    var(--red),
    var(--red) 14px,
    #FFFDF7 14px,
    #FFFDF7 28px
  );
  border-bottom: 3px solid var(--ink);
  padding: 9px 12px;
  text-align: center;
}

.wally-ribbon span {
  display: inline-block;
  background: var(--ink);
  color: #FFFDF7;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 3px 11px;
  border-radius: var(--radius-pill);
}

.wally-ribbon-slim {
  height: 16px;
  padding: 0;
}

.start-card-body {
  padding: 20px 22px 22px;
  text-align: center;
}

.hero-wanted-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 12px;
  text-align: left;
}

.hero-badge {
  position: relative;
  width: 86px;
  height: 86px;
  flex-shrink: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFFBE8, #F4DC9E);
  border: 3px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 0 var(--ink);
  animation: gentleFloat 3.2s ease-in-out infinite;
}

.hero-caganer-img {
  width: 66px;
  height: 66px;
  object-fit: contain;
}

.hero-loupe {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--red);
  border: 2.5px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

@keyframes gentleFloat {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-4px) rotate(2deg); }
}

.hero-title-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.wanted-stamp {
  display: inline-block;
  background: var(--gold);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  margin-bottom: 4px;
  transform: rotate(-2deg);
}

.start-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 6vw, 2.35rem);
  font-weight: 700;
  line-height: 1.03;
  color: var(--red);
  text-shadow: 2px 2px 0 rgba(35, 31, 32, 0.14);
}

.start-subtitle {
  margin: 0 0 18px;
  font-size: 0.94rem;
  line-height: 1.46;
  color: var(--ink-muted);
  font-weight: 600;
}

.difficulty-box {
  text-align: left;
  margin-bottom: 14px;
}

.level-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.difficulty-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--green);
}

.level-progress-pill {
  font-size: 0.72rem;
  font-weight: 800;
  background: #E4F5EA;
  color: var(--green);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 2px 9px;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.level-btn {
  height: 44px;
  border-radius: 12px;
  border: 2.5px solid var(--ink);
  background: #FFFDF8;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.12s ease, background-color 0.15s ease;
}

.level-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink);
}

.level-btn.is-selected {
  background: var(--red);
  color: #FFFFFF;
  box-shadow: 0 3px 0 var(--ink);
}

.level-btn.is-completed:not(.is-selected) {
  background: #E4F5EA;
  color: var(--green);
}

.level-btn:disabled {
  background: #EAE2D3;
  color: #9A8F82;
  border-color: rgba(35, 31, 32, 0.35);
  box-shadow: none;
  cursor: not-allowed;
  font-size: 0.82rem;
}

.level-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #FFFDF7;
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ink);
}

.level-info-count {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--red);
  white-space: nowrap;
}

.best-time-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--gold-soft);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 8px 13px;
  margin-bottom: 14px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
}

.best-time-banner strong {
  font-variant-numeric: tabular-nums;
  font-size: 0.96rem;
  color: var(--red);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--red);
  color: #FFFFFF;
  border: 3px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.15s ease;
}

.btn-primary:hover {
  background: var(--red-dark);
}

.btn-primary:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--ink);
}

.btn-start-cta {
  width: 100%;
  font-size: 1.15rem;
  padding: 15px 20px;
}

.start-tip {
  margin: 13px 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-muted);
}

/* ==================== 2. PANTALLA DE JOC ==================== */
.screen-game {
  background: #142847;
  user-select: none;
  -webkit-user-select: none;
}

.game-hud {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 25;
  pointer-events: none;
}

.game-hud > * {
  pointer-events: auto;
}

.hud-center-group {
  display: flex;
  align-items: center;
  gap: 7px;
}

.hud-level-badge {
  background: var(--gold);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 7px 11px;
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: 0 4px 0 var(--ink);
  white-space: nowrap;
}

/* Miniatura d'objectiu estil llibre d'en Wally al HUD */
.target-medallion {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--cream);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 4px 12px 4px 6px;
  box-shadow: 0 4px 0 var(--ink);
}

.target-medallion-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  background: var(--gold-soft);
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  padding: 2px;
}

.target-medallion-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--red);
}

.hud-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  background: var(--cream);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  font-size: 1.1rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.hud-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--ink);
}

.timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--cream);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 8px 15px;
  box-shadow: 0 4px 0 var(--ink);
}

.timer-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
  animation: pulseDot 1s ease-in-out infinite;
}

.timer-pill.is-stopped .timer-dot {
  background: var(--green-mid);
  animation: none;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.timer-value {
  font-size: 1.12rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  min-width: 64px;
  text-align: center;
}

/* Viewport interactiu */
.viewport-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}

.viewport-container:active {
  cursor: grabbing;
}

.pessebre-stage {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.pessebre-svg {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* El Caganer dins l'escenari */
.caganer-target {
  position: absolute;
  width: 96px;
  height: 112px;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  pointer-events: none;
  z-index: 6;
}

.caganer-sprite {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.35s ease;
}

.caganer-glow {
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 224, 102, 0.9) 0%, rgba(212, 175, 55, 0.38) 55%, transparent 72%);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.caganer-target.is-found .caganer-glow {
  opacity: 1;
  transform: scale(1.3);
  animation: foundPulse 1s ease-in-out infinite alternate;
}

.caganer-target.is-found .caganer-sprite {
  transform: scale(1.25);
  filter: drop-shadow(0 0 14px rgba(255, 232, 128, 0.95));
}

@keyframes foundPulse {
  from { transform: scale(1.1); opacity: 0.85; }
  to { transform: scale(1.4); opacity: 1; }
}

/* Halo daurat ampli per pistes (diàmetre dinàmic per nivell) */
.hint-halo {
  position: absolute;
  width: 660px;
  height: 660px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 6px dashed #FFD166;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.22) 0%, rgba(255, 209, 102, 0.05) 65%, transparent 78%);
  pointer-events: none;
  z-index: 5;
  animation: hintPulse 1.8s ease-in-out infinite;
}

@keyframes hintPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(0.94); opacity: 0.72; }
  50% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
}

/* Controls de zoom */
.zoom-controls {
  position: fixed;
  right: 14px;
  bottom: max(18px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 25;
}

.zoom-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 2.5px solid var(--ink);
  background: var(--cream);
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.zoom-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--ink);
}

/* Botó discret de pista */
.btn-hint {
  position: fixed;
  left: 14px;
  bottom: calc(max(12px, env(safe-area-inset-bottom)) + 36px);
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #FFE58A, #F4C430);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  animation: hintEntrance 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Crèdit discret al marge inferior esquerre dels paisatges */
.scene-credit {
  position: fixed;
  left: 12px;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 24;
  background: rgba(253, 246, 233, 0.82);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--ink);
  border: 1.5px solid rgba(35, 31, 32, 0.25);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  pointer-events: auto;
}

.scene-credit-link {
  color: var(--red);
  font-weight: 800;
  text-decoration: none;
}

.scene-credit-link:hover {
  text-decoration: underline;
}

@keyframes hintEntrance {
  from { opacity: 0; transform: translateY(18px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.gesture-guide {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 20;
  background: var(--ink);
  color: var(--cream);
  border: 2px solid var(--cream);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: opacity 0.45s ease;
}

.gesture-guide.is-faded {
  opacity: 0;
}

/* Banner de pista */
.hint-banner {
  position: fixed;
  top: calc(max(12px, env(safe-area-inset-top)) + 58px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 28px);
  max-width: 440px;
  z-index: 26;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFF9E2;
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  box-shadow: 0 4px 0 var(--ink);
}

/* Banner celebració immediata */
.found-banner {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: calc(100% - 28px);
  max-width: 440px;
  z-index: 35;
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  text-align: center;
  box-shadow: 0 8px 0 var(--ink), 0 18px 36px rgba(0, 0, 0, 0.35);
  animation: hintEntrance 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.found-badge {
  display: inline-block;
  background: var(--red);
  color: #FFFFFF;
  border: 2px solid var(--ink);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 8px;
}

.found-phrase {
  margin: 0 0 10px;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
}

.btn-skip-results {
  background: transparent;
  border: none;
  color: var(--green);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  padding: 4px 10px;
}

/* Feedback clic erroni */
.feedback-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 22;
}

.miss-ping {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  animation: missFloat 0.9s ease-out forwards;
}

.miss-ring {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid #FFFFFF;
  background: rgba(214, 34, 41, 0.38);
}

.miss-label {
  margin-top: 4px;
  background: var(--ink);
  color: #FFFFFF;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

@keyframes missFloat {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.75); }
  25% { opacity: 1; transform: translate(-50%, -62%) scale(1.03); }
  100% { opacity: 0; transform: translate(-50%, -95%) scale(0.95); }
}

/* ==================== 3. PANTALLA DE RESULTATS ==================== */
.results-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(19, 34, 56, 0.74);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  overflow-y: auto;
}

.results-card {
  width: 100%;
  max-width: 440px;
  background: var(--cream);
  border: 3.5px solid var(--ink);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-align: center;
  box-shadow: 0 10px 0 var(--ink), 0 24px 60px rgba(0, 0, 0, 0.4);
  animation: modalPop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.results-card-inner {
  padding: 18px 20px 18px;
}

@keyframes modalPop {
  from { opacity: 0; transform: translateY(24px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.results-top-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.pill-badge {
  background: #E4F5EA;
  color: var(--green);
  border: 2px solid var(--ink);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
}

.pill-gold {
  background: var(--gold-soft);
  color: var(--ink);
}

.results-caganer-wrap {
  width: 72px;
  height: 72px;
  margin: 0 auto 6px;
}

.results-caganer-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.results-heading {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--red);
}

.results-time-box {
  background: #FFFFFF;
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 12px;
  box-shadow: 0 3px 0 var(--ink);
}

.results-time-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.results-time-number {
  font-family: var(--font-display);
  font-size: 2.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--green);
  line-height: 1.15;
}

.results-time-number small {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.rank-card {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: #FFFDF7;
  border: 2px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.rank-emoji {
  font-size: 2.1rem;
  line-height: 1;
  flex-shrink: 0;
}

.rank-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--red);
}

.rank-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.rank-subtitle {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--ink-muted);
  line-height: 1.35;
}

.results-phrase {
  margin: 0 0 15px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  background: #FFF9E6;
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 10px 12px;
  line-height: 1.42;
}

.results-card.is-grand-finale .results-phrase {
  background: linear-gradient(135deg, #FFF3B0, #FFE082);
  border: 2.5px solid var(--ink);
  font-weight: 800;
  font-size: 0.94rem;
}

.btn-next-level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: var(--red);
  color: #FFFFFF;
  border: 3px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.15s ease;
}

.btn-next-level:hover {
  background: var(--red-dark);
}

.btn-next-level:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--ink);
}

.btn-next-level.is-finale {
  background: var(--gold);
  color: var(--ink);
}

.results-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: var(--whatsapp);
  color: #082914;
  text-decoration: none;
  border: 3px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 0.96rem;
  font-weight: 800;
  box-shadow: 0 5px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.15s ease;
}

.btn-whatsapp:hover {
  background: var(--whatsapp-dark);
  color: #FFFFFF;
}

.btn-whatsapp:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--ink);
}

.results-secondary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #FFFFFF;
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 12px 12px;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn-secondary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--ink);
}

.results-secondary-row .btn-primary {
  padding: 12px 12px;
  font-size: 0.9rem;
  box-shadow: 0 4px 0 var(--ink);
}

.btn-link {
  background: none;
  border: none;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  padding: 6px;
}

@media (max-width: 400px) {
  .start-card-body {
    padding: 16px 15px 18px;
  }
  .target-medallion-label {
    display: none;
  }
  .difficulty-grid,
  .results-secondary-row {
    grid-template-columns: 1fr;
  }
}
