﻿/* ============================================================
   LETTER GETTERS — SHARED HUD
   ------------------------------------------------------------
   This stylesheet is the single source of truth for the
   Letter Getters HUD appearance and behavior.

   The visual appearance is matched to the Example HUD.
   Page-specific game logic remains in JavaScript.
   ============================================================ */


/* ============================================================
   HUD CONTAINER
   ============================================================ */

#lgHudContainer {
    position: fixed;
    top: 100px;
    right: 32px;
    z-index: 1050;
    width: max-content;
    min-width: 320px;
    max-width: 92vw;
    display: none;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}


/* ============================================================
   HUD CARD
   ============================================================ */

.lg-hud-card {
    position: relative;
    width: 100%;
    min-width: 320px;
    max-width: 760px;
    padding: 0 1.45rem 1.25rem;
    overflow: hidden;
    border: 3px solid #08284E !important;
    border-radius: 22px !important;
    color: #08284E;
    background: linear-gradient( 180deg, #D01C31 0%, #D01C31 13%, #F8DDE1 28%, #FAF9F7 45%, #F3F4F7 100% ) !important;
    box-shadow: 0 12px 28px rgba(8, 40, 78, 0.24), inset 0 0 0 2px rgba(255, 255, 255, 0.8);
    user-select: none;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
}


    /* ============================================================
   SUBTLE LIGHT EFFECT
   ============================================================ */

    .lg-hud-card::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 150px;
        background: linear-gradient( 135deg, rgba(255, 255, 255, 0.28), transparent 45% );
        pointer-events: none;
    }


/* ============================================================
   HEADER
   ============================================================ */

.lg-hud-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 112px;
    padding: 0.75rem 0.5rem;
    border-bottom: 2px solid rgba(8, 40, 78, 0.35);
    cursor: grab;
}


    .lg-hud-header:active {
        cursor: grabbing;
    }


/* ============================================================
   BRAND IMAGE
   ------------------------------------------------------------
   Matches the Example HUD.
   ============================================================ */

.lg-hud-brand {
    position: absolute;
    left: 4px;
    top: 7px;
    display: flex;
    align-items: center;
}


.lg-hud-brand-image {
    display: block;
    width: 100px;
    max-width: 32vw;
    height: auto;
    object-fit: contain;
}


/* ============================================================
   HEADER TITLE
   ------------------------------------------------------------
   The Example HUD does not display a visible title because
   the medallion provides the branding.
   ============================================================ */

.lg-hud-title {
    margin: 0;
    color: transparent !important;
    font-size: 1.65rem !important;
    font-weight: 900 !important;
    letter-spacing: 1px;
    white-space: nowrap;
    text-shadow: none;
    pointer-events: none;
}


/* ============================================================
   MINIMIZE BUTTON
   ------------------------------------------------------------
   Matches the Example HUD's circular blue button.
   ============================================================ */

.hud-close-wrapper {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
}


.lg-hud-minimize-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 2px solid #FFFFFF;
    border-radius: 50%;
    background: #08284E;
    color: #FFFFFF;
    box-shadow: 0 3px 7px rgba(8, 40, 78, 0.35), inset 0 1px 2px rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: transform 0.18s ease, background-color 0.18s ease;
}


    .lg-hud-minimize-button i {
        font-size: 1.35rem;
        line-height: 1;
        color: #FFFFFF;
    }


    .lg-hud-minimize-button:hover {
        background: #0C3A68;
        transform: scale(1.05);
    }


    .lg-hud-minimize-button:active {
        transform: scale(0.96);
    }


/* ============================================================
   HUD BODY
   ============================================================ */

.lg-hud-body {
    position: relative;
    padding-top: 1.15rem;
}


/* ============================================================
   STATUS / MYSTERY WORD
   ============================================================ */

.lg-hud-status-container {
    margin-bottom: 1rem;
    text-align: center;
}


.lg-hud-status-text {
    margin: 0 0 0.35rem;
    color: #08284E;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
}


.lg-hud-subtext {
    margin: 0;
    color: #08284E;
}


/* ============================================================
   TARGET WORD
   ------------------------------------------------------------
   Matches the Example HUD.
   ============================================================ */

.hud-target-word {
    display: inline-block;
    padding: 5px 13px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 7px;
    background: #08284E !important;
    color: #FFFFFF !important;
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    box-shadow: 0 3px 7px rgba(8, 40, 78, 0.22);
}


/* ============================================================
   LETTER SLOT ROW
   ============================================================ */

#lgSlotRow,
.lg-slot-row {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 1.1rem 0 1.35rem;
    padding-bottom: 1.15rem;
    border-bottom: 2px solid rgba(8, 40, 78, 0.25);
}
#lgExampleSlotRow,
.lg-example-slot-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 1.1rem 0 1.35rem;
    padding-bottom: 1.15rem;
    border-bottom: 2px solid rgba(8, 40, 78, 0.25);
}


/* ============================================================
   LEGACY WORD ROW
   ============================================================ */


.lg-word-row {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    flex-wrap: nowrap;
}



/* ============================================================
   EMPTY LETTER SLOTS
   ============================================================ */

.lg-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 58px;
    flex: 0 0 52px;
    border: 2px solid #B7BBC4;
    border-radius: 10px;
    background: linear-gradient( 145deg, #FFFFFF 0%, #F4F5F7 55%, #DDE1E7 100% );
    color: #08284E;
    font-size: 1.7rem;
    font-weight: 900;
    box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.95), inset 0 -3px 5px rgba(8, 40, 78, 0.08), 0 3px 6px rgba(8, 40, 78, 0.18);
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.lg-example-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 58px;
    flex: 0 0 52px;
    border: 2px solid #B7BBC4;
    border-radius: 10px;
    background: linear-gradient(145deg, #FFFFFF 0%, #F4F5F7 55%, #DDE1E7 100%);
    color: #08284E;
    font-size: 1.7rem;
    font-weight: 900;
    box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.95), inset 0 -3px 5px rgba(8, 40, 78, 0.08), 0 3px 6px rgba(8, 40, 78, 0.18);
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}


    /* ============================================================
   POPULATED LETTER SLOT
   ============================================================ */

    .lg-slot.filled {
        border: 2px solid #08284E;
        background: linear-gradient( 145deg, #0E4B86 0%, #08284E 58%, #061D39 100% );
        color: #FFFFFF;
        box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.22), 0 5px 10px rgba(8, 40, 78, 0.30);
        transform: translateY(-2px);
    }


/* ============================================================
   GAME STATUS
   ------------------------------------------------------------
   This is the visual structure used by the Example HUD.
   ============================================================ */

.lg-hud-game-status {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 0.15rem;
}


/* ============================================================
   STATUS BLOCK
   ============================================================ */

.lg-hud-status-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    text-align: center;
}


/* ============================================================
   STATUS HEADING
   ============================================================ */

.lg-hud-status-heading {
    margin-bottom: 0.45rem;
    color: #08284E;
    font-size: 0.88rem;
    font-weight: 900;
    letter-spacing: 0.6px;
    line-height: 1.1;
    text-transform: uppercase;
}


/* ============================================================
   STATUS VALUE
   ============================================================ */

.lg-hud-status-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    min-height: 45px;
    padding: 5px 16px;
    border-radius: 24px;
    background: #08284E;
    color: #FFFFFF;
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.15), 0 4px 8px rgba(8, 40, 78, 0.22);
}


/* ============================================================
   "OF" BETWEEN LETTER COUNTS
   ============================================================ */

.lg-hud-status-divider {
    margin: 0 6px;
    font-size: 0.75rem;
    font-weight: 700;
    opacity: 0.8;
    text-transform: lowercase;
}


/* ============================================================
   TIME DISPLAY
   ============================================================ */

.lg-hud-time-value {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 150px;
    min-height: 45px;
}


/* ============================================================
   TIMER
   ------------------------------------------------------------
   The timer now sits inside the same blue status pill as
   the Example HUD.
   ============================================================ */

#lgAutoTimerText {
    display: inline-block !important;
    margin: 0;
    color: #FFFFFF !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    opacity: 1 !important;
    visibility: visible !important;
    white-space: nowrap;
}


    #lgAutoTimerText i {
        color: #FFFFFF !important;
    }


/* ============================================================
   VERTICAL STATUS DIVIDER
   ============================================================ */

.lg-hud-status-divider-line {
    width: 2px;
    height: 58px;
    margin: 0 20px;
    background: rgba(8, 40, 78, 0.28);
}


/* ============================================================
   HUD FOOTER
   ============================================================ */

.lg-hud-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 2px solid rgba(8, 40, 78, 0.25);
}


/* ============================================================
   SUBMIT WORD BUTTON
   ------------------------------------------------------------
   The Example HUD uses Bootstrap's btn-primary appearance.
   Do NOT apply the former custom red button styling here.
   ============================================================ */

#lgSubmitBtn {
    min-width: 140px;
    padding: 9px 20px !important;
    font-size: 1.5rem !important;
    font-weight: 300 !important;
}


/* ============================================================
   TARGET LETTER
   ============================================================ */

.letter-getter-target {
    position: relative;
    display: inline-block;
    cursor: pointer;
    font-weight: 800;
    color: #FFFFFF !important;
    background: linear-gradient( 135deg, #ff416c, #ff4b2b ) !important; /*background: #D01C31 !important; for brand color*/
    padding: 2px 8px !important;
    margin: 0 2px !important;
    border-radius: 6px !important;
    box-shadow: 0 0 10px rgba(255, 75, 43, 0.5) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    transition: transform 0.2s cubic-bezier( 0.175, 0.885, 0.32, 1.275 ), box-shadow 0.2s ease !important;
    animation: targetPulse 2s infinite ease-in-out !important;
    user-select: none;
}


    .letter-getter-target:not(.found):hover {
        transform: scale(1.25) translateY(-2px) !important;
        box-shadow: 0 0 18px rgba(255, 75, 43, 0.9) !important;
        z-index: 10;
    }


    .letter-getter-target:not(.found):active {
        transform: scale(0.95) !important;
    }


    .letter-getter-target.found {
        all: unset !important;
        display: inline !important;
        cursor: default !important;
    }


/* ============================================================
   TARGET LETTER PULSE
   ============================================================ */

@keyframes targetPulse {

    0%, 100% {
        box-shadow: 0 0 8px rgba(255, 75, 43, 0.5) !important;
    }

    50% {
        box-shadow: 0 0 16px rgba(255, 75, 43, 0.9) !important;
    }
}


/* ============================================================
   FLYING LETTER
   ============================================================ */

.lg-flying-letter {
    position: fixed !important;
    z-index: 9999 !important;
    pointer-events: none !important;
    background-color: #FFFFFF !important;
    color: #63BAF8 !important;
    font-weight: 800 !important;
    font-size: 1.3rem !important;
    padding: 2px 4px !important;
    border-radius: 4px !important;
    box-shadow: 0 0 16px rgba(99, 186, 248, 0.9) !important;
    transition: all 0.75s cubic-bezier( 0.18, 0.89, 0.32, 1.28 ) !important;
}
/* ============================================================
   READING EDGE
   ------------------------------------------------------------
   Read-only score meter.
   The illuminated portion represents the current score.
   The remaining portion stays completely black.
   ============================================================ */

.lg-reading-edge {
    width: 100%;
    margin-top: 10px;
    padding: 9px 14px 10px;
    border: 2px solid #08284E;
    border-radius: 14px;
    background: #FAF9F7;
    box-shadow: 0 6px 14px rgba(8, 40, 78, 0.18);
    box-sizing: border-box;
    user-select: none;
}

.lg-reading-edge-label {
    margin-bottom: 6px;
    color: #08284E;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 1px;
    line-height: 1;
    text-align: center;
}

.lg-reading-edge-meter {
    position: relative;
    width: 100%;
    padding-bottom: 24px;
}

.lg-reading-edge-track {
    position: relative;
    width: 100%;
    height: 14px;
    overflow: hidden;
    border: 2px solid #08284E;
    border-radius: 999px;
    box-sizing: border-box;
    background: #000000;
}

.lg-reading-edge-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    border-radius: 999px 0 0 999px;
    /*
       The gradient represents the complete 0–100
       score scale.

       JavaScript adjusts background-size so the
       visible portion always corresponds to the
       correct section of that complete scale.
    */
    background: linear-gradient( 90deg, #D01C31 0%, #D01C31 25%, #E67E22 50%, #F1C40F 75%, #8BC34A 88%, #2E9E4D 100% );
    transition: width 0.4s ease, background-size 0.4s ease;
}
    .lg-reading-edge-fill.is-boosting {
        animation: lgReadingEdgeBoost 0.7s ease-out;
    }

@keyframes lgReadingEdgeBoost {
    0% {
        filter: brightness(1);
        transform: scaleY(1);
    }

    35% {
        filter: brightness(1.8);
        transform: scaleY(1.35);
    }

    100% {
        filter: brightness(1);
        transform: scaleY(1);
    }
}


    /* ============================================================
   LOW-SCORE WARNING
   ------------------------------------------------------------
   Scores from 0–10 pulse between normal red and bright red.
   ============================================================ */

    .lg-reading-edge-fill.is-warning {
        background: #D01C31;
        animation: lgReadingEdgeWarning 0.8s ease-in-out infinite alternate;
    }

@keyframes lgReadingEdgeWarning {
    from {
        background-color: #D01C31;
    }

    to {
        background-color: #FF3347;
    }
}


/* ============================================================
   SCORE VALUE
   ============================================================ */

.lg-reading-edge-score {
    position: absolute;
    left: 50%;
    bottom: 0;
    min-width: 30px;
    color: #08284E;
    font-size: 0.85rem;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    transform: translateX(-50%);
}

/* ============================================================
   MINIMIZED HUD / LETTER GETTERS MEDALLION
   ============================================================ */

#lgHudContainer.is-minimized {
    width: 150px !important;
    min-width: 150px !important;
}


    #lgHudContainer.is-minimized .lg-hud-card {
        padding: 0 !important;
        width: 150px !important;
        height: 150px !important;
        border: none !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: visible !important;
    }
        #lgHudContainer.is-minimized .lg-hud-card::before {
            display: none !important;
        }


    /* ------------------------------------------------------------
   Hide the normal HUD while minimized
   ------------------------------------------------------------ */

    #lgHudContainer.is-minimized .lg-hud-header,
    #lgHudContainer.is-minimized .lg-hud-body,
    #lgHudContainer.is-minimized .lg-hud-footer {
        display: none !important;
    }


/* ------------------------------------------------------------
   Minimized HUD graphic
   ------------------------------------------------------------ */

.lg-hud-trophy-icon {
    display: none;
}


#lgHudContainer.is-minimized .lg-hud-trophy-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}


    /* ------------------------------------------------------------
   Letter Getters medallion
   ------------------------------------------------------------ */

    #lgHudContainer.is-minimized .lg-hud-trophy-icon img {
        display: block;
        width: 150px !important;
        height: 150px !important;
        max-width: none !important;
        max-height: none !important;
        object-fit: contain;
    }


/* ------------------------------------------------------------
   Medallion hover
   ------------------------------------------------------------ */

#lgHudContainer.is-minimized
.lg-hud-card:hover
.lg-hud-trophy-icon {
    transform: scale(1.06);
}


/* ============================================================
   RESPONSIVE HUD — 768px
   ============================================================ */

@media (max-width: 768px) {

    #lgHudContainer {
        top: 75px;
        right: 12px;
        min-width: 280px;
    }


    .lg-hud-card {
        min-width: 280px;
        padding: 1.15rem;
    }


    .lg-slot {
        width: 38px;
        height: 46px;
        flex-basis: 38px;
        font-size: 1.35rem;
        border-radius: 8px;
    }
    .2lg-slot {
        width: 38px;
        height: 46px;
        flex-basis: 38px;
        font-size: 1.35rem;
        border-radius: 8px;
    }


    .lg-word-row {
        gap: 6px;
    }
}


/* ============================================================
   RESPONSIVE HUD — 600px
   ============================================================ */

@media (max-width: 600px) {

    #lgHudContainer {
        width: 100%;
        max-width: 100%;
    }


    .lg-hud-card {
        min-width: 0;
        width: 100%;
        padding-left: 0.8rem;
        padding-right: 0.8rem;
    }


    .lg-hud-header {
        min-height: 95px;
    }


    .lg-hud-brand-image {
        width: 115px;
    }


    .lg-hud-title {
        font-size: 1.2rem !important;
    }


    .lg-hud-minimize-button {
        width: 40px;
        height: 40px;
    }


    #lgSlotRow,
    .lg-slot-row {
        gap: 5px;
    }


    .lg-slot {
        width: 44px;
        height: 50px;
        flex-basis: 44px;
        font-size: 1.4rem;
    }


    .lg-hud-game-status {
        flex-direction: column;
        gap: 12px;
    }


    .lg-hud-status-divider-line {
        width: 70%;
        height: 2px;
        margin: 2px 0;
    }


    .lg-hud-status-block {
        min-width: 0;
    }


    .lg-hud-status-value {
        min-width: 145px;
    }
}
