:root {
    --gdr-fh-white: #ffffff;
    --gdr-fh-green: #28a745;
    --gdr-fh-green-bright: #2ecc71;
    --gdr-fh-blue: #007bff;
    --gdr-fh-red: #ff4d4d;
    --gdr-fh-border: rgba(255, 255, 255, 0.35);
}

.gdr-fh-wrap {
    max-width: 1050px;
    margin: 26px auto;
    font-family: 'Montserrat', sans-serif;
    color: var(--gdr-fh-white);
    text-align: center;
}

.gdr-fh-shell,
.gdr-fh-hero,
.gdr-fh-stage-card,
.gdr-fh-puzzle-card {
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--gdr-fh-white);
}

.gdr-fh-hero {
    max-width: 820px;
    margin: 0 auto 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.gdr-fh-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.gdr-fh-hero-copy {
    flex: 1 1 420px;
}

.gdr-fh-title {
    margin: 0;
    font-size: 34px;
    line-height: 1.1;
    font-weight: 800;
    color: var(--gdr-fh-white);
    text-align: left;
}

.gdr-fh-intro {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 15px;
    line-height: 1.5;
    font-weight: 600;
    text-align: left;
}

.gdr-fh-score-box {
    min-width: 136px;
    padding: 10px 16px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease, background 0.24s ease;
}

.gdr-fh-score-box--multiplier .gdr-fh-stage-value {
    color: #d9ff88;
}

.gdr-fh-score-box.is-score-up {
    border-color: rgba(46, 204, 113, 0.74);
    background: rgba(40, 167, 69, 0.14);
    box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.1);
    transform: translateY(-1px);
}

.gdr-fh-score-box.is-score-down {
    border-color: rgba(255, 99, 99, 0.72);
    background: rgba(255, 77, 77, 0.12);
    box-shadow: 0 0 0 4px rgba(255, 77, 77, 0.1);
    transform: translateY(-1px);
}

.gdr-fh-score-box.is-negative {
    border-color: rgba(255, 99, 99, 0.82);
    background: rgba(255, 77, 77, 0.18);
}

.gdr-fh-score-box.is-negative .gdr-fh-stage-value {
    color: #ff8f8f;
}

.gdr-fh-board {
    width: 100%;
    max-width: 820px;
    margin: 14px auto 0;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
        "answer"
        "summary"
        "keyboard";
    gap: 8px;
}

.gdr-fh-stage-card,
.gdr-fh-puzzle-card {
    padding: 0;
    margin-bottom: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.gdr-fh-stage-header {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.gdr-fh-clue-heading {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    text-align: left;
}

.gdr-fh-stage-label {
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.74);
}

.gdr-fh-stage-value {
    margin-top: 3px;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1;
    font-weight: 800;
    color: var(--gdr-fh-green-bright);
}

.gdr-fh-clue-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.gdr-fh-clue-card {
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    box-shadow: none;
    color: rgba(255, 255, 255, 0.96);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: none;
    text-align: center;
    cursor: pointer;
    transition: transform 0.18s ease, filter 0.18s ease, border-color 0.18s ease;
}

.gdr-fh-clue-card:hover,
.gdr-fh-clue-card:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.08);
    filter: none;
    outline: none;
}

.gdr-fh-clue-meta {
    display: none;
}

.gdr-fh-clue-card.is-revealed {
    border-color: rgba(46, 204, 113, 0.95);
    background: linear-gradient(180deg, rgba(23, 98, 56, 0.96) 0%, rgba(17, 77, 43, 0.98) 100%);
    color: #ffffff;
    font-weight: 900;
    box-shadow: 0 0 0 1px rgba(46, 204, 113, 0.18), 0 10px 22px rgba(10, 32, 18, 0.28);
}

.gdr-fh-clue-text {
    color: inherit;
    line-height: 1.2;
}

.gdr-fh-status {
    margin-top: 10px;
    min-height: 0;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 800;
    color: var(--gdr-fh-white);
    text-align: left;
}

.gdr-fh-status.is-win {
    color: #7dff9a;
}

.gdr-fh-status.is-lose {
    color: #ff9b9b;
}

.gdr-fh-puzzle-card--answer {
    padding: 0 0 10px;
}

.gdr-fh-answer {
    --gdr-fh-answer-size: 32px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.34em 0.5em;
    margin: 0;
    min-height: 48px;
    font-size: var(--gdr-fh-answer-size);
    line-height: 1.25;
}

.gdr-fh-word {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 0.22em;
    white-space: nowrap;
}

.gdr-fh-answer.is-solve-mode .gdr-fh-char:not(.is-space):not(.is-symbol) {
    border-color: rgba(43, 132, 255, 0.95);
    box-shadow: 0 0 0 2px rgba(43, 132, 255, 0.18);
}

.gdr-fh-char {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0.92em;
    height: 1.24em;
    padding: 0 0.14em;
    border: 0.08em solid rgba(0, 0, 0, 0.18);
    border-radius: 0.12em;
    background: #ffffff;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18);
    color: #111111;
    font-size: 1em;
    font-weight: 800;
    text-transform: uppercase;
}

.gdr-fh-char.is-solve-fill {
    color: #1d5fd4;
    background: #f3f8ff;
}

.gdr-fh-char.is-space,
.gdr-fh-char.is-symbol {
    min-width: 0.48em;
    border: none;
    background: transparent;
    box-shadow: none;
    color: var(--gdr-fh-white);
}

.gdr-fh-letters {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.gdr-fh-stage-card--top {
    grid-area: summary;
}

.gdr-fh-puzzle-card--bottom {
    grid-area: keyboard;
    margin-top: 0;
}

.gdr-fh-rules-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--gdr-fh-white);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    user-select: none;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.gdr-fh-rules-pill:hover,
.gdr-fh-rules-pill:focus-visible {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.32);
    outline: none;
}

.gdr-fh-key,
.gdr-fh-primary-btn,
.gdr-fh-secondary-btn {
    font-family: 'Montserrat', sans-serif;
}

.gdr-fh-key {
    appearance: none;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    border: 2px solid var(--gdr-fh-border);
    border-radius: 12px;
    background: transparent;
    color: var(--gdr-fh-white);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.gdr-fh-key-letter {
    display: block;
    line-height: 1;
}

.gdr-fh-key:hover,
.gdr-fh-key:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.62);
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.gdr-fh-letters.is-solve-mode .gdr-fh-key {
    border-color: rgba(43, 132, 255, 0.72);
    box-shadow: 0 0 0 1px rgba(43, 132, 255, 0.18);
}

.gdr-fh-key[disabled] {
    cursor: not-allowed;
}

.gdr-fh-key.is-correct[disabled] {
    border-color: rgba(74, 222, 128, 0.92);
    background: linear-gradient(180deg, rgba(26, 112, 67, 0.48) 0%, rgba(18, 79, 46, 0.68) 100%);
}

.gdr-fh-key.is-wrong[disabled] {
    border-color: rgba(255, 99, 99, 0.92);
    background: linear-gradient(180deg, rgba(163, 37, 37, 0.5) 0%, rgba(114, 26, 26, 0.72) 100%);
    color: #ffd2d2;
}

.gdr-fh-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.gdr-fh-primary-btn,
.gdr-fh-secondary-btn {
    appearance: none;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.18s ease, filter 0.18s ease;
}

.gdr-fh-primary-btn {
    border: none;
    background: var(--gdr-fh-green);
    color: var(--gdr-fh-white);
}

.gdr-fh-secondary-btn {
    border: 2px solid var(--gdr-fh-border);
    background: transparent;
    color: var(--gdr-fh-white);
}

.gdr-fh-primary-btn:hover,
.gdr-fh-primary-btn:focus-visible,
.gdr-fh-secondary-btn:hover,
.gdr-fh-secondary-btn:focus-visible {
    transform: translateY(-1px);
    filter: brightness(1.05);
    outline: none;
}

.gdr-fh-modal-open {
    overflow: hidden;
}

.gdr-fh-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.gdr-fh-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 10, 16, 0.78);
    backdrop-filter: blur(6px);
}

.gdr-fh-modal-dialog {
    position: relative;
    width: min(92vw, 560px);
    margin: 8vh auto 0;
    padding: 28px 28px 22px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(17, 19, 24, 0.98) 0%, rgba(12, 14, 18, 0.98) 100%);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.gdr-fh-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--gdr-fh-white);
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.gdr-fh-modal-label {
    margin-bottom: 8px;
    color: var(--gdr-fh-green-bright);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gdr-fh-modal-title {
    margin: 0 0 14px;
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.05;
    font-weight: 800;
    color: var(--gdr-fh-white);
}

.gdr-fh-modal-copy {
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    line-height: 1.5;
    font-weight: 600;
}

.gdr-fh-modal-summary {
    margin: 0 0 10px;
}

.gdr-fh-modal-list {
    margin: 0;
    padding-left: 18px;
}

.gdr-fh-modal-list li {
    margin: 0 0 8px;
}

.gdr-fh-modal-action {
    margin-top: 12px;
}

.gdr-fh-modal--result .gdr-fh-modal-dialog {
    overflow: hidden;
}

.gdr-fh-result-dialog {
    width: min(92vw, 520px);
}

.gdr-fh-result-answer {
    margin: 0 0 16px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gdr-fh-white);
}

.gdr-fh-result-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.gdr-fh-result-stat {
    padding: 12px 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
}

.gdr-fh-result-stat-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

.gdr-fh-result-stat-value {
    display: block;
    margin-top: 8px;
    font-size: 30px;
    line-height: 1;
    font-weight: 800;
    color: var(--gdr-fh-white);
}

.gdr-fh-result-stat-value--bonus {
    color: #7dff9a;
}

.gdr-fh-result-summary {
    margin: 14px 0 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    line-height: 1.5;
    font-weight: 700;
}

.gdr-fh-result-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.gdr-fh-confetti {
    pointer-events: none;
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.gdr-fh-confetti-piece {
    position: absolute;
    top: -14px;
    width: 10px;
    height: 18px;
    border-radius: 999px;
    opacity: 0;
    animation-name: gdr-fh-confetti-fall;
    animation-timing-function: ease-out;
    animation-fill-mode: forwards;
}

.gdr-fh-nav-actions {
    max-width: 900px;
    margin: 34px auto 0;
}

.gdr-fh-nav-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 18px;
}

.gdr-fh-nav-row--bottom {
    margin-top: 18px;
}

.gdr-fh-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 220px;
    min-height: 60px;
    padding: 0 30px;
    border: 2px solid rgba(46, 178, 71, 0.55);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.94);
    color: #18d06a;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.01em;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.gdr-fh-nav-link:hover,
.gdr-fh-nav-link:focus-visible {
    background: rgba(4, 20, 10, 0.96);
    border-color: #20e57d;
    color: #2bf285;
    transform: translateY(-2px);
    outline: none;
}

.gdr-fh-nav-link--hub {
    min-width: 372px;
    gap: 10px;
}

.gdr-fh-nav-link--hub::before {
    content: "\1F4DA";
    font-size: 18px;
    line-height: 1;
}

.gdr-fh-nav-link.is-disabled {
    opacity: 0.38;
    cursor: default;
    pointer-events: none;
}

@keyframes gdr-fh-confetti-fall {
    0% {
        transform: translate3d(0, -10px, 0) rotate(0deg);
        opacity: 0;
    }

    12% {
        opacity: 1;
    }

    100% {
        transform: translate3d(-18px, 360px, 0) rotate(540deg);
        opacity: 0;
    }
}

@media (max-width: 640px) {
    .gdr-fh-wrap {
        margin: 12px auto;
    }

    .gdr-fh-title {
        font-size: 24px;
    }

    .gdr-fh-hero-top {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 8px;
    }

    .gdr-fh-hero-copy {
        flex: none;
        width: 100%;
    }

    .gdr-fh-hero {
        margin-bottom: 10px;
        padding-bottom: 12px;
    }

    .gdr-fh-rules-pill {
        width: 100%;
        padding: 9px 12px;
    }

    .gdr-fh-board {
        grid-template-columns: 1fr;
        grid-template-areas:
            "answer"
            "summary"
            "keyboard";
        gap: 12px;
    }

    .gdr-fh-stage-card,
    .gdr-fh-puzzle-card {
        padding: 0;
    }

    .gdr-fh-stage-header {
        margin-bottom: 16px;
    }

    .gdr-fh-letters {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 8px;
    }

    .gdr-fh-clue-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .gdr-fh-clue-card {
        min-height: 38px;
        padding: 8px 6px;
        font-size: 12px;
    }

    .gdr-fh-score-box {
        min-width: 0;
        flex: 1 1 0;
        padding: 10px 12px 11px;
        border-radius: 999px;
    }

    .gdr-fh-puzzle-card--answer {
        padding-bottom: 16px;
    }

    .gdr-fh-answer {
        --gdr-fh-answer-size: 26px;
        gap: 0.34em 0.44em;
        min-height: 72px;
    }

    .gdr-fh-word {
        gap: 0.2em;
    }

    .gdr-fh-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-top: 16px;
    }

    .gdr-fh-primary-btn,
    .gdr-fh-secondary-btn {
        width: 100%;
        padding: 10px 14px;
        border-radius: 10px;
    }

    .gdr-fh-status,
    .gdr-fh-intro {
        text-align: left;
    }

    .gdr-fh-clue-heading {
        margin-bottom: 8px;
    }

    .gdr-fh-status {
        margin-top: 12px;
        font-size: 13px;
        line-height: 1.5;
    }

    .gdr-fh-modal-dialog {
        width: min(94vw, 420px);
        margin-top: 4vh;
        padding: 20px 16px 18px;
        border-radius: 18px;
    }

    .gdr-fh-modal-title {
        margin-bottom: 10px;
    }

    .gdr-fh-modal-copy {
        font-size: 14px;
        line-height: 1.45;
    }

    .gdr-fh-modal-list {
        padding-left: 16px;
    }

    .gdr-fh-modal-list li {
        margin-bottom: 6px;
    }

    .gdr-fh-result-answer {
        margin-bottom: 12px;
        font-size: 16px;
        letter-spacing: 0.05em;
    }

    .gdr-fh-result-stats {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .gdr-fh-result-stat {
        padding: 10px;
    }

    .gdr-fh-result-stat-value {
        font-size: 24px;
    }

    .gdr-fh-result-summary {
        margin-top: 12px;
        font-size: 14px;
    }

    .gdr-fh-result-actions {
        flex-direction: column;
        gap: 8px;
    }

    .gdr-fh-nav-actions {
        margin-top: 26px;
    }

    .gdr-fh-nav-row {
        gap: 12px;
    }

    .gdr-fh-nav-link,
    .gdr-fh-nav-link--hub {
        width: 100%;
        min-width: 0;
        min-height: 56px;
        padding: 0 18px;
    }
}
