/* ════════════════════════════════════════════
   TRIVIA ÉTICA — Game Styles  v3.0
════════════════════════════════════════════ */

/* Body background override */
body.trivia-etica-body,
body.trivia-etica-body.single-dilemas {
    background: url('../images/trivia-etica/Fondo-pantalla-grande.png') no-repeat center center fixed !important;
    background-size: cover !important;
}

body.game-active {
    background: url('../images/trivia-etica/Fondo-pantalla-grande.png') center center / cover no-repeat !important;
}

/* ════════════════════════════════════════════
   START OVERLAY (splash rápido)
════════════════════════════════════════════ */
.game-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.game-modal:not(.hidden) { opacity: 1; pointer-events: auto; }

.tg-start-content {
    background: rgba(14, 8, 50, 0.96) !important;
    border: 2px solid rgba(140,100,255,0.6) !important;
    box-shadow: 0 0 50px rgba(120,80,255,0.35) !important;
    padding: 50px 44px !important;
    max-width: 560px !important;
    border-radius: 20px !important;
    text-align: center;
}
.tg-start-content p { font-size: 1.15rem; color: #ccc; margin-bottom: 8px; }

.logo-trivia-img { max-width: 280px; width: 100%; height: auto; margin-bottom: 10px; }

@keyframes floatLogo {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}
.logo-large { animation: floatLogo 3s ease-in-out infinite; margin-bottom: 20px; }

.btn-millonario {
    background: linear-gradient(135deg, #7c4dff, #5c35cc);
    color: #fff;
    border: none;
    padding: 14px 34px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 50px;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 4px 18px rgba(124,77,255,.5);
    margin-top: 18px;
}
.btn-millonario:hover { transform: scale(1.05); box-shadow: 0 6px 26px rgba(124,77,255,.7); }

/* ════════════════════════════════════════════
   GAME WRAPPER
════════════════════════════════════════════ */
.tg-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    background: url('../images/trivia-etica/Fondo-juego.png') center center;
    background-size: 115% auto;
    background-repeat: no-repeat;
    border-radius: 16px;
    overflow: hidden;
    padding: 18px 20px 16px;
    position: relative;
    font-family: 'Geist', 'Inter', sans-serif;
    color: #fff;
    border: 1px solid rgba(130, 90, 255, 0.25);
    box-shadow: 0 0 60px rgba(90,50,200,.2), inset 0 0 80px rgba(100,60,220,.08);
}

/* ── TOP BAR ── */
.tg-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-shrink: 0;
}

.tg-fge {
    position: absolute;
    top: 110px;
    left: 60px;
    z-index: 20;
}
.tg-fge-img {
    height: 32px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: .9;
}

/* Progress circles */
.tg-progress-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 80px;
    margin-bottom: 40px;
    overflow: visible;
    padding: 0 20px;
}

.tg-progress-track {
    display: flex;
    align-items: center;
    gap: 36px; /* space between dots — must match ::before width */
    position: relative;
}

.tg-progress-dot {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2.5px solid rgba(255,255,255,0.45);
    background: rgb(75 55 208);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: rgba(255,255,255,0.80);
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    transition: all 0.3s ease;
    user-select: none;
    box-shadow: 0 0 0 1px rgba(180,150,255,0.10), inset 0 1px 0 rgba(255,255,255,0.07);
}

/* Connecting line — fills exactly the gap between dots */
.tg-progress-dot + .tg-progress-dot::before {
    content: '';
    position: absolute;
    right: 100%;          /* right edge aligns with this dot's left edge */
    top: 50%;
    width: 36px;          /* matches gap value */
    height: 2px;
    background: rgba(255,255,255,0.28);
    transform: translateY(-50%);
    border-radius: 1px;
}

.tg-progress-dot.active {
    background: #f5c518;
    border-color: #f5c518;
    color: #1a1200;
    font-size: 1.1rem;
    box-shadow:
        0 0 0 4px rgba(245,197,24,0.20),
        0 0 16px rgba(245,197,24,0.80),
        0 0 36px rgba(245,197,24,0.35);
}

.tg-progress-dot.passed {
    background: rgba(120,85,220,0.55);
    border-color: rgba(140,100,255,0.75);
    color: rgba(255,255,255,0.90);
}

/* Org Logo — top-right card */
.tg-org-logo-wrap {
    background: transparent;
    padding: 0;
    position: absolute;
    top: 65px;
    right: 85px;
    width: 128px;
    height: 128px;
    border-radius: 45px 0 45px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
}
.tg-org-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.tg-org-placeholder {
    font-size: 0.68rem;
    color: #475569;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
}

/* ── BODY ── */
.tg-body {
    display: flex;
    gap: 16px;
    flex: 1;
    min-height: 0;
}

/* ══════════════════════════════════════
   QUESTION TRANSITION  (exit → enter)
══════════════════════════════════════ */
@keyframes tg-q-exit {
    0%   { opacity: 1; transform: translateY(0)    scale(1);    filter: blur(0px); }
    100% { opacity: 0; transform: translateY(-28px) scale(0.94); filter: blur(3px); }
}
@keyframes tg-q-enter {
    0%   { opacity: 0; transform: translateY(32px) scale(0.93); filter: blur(4px); }
    70%  { filter: blur(0px); }
    100% { opacity: 1; transform: translateY(0)   scale(1);    filter: blur(0px); }
}
.tg-left.tg-q-exit {
    animation: tg-q-exit 0.20s cubic-bezier(.55,0,1,.45) both;
    pointer-events: none;   /* block clicks during exit */
}
.tg-left.tg-q-enter {
    animation: tg-q-enter 0.34s cubic-bezier(.16,1,.3,1) both;
}

/* ── LEFT PANEL ── */
.tg-left {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    padding-left:120px;
    padding-bottom: 0;
}

/* Question Area */
.tg-question-area {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tg-question-icon-wrap {
    position: relative;
    z-index: 2;
    margin-bottom: -30px;
}

.tg-question-icon-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(160,120,255,.75)) drop-shadow(0 0 24px rgba(120,80,220,.45));
    display: block;
}

.tg-question-box {
    background: rgb(18 10 58 / 58%);
    border: 1px solid rgba(120, 90, 255, 0.4);
    border-radius: 16px;
    padding: 35px 15px 15px;
    width: 100%;
    box-sizing: border-box;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    box-shadow: 0 0 28px rgba(80, 50, 200, .2), inset 0 1px 0 rgba(255, 255, 255, .06);
}

#question-text {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.15;
    margin: 0;
    color: #fff;
}

/* ── ANSWERS ── */
.tg-answers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    flex: 1;
}

/* Re-use .answers-container for JS compat */
.answers-container { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 50px; }

.answer-btn,
.tg-answer-btn {
    background: linear-gradient(
        160deg,
        rgba(60, 35, 155, 0.97) 0%,
        rgba(35, 18, 105, 0.97) 45%,
        rgba(50, 28, 138, 0.95) 100%
    );
    border: 1.5px solid rgba(140, 110, 255, 0.6);
    color: #fff;
    padding: 14px 18px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 14px;
    border-radius: 16px;
    transition: transform .15s ease, box-shadow .15s ease;
    min-height: 68px;
    max-height: 105px;
    position: relative;
    overflow: hidden;
    font-family: 'Geist','Inter',sans-serif;
    box-shadow:
        0 4px 22px rgba(60, 30, 180, 0.4),
        0 1px 3px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    box-sizing: border-box;
}

/* Top sheen — thin highlight along the upper edge */
.answer-btn::before,
.tg-answer-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 40%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.07) 0%,
        rgba(255, 255, 255, 0.00) 100%
    );
    border-radius: 16px 16px 0 0;
    pointer-events: none;
}

/* Diagonal light sweep */
.answer-btn::after,
.tg-answer-btn::after {
    content: '';
    position: absolute;
    top: -60%;
    left: -20%;
    width: 55%;
    height: 220%;
    background: linear-gradient(
        100deg,
        transparent 35%,
        rgba(200, 170, 255, 0.06) 50%,
        transparent 65%
    );
    transform: rotate(-18deg);
    pointer-events: none;
}

.answer-btn:hover:not(.disabled):not(.used),
.tg-answer-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow:
        0 8px 28px rgba(80, 45, 210, 0.6),
        0 2px 6px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

/* Letter circle */
.tg-letter {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    color: #16085a;
    font-weight: 900;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.35),
        0 0 0 2px rgba(255, 255, 255, 0.15);
}

.opt-label-img { /* kept for compat — not used in new template */ display: none; }
.opt-label     { display: none; }

.opt-text {
    font-size: 0.8rem !important;
    line-height: 1 !important;
    font-weight: 300 !important;
    color: #fff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
    position: relative;
    z-index: 2;
}

/* Answer states */
.answer-btn.selected,
.tg-answer-btn.selected {
    filter: brightness(1.2);
    box-shadow: 0 0 18px rgba(160,120,255,.8);
    transform: scale(1.02);
}

.answer-btn.correct,
.tg-answer-btn.correct {
    background: rgba(0,200,140,.28) !important;
    border: 2px solid #00c88c !important;
    box-shadow: 0 0 22px rgba(0,200,140,.6) !important;
    animation: flashGreen .5s infinite alternate;
}
.answer-btn.wrong,
.tg-answer-btn.wrong {
    background: rgba(244,67,54,.28) !important;
    border: 2px solid #f44336 !important;
    box-shadow: 0 0 16px rgba(244,67,54,.5) !important;
}
/* Wrong attempt during retry — dims without error color */
.answer-btn.used-wrong,
.tg-answer-btn.used-wrong {
    opacity: 0.3;
    pointer-events: none;
    filter: grayscale(0.4);
}
.answer-btn.invisible { visibility: hidden; pointer-events: none; }

@keyframes flashGreen {
    from { box-shadow: 0 0 16px rgba(0,200,140,.5); }
    to   { box-shadow: 0 0 30px rgba(0,200,140,.9); }
}

/* ── RIGHT PANEL ── */
.tg-right {
    width: 230px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-right: 80px;
    margin-top: 100px;
}

/* Score box */
.tg-score-box {
    background: url('../images/trivia-etica/fondo-caja-puntos.png') center center / cover no-repeat;
    border: none;
    border-radius: 0px;
    padding: 22px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    box-shadow: 0 4px 20px rgba(60,30,180,.3);
    overflow: hidden;
}
.tg-score-star {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 0 6px rgba(245,197,24,.5));
}
#tg-score-val {
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
    line-height: 1;
}
.tg-score-label {
    font-size: 1.3rem;
    color: #fff;
    font-weight: 700;
    line-height: 1;
}

/* Timer — hidden visually, logic still runs */
.tg-timer-hidden { display: none; }
.timer-ring { display: none; }
#timer-ring  { display: none; }

/* Lifelines */
.tg-lifelines {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    justify-content: flex-start;
}

.tg-lifeline-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 100%;
    display: block;
    border-radius: 12px;
    line-height: 0;
    transition: opacity .2s, filter .2s, transform .15s;
    box-shadow: none;
}
.tg-lifeline-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}
.tg-lifeline-btn:hover:not(.used):not(.active) {
    transform: translateY(-2px);
    filter: brightness(1.08) drop-shadow(0 4px 14px rgba(140,100,255,.55));
}
.tg-lifeline-btn.used {
    opacity: .35;
    pointer-events: none;
    filter: grayscale(0.4);
}
.tg-lifeline-btn.active {
    filter: brightness(1.45) saturate(1.5) drop-shadow(0 0 18px rgba(245,197,24,.85));
    pointer-events: none;
}

/* ── Pista Ética overlay (left panel only) ── */
.tg-hint-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(5, 2, 24, 0.82);
    border-radius: 14px;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: feedbackPop .3s cubic-bezier(.175,.885,.32,1.275);
}
.tg-hint-overlay.hidden { display: none !important; }

.tg-hint-body {
    background: linear-gradient(160deg, #0d1a52 0%, #091038 55%, #0d1060 100%);
    border: 4px solid rgba(80, 130, 255, 0.5);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 36px 44px;
    max-width: 520px;
    width: 88%;
    box-shadow: 0 0 50px rgba(30,100,255,.2), inset 0 1px 0 rgba(255,255,255,.06);
    animation: feedbackPop .35s cubic-bezier(.175,.885,.32,1.275);
}

/* Pista Ética modal — usa imagen de fondo propia */
#modal-phone .tg-hint-body {
    background: url('../images/trivia-etica/caja-fondo-pista-etica-publico.png') center center / cover no-repeat;
    border-color: rgba(140, 100, 255, 0.5);
    background-size: 160% auto;
    box-shadow: 0 0 50px rgba(100,60,255,.25), inset 0 1px 0 rgba(255,255,255,.06);
}

.tg-hint-bulb-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    display: block;
    margin-bottom: 18px;
    filter: drop-shadow(0 0 18px rgba(245,197,24,.85));
}

.tg-hint-title {
    font-size: 2rem;
    color: #e9b105;
    line-height: 1.25;
    margin: 0 0 28px;
    font-weight: 400;
}

.tg-hint-text {
    font-size: 1.2rem;
    color: #fff;
    line-height: 1.25;
    margin: 0 0 28px;
    font-weight: 500;
}

.tg-hint-close {
    background: linear-gradient(135deg, #f5c518, #e6ac00);
    color: #5a3e00;
    border: none;
    padding: 12px 44px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    font-family: 'Geist','Inter',sans-serif;
    box-shadow: 0 4px 16px rgba(245,197,24,.3);
}
.tg-hint-close:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(245,197,24,.5); }

/* ── FEEDBACK OVERLAYS ── */
.trivia-feedback-overlay {
    position: absolute;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.45);
    animation: feedbackPop .35s cubic-bezier(.175,.885,.32,1.275);
}
.trivia-feedback-overlay.hidden { display: none !important; }
.feedback-card-img {
    max-width: 480px;
    width: 85%;
    height: auto;
    border-radius: 16px;
}
@keyframes feedbackPop {
    from { opacity: 0; transform: scale(.7); }
    to   { opacity: 1; transform: scale(1);  }
}

/* ── Correct answer card ── */
.tg-correct-card {
    background: url('../images/trivia-etica/Fondo-juego.png') center center / 210% auto no-repeat;
    border: 2px solid rgba(60, 210, 200, 0.7);
    border-radius: 22px;
    padding: 36px 44px;
    text-align: center;
    max-width: 400px;
    width: 88%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    box-shadow: 0 0 36px rgba(60,210,200,.4), 0 0 80px rgba(60,210,200,.15), inset 0 1px 0 rgba(255,255,255,.06);
    animation: feedbackPop .35s cubic-bezier(.175,.885,.32,1.275);
    position: relative;
    overflow: visible;
}

/* ── Icon wrapper — sparkles burst from here ── */
.tg-correct-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
}
.tg-correct-icon-img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    display: block;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 20px rgba(60,210,200,.6));
}

/* Individual sparkle stars */
.tg-sparkle {
    position: absolute;
    top: 50%; left: 50%;
    margin: -7px;
    line-height: 1;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    animation: tg-sparkle-burst 0.85s ease-out both;
    animation-play-state: paused;
}
.tg-sp-1 { --a:   0deg; --d: 68px; color: #f5c518; font-size: 17px; animation-delay: 0.04s; }
.tg-sp-2 { --a:  45deg; --d: 74px; color: #ffffff; font-size: 11px; animation-delay: 0.10s; }
.tg-sp-3 { --a:  90deg; --d: 70px; color: #3cd2c8; font-size: 16px; animation-delay: 0.06s; }
.tg-sp-4 { --a: 135deg; --d: 72px; color: #f5c518; font-size: 12px; animation-delay: 0.12s; }
.tg-sp-5 { --a: 180deg; --d: 66px; color: #ffffff; font-size: 16px; animation-delay: 0.03s; }
.tg-sp-6 { --a: 225deg; --d: 75px; color: #3cd2c8; font-size: 11px; animation-delay: 0.09s; }
.tg-sp-7 { --a: 270deg; --d: 69px; color: #f5c518; font-size: 15px; animation-delay: 0.07s; }
.tg-sp-8 { --a: 315deg; --d: 73px; color: #ffffff; font-size: 12px; animation-delay: 0.11s; }

/* Radial burst keyframe — each star flies outward at its own angle */
@keyframes tg-sparkle-burst {
    0%   { opacity: 0;   transform: rotate(var(--a)) translateX(8px)                    scale(0.3); }
    18%  { opacity: 1; }
    65%  { opacity: 0.9; transform: rotate(var(--a)) translateX(var(--d))               scale(1.1); }
    100% { opacity: 0;   transform: rotate(var(--a)) translateX(calc(var(--d) + 18px))  scale(0.4); }
}
/* JS adds .sparkles-active to the wrapper to fire / re-fire the burst */
.sparkles-active .tg-sparkle { animation-play-state: running; }

/* ── Wrong-answer sparkles (red / orange burst) ── */
.tg-retry-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}
.tg-wrong-sparkle {
    position: absolute;
    top: 50%; left: 50%;
    margin: -7px;
    line-height: 1;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    animation: tg-sparkle-burst 0.85s ease-out both;
    animation-play-state: paused;
}
.tg-ws-1 { --a:   0deg; --d: 98px; color: #ff3b30; font-size: 17px; animation-delay: 0.04s; }
.tg-ws-2 { --a:  45deg; --d:105px; color: #ff8c00; font-size: 11px; animation-delay: 0.10s; }
.tg-ws-3 { --a:  90deg; --d: 98px; color: #ff3b30; font-size: 16px; animation-delay: 0.06s; }
.tg-ws-4 { --a: 135deg; --d:102px; color: #ffaa44; font-size: 12px; animation-delay: 0.12s; }
.tg-ws-5 { --a: 180deg; --d: 95px; color: #ff3b30; font-size: 16px; animation-delay: 0.03s; }
.tg-ws-6 { --a: 225deg; --d:106px; color: #ff8c00; font-size: 11px; animation-delay: 0.09s; }
.tg-ws-7 { --a: 270deg; --d: 99px; color: #ffaa44; font-size: 15px; animation-delay: 0.07s; }
.tg-ws-8 { --a: 315deg; --d:103px; color: #ff3b30; font-size: 12px; animation-delay: 0.11s; }
/* JS adds .wrong-sparkles-active to fire / re-fire the burst */
.wrong-sparkles-active .tg-wrong-sparkle { animation-play-state: running; }

.tg-correct-title {
    font-size: 1.5rem; font-weight: 600; color: #fff; margin: 0;
    text-shadow: 0 2px 14px rgba(60,210,200,.3);
}
.tg-correct-btn {
    background: linear-gradient(135deg, #f5c518, #e8b000);
    color: #1a1200; border: none;
    padding: 12px 40px; border-radius: 50px;
    font-size: 1rem; font-weight: 700;
    cursor: pointer;
    display: flex; align-items: center; gap: 10px;
    transition: transform .2s, box-shadow .2s;
    font-family: inherit;
    box-shadow: 0 4px 16px rgba(245,197,24,.5);
}
.tg-correct-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(245,197,24,.7); }

/* ── Retry card (wrong answer — keep playing) ── */
.tg-retry-card {
    background: url(../images/trivia-etica/Fondo-juego.png) center center / cover no-repeat;
    background-size: 220% auto;
    border: 2px solid rgba(255, 100, 60, 0.55);
    border-radius: 20px;
    padding: 36px 44px;
    text-align: center;
    max-width: 380px;
    width: 88%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    box-shadow: 0 0 40px rgba(255,80,40,.25), inset 0 1px 0 rgba(255,255,255,.06);
    animation: feedbackPop .35s cubic-bezier(.175,.885,.32,1.275);
}
.tg-retry-icon-img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 0 18px rgba(255,80,40,.5));
    margin-top: -20px;
    margin-bottom: -20px;
}
.tg-retry-title {
    font-size: 1.5rem; font-weight: 700;
    color: #fff; margin: 0;
    text-shadow: 0 2px 12px rgba(255,80,40,.3);
    margin-top: -30px;
    margin-bottom:15px;
}
.tg-retry-feedback {
    max-width: 420px; margin: -4px auto 18px;
    font-size: 0.95rem; line-height: 1.5; color: #fff;
    text-align: center; white-space: pre-line;
}
.tg-retry-feedback.hidden { display: none; }
.tg-retry-btn {
    background: linear-gradient(135deg, #f5c518, #e8b000);
    color: #1a1200; border: none;
    padding: 12px 40px; border-radius: 50px;
    font-size: 1rem; font-weight: 600;
    cursor: pointer;
    display: flex; align-items: center; gap: 10px;
    transition: transform .2s, box-shadow .2s;
    font-family: inherit;
    box-shadow: 0 4px 16px rgba(245,197,24,.5);
}
.tg-retry-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(245,197,24,.7); }

/* ── MESSAGE OVERLAY (correcto/nivel) ── */
.message-overlay {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    background: rgba(14,8,50,.95);
    border: 2px solid rgba(140,100,255,.6);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    z-index: 100;
    box-shadow: 0 0 50px rgba(120,80,255,.4);
    min-width: 300px;
    color: #fff;
}
.message-overlay h2 { font-size: 2.2rem; margin: 0 0 16px; color: #c8b8ff; }
.message-overlay p  { font-size: 1.3rem; margin-bottom: 28px; color: #ddd; }

/* ── MODALS (pista ética / público) ── */
.modal-content {
    background: url('../images/trivia-etica/caja-fondo-pista-etica-publico.png') center center / 100% 100% no-repeat;
    border-radius: 20px;
    padding: 36px 32px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0 50px rgba(100,60,220,.4);
    position: relative;
    transform: scale(.85);
    transition: transform .3s ease;
    color: #fff;
}
.game-modal:not(.hidden) .modal-content { transform: scale(1); }

.start-content {
    background: rgba(14,8,50,.96) !important;
    border: 2px solid rgba(140,100,255,.6) !important;
    box-shadow: 0 0 40px rgba(120,80,255,.4) !important;
}

.trivia-hint-content { color: white; }
.trivia-hint-header { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 18px; }
.trivia-hint-header h3 { font-size: 1.4rem; font-weight: 700; color: #f5c518; margin: 0; }
.hint-icon { width: 40px; height: 40px; object-fit: contain; }

.close-modal-btn {
    background: linear-gradient(135deg,#7c4dff,#5c35cc);
    color: #fff; border: none;
    padding: 10px 24px; border-radius: 20px;
    font-weight: 700; cursor: pointer;
    margin-top: 20px; transition: transform .2s;
}
.close-modal-btn:hover { transform: scale(1.05); }

.speech-bubble {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff; padding: 14px;
    border-radius: 12px;
    font-size: 1.05rem; font-style: italic;
}

/* ── Audience card ── */
.tg-audience-card {
    background: url(../images/trivia-etica/caja-fondo-pista-etica-publico.png) center center / cover no-repeat;
    box-shadow: 0 0 50px rgba(100, 60, 255, .25), inset 0 1px 0 rgba(255, 255, 255, .06);
    background-size: 180% auto;
    border: 4px solid rgba(110, 85, 255, 0.65);
    border-radius: 20px;
    max-width: 480px;
    width: 90%;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(80,50,255,.35), 0 0 120px rgba(80,50,255,.12), inset 0 1px 0 rgba(255,255,255,.06);
    animation: feedbackPop .35s cubic-bezier(.175,.885,.32,1.275);
}
.tg-audience-hdr {
    background: rgba(8, 5, 35, 0.85);
    border-bottom: 1px solid rgba(110,85,255,.3);
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.tg-audience-hdr-icon {
    width: 46px; height: 46px;
    background: rgba(110,85,255,.3);
    border: 1px solid rgba(140,115,255,.5);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.tg-audience-hdr-title {
    font-size: 1.55rem; font-weight: 600;
    color: #fff; margin: 0; letter-spacing: -0.3px;
    font-family: 'Geist','Inter',sans-serif;
}
.tg-audience-body {
    padding: 20px 24px 24px;
    display: flex; flex-direction: column; gap: 14px;
}
.tg-audience-sub {
    font-size: 1.3rem; color: rgba(220,210,255,.85);
    margin: 0; text-align: center; font-weight: 500;
}
.tg-audience-bars {
    display: flex; flex-direction: column; gap: 12px;
}
.tg-aud-row {
    display: flex; align-items: center; gap: 12px;
}
.tg-aud-letter {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem; font-weight: 900;
    flex-shrink: 0;
}
.tg-aud-letter--a { background: #5ecef0; color: #0a3545; }
.tg-aud-letter--b { background: #f5c518; color: #3a2800; }
.tg-aud-letter--c { background: #a78bfa; color: #2a1060; }
.tg-aud-letter--d { background: #7b9cf5; color: #0a1e60; }
.tg-aud-bar-track {
    flex: 1;
    height: 22px;
    background: rgba(255,255,255,.09);
    border-radius: 50px;
    overflow: hidden;
}
.tg-aud-bar {
    height: 100%;
    width: 0;
    border-radius: 50px;
    transition: width 1.2s cubic-bezier(.4,0,.2,1);
}
.tg-aud-pct {
    font-size: 0.9rem; font-weight: 700;
    color: rgba(255,255,255,.85);
    min-width: 38px; text-align: right; flex-shrink: 0;
}
.tg-aud-pct--max { color: #f5c518; font-weight: 900; font-size: 1rem; }
.tg-audience-close {
    background: transparent;
    border: 1px solid rgba(255,255,255,.25);
    color: rgba(255,255,255,.7); border-radius: 50px;
    padding: 8px 28px; font-size: .85rem; font-weight: 600;
    cursor: pointer; transition: all .2s; align-self: center;
    font-family: 'Geist','Inter',sans-serif;
}
.tg-audience-close:hover {
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.5);
    color: #fff;
}

/* ── TOAST ── */
.game-toast {
    position: fixed; bottom: 40px; left: 50%;
    transform: translateX(-50%);
    background: rgba(80,40,180,.95); color: white;
    padding: 12px 24px; border-radius: 50px;
    display: flex; align-items: center; gap: 10px;
    z-index: 9999; font-weight: 600; font-size: 1rem;
    pointer-events: none; border: 1px solid rgba(160,120,255,.5);
    box-shadow: 0 5px 20px rgba(0,0,0,.5);
    animation: toastSlideIn .4s cubic-bezier(.175,.885,.32,1.275);
}
.game-toast.hidden { display: none !important; }
@keyframes toastSlideIn {
    from { transform: translate(-50%, 50px); opacity: 0; }
    to   { transform: translate(-50%, 0);    opacity: 1; }
}

/* ════════════════════════════════════════════
   END GAME SCREEN
════════════════════════════════════════════ */
#trivia-end-screen {
    position: absolute;
    inset: 0;
    background: url('../images/trivia-etica/Fondo-juego.png') center center;
    background-size: 115% auto;
    background-repeat: no-repeat;
    border-radius: 16px;
    z-index: 600;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    padding: 24px 32px 20px;
    box-sizing: border-box;
    font-family: 'Geist','Inter',sans-serif;
    color: #fff;
    overflow: hidden;
}
#trivia-end-screen.hidden { display: none !important; }

/* Org logo — flush top-right corner inside end screen */
#trivia-end-screen .org-logo-leaf {
    background: transparent;
    padding: 0;
    position: absolute;
    top: 40px;
    right: 70px;
    width: 128px;
    height: 128px;
    border-radius: 45px 0 45px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
}

/* ── Top bar (title only — FGE and org logo are absolutely positioned) ── */
.te-end-topbar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    flex-shrink: 0;
    padding-top: 8px;
}
.te-end-header-center { text-align: center; width: 100%; }
.te-end-title {
    font-size: 2.8rem;
    font-weight: 600;
    font-style: normal;
    margin: 0 0 6px;
    display: flex; align-items: center; justify-content: center; gap: 12px;
    text-shadow: 0 2px 16px rgba(120,80,255,.3);
    margin-top: 50px;
    margin-bottom: 20px;
}
.te-end-title-deco {
    color: rgba(255,255,255,.65);
    font-size: 1.6rem;
    font-style: normal;
    font-weight: 400;
}
.te-end-subtitle {
    font-size: 1.2rem;
    color: #fff;
    margin: 0;
    margin-top: -10px;
}

/* ── 2×2 Grid ── */
.te-end-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    flex: 1;
    min-height: 0;
    max-width: 900px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.te-end-card {
    background: rgb(14 7 50 / 30%);
    border: 3px solid rgba(120, 90, 255, 0.45);
    border-radius: 20px;
    padding: 22px 26px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 32px rgba(50,20,180,.3), inset 0 1px 0 rgba(255,255,255,.05);
}

/* ── Score card ── */
.te-score-card { align-items: flex-start; justify-content: center; gap: 6px; }
.te-score-row {
    display: flex; align-items: center; gap: 14px;
}
.te-score-star-big {
    width: 52px; height: 52px; object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(245,197,24,.7));
    flex-shrink: 0;
}
.te-score-number {
    font-size: 3rem; font-weight: 900; color: #e0c634;
    line-height: 1; letter-spacing: -1px;
    padding-left: 20px;
}
.te-score-unit {
    font-size: 3rem; font-weight: 900; color: #e0c634; line-height: 1;
}
.te-score-label-correct {
    font-size: 1.5rem; color: #e0c634; font-weight: 700;
    margin: 2px 0 0; line-height: 1.35; text-align: center; width: 100%;
}
.te-score-detail {
    font-size: 1.5rem; color: #e0c634; font-weight: 700;
    line-height: 1.35; margin: 0; text-align: center; width: 100%;
}

/* ── Badge card ── */
.te-badge-card { flex-direction: row; align-items: center; gap: 20px; justify-content: flex-start; }
.te-badge-img {
    width: 130px; height: 130px; flex-shrink: 0;
    object-fit: cover;
    border-radius: 50%;
    filter: drop-shadow(0 0 14px rgba(245,197,24,.55));
}
.te-badge-info { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.te-badge-title { font-size: 1.3rem; font-weight: 700; margin: 0; line-height: 1.2; color: #fff; }
.te-badge-sub   { font-size: 0.9rem; color: #fff; margin: 0; line-height: 1.4; }
.te-badge-btn {
    background: linear-gradient(135deg, #f5c518, #e8b000);
    color: #1a1200; border: none;
    padding: 7px 20px; border-radius: 50px;
    font-size: 1rem; font-weight: 400;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 4px 16px rgba(245,197,24,.45);
    font-family: inherit; width: 100%;
}
.te-badge-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(245,197,24,.65); }

/* ── Feedback card ── */
.te-feedback-card { justify-content: flex-start; gap: 12px; max-height: 250px; }
.te-dilema-card { justify-content: flex-start; gap: 14px; max-height: 250px; padding: 22px 26px 18px; }
.te-dilema-card #te-dilema-form-body { display: flex; flex-direction: column; gap: 12px; }
.te-dilema-card .te-feedback-hdr-text { gap: 8px; }
.te-feedback-header { display: flex; align-items: flex-start; gap: 10px; }
.te-feedback-icon { flex-shrink: 0; display: flex; margin-top: 2px; line-height: 1; }
.te-feedback-hdr-text { display: flex; flex-direction: column; gap: 3px; }
.te-feedback-title { font-size: 1.15rem; font-weight: 900; margin: 0; color: #fff; }
.te-feedback-sub   { font-size: 0.82rem; color: rgba(200,190,255,.8); margin: 0; }
.te-feedback-tags  { display: flex; gap: 8px; }
.te-tag {
    background: transparent;
    border: 1px solid rgba(255,255,255,.4);
    color: rgba(255,255,255,.9);
    border-radius: 50px; padding: 6px 18px;
    font-size: 0.85rem; font-weight: 600;
    cursor: pointer; transition: all .2s;
    font-family: inherit;
    flex: 1;
    text-align: center;
}
.te-tag:hover, .te-tag.active {
    background: rgba(255,255,255,.18);
    border-color: rgba(255,255,255,.85);
    color: #fff;
}
.te-feedback-input {
    width: 100%; padding: 11px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.08);
    color: #fff; font-size: .88rem;
    font-family: inherit; outline: none;
    transition: border-color .2s, background .2s;
    box-sizing: border-box;
}
.te-feedback-input:focus {
    border-color: rgba(160,120,255,.6);
    background: rgba(255,255,255,.12);
}
.te-dilema-textarea { resize: none; min-height: 74px; padding: 10px 14px; font-family: inherit; line-height: 1.4; }
.te-feedback-input::placeholder { color: rgba(255,255,255,.3); }
.te-feedback-send {
    margin-top: 10px;
    background: rgba(160,130,230,.55);
    border: 1px solid rgba(180,150,255,.4);
    color: #fff; border-radius: 50px;
    padding: 10px 40px; font-size: .9rem; font-weight: 700;
    cursor: pointer; transition: background .2s, box-shadow .2s;
    align-self: center; font-family: inherit;
}
.te-feedback-send:hover { background: rgba(160,130,230,.8); box-shadow: 0 4px 16px rgba(120,80,255,.4); }
.te-feedback-sent {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(60, 200, 140, 0.15);
    border: 1px solid rgba(60, 200, 140, 0.4);
    border-radius: 50px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #6effc8;
    text-align: center;
    animation: feedbackSentIn .4s cubic-bezier(.175,.885,.32,1.275);
}
.te-feedback-sent::before {
    content: '✓';
    width: 20px;
    height: 20px;
    background: rgba(60,200,140,.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 900;
    flex-shrink: 0;
    color: #6effc8;
}
@keyframes feedbackSentIn {
    from { opacity: 0; transform: translateY(6px) scale(.92); }
    to   { opacity: 1; transform: translateY(0)  scale(1); }
}

/* ── Share card ── */
.te-share-card { align-items: center; text-align: center; justify-content: center; gap: 24px; max-height: 250px;}
.te-share-title { font-size: 1.35rem; font-weight: 700; margin: 0; line-height: 1.35; color: #fff; }
.te-share-icons { display: flex; gap: 24px; align-items: center; justify-content: center; }
.te-share-btn {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: transform .2s, opacity .2s;
    text-decoration: none; border: none; padding: 0;
    background: transparent !important;
}
.te-share-btn:hover { transform: scale(1.2); opacity: .8; }
.te-share-btn svg { width: 32px; height: 32px; fill: rgba(255,255,255,.92); }

/* ════════════════════════════════════════════
   TRIVIA ÉTICA — INTRO / WELCOME SCREEN
════════════════════════════════════════════ */
.trivia-etica-intro {
    position: relative; width: 100%; height: 100%;
    background: url('../images/trivia-etica/Fondo-juego.png') center center;
    background-size: 115% auto;
    background-repeat: no-repeat;
    border-radius: 40px; overflow: hidden;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    color: white; font-family: 'Geist','Inter',sans-serif;
}

/* Cuando el dilema tiene video de introducción: formulario a la izquierda, video a la derecha
   (mismas proporciones que Clave Ética, para que ambos diagramas de inicio luzcan iguales) */
.trivia-etica-intro.has-video {
    flex-direction: row;
    justify-content: center;
    gap: 50px;
    max-width: 1250px;
    margin: 0 auto;
}
.trivia-etica-intro.has-video .te-center-content {
    margin-top: 0;
    max-width: 440px;
    flex: 1 1 440px;
}
/* Achicar el logo/título grandes para que el formulario quepa en la columna angosta,
   igual de compacto que el bloque central de Clave Ética */
.trivia-etica-intro.has-video .te-logo-wrap { width: 130px; height: 130px; }
.trivia-etica-intro.has-video .te-logo-icon { width: 130px; height: 130px; }
.trivia-etica-intro.has-video .te-title { font-size: 2.6rem; margin: 0 0 6px; }
.trivia-etica-intro.has-video .te-subtitle { font-size: 0.95rem; margin-bottom: 6px; }

.te-video-side {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 525px;
    max-width: 525px;
    z-index: 10;
}

/* Language selector — bottom centered */
.te-lang-bottom { z-index: 20; }

/* FGE logo — top-left */
.te-fge-logo { position: absolute; top: 110px; left: 60px; z-index: 20; }
.te-fge-img  { height: 36px; width: auto; filter: brightness(0) invert(1); opacity: .9; }

/* Org logo — top-right (leaf card, same design as Dilema Ético) */
.trivia-etica-intro .org-logo-leaf {
    background: transparent;
    padding: 0;
    position: absolute;
    top: 65px;
    right: 85px;
    width: 128px;
    height: 128px;
    border-radius: 45px 0 45px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
}

/* Center content */
.te-center-content {
    display: flex; flex-direction: column; align-items: center;
    text-align: center; z-index: 10;
    padding: 0 40px; max-width: 600px; width: 100%;
    margin-top: -50px;
}

/* Logo — duplicated size + estrellas */
.te-logo-wrap {
    position: relative; margin-bottom: 10px;
    animation: floatLogo 3s ease-in-out infinite;
    width: 220px; height: 220px;
    display: flex; align-items: center; justify-content: center;
}
.te-logo-icon {
    width: 300px; height: 300px; object-fit: contain;
    filter: drop-shadow(0 0 40px rgba(160,120,255,.65));
    position: relative; z-index: 1;
}

/* Logo más pequeño en desktop cuando hay selector de área (evita que se clippe arriba) */
.trivia-etica-intro:has(#user-area) .te-logo-wrap { width: 160px; height: 160px; }
.trivia-etica-intro:has(#user-area) .te-logo-icon { width: 160px; height: 160px; }

/* Aún más pequeño cuando además hay bloque de consent */
.trivia-etica-intro:has(#user-area):has(#consent-block) .te-logo-wrap { width: 130px; height: 130px; }
.trivia-etica-intro:has(#user-area):has(#consent-block) .te-logo-icon { width: 130px; height: 130px; }

/* ── Estrellas destellando ── */
.te-star { position: absolute; z-index: 2; pointer-events: none; }
.te-star::before, .te-star::after {
    content: ''; position: absolute; background: #fff; border-radius: 2px;
}
.te-star::before { width: 3px; height: 18px; left: 50%; top: 50%; transform: translate(-50%,-50%); }
.te-star::after  { width: 18px; height: 3px; left: 50%; top: 50%; transform: translate(-50%,-50%); }

@keyframes starTwinkle {
    0%,100% { opacity: 0;   transform: scale(.2) rotate(0deg); }
    40%      { opacity: 1;   transform: scale(1)  rotate(15deg); }
    60%      { opacity: .9;  transform: scale(1)  rotate(15deg); }
}
.te-star.s1 { top: 4px;    left: 50%;   width:8px;  height:8px;  animation: starTwinkle 2.0s 0.0s infinite; }
.te-star.s2 { top: 20px;   right: 18px; width:6px;  height:6px;  animation: starTwinkle 1.8s 0.4s infinite; }
.te-star.s3 { top: 55%;    right: 4px;  width:10px; height:10px; animation: starTwinkle 2.4s 0.8s infinite; }
.te-star.s4 { bottom: 18px;right: 28px; width:7px;  height:7px;  animation: starTwinkle 1.6s 1.2s infinite; }
.te-star.s5 { bottom: 4px; left: 38%;   width:9px;  height:9px;  animation: starTwinkle 2.2s 0.6s infinite; }
.te-star.s6 { bottom: 22px;left: 16px;  width:6px;  height:6px;  animation: starTwinkle 1.9s 1.5s infinite; }
.te-star.s7 { top: 48%;    left: 2px;   width:8px;  height:8px;  animation: starTwinkle 2.1s 0.2s infinite; }
.te-star.s8 { top: 14px;   left: 22px;  width:5px;  height:5px;  animation: starTwinkle 1.7s 1.0s infinite; }
.te-star.s1::before,.te-star.s1::after,.te-star.s4::before,.te-star.s4::after,
.te-star.s7::before,.te-star.s7::after { background:#fff; }
.te-star.s2::before,.te-star.s2::after,.te-star.s5::before,.te-star.s5::after,
.te-star.s8::before,.te-star.s8::after { background:#f5c518; }
.te-star.s3::before,.te-star.s3::after,.te-star.s6::before,.te-star.s6::after { background:#c8b8ff; }

/* Title */
.te-title { font-size: 5rem; font-weight: 900; margin: 0 0 10px; line-height: 1.05; letter-spacing: -.5px; }
.te-title-white  { color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.te-title-yellow { color: #f5c518; text-shadow: 0 2px 16px rgba(245,197,24,.5); margin-left: 8px; }

.te-subtitle { font-size: 1.4rem; color: white; margin: 0 0 10px; font-weight: 400; line-height: 1.4; margin-top:-10px}

/* Form */
.te-form { width: 100%; max-width: 440px; display: flex; flex-direction: column; align-items: center; }
.te-form-label { font-size: .9rem; color:white; margin: 0 0 10px; font-weight: 400; }
.te-input {
    width: 100%; padding: 10px 20px; border-radius: 5px;
    border: 1.5px solid rgba(255,255,255,.3);
    background: rgba(255,255,255,.92); color: #94a3b8;
    font-size: 1rem; font-family: 'Geist','Inter',sans-serif;
    outline: none; transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
}
.te-input:focus { border-color: #a78bfa; box-shadow: 0 0 0 3px rgba(167,139,250,.3); background: #fff; }
.te-input::placeholder { color: #94a3b8; }

.te-btn {
    width: 100%; padding: 15px 28px; border-radius: 12px;
    border: none; background: linear-gradient(135deg,#f5c518,#e6ac00);
    color: #1a1200; font-size: 1.05rem; font-weight: 500;
    font-family: 'Geist','Inter',sans-serif; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 4px 20px rgba(245,197,24,.45); letter-spacing: .02em;
    margin-top:10px;
}
.te-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(245,197,24,.6); }

/* ════════════════════════════════════════════
   INSTRUCTIONS OVERLAY  (.tg-start-overlay)
════════════════════════════════════════════ */
.tg-start-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    background: url('../images/trivia-etica/Fondo-juego.png') center center;
    background-size: 115% auto;
    background-repeat: no-repeat;
}
.tg-start-overlay.hidden { display: none !important; }

/* FGE logo — top left */
.ti-corner-fge {
    position: absolute;
    top: 110px;
    left: 60px;
    z-index: 20;
}
.ti-fge-img {
    height: 34px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 1;
    display: block;
}
.trivia-etica-intro .org-logo-leaf img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: none !important;
    transform-origin: center center;
}
/* Org logo — top right */
.ti-corner-org {
    background: transparent;
    padding: 0;
    position: absolute;
    top: 65px;
    right: 85px;
    width: 128px;
    height: 128px;
    border-radius: 45px 0 45px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
}
.ti-corner-org img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: none !important;
    transform-origin: center center;
}
.ti-org-leaf-text {
    font-size: 0.7rem;
    color: #475569;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
}

/* Main content — transparent, 90% wide */
.ti-card {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    width: 90%;
    max-width: 920px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    font-family: 'Geist','Inter',sans-serif;
    color: #fff;
}

/* Icon + title block */
.ti-icon-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}
.ti-qmark-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ti-qmark-img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    display: block;
    position: relative;
    z-index: 1;
}

/* Sparkles around the question mark icon */
.ti-spark {
    position: absolute;
    pointer-events: none;
    font-weight: 900;
    line-height: 1;
    animation: ti-twinkle 2.2s ease-in-out infinite;
    z-index: 0;
}
@keyframes ti-twinkle {
    0%, 100% { opacity: 0.15; transform: scale(0.7); }
    50%       { opacity: 1;    transform: scale(1.2); }
}
.ti-s1 { top: -8px;  right: -4px;  font-size: 1.3rem; color: #f0b429; animation-duration: 2.1s; animation-delay: 0s; }
.ti-s2 { top: 10%;   left: -14px;  font-size: 1rem;   color: #c8b0f8; animation-duration: 1.9s; animation-delay: 0.5s; }
.ti-s3 { bottom: 0;  left: -8px;   font-size: 0.9rem; color: #7bb5f5; animation-duration: 2.5s; animation-delay: 0.9s; }
.ti-s4 { bottom: 0;  right: -10px; font-size: 0.8rem; color: #f0b429; animation-duration: 2.0s; animation-delay: 0.3s; }
.ti-s5 { top: -14px; left: 50%;    font-size: 1.5rem; color: #f0b429; animation-duration: 2.4s; animation-delay: 0.2s; transform: translateX(-50%); }
.ti-s6 { top: 40%;   right: -18px; font-size: 1rem;   color: #e89878; animation-duration: 2.6s; animation-delay: 1.4s; }
.ti-title {
    font-size: 2.6rem;
    font-weight: 700;
    font-style: normal;
    margin: 4px 0 0;
    color: #fff;
    text-align: center;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 20px rgba(120,80,255,.4);
}
.ti-subtitle {
    font-size: 0.9rem;
    color: rgba(210,200,255,.75);
    margin: 0;
    text-align: center;
}

/* Lifelines row */
.ti-lifelines-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
    width: 100%;
}
.ti-lf-card {
    background: linear-gradient(160deg, rgba(55,32,160,.72) 0%, rgba(28,14,90,.82) 100%);
    border: 1px solid rgba(140,110,255,.5);
    border-radius: 20px;
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 24px rgba(60,30,160,.35), inset 0 1px 0 rgba(255,255,255,.06);
}

/* Preview del botón de comodín (igual que en partida, no interactivo) */
.ti-lf-btn-preview {
    width: 100%;
    pointer-events: none;
    user-select: none;
    border-radius: 12px;
    line-height: 0;
    filter: drop-shadow(0 4px 14px rgba(140,100,255,.45));
}
/* Mantener la imagen a ancho completo en preview (override del responsive de la partida) */
.ti-lf-btn-preview .tg-lifeline-img {
    width: 100% !important;
    height: auto !important;
}

.ti-lf-desc {
    font-size: 1.0rem;
    color: rgba(220, 210, 255, .92);
    margin: 0;
    font-weight: 400;
    line-height: 1.3;
    padding: 0 4px;
    text-align: center;
}

/* Steps */
.ti-steps {
    background: #c3b4f7ba;
    border: 1px solid rgba(160, 140, 255, 0.22);
    border-radius: 18px;
    padding: 20px 28px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 13px;
}
.ti-step {
    display: flex;
    align-items: center;
    gap: 14px;
}
.ti-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #6040d0;
    border: 2px solid rgba(180,160,255,.5);
    color: #c6c1db;
    font-size: 0.82rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(80,50,200,.45);
    padding-top: 2px;  /* Ajuste visual para centrar el número */
}
.ti-step-text {
    font-size: 0.93rem;
    color: rgb(55 32 120 / 95%);
    font-weight: 500;
}

/* Start button */
.ti-start-btn {
    background: linear-gradient(135deg, #f5c518, #e8b000);
    color: #1a1200;
    border: none;
    padding: 10px 60px !important;
    font-size: 1.0rem !important;
    font-weight: 500 !important;
    cursor: pointer;
    border-radius: 50px;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 4px 24px rgba(245,197,24,.5);
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Geist','Inter',sans-serif;
    margin-top: 8px;
    letter-spacing: 0.01em;
}
.ti-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(245,197,24,.7);
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .tg-body { flex-direction: column; }
    .tg-right { width: 100%; flex-direction: row; flex-wrap: wrap; }
    .tg-lifelines { flex-direction: row; }
    .tg-lifeline-img { height: 44px; width: auto; }
    .tg-answers, .answers-container { grid-template-columns: 1fr; }
    .te-end-grid { grid-template-columns: 1fr; }
    .te-title { font-size: 2.8rem; }
    .te-logo-wrap, .te-logo-icon { width: 160px; height: 160px; }
    .te-org-logo { right: 90px; }
    .ti-lifelines-row { grid-template-columns: 1fr; }
    .ti-title { font-size: 1.9rem; }
    .ti-corner-fge { top: 20px; left: 20px; }
    .ti-corner-org { top: 0; right: 0; width: 90px; height: 72px; }
}

/* ══════════════════════════════════════════════
   MOBILE — Trivia Ética responsive (≤ 768 px)
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* 0. Body/HTML: scroll fix — anula body.game-active { overflow:hidden; height:100vh } de single-dilema.css */
    html {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        height: auto !important;
    }
    body.trivia-etica-body,
    body.trivia-etica-body.single-dilemas,
    body.trivia-etica-body.game-active {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y !important;
        height: auto !important;
        min-height: 100dvh !important;
        background-attachment: scroll !important;
        background-color: #120a3a !important;
        background-size: cover !important;
    }

    /* 1. Contenedores base: quitar transform fijo de 1250×700 */
    body.trivia-etica-body #welcome-box,
    body.trivia-etica-body #instructions-box,
    body.trivia-etica-body #game-container,
    body.trivia-etica-body #game-loader {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        margin: 0 !important;
        background-color: #120a3a !important;
        overflow: visible !important; /* anula #welcome-box { overflow:hidden } de single-dilema.css */
    }

    body.trivia-etica-body .app-master-wrapper {
        min-height: 0 !important;
        align-items: stretch !important;
        padding: 0 !important;
        background-color: #120a3a !important;
    }

    /* 2. Intro / login screen */
    .trivia-etica-intro {
        border-radius: 0 !important;
        min-height: 100dvh !important;
        padding: 55px 20px 30px !important;
        background: url(../images/trivia-etica/Fondo-juego.png) center center !important;
        background-size: 360% !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        justify-content: flex-start !important;
    }

    .te-fge-logo {
        top: 16px !important;
        left: 20px !important;
    }
    .te-fge-img { height: 26px !important; }

    .trivia-etica-intro .org-logo-leaf {
        top: 12px !important;
        right: 14px !important;
        width: 60px !important;
        height: 60px !important;
        border-radius: 50% !important;
        padding: 0 !important;
    }

    .te-center-content {
        max-width: 100% !important;
        padding: 0 !important;
        margin-top: 8px !important;
    }

    .trivia-etica-intro.has-video {
        flex-direction: column !important;
        gap: 20px !important;
        max-width: 100% !important;
    }

    .te-video-side {
        max-width: 100% !important;
        width: 100% !important;
    }

    .te-logo-wrap { width: 70px !important; height: 70px !important; }
    .te-logo-icon { width: 150px !important; height: auto !important; }
    .te-title { font-size: 1.8rem !important; }
    .te-subtitle { font-size: 0.88rem !important; margin-bottom: 6px !important; }

    .te-lang-bottom {
        position: static !important;
        transform: none !important;
        margin: 16px auto 0 !important;
        left: auto !important;
        bottom: auto !important;
    }

    /* 3. Game screen (preguntas) */
    .tg-wrapper {
        border-radius: 0 !important;
        padding: 60px 12px 12px !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        background-size: cover !important;
        background-color: #120a3a !important;
    }

    .tg-fge {
        top: 14px !important;
        left: 16px !important;
    }
    .tg-fge-img { height: 24px !important; }

    .tg-org-logo-wrap {
        top: 12px !important;
        right: 14px !important;
        width: 60px !important;
        height: 60px !important;
        border-radius: 50% !important;
    }

    .tg-top-bar {
        margin-top: 10px !important;
    }

    .tg-progress-area {
        flex: 0 0 auto !important;
        margin-top: 8px !important;
        margin-bottom: 8px !important;
        padding: 0 4px !important;
        width: 100% !important;
    }

    .tg-progress-track {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .tg-progress-dot {
        width: 34px !important;
        height: 34px !important;
        font-size: 0.8rem !important;
        flex-shrink: 0 !important;
    }

    /* Ocultar líneas conectoras en mobile — con wrap quedarían mal */
    .tg-progress-dot + .tg-progress-dot::before { display: none !important; }

    .tg-left {
        padding-left: 0 !important;
        gap: 8px !important;
    }

    .tg-right {
        width: 100% !important;
        margin-right: 0 !important;
        margin-top: 10px !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 10px !important;
    }

    .tg-score-box {
        align-self: center !important;
        min-width: 160px !important;
    }

    .tg-lifelines {
        flex-direction: column !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .tg-lifeline-btn {
        width: 220px !important;
        max-width: 80vw !important;
        display: block !important;
        margin: 0 auto !important;
    }

    .tg-lifeline-img {
        width: 100% !important;
        height: auto !important;
    }

    .tg-question-icon-img {
        width: 40px !important;
        height: 40px !important;
    }

    .tg-question-icon-wrap { margin-bottom: -20px !important; }

    .tg-question-box {
        padding: 28px 14px 12px !important;
        min-height: 70px !important;
        font-size: 0.9rem !important;
    }

    #question-text { font-size: 1rem !important; line-height: 1.15 !important; }

    .tg-answers {
        grid-template-columns: 1fr !important;
        gap: 6px !important;
    }

    .tg-answer-btn, .answer-btn {
        min-height: 44px !important;
        max-height: none !important;
        padding: 10px 12px !important;
        font-size: 0.85rem !important;
        gap: 8px !important;
    }

    /* 4. Instructions overlay */
    .tg-start-overlay {
        background: url(../images/trivia-etica/Fondo-juego.png) center center !important;
        background-size: 504% !important;
        background-repeat: no-repeat !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y !important;
        padding: 60px 16px 30px !important;
    }

    .ti-card {
        max-height: none !important;
        width: 100% !important;
    }

    .ti-lifelines-row {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .ti-lf-card {
        flex-direction: row !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 10px 14px !important;
    }

    .ti-lf-btn-preview {
        width: 80px !important;
        flex-shrink: 0 !important;
    }

    .ti-lf-desc { text-align: left !important; padding: 0 !important; font-size: 0.9rem !important; }

    .ti-title { font-size: 1.8rem !important; }

    .ti-steps { padding: 14px 16px !important; gap: 10px !important; }

    .ti-spark { display: none !important; }

    .ti-corner-fge {
        top: 14px !important;
        left: 16px !important;
    }

    .ti-corner-org {
        top: 12px !important;
        right: 14px !important;
        width: 60px !important;
        height: 60px !important;
        border-radius: 50% !important;
    }

    .ti-title { font-size: 1.5rem !important; }

    /* 5. End screen */
    #trivia-end-screen {
        position: fixed !important;
        inset: 0 !important;
        border-radius: 0 !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y !important;
        height: 100dvh !important;
        padding: 60px 16px 40px !important;
        background-size: cover !important;
        background-color: #120a3a !important;
        z-index: 600 !important;
        box-sizing: border-box !important;
    }

    #trivia-end-screen .org-logo-leaf {
        top: 12px !important;
        right: 14px !important;
        width: 60px !important;
        height: 60px !important;
        border-radius: 50% !important;
    }

    .te-end-title {
        font-size: 1.6rem !important;
        margin-top: 10px !important;
        flex-wrap: wrap !important;
        text-align: center !important;
    }
    .te-end-subtitle { font-size: 1rem !important; }
    .te-end-grid {
        grid-template-columns: 1fr !important;
        flex: none !important;
        min-height: 0 !important;
    }
    .te-end-card { padding: 15px 15px !important; }

    /* Comodines / modales: ajuste de background-size en mobile */
    .tg-correct-card { background-size: 176% auto !important; }
    .tg-retry-card { background-size: 210% auto !important; }
    #modal-phone .tg-hint-body, .tg-audience-card { background-size: 260% auto !important; }

    /* Footer: extend game background so no white gap appears below game */
    body.trivia-etica-body #main-footer {
        background: url('../images/trivia-etica/Fondo-pantalla-grande.png') center bottom / cover no-repeat !important;
        background-color: #120a3a !important;
        border-radius: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-shadow: none !important;
        padding: 16px 20px 20px !important;
    }
}

/* ── Ya completaste (Trivia Ética) ── */
body.trivia-etica-body .dilema-done-icon-wrap {
    background: rgba(245,197,24,.15);
    box-shadow: 0 0 0 6px rgba(245,197,24,.1);
}
body.trivia-etica-body .dilema-done-check {
    color: #f5c518;
}
body.trivia-etica-body .dilema-done-title {
    color: #f5c518;
}
body.trivia-etica-body .dilema-done-msg {
    color: #fff;
}

/* ── Markdown bold ── */
#question-text strong {
    font-weight: 800;
    color: #f5c518;
}
.opt-text strong {
    font-weight: 700 !important;
    color: #ffe87a !important;
    text-shadow: 0 0 8px rgba(245,197,24,.35);
}
.tg-hint-text strong {
    font-weight: 700;
    color: #f5c518;
}

/* ── Chapita: nombre de empresa overlay ── */
.chapita-wrapper {
    position: relative;
    display: inline-block;
    line-height: 0;
}
.chapita-empresa-label {
    position: absolute;
    bottom: 22%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 50, 70, 0.80);
    color: #fff;
    padding: 3px 14px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.04em;
    pointer-events: none;
    line-height: 1.6;
}

/* Feedback opcional al acertar (Trivia Ética) */
.tg-correct-feedback {
    max-width: 420px; margin: -4px auto 18px;
    font-size: 0.95rem; line-height: 1.5; color: #fff;
    text-align: center; white-space: pre-line;
}
.tg-correct-feedback.hidden { display: none; }
/* Opción A: negrita amarilla y sombra oscura para que el texto no se pierda sobre la luz del fondo */
.tg-correct-feedback, .tg-retry-feedback {
    text-shadow: 0 1px 3px rgba(0,0,0,.85), 0 0 10px rgba(0,0,0,.55);
}
.tg-correct-feedback strong, .tg-retry-feedback strong {
    font-weight: 800; color: #f5c518;
    text-shadow: 0 1px 3px rgba(0,0,0,.9), 0 0 8px rgba(245,197,24,.25);
}
