/**
 * CATALIS - mambearte.css
 * Ubicación: /catalis/mambearte/mambearte.css
 * Descripción: Estilos completos del juego MambeArte individual
 */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=DM+Sans:wght@400;500;600;700&display=swap');

/* ── RESET & ROOT ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:   #0a0a0f;
  --sf:   #12121a;
  --sf2:  #1a1a26;
  --ac:   #c9a84c;
  --acd:  #8a7033;
  --bd:   #2a2a3a;
  --tx:   #e8e6e1;
  --txd:  #7a7872;
  --ok:   #5cb85c;
  --no:   #d9534f;
  --info: #5c9ded;
}

/* ══════════════════════════════════════════════
   BODY & LAYOUT
══════════════════════════════════════════════ */
body {
  height: 100vh; overflow: hidden;
  background: #06060a;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(201,168,76,0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(92,157,237,0.03) 0%, transparent 60%),
    repeating-linear-gradient(0deg, transparent, transparent 40px,
      rgba(255,255,255,0.012) 40px, rgba(255,255,255,0.012) 41px);
  color: var(--tx);
  font-family: 'DM Sans', sans-serif;
  display: flex; justify-content: center; align-items: flex-start;
}

body.menu-visible {
  height: auto;
  min-height: 100vh;
  overflow-y: scroll;
}

@media (min-width: 640px) {
  body::before, body::after {
    content: ''; position: fixed; top: 0; bottom: 0;
    width: calc((100vw - 780px) / 2 - 20px); pointer-events: none;
  }
  body::before { left: 0;  background: linear-gradient(to right, transparent, rgba(201,168,76,0.06)); }
  body::after  { right: 0; background: linear-gradient(to left,  transparent, rgba(201,168,76,0.06)); }
}

.game-shell {
  width: 100%; max-width: 600px; height: 100vh;
  background: var(--bg); display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}

body.menu-visible .game-shell {
  height: auto;
  min-height: 100vh;
  overflow: visible;
}
body.menu-visible .game-content {
  overflow: visible;
  flex: none;
}
body.menu-visible #phaseMenu {
  overflow: visible;
  min-height: unset;
}

/* ══════════════════════════════════════════════
   HEADER — dos modos: menú y partida
══════════════════════════════════════════════ */
.game-header {
  background: rgba(10,10,15,0.95);
  border-bottom: 1px solid rgba(201,168,76,0.15);
  flex-shrink: 0;
}

.game-header-menu { padding: 10px 16px 8px; }
.game-title    { text-align: center; padding: 2px 0 4px; }
.game-title h1 { font-family: 'Playfair Display', Georgia, serif; font-size: 28px; font-weight: 900; color: var(--ac); letter-spacing: 3px; }
.game-subtitle { font-size: 10px; color: var(--txd); letter-spacing: 3px; margin-top: 2px; }

.game-header-partida {
  display: none;
  padding: 4px 10px;
  align-items: center;
  gap: 8px;
}
.game-header-partida.visible { display: flex; }

.score-bar-inline {
  display: flex; align-items: center; gap: 14px; flex: 1;
}
.score-col-inline { text-align: center; min-width: 36px; }
.score-label-inline { font-size: 8px; color: var(--txd); letter-spacing: 1px; text-transform: uppercase; }
.score-val-inline { font-size: 20px; font-weight: 700; font-family: 'Playfair Display', serif; line-height: 1; }
.score-sep-inline { color: rgba(201,168,76,0.2); font-size: 18px; }

.status-bar-inline {
  display: flex; gap: 6px; align-items: center; flex: 1; justify-content: center;
}
.status-item-inline { font-size: 9px; color: var(--txd); display: flex; gap: 2px; align-items: center; }
.status-item-inline span { color: var(--tx); font-weight: 600; }
.status-dot { color: rgba(201,168,76,0.25); font-size: 8px; }

.btn-abandonar {
  background: transparent;
  border: 1px solid rgba(217,83,79,.3);
  border-radius: 6px;
  padding: 5px 10px;
  color: rgba(217,83,79,.7);
  font-size: 11px; font-weight: 600;
  cursor: pointer; font-family: 'DM Sans', sans-serif;
  transition: all .2s; flex-shrink: 0;
  white-space: nowrap;
}
.btn-abandonar:hover { background: rgba(217,83,79,.12); color: var(--no); border-color: var(--no); }

.score-section { display: none !important; }

/* ══════════════════════════════════════════════
   CONTENT & PHASES
══════════════════════════════════════════════ */
/* position:relative permite que el vc-overlay (dentro de game-content)
   quede debajo del header de puntajes */
.game-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; position: relative; }

.phase {
  flex: 1; display: flex; flex-direction: column;
  padding: 8px 10px; gap: 6px;
  overflow: hidden; min-height: 0;
}
.phase.hidden { display: none; }

/* ══════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════ */
.card-wrap {
  border-radius: 10px; overflow: hidden; flex-shrink: 0;
  position: relative; cursor: pointer; transition: all .2s ease;
}
.card-wrap img, .card-wrap svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-wrap.selected {
  border: 2.5px solid var(--ac) !important;
  box-shadow: 0 0 20px rgba(201,168,76,.5), 0 6px 24px rgba(0,0,0,.6);
  transform: translateY(-4px) scale(1.04);
}
.card-wrap.glow { border: 2px solid rgba(92,184,92,.53) !important; box-shadow: 0 0 14px rgba(92,184,92,.3); }

.card-check {
  position: absolute; top: 6px; right: 6px;
  background: #27ae60; border-radius: 50%; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff; font-weight: 900;
  box-shadow: 0 2px 8px rgba(39,174,96,.5);
}
.card-num {
  position: absolute; bottom: 5px; left: 5px;
  background: rgba(0,0,0,.7); border-radius: 5px; padding: 1px 6px;
  font-size: 11px; font-weight: 700; color: rgba(255,255,255,.9); backdrop-filter: blur(4px);
}
.card-info-btn {
  position: absolute; top: 5px; left: 5px;
  background: rgba(0,0,0,.7); border-radius: 50%; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: rgba(255,255,255,.9); font-weight: 700;
  cursor: pointer; backdrop-filter: blur(4px); border: none;
}

#handCards {
  display: grid; grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(3, 1fr);
  gap: 8px; flex: 1; min-height: 0;
}
#handCards .card-wrap { width: 100% !important; height: 100% !important; }

/* Mesa de Klem evalúa: 3 columnas × 2 filas = 6 cartas */
#tableCardsThink {
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr);
  gap: 8px; flex: 1; min-height: 0;
}
#tableCardsThink .card-wrap { width: 100% !important; height: 100% !important; }

/* Mesa Klem narra: 3 columnas × 2 filas = 6 cartas */
#tableCardsKlem {
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr);
  gap: 8px; flex: 1; min-height: 0;
}
#tableCardsKlem .card-wrap { width: 100% !important; height: 100% !important; }

/* ══════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════ */
.btn {
  padding: 11px 24px; border-radius: 8px; cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 600;
  letter-spacing: .5px; transition: all .2s; border: none; flex-shrink: 0;
}
.btn-primary   { background: var(--ac); color: #0a0a0f; }
.btn-secondary { background: transparent; color: var(--ac); border: 1px solid var(--ac); }
.btn-ghost     { background: transparent; color: var(--txd); border: 1px solid rgba(122,120,114,.27); }
.btn-danger    { background: transparent; color: var(--no); border: 1px solid rgba(217,83,79,.4); }
.btn-danger:hover { background: rgba(217,83,79,.12); }
.btn:disabled  { opacity: .4; cursor: not-allowed; }
.btn-sm        { padding: 7px 16px; font-size: 12px; }
.btn-row       { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; flex-shrink: 0; }

/* ══════════════════════════════════════════════
   BANNER & LABELS
══════════════════════════════════════════════ */
.banner       { text-align: center; border-radius: 8px; padding: 7px 12px; flex-shrink: 0; }
.banner-title { font-size: 13px; font-weight: 600; }
.banner-sub   { font-size: 10px; color: var(--txd); margin-top: 2px; }
.banner-gold  { background: rgba(201,168,76,.07); border: 1px solid rgba(201,168,76,.13); }
.banner-gold .banner-title { color: var(--ac); }
.banner-blue  { background: rgba(92,157,237,.06); border: 1px solid rgba(92,157,237,.13); }
.banner-blue .banner-title { color: var(--info); }

.lbl      { text-align: center; font-size: 9px; color: var(--txd); letter-spacing: 1.5px; text-transform: uppercase; flex-shrink: 0; }
.lbl-gold { color: var(--ac); }
.lbl-blue { color: var(--info); }

/* ══════════════════════════════════════════════
   MENÚ
══════════════════════════════════════════════ */
.klem-foto-wrap { position: relative; display: inline-block; cursor: pointer; }
.menu-klem {
  width: 110px; height: 110px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--ac); box-shadow: 0 0 35px rgba(201,168,76,.3);
  display: block; transition: border-color .4s, box-shadow .4s;
}
.menu-klem-label { font-family: 'Playfair Display', serif; font-size: 12px; font-weight: 700; letter-spacing: 2px; color: var(--txd); text-transform: uppercase; }
.klem-frase {
  position: absolute; inset: 0; border-radius: 50%; background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  padding: 10px; text-align: center;
  font-family: 'Playfair Display', serif; font-size: 10px; font-style: italic;
  color: var(--ac); line-height: 1.4; opacity: 0; transition: opacity 0.35s ease; pointer-events: none;
}
.klem-frase.visible { opacity: 1; }

.menu-intro, .menu-howto {
  background: var(--sf2); border-radius: 10px; padding: 10px 14px;
  max-width: 340px; width: 100%; border: 1px solid rgba(138,112,51,.13);
}
.menu-intro { font-style: italic; color: var(--tx); font-size: 12px; line-height: 1.5; }
.menu-howto { text-align: left; }
.menu-howto-title { font-size: 11px; color: var(--ac); font-weight: 600; margin-bottom: 6px; }
.menu-howto-line  { font-size: 11px; color: var(--txd); line-height: 1.8; }
.menu-howto-line b { color: var(--tx); }

.menu-preview { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.menu-preview-card {
  width: 36px; height: 50px; border-radius: 4px; overflow: hidden;
  border: 1px solid rgba(138,112,51,.2); cursor: pointer; transition: transform .15s;
}
.menu-preview-card:hover { transform: translateY(-3px) scale(1.06); }
.menu-preview-card img { width: 100%; height: 100%; object-fit: cover; }

.diff-row { display: flex; gap: 6px; justify-content: center; }
.diff-btn {
  padding: 6px 14px; border-radius: 20px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--bd); cursor: pointer; transition: all .2s;
  background: transparent; color: var(--txd); font-family: 'DM Sans', sans-serif;
}
.diff-btn.active { background: var(--ac); color: #0a0a0f; border-color: var(--ac); }

/* ══════════════════════════════════════════════
   FASES ESPECÍFICAS
══════════════════════════════════════════════ */
#phasePickCard    { overflow: hidden; padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); }
#confirmCardBtn   { text-align: center; flex-shrink: 0; }

#phaseWriteClue   { justify-content: space-between; overflow: hidden; padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); }
#selectedCardDisplay { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }

#phaseKlemThinks  { justify-content: space-between; overflow: hidden; }
#phaseKlemNarrates { overflow: hidden; }

/* ══════════════════════════════════════════════
   CLUE INPUT & DISPLAY
══════════════════════════════════════════════ */
.clue-input {
  width: 100%; max-width: 300px; background: var(--sf2);
  border: 1px solid rgba(138,112,51,.27); border-radius: 8px; padding: 9px 12px;
  color: var(--tx); font-family: 'DM Sans', sans-serif; font-size: 14px; outline: none; flex-shrink: 0;
}
.clue-input:focus { border-color: var(--ac); }
.clue-display { text-align: center; padding: 7px 12px; background: rgba(92,157,237,.06); border-radius: 8px; border: 1px solid rgba(92,157,237,.13); flex-shrink: 0; }
.clue-display-text { font-size: 15px; font-weight: 700; font-family: 'Playfair Display', serif; color: var(--tx); font-style: italic; }

/* ══════════════════════════════════════════════
   KLEM THINKING
══════════════════════════════════════════════ */
.klem-thinking {
  flex-shrink: 0; display: flex; flex-direction: row;
  align-items: center; justify-content: center; gap: 12px;
  padding: 8px 14px;
  background: var(--sf2); border-radius: 10px;
  border: 1px solid rgba(255,255,255,.05);
}
.klem-thinking-text { font-style: italic; font-size: 12px; color: var(--txd); text-align: left; flex: 1; }
.klem-thinking-img {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(201,168,76,.45); box-shadow: 0 0 16px rgba(0,0,0,.6); flex-shrink: 0;
}
.klem-thinking-img.pulsing { animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* ══════════════════════════════════════════════
   RESULTADO
══════════════════════════════════════════════ */
#phaseResult { overflow-y: auto; gap: 8px; }

.result-klem-hero {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--sf2); border-radius: 12px;
  border: 1px solid rgba(255,255,255,.05);
  flex-shrink: 0;
}
.result-klem-foto {
  width: 80px; height: 80px; border-radius: 50%; object-fit: cover;
  border: 3px solid rgba(201,168,76,.45); box-shadow: 0 0 24px rgba(0,0,0,.6);
  display: block; flex-shrink: 0;
}
.result-klem-texto { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.result-klem-label { font-size: 9px; color: var(--ac); text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; }
.result-klem-frase { font-size: 12px; color: var(--tx); line-height: 1.5; font-style: italic; }

.result-clue-box   { background: rgba(201,168,76,.07); border-radius: 7px; padding: 6px 10px; border: 1px solid rgba(201,168,76,.13); text-align: center; flex-shrink: 0; }
.result-clue-label { font-size: 9px; color: var(--txd); margin-bottom: 2px; text-transform: uppercase; letter-spacing: 1px; }
.result-clue-val   { font-size: 14px; font-weight: 700; color: var(--ac); font-family: 'Playfair Display', serif; }

.result-cards-area {
  display: flex; gap: 14px; align-items: center; justify-content: center; flex-shrink: 0;
  padding: 4px 0;
}
.result-card-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: 50%; }
.result-card-label-sm { font-size: 9px; color: var(--txd); text-transform: uppercase; letter-spacing: 1px; }

.result-veredicto {
  text-align: center; padding: 10px 14px;
  background: var(--sf2); border-radius: 10px; flex-shrink: 0;
}
.result-msg    { font-size: 14px; font-weight: 700; color: var(--txd); }
.result-detail { font-size: 15px; color: var(--ac); font-weight: 700; margin-top: 3px; font-family: 'Playfair Display', serif; }

.klem-fail-strip { background: rgba(217,83,79,.06); border-radius: 8px; border: 1px solid rgba(217,83,79,.15); padding: 7px 14px; text-align: center; flex-shrink: 0; }
.klem-fail-strip-label { font-size: 9px; color: var(--no); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 2px; font-weight: 700; }
.klem-fail-strip-text  { font-size: 11px; color: var(--tx); line-height: 1.5; }

.result-box, .result-top, .result-body, .result-card-col, .result-comments-col,
.result-bottom, .result-klem-section, .result-cards-row,
.klem-comment, .klem-comment-header, .klem-comment-img, .klem-comment-name,
.klem-comment-text, .klem-fail, .klem-voted, .result-detail-box { display: none; }

.result-next { text-align: center; flex-shrink: 0; }

/* ══════════════════════════════════════════════
   GAMEOVER
══════════════════════════════════════════════ */
#phaseGameover {
  overflow-y: auto;
  align-items: center; justify-content: center; text-align: center; gap: 12px;
}

.gameover-klem {
  width: 140px; height: 140px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--ac);
  box-shadow: 0 0 60px rgba(201,168,76,.3), 0 0 0 8px rgba(201,168,76,.07), 0 20px 40px rgba(0,0,0,.8);
  display: block; flex-shrink: 0;
}
.gameover-klem.klem-gana   { border-color: var(--info); box-shadow: 0 0 60px rgba(92,157,237,.3), 0 0 0 8px rgba(92,157,237,.07), 0 20px 40px rgba(0,0,0,.8); }
.gameover-klem.klem-pierde { border-color: var(--ac);   box-shadow: 0 0 60px rgba(201,168,76,.3), 0 0 0 8px rgba(201,168,76,.07), 0 20px 40px rgba(0,0,0,.8); }

.gameover-verdict   { font-family: 'Playfair Display', serif; font-size: 10px; font-weight: 700; letter-spacing: 2px; color: var(--txd); text-transform: uppercase; }
.gameover-emoji     { font-size: 40px; line-height: 1; }
.gameover-title     { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 900; }

.gameover-quote {
  background: rgba(255,255,255,.04); border-radius: 12px;
  padding: 14px 20px; max-width: 320px; width: 100%;
  border: 1px solid rgba(255,255,255,.07);
  font-family: 'Playfair Display', serif;
  font-style: italic; color: var(--tx); font-size: 13px; line-height: 1.6;
  position: relative;
}
.gameover-quote::before {
  content: '\201C';
  position: absolute; top: -8px; left: 14px;
  font-size: 48px; color: var(--ac); opacity: .3;
  font-family: 'Playfair Display', serif; line-height: 1;
}

.gameover-scores    { display: flex; gap: 36px; }
.gameover-score-col { text-align: center; }
.gameover-score-val { font-size: 32px; font-weight: 700; font-family: 'Playfair Display', serif; }
.gameover-score-lbl { font-size: 11px; color: var(--txd); }

.gameover-rating {
  background: var(--sf2); border-radius: 12px;
  padding: 14px 20px; max-width: 320px; width: 100%;
  border: 1px solid rgba(201,168,76,.2);
}
.gameover-rating-title { font-size: 9px; color: var(--txd); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 5px; }
.gameover-rating-name  { font-size: 17px; font-weight: 700; color: var(--ac); font-family: 'Playfair Display', serif; }
.gameover-rating-desc  { font-size: 11px; color: var(--txd); margin-top: 4px; line-height: 1.5; }

/* ══════════════════════════════════════════════
   LOADING / ERROR
══════════════════════════════════════════════ */
.loading-screen  { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--txd); }
.loading-spinner { width: 36px; height: 36px; border: 3px solid var(--bd); border-top-color: var(--ac); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════
   INFO MODAL
══════════════════════════════════════════════ */
.info-overlay { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.92); display: flex; align-items: stretch; justify-content: center; padding: 0; }
.info-overlay.hidden { display: none; }
.info-modal { width: 100%; max-width: 600px; background: var(--sf); border-radius: 0; overflow: hidden; border: none; display: flex; flex-direction: column; }
.info-modal-topbar { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 8px 12px; background: rgba(0,0,0,.5); border-bottom: 1px solid rgba(201,168,76,.1); flex-shrink: 0; }
.info-modal-zoom { background: rgba(201,168,76,.12); border: 1px solid rgba(201,168,76,.3); border-radius: 6px; padding: 5px 14px; color: var(--ac); font-size: 11px; font-weight: 600; cursor: pointer; font-family: 'DM Sans', sans-serif; }
.info-modal-zoom:hover { background: rgba(201,168,76,.22); }
.info-modal-close-btn { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 6px; padding: 5px 14px; color: var(--txd); font-size: 11px; font-weight: 600; cursor: pointer; font-family: 'DM Sans', sans-serif; }
.info-modal-close-btn:hover { background: rgba(255,255,255,.12); color: var(--tx); }
.info-modal-img-wrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.info-modal-img { width: 100%; height: 100%; object-fit: contain; display: block; cursor: zoom-in; flex: 1; min-height: 0; }
.info-modal-img-placeholder { flex: 1; display: flex; align-items: center; justify-content: center; background: var(--sf2); }
.info-modal-placa { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,.85) 40%, rgba(0,0,0,.95)); padding: 30px 14px 14px; pointer-events: none; }
.info-modal-title { font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 700; color: var(--tx); line-height: 1.2; }
.info-modal-sub   { font-size: 12px; color: var(--ac); font-weight: 600; margin-top: 3px; }
.info-modal-info-btn { position: absolute; bottom: 12px; right: 12px; width: 26px; height: 26px; background: rgba(0,0,0,.7); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: rgba(255,255,255,.85); text-decoration: none; backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,.15); cursor: pointer; z-index: 2; }
.info-modal-info-btn:hover { background: rgba(92,157,237,.5); color: #fff; }
.info-modal-info-btn.hidden { display: none; }

/* ══════════════════════════════════════════════
   OVERLAY IMAGEN AMPLIADA
══════════════════════════════════════════════ */
#imgAmpliada { position: fixed; inset: 0; z-index: 19999; background: rgba(0,0,0,.97); display: flex; flex-direction: column; align-items: stretch; justify-content: stretch; }
#imgAmpliada.hidden { display: none !important; }
#imgAmpliadaBar { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; flex-shrink: 0; background: rgba(0,0,0,.6); }
#imgAmpliadaHint { font-size: 10px; color: rgba(255,255,255,.25); letter-spacing: 1px; }
#imgAmpliadaCerrar { width: 32px; height: 32px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); border-radius: 50%; color: rgba(255,255,255,.7); font-size: 14px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; font-family: 'DM Sans', sans-serif; backdrop-filter: blur(4px); flex-shrink: 0; }
#imgAmpliadaCerrar:hover { background: rgba(217,83,79,.7); color: #fff; border-color: transparent; }
#imgAmpliadaWrap { flex: 1; overflow: hidden; position: relative; cursor: grab; touch-action: none; user-select: none; }
#imgAmpliadaWrap.dragging { cursor: grabbing; }
#imgAmpliadaSrc { position: absolute; transform-origin: 0 0; max-width: none; max-height: none; width: auto; height: auto; display: block; -webkit-user-drag: none; user-select: none; }
#imgAmpliadaPlaca { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,.88) 50%, rgba(0,0,0,.96)); padding: 28px 16px 14px; pointer-events: none; z-index: 2; }
#imgAmpliadaTitulo { font-family: 'Playfair Display', serif; font-size: 17px; font-weight: 700; color: var(--tx); }
#imgAmpliadaSub    { font-size: 11px; color: var(--ac); font-weight: 600; margin-top: 3px; }
#imgAmpliadaZoomBadge { position: absolute; top: 10px; left: 10px; z-index: 3; background: rgba(0,0,0,.7); border-radius: 6px; padding: 3px 8px; font-size: 11px; color: rgba(255,255,255,.6); backdrop-filter: blur(4px); transition: opacity .3s; pointer-events: none; }

/* ══════════════════════════════════════════════
   MODAL TARJETA
══════════════════════════════════════════════ */
.tarjeta-overlay { position: fixed; inset: 0; z-index: 29999; background: rgba(0,0,0,.96); display: flex; align-items: center; justify-content: center; padding: 24px; }
.tarjeta-overlay.hidden { display: none; }
.tarjeta-modal { max-width: 360px; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.tarjeta-klem-foto { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; border: 4px solid var(--ac); box-shadow: 0 0 60px rgba(201,168,76,.35), 0 0 0 8px rgba(201,168,76,.08), 0 20px 40px rgba(0,0,0,.8); }
.tarjeta-klem-foto.klem-rojo    { border-color: #c0392b; box-shadow: 0 0 60px rgba(192,57,43,.4), 0 0 0 8px rgba(192,57,43,.1), 0 20px 40px rgba(0,0,0,.8); }
.tarjeta-klem-foto.klem-cobarde { border-color: var(--txd); box-shadow: 0 0 40px rgba(122,120,114,.3), 0 0 0 8px rgba(122,120,114,.08), 0 20px 40px rgba(0,0,0,.8); }
.tarjeta-card-wrap { perspective: 800px; }
.tarjeta-card { font-size: 80px; line-height: 1; display: flex; align-items: center; justify-content: center; width: 96px; height: 134px; border-radius: 14px; margin: 0 auto; transform: rotateY(90deg); transition: none; }
.tarjeta-card.tarjeta-card-anim { animation: tarjetaFlip .6s cubic-bezier(.34,1.56,.64,1) forwards; }
.tarjeta-amarilla { background: linear-gradient(135deg, rgba(255,200,0,.18), rgba(255,160,0,.08)); border: 2px solid rgba(255,200,0,.6); box-shadow: 0 0 30px rgba(255,180,0,.25), inset 0 1px 0 rgba(255,255,255,.1); }
.tarjeta-roja     { background: linear-gradient(135deg, rgba(220,50,50,.18), rgba(180,20,20,.08)); border: 2px solid rgba(220,50,50,.7); box-shadow: 0 0 30px rgba(220,50,50,.3), inset 0 1px 0 rgba(255,255,255,.08); }
.tarjeta-blanca   { background: linear-gradient(135deg, rgba(122,120,114,.1), rgba(80,80,80,.05)); border: 2px solid rgba(122,120,114,.4); box-shadow: 0 0 20px rgba(0,0,0,.3); }
@keyframes tarjetaFlip {
  0%   { transform: rotateY(90deg) scale(.6); opacity: 0; }
  60%  { transform: rotateY(-10deg) scale(1.12); opacity: 1; }
  100% { transform: rotateY(0deg)  scale(1); opacity: 1; }
}
.tarjeta-titulo { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 900; letter-spacing: 1px; line-height: 1.1; }
.tarjeta-titulo-amarilla { color: #f0c040; text-shadow: 0 0 20px rgba(240,192,64,.4); }
.tarjeta-titulo-roja     { color: #e04040; text-shadow: 0 0 20px rgba(220,50,50,.4); }
.tarjeta-titulo-cobarde  { color: var(--txd); }
.tarjeta-frase { font-family: 'Playfair Display', serif; font-size: 14px; color: var(--tx); font-style: italic; line-height: 1.65; max-width: 320px; padding: 16px 20px; background: rgba(255,255,255,.04); border-radius: 12px; border: 1px solid rgba(255,255,255,.07); position: relative; }
.tarjeta-frase::before { content: '\201C'; position: absolute; top: -8px; left: 14px; font-size: 48px; color: var(--ac); opacity: .4; font-family: 'Playfair Display', serif; line-height: 1; }
.tarjeta-pista-wrap { position: relative; background: rgba(255,255,255,.03); border-radius: 8px; padding: 8px 18px; border: 1px solid rgba(255,255,255,.07); transform: rotate(-1.5deg); }
.tarjeta-pista-label { font-size: 9px; color: var(--txd); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 3px; font-weight: 700; }
.tarjeta-pista-val { font-size: 17px; font-weight: 700; color: rgba(255,255,255,.35); font-family: 'Playfair Display', serif; text-decoration: line-through; text-decoration-color: var(--no); text-decoration-thickness: 2px; }
.tarjeta-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ══════════════════════════════════════════════
   RESPONSIVE PC
══════════════════════════════════════════════ */
@media (min-width: 640px) {
  .game-shell    { max-width: 780px; }
  .game-title h1 { font-size: 42px; letter-spacing: 5px; }
  .game-subtitle { font-size: 12px; letter-spacing: 4px; }
  .score-val-inline { font-size: 26px; }
  .menu-klem       { width: 150px; height: 150px; border-width: 4px; }
  .menu-klem-label { font-size: 14px; letter-spacing: 3px; margin-top: 6px; }
  .menu-intro, .menu-howto { max-width: 500px; font-size: 14px; padding: 14px 20px; }
  .menu-howto-line  { font-size: 13px; line-height: 2; }
  .menu-preview-card { width: 50px; height: 70px; }
  .btn    { font-size: 15px; padding: 12px 28px; }
  .btn-sm { font-size: 12px; padding: 8px 18px; }
  .diff-btn { font-size: 12px; padding: 8px 18px; }
  #handCards      { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); }
  .klem-thinking-img { width: 130px; height: 130px; }
  .result-klem-foto  { width: 90px; height: 90px; }
  .gameover-klem     { width: 160px; height: 160px; }
  .gameover-title    { font-size: 30px; }
  .gameover-score-val { font-size: 38px; }
}

/* ══════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════ */
.mambe-footer { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 5px 16px;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 5px); border-top: 1px solid rgba(201,168,76,0.08); background: rgba(10,10,15,0.95); flex-shrink: 0; flex-wrap: wrap; }
.mambe-footer-logo    { display: none; }
.mambe-footer-version { font-size: 9px; color: var(--txd); letter-spacing: 1px; }
.mambe-footer-sep     { font-size: 9px; color: rgba(201,168,76,0.3); }
.mambe-footer-link    { font-size: 9px; color: var(--txd); text-decoration: none; letter-spacing: .5px; transition: color .2s; }
.mambe-footer-link:hover { color: var(--ac); }

/* ══════════════════════════════════════════════
   HIDDEN UTILITY
══════════════════════════════════════════════ */
.hidden { display: none !important; }

/* ══════════════════════════════════════════════
   VISTA CARTA FULLSCREEN
   — dentro de .game-content (position:relative)
   — no tapa el header de puntajes
══════════════════════════════════════════════ */
.vc-overlay {
  position: absolute; inset: 0; z-index: 9000;
  background: linear-gradient(160deg, #faf6ee 0%, #f0e8d4 100%);
  display: flex; flex-direction: column;
}
.vc-overlay.hidden { display: none; }

.vc-title-banner {
  background: linear-gradient(90deg, #3a2a10, #7a5a18, #c8a030, #7a5a18, #3a2a10);
  padding: 9px 40px 8px 36px; text-align: center;
  border-bottom: 1px solid #e8c060; flex-shrink: 0;
  position: relative; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.vc-title {
  font-family: 'Playfair Display', serif; font-size: 15px; font-weight: 700;
  letter-spacing: 0.07em; color: #f8e080;
  text-shadow: 0 1px 3px rgba(0,0,0,.5); line-height: 1.15; text-align: center; flex: 1;
}
.vc-url-btn {
  width: 26px; height: 26px; flex-shrink: 0;
  background: #2255aa; border: 2px solid #3366cc; border-radius: 50%;
  color: #fff; font-family: 'Playfair Display', serif; font-size: 13px; font-weight: 700;
  text-decoration: none; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(34,85,170,.4); transition: all .15s; line-height: 1;
}
.vc-url-btn:hover { background: #3366cc; transform: scale(1.1); }
.vc-sel-badge {
  background: #c8a030; color: #1a0f00; border-radius: 3px;
  font-size: 10px; font-weight: 700; padding: 3px 8px; letter-spacing: 0.5px; flex-shrink: 0;
}

.vc-img-zone {
  flex: 1; min-height: 0; position: relative; overflow: hidden;
  background: #e8e2d8; cursor: zoom-in;
}
.vc-img-zone img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.vc-img-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 64px; opacity: .2; }

.vc-img-zone::before, .vc-img-zone::after {
  content: ''; position: absolute; width: 20px; height: 20px;
  border-color: #c8a030; border-style: solid; z-index: 2; opacity: 0.6; pointer-events: none;
}
.vc-img-zone::before { top: 6px; left: 6px;  border-width: 2px 0 0 2px; }
.vc-img-zone::after  { top: 6px; right: 6px; border-width: 2px 2px 0 0; }
.vc-corners-bottom { position: absolute; bottom: 0; left: 0; right: 0; pointer-events: none; z-index: 2; }
.vc-corners-bottom::before, .vc-corners-bottom::after {
  content: ''; position: absolute; width: 20px; height: 20px;
  border-color: #c8a030; border-style: solid; opacity: 0.6; bottom: 6px;
}
.vc-corners-bottom::before { left: 6px;  border-width: 0 0 2px 2px; }
.vc-corners-bottom::after  { right: 6px; border-width: 0 2px 2px 0; }

.vc-meta-banner { background: linear-gradient(90deg, #3a2a10, #7a5a18, #c8a030, #7a5a18, #3a2a10); padding: 6px 14px; border-top: 1px solid #e8c060; text-align: center; flex-shrink: 0; }
.vc-meta-text   { font-family: 'Playfair Display', serif; font-size: 12px; color: #f8e080; letter-spacing: 0.06em; }

.vc-desc-zone { background: rgba(240,232,212,0.95); border-top: 1px solid rgba(200,160,48,.2); padding: 8px 14px; flex-shrink: 0; max-height: 88px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(200,160,48,.4) transparent; }
.vc-desc-zone::-webkit-scrollbar { width: 3px; }
.vc-desc-zone::-webkit-scrollbar-thumb { background: rgba(200,160,48,.4); }
.vc-desc-text { font-family: 'DM Sans', sans-serif; font-size: 13px; color: #2a1a08; line-height: 1.55; }

.vc-action-bar {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
  justify-content: space-between;
  padding: 8px 10px;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
  background: rgba(10,10,15,0.97);
  border-top: 1px solid rgba(201,168,76,0.15);
}

.vc-volver-compact {
  flex-shrink: 0;
  background: var(--ac); color: #0a0a0f;
  border: none; border-radius: 8px;
  padding: 9px 14px;
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: background .15s;
}
.vc-volver-compact:hover { background: #e0b85a; }

.vc-pista-inline {
  flex: 1; display: flex; gap: 8px; align-items: center; min-width: 0;
}
.vc-pista-inline input {
  flex: 1; min-width: 0;
  background: var(--sf2); border: 1px solid rgba(138,112,51,.27); border-radius: 8px;
  color: var(--tx); font-family: 'DM Sans', sans-serif; font-size: 14px;
  padding: 9px 12px; outline: none; transition: border-color .2s;
}
.vc-pista-inline input:focus { border-color: var(--ac); }
.vc-enviar-btn { flex-shrink: 0; padding: 9px 16px; font-size: 13px; }
.vc-elegir-btn { flex-shrink: 0; padding: 9px 16px; font-size: 13px; }

.vc-action-error { width: 100%; margin: 0; padding: 0 2px; min-height: 0; color: var(--no); font-size: 12px; }

/* ══════════════════════════════════════════════
   ZOOM OVERLAY (dentro de .game-content)
══════════════════════════════════════════════ */
.vc-zoom-overlay {
  position: absolute; inset: 0; z-index: 19000;
  background: rgba(0,0,0,.97);
  display: flex; flex-direction: column;
}
.vc-zoom-overlay.hidden { display: none; }

.vc-zoom-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: rgba(0,0,0,.6); flex-shrink: 0;
}
.vc-zoom-hint   { font-size: 10px; color: rgba(255,255,255,.25); letter-spacing: 1px; }
.vc-zoom-cerrar { width: 32px; height: 32px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); border-radius: 50%; color: rgba(255,255,255,.7); font-size: 14px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; font-family: 'DM Sans', sans-serif; }
.vc-zoom-cerrar:hover { background: rgba(217,83,79,.7); color: #fff; border-color: transparent; }

.vc-zoom-wrap {
  flex: 1; overflow: hidden; position: relative;
  cursor: grab; touch-action: none; user-select: none;
}
.vc-zoom-wrap:active { cursor: grabbing; }
#vcZoomImg {
  position: absolute; transform-origin: 0 0;
  max-width: none; max-height: none; width: auto; height: auto;
  display: block; -webkit-user-drag: none; user-select: none;
}

.vc-zoom-badge {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  background: rgba(0,0,0,.7); border-radius: 6px; padding: 3px 8px;
  font-size: 11px; color: rgba(255,255,255,.6); pointer-events: none;
  transition: opacity .3s;
}

.vc-zoom-titulo {
  padding: 8px 16px; text-align: center; flex-shrink: 0;
  font-family: 'Playfair Display', serif; color: rgba(255,255,255,.35);
  font-size: 12px; background: rgba(0,0,0,.4);
}

/* ══════════════════════════════════════════════
   DOTS ANIMADOS
══════════════════════════════════════════════ */
.mm-dots { display: flex; gap: 6px; justify-content: center; }
.mm-dots span { width: 8px; height: 8px; background: var(--ac); border-radius: 50%; opacity: .3; animation: mmDot .8s infinite alternate; }
.mm-dots span:nth-child(2) { animation-delay: .2s; }
.mm-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes mmDot { from { opacity: .2; transform: scale(.8); } to { opacity: 1; transform: scale(1.2); } }
.mm-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ac); opacity: .5; flex-shrink: 0; }
.mm-dot.pulsing { animation: mmPulse 1.2s infinite; }
@keyframes mmPulse { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
.mm-loading-screen { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--txd); padding: 40px; text-align: center; }

.vc-titulo-flag {
    font-size: 18px; flex-shrink: 0; min-width: 24px; line-height: 1;
}
.vc-titulo-num {
    font-family: 'Playfair Display', serif; font-size: 11px;
    color: rgba(248,224,128,0.6); letter-spacing: 0.08em;
    flex-shrink: 0; min-width: 28px; text-align: right;
}

/* ══════════════════════════════════════════════
   FIX — Tarjeta modal siempre entra en viewport
══════════════════════════════════════════════ */
.tarjeta-overlay {
  padding: 14px;
  overflow-y: auto;
  align-items: flex-start;
}
.tarjeta-modal {
  max-height: calc(100vh - 28px);
  gap: 12px;
  margin: auto 0;
  justify-content: center;
}
.tarjeta-klem-foto,
.tarjeta-card-wrap,
.tarjeta-titulo,
.tarjeta-pista-wrap,
.tarjeta-btns { flex-shrink: 0; }
.tarjeta-frase {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  max-height: 30vh;
}

@media (max-height: 700px) {
  .tarjeta-modal { gap: 10px; }
  .tarjeta-klem-foto { width: 100px; height: 100px; }
  .tarjeta-card { width: 70px; height: 98px; font-size: 56px; }
  .tarjeta-titulo { font-size: 19px; }
  .tarjeta-frase { font-size: 13px; padding: 12px 16px; max-height: 28vh; }
  .tarjeta-frase::before { font-size: 40px; }
}
@media (max-height: 560px) {
  .tarjeta-overlay { padding: 10px; }
  .tarjeta-modal { gap: 8px; max-height: calc(100vh - 20px); }
  .tarjeta-klem-foto {
    width: 72px; height: 72px; border-width: 3px;
    box-shadow: 0 0 30px rgba(201,168,76,.3), 0 0 0 4px rgba(201,168,76,.08);
  }
  .tarjeta-card { width: 52px; height: 72px; font-size: 40px; }
  .tarjeta-titulo { font-size: 15px; }
  .tarjeta-frase { font-size: 11px; padding: 9px 13px; max-height: 26vh; line-height: 1.5; }
  .tarjeta-pista-wrap { padding: 5px 12px; }
  .tarjeta-pista-val { font-size: 13px; }
  .tarjeta-pista-label { font-size: 8px; margin-bottom: 2px; }
}

/* ══ SKELETON DE CARGA ══ */
.card-img-wrap {
  position: relative; width: 100%; height: 100%;
}
.card-skeleton {
  position: absolute; inset: 0; z-index: 1; border-radius: inherit;
  background: linear-gradient(90deg, #1a1208 25%, #3a2810 50%, #1a1208 75%);
  background-size: 200% 100%;
  animation: cardShimmer 1.4s infinite;
}
.card-img {
  position: relative; z-index: 2;
  opacity: 0; transition: opacity 0.3s ease;
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.card-img.img-loaded { opacity: 1; }
@keyframes cardShimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}