:root {
    --hg-bg: #060f22;
    --hg-card: linear-gradient(145deg, rgba(22, 41, 74, 0.92), rgba(10, 22, 45, 0.95));
    --hg-card-soft: rgba(10, 18, 35, 0.84);
    --hg-line: rgba(113, 159, 231, 0.24);
    --hg-line-soft: rgba(148, 163, 184, 0.22);
    --hg-text: #e2e8f0;
    --hg-text-soft: #a9bddb;
    --hg-accent: #22d3ee;
    --hg-accent-strong: #60a5fa;
    --hg-good: #34d399;
    --hg-warn: #f59e0b;
    --hg-bad: #f87171;
    --hg-key-idle: rgba(15, 23, 42, 0.88);
    --hg-key-hit: rgba(5, 150, 105, 0.22);
    --hg-key-miss: rgba(185, 28, 28, 0.25);
}

.hg-hero {
    position: relative;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.22), transparent 55%),
        linear-gradient(130deg, rgba(30, 58, 138, 0.42), rgba(15, 23, 42, 0.88));
    border: 1px solid var(--hg-line);
    border-radius: 1.2rem;
    padding: 1.75rem 2rem;
    box-shadow: 0 24px 50px rgba(2, 8, 23, 0.44);
}

.hg-hero-guide-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.hg-hero-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.34rem 0.86rem;
    border: 1px solid rgba(96, 165, 250, 0.45);
    background: rgba(29, 78, 216, 0.22);
    color: #bfd6ff;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.74rem;
    font-weight: 700;
}

.hg-hero-title {
    margin-top: 0.88rem;
    font-size: clamp(2.05rem, 3.25vw, 2.9rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ecf3ff;
}

.hg-hero-subtitle {
    margin-top: 0.45rem;
    max-width: 62ch;
    color: var(--hg-text-soft);
    font-size: 1.12rem;
}

.hg-hero-pills {
    margin-top: 0.95rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.hg-hero-pills span {
    border: 1px solid var(--hg-line-soft);
    border-radius: 999px;
    padding: 0.32rem 0.72rem;
    font-size: 0.77rem;
    color: #dbeafe;
    background: rgba(10, 18, 37, 0.58);
}

.hg-layout {
    display: grid;
    grid-template-columns: minmax(290px, 340px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.hg-sidebar,
.hg-main {
    display: grid;
    gap: 1rem;
}

.hg-card {
    background: var(--hg-card);
    border: 1px solid var(--hg-line);
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 14px 35px rgba(2, 8, 23, 0.3);
}

.hg-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f0f6ff;
}

.hg-muted {
    color: var(--hg-text-soft);
    font-size: 0.88rem;
}

.hg-label {
    display: block;
    margin-bottom: 0.36rem;
    color: #dbeafe;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hg-control-group {
    margin-top: 0.72rem;
}

.hg-select,
.hg-input {
    width: 100%;
    border: 1px solid var(--hg-line-soft);
    border-radius: 0.72rem;
    background: var(--hg-card-soft);
    color: #e2e8f0;
    padding: 0.54rem 0.66rem;
    font-size: 0.89rem;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.hg-input {
    text-transform: uppercase;
}

.hg-select:focus,
.hg-input:focus {
    border-color: rgba(56, 189, 248, 0.62);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.18);
}

.hg-range {
    width: 100%;
    accent-color: #38bdf8;
}

.hg-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.42rem;
    color: #dbeafe;
    font-size: 0.85rem;
}

.hg-check input {
    margin-top: 0.14rem;
}

.hg-audio-effects {
    border-top: 1px solid var(--hg-line);
    padding-top: 0.7rem;
}

.hg-inline-range {
    margin-top: 0.42rem;
}

.hg-pro-training {
    border-top: 1px solid var(--hg-line);
    padding-top: 0.7rem;
}

.hg-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hg-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 0.72rem;
    border: 1px solid transparent;
    padding: 0.53rem 0.74rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.16s ease, filter 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.hg-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.hg-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.hg-btn-primary {
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #f8fafc;
}

.hg-btn-secondary {
    background: rgba(15, 23, 42, 0.82);
    border-color: var(--hg-line-soft);
    color: #e2e8f0;
}

.hg-btn-danger {
    background: rgba(153, 27, 27, 0.28);
    border-color: rgba(248, 113, 113, 0.42);
    color: #fecaca;
}

.hg-btn-ghost {
    background: transparent;
    border-color: rgba(148, 163, 184, 0.35);
    color: #cbd5e1;
}

.hg-status-card {
    padding-bottom: 0.92rem;
}

.hg-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
}

.hg-status-chip {
    border: 1px solid rgba(96, 165, 250, 0.42);
    background: rgba(15, 23, 42, 0.54);
    color: #dbeafe;
    border-radius: 999px;
    padding: 0.24rem 0.63rem;
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.hg-turn-row {
    margin-top: 0.84rem;
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: center;
}

.hg-turn-label {
    color: var(--hg-text-soft);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.68rem;
    font-weight: 700;
}

.hg-turn-value {
    margin-top: 0.1rem;
    color: #ecf3ff;
    font-size: 1.04rem;
    font-weight: 700;
}

.hg-cw-panel {
    margin-top: 0.92rem;
    border: 1px solid rgba(30, 64, 175, 0.5);
    background: linear-gradient(140deg, rgba(3, 45, 87, 0.52), rgba(15, 23, 42, 0.72));
    border-radius: 0.82rem;
    padding: 0.7rem 0.82rem;
}

.hg-cw-visual {
    font-family: "Courier New", Courier, monospace;
    letter-spacing: 0.1em;
    color: #e0f2fe;
    font-size: 1.16rem;
}

.hg-cw-decoded {
    margin-top: 0.34rem;
    color: #bae6fd;
    font-size: 0.86rem;
}

.hg-shortcuts {
    margin-top: 0.68rem;
    color: #b9d4f8;
    font-size: 0.76rem;
    border-top: 1px solid var(--hg-line);
    padding-top: 0.6rem;
}

.hg-shortcuts kbd {
    display: inline-block;
    border: 1px solid rgba(148, 163, 184, 0.52);
    border-bottom-width: 2px;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 0.34rem;
    padding: 0.08rem 0.34rem;
    color: #e2e8f0;
    font-size: 0.72rem;
    font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.hg-board-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.hg-board-header {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.hg-mini-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    color: #cbd5e1;
    font-size: 0.78rem;
}

.hg-mini-stats strong {
    color: #e2e8f0;
}

.hg-hangman-shell {
    margin-top: 0.62rem;
    display: grid;
    place-items: center;
    border: 1px solid var(--hg-line-soft);
    border-radius: 0.85rem;
    background: rgba(8, 15, 32, 0.8);
    padding: 0.6rem;
    min-height: 310px;
}

.hg-hangman-svg {
    width: min(100%, 280px);
    height: auto;
}

.hg-static {
    stroke: #7ca7df;
    stroke-width: 6;
    stroke-linecap: round;
    fill: none;
}

.hg-part {
    stroke: #f8fafc;
    stroke-width: 6;
    stroke-linecap: round;
    fill: none;
    opacity: 0.12;
    transition: opacity 0.18s ease;
}

.hg-part.active {
    opacity: 1;
}

.hg-word-slots {
    margin-top: 0.65rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.48rem;
}

.hg-slot {
    width: 2.02rem;
    height: 2.4rem;
    border-radius: 0.45rem;
    border: 1px solid rgba(125, 164, 231, 0.45);
    background: rgba(6, 15, 32, 0.84);
    display: grid;
    place-items: center;
    color: #eff6ff;
    font-weight: 800;
    font-size: 1.02rem;
    text-transform: uppercase;
}

.hg-slot.space {
    border-color: transparent;
    background: transparent;
}

.hg-guess-panel {
    margin-top: 0.9rem;
    border-top: 1px solid var(--hg-line);
    padding-top: 0.8rem;
}

.hg-guess-panel h4 {
    font-size: 0.94rem;
    font-weight: 700;
}

.hg-guess-row {
    margin-top: 0.6rem;
    display: flex;
    gap: 0.48rem;
}

.hg-guess-row .hg-input {
    max-width: 92px;
    text-align: center;
    font-weight: 800;
    font-size: 1.1rem;
}

.hg-keyboard {
    margin-top: 0.65rem;
    display: grid;
    grid-template-columns: repeat(13, minmax(0, 1fr));
    gap: 0.42rem;
}

.hg-key {
    border: 1px solid var(--hg-line-soft);
    border-radius: 0.44rem;
    background: var(--hg-key-idle);
    color: #dbeafe;
    font-weight: 700;
    font-size: 0.82rem;
    min-height: 2rem;
}

.hg-key:hover:not(:disabled) {
    filter: brightness(1.07);
}

.hg-key:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hg-key.cue {
    border-color: rgba(34, 211, 238, 0.66);
    box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.45);
}

.hg-key.correct {
    background: var(--hg-key-hit);
    border-color: rgba(16, 185, 129, 0.56);
    color: #a7f3d0;
}

.hg-key.wrong {
    background: var(--hg-key-miss);
    border-color: rgba(248, 113, 113, 0.5);
    color: #fecaca;
}

.hg-log {
    margin-top: 0.62rem;
    border: 1px solid var(--hg-line-soft);
    border-radius: 0.82rem;
    background: rgba(4, 10, 24, 0.74);
    padding: 0.56rem;
    min-height: 180px;
    max-height: 320px;
    overflow: auto;
    font-size: 0.82rem;
}

.hg-log-entry {
    padding: 0.34rem 0.4rem;
    border-radius: 0.48rem;
    color: #dbeafe;
}

.hg-log-entry + .hg-log-entry {
    margin-top: 0.28rem;
}

.hg-log-entry.good {
    background: rgba(16, 185, 129, 0.16);
    color: #a7f3d0;
}

.hg-log-entry.bad {
    background: rgba(239, 68, 68, 0.14);
    color: #fecaca;
}

.hg-log-entry.warn {
    background: rgba(245, 158, 11, 0.16);
    color: #fde68a;
}

.hg-best-row {
    border: 1px solid var(--hg-line-soft);
    border-radius: 0.66rem;
    padding: 0.46rem 0.56rem;
    background: rgba(10, 18, 35, 0.66);
    font-size: 0.8rem;
    color: #dbeafe;
}

.hg-best-row + .hg-best-row {
    margin-top: 0.43rem;
}

.hg-modal {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.76);
    display: grid;
    place-items: center;
    z-index: 70;
}

.hg-modal.hidden {
    display: none;
}

.hg-modal-content {
    width: min(620px, calc(100% - 1.8rem));
    background: linear-gradient(145deg, rgba(25, 45, 80, 0.95), rgba(8, 18, 37, 0.98));
    border-radius: 1rem;
    border: 1px solid rgba(96, 165, 250, 0.45);
    padding: 1.1rem;
    box-shadow: 0 24px 45px rgba(2, 8, 23, 0.55);
}

.hg-result-summary {
    margin-top: 0.72rem;
    display: grid;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: #dbeafe;
}

@media (max-width: 1180px) {
    .hg-layout {
        grid-template-columns: 1fr;
    }

    .hg-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 880px) {
    .hg-sidebar {
        grid-template-columns: 1fr;
    }

    .hg-board-grid {
        grid-template-columns: 1fr;
    }

    .hg-turn-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .hg-keyboard {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .hg-hero {
        padding: 1.1rem;
    }

    .hg-hero-guide-btn {
        position: static;
        margin-bottom: 0.7rem;
    }

    .hg-keyboard {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}
