/* =========================================
   8. UNIFIED GAME RESULT SCREENS (COMMON)
   ========================================= */
/* Generic Container for Modal/Overlay results */
.game-result-modal {
    margin: 20px auto;
    width: 100%;
    max-width: 500px;
    /* Juegos con board ~500px. Overridear en CSS específico si el board es más ancho */
    animation: bounceIn 0.8s;
    text-align: center;
    z-index: 200;

    /* Stack content (card) and countdown vertically */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    /* Space between card and countdown */
}

/* Flex content wrapper (THE CARD) */
.game-result-content {
    border: 3px solid #ffb300;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
    color: white;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    /* Win Green */

    width: 100%;
    /* Se acota por el max-width del padre (.game-result-modal) */
}

/* LOSS Variant */
.game-result-content.is-loss {
    background: linear-gradient(135deg, #c62828, #b71c1c);
    box-shadow: 0 0 20px rgba(198, 40, 40, 0.4);
    border-color: #e57373;
}

.game-result-content.is-loss .game-result-title {
    color: #ffcdd2;
    text-shadow: 2px 2px 0 #5c0000;
}

.game-result-content.is-loss .character-portrait {
    border-color: #ffcdd2;
}

/* Icon / Image container */
.game-result-icon {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Text Icon (Skull, etc) */
.game-result-icon.text-icon,
.game-result-icon .text-icon {
    font-size: 3.5rem;
    /* Larger icon */
    margin-bottom: 0;
}

.character-portrait {
    width: 100px;
    height: 100px;
    min-height: 80px;
    object-fit: cover;
    object-position: top center;
    border-radius: 10%;
    border: 1px solid #fff;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.text-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

/* Text Wrapper */
.game-result-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Force center alignment for text */
    text-align: center;
    /* Force center text */
    justify-content: center;
}

.game-result-text.centered {
    width: 100%;
    align-items: center;
}

.total-score-highlight {
    font-size: 2.5rem;
    margin: 10px 0;
}

/* Titles */
.game-result-modal h2,
.game-result-title {
    font-family: 'Pirata One', cursive;
    color: #ffca28;
    /* var(--gold-treasure) */
    font-size: 2.2rem;
    /* Larger Title */
    margin: 0 0 10px 0;
    text-shadow: 2px 2px 0px #3e2723;
    line-height: 1.1;
}

/* Descriptions */
.game-result-modal p,
.game-result-desc {
    margin: 15px 0;
    font-size: 1.2rem;
    /* Larger readable text */
    color: #fff;
    line-height: 1.3;
}

/* Extra info (scores, solutions) */
.game-result-extra {
    margin-top: 10px;
    font-weight: bold;
    color: #ffca28;
}

/* Responsive */
@media (max-width: 600px) {
    .game-result-content {
        flex-direction: column;
        text-align: center;
        padding: 20px;
        gap: 15px;
    }

    .game-result-text {
        align-items: center;
        text-align: center;
    }
}


/* =========================================
   8. COMMON RESULTS UI (Wordle, Character, Fruta)
   ========================================= */

/* YESTERDAY BANNER */
.yesterday-banner {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 500px;
    margin: 10px auto;
    background-color: #f7ebc7;
    background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.05));
    border: 3px solid #6d4c41;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), inset 0 0 10px rgba(161, 136, 127, 0.4);
    padding: 10px 15px;
    position: relative;
    color: #3e2723;
    z-index: 0;
}

.yesterday-img-container {
    width: 50px;
    height: 60px;
    flex-shrink: 0;
    margin-right: 15px;
    border: 2px solid #4e342e;
    background: #222;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    transform: rotate(-2deg);
}

.yesterday-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    /* Focus on face usually at top */
}

.yesterday-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.yesterday-label {
    font-family: 'Roboto', sans-serif;
    font-size: 0.75rem;
    color: #5d4037;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.yesterday-name {
    font-family: 'Pirata One', cursive;
    font-size: 1.5rem;
    color: #211512;
    line-height: 1;
}

/* COUNTDOWN (Themed & Professional) */
.countdown-container {
    display: flex;
    align-items: center;
    justify-content: center;
    /* margin-top: 15px; Removed, parent gap handles it */
    gap: 15px;

    /* WIDTH CONTROL — se acota por el max-width del padre (.game-result-modal) */
    width: 100%;
    box-sizing: border-box;

    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    padding: 10px 15px;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.hourglass-icon {
    width: 32px;
    /* Slightly larger */
    height: 32px;
    stroke: #ffd700;
    /* Gold stroke */
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.8));
}

.countdown-text {
    display: flex;
    flex-direction: column;
    /* Stack label and time for better hierarchy */
    align-items: flex-start;
    /* Align text left within block */
    line-height: 1;
}

.countdown-label {
    font-family: 'Pirata One', cursive;
    /* Thematic font */
    font-size: 0.9rem;
    color: #bdbdbd;
    /* Silver-ish */
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 1);
}

.countdown-timer {
    font-family: 'Pirata One', cursive;
    /* Thematic font for numbers too */
    font-size: 1.6rem;
    color: #ffd700;
    /* Gold */
    background: transparent;
    padding: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 1);
    letter-spacing: 1px;
}


/* =========================
   SHARE BUTTON (Reusable)
   ========================= */
.btn-share {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #5d4037, #3e2723);
    color: #f7ebc7;
    border: 2px solid #6d4c41;
    border-radius: 8px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.btn-share:hover {
    background: linear-gradient(135deg, #6d4c41, #5d4037);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(93, 64, 55, 0.4);
}

.btn-share:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.btn-share svg {
    flex-shrink: 0;
}

/* =========================
   SHARE TOAST (Reusable)
   ========================= */
.share-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: linear-gradient(135deg, #2c1a0e, #3e2723);
    color: #f7ebc7;
    padding: 12px 28px;
    border-radius: 10px;
    border: 2px solid #6d4c41;
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
    white-space: nowrap;
}

.share-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* =========================
   SHARE MODAL (Reusable)
   ========================= */
.share-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.share-modal-overlay.show {
    opacity: 1;
}

.share-modal-content {
    background: linear-gradient(145deg, #3e2723, #2c1a0e);
    border: 2px solid #6d4c41;
    border-radius: 16px;
    padding: 28px 32px;
    min-width: 280px;
    max-width: 360px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.share-modal-overlay.show .share-modal-content {
    transform: scale(1) translateY(0);
}

.share-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    color: #a1887f;
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
    padding: 4px;
}

.share-modal-close:hover {
    color: #f7ebc7;
}

.share-modal-title {
    font-family: 'Pirata One', cursive;
    font-size: 1.4rem;
    color: #f7ebc7;
    margin: 0 0 20px 0;
    text-align: center;
}

.share-modal-options {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #f7ebc7;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 80px;
}

.share-option:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #d4a843;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(212, 168, 67, 0.2);
    color: #f7ebc7;
}

.share-option:active {
    transform: translateY(0);
}

