.gd-shell {
    max-width: 620px;
    margin: 0 auto;
    padding: 12px 12px 26px;
    color: var(--cg-ink);
    text-align: left;
    font-family: Inter, Arial, sans-serif;
}

.gd-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.gd-stats,
.gd-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.gd-stat {
    min-width: 58px;
    padding: 6px 9px;
    border: 1px solid var(--cg-line);
    border-radius: 8px;
    background: var(--cg-panel);
    box-shadow: 0 6px 16px rgba(30, 37, 40, 0.06);
}

.gd-stat span {
    display: block;
    color: var(--cg-muted);
    font-size: 10px;
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
}

.gd-stat strong {
    display: block;
    margin-top: 2px;
    font-size: 17px;
    line-height: 1;
}

.gd-btn {
    padding: 10px 14px;
    border: 1px solid var(--cg-line);
    border-radius: 8px;
    background: var(--cg-panel);
    color: var(--cg-ink);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.1s ease, border-color 0.1s ease;
}

.gd-btn:hover {
    border-color: var(--cg-teal);
    transform: translateY(-1px);
}

.gd-icon-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.gd-icon-btn svg {
    width: 20px;
    height: 20px;
}

.gd-primary {
    background: var(--cg-green);
    border-color: var(--cg-green);
    color: #fff;
}

.gd-primary:hover {
    border-color: var(--cg-green);
    filter: brightness(1.08);
}

.gd-stage {
    position: relative;
    width: 100%;
    height: 300px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #10202b;
    background: linear-gradient(165deg, #1b2f3d, #101d27);
    box-shadow: var(--cg-shadow);
}

.gd-stage canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.gd-badge {
    position: absolute;
    top: 10px;
    left: 12px;
    padding: 4px 9px;
    border-radius: 99px;
    background: rgba(9, 20, 27, 0.72);
    color: #b9d8cf;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.gd-entry {
    display: flex;
    gap: 8px;
    margin: 10px 0 8px;
}

.gd-field {
    position: relative;
    flex: 1;
}

.gd-input {
    width: 100%;
    height: 46px;
    padding: 0 12px;
    border: 1px solid var(--cg-line);
    border-radius: 8px;
    background: var(--cg-panel);
    color: var(--cg-ink);
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
}

.gd-input:focus {
    outline: none;
    border-color: var(--cg-teal);
    box-shadow: 0 0 0 3px rgba(18, 122, 137, 0.16);
}

.gd-input:disabled {
    background: #eef1ee;
    color: var(--cg-muted);
}

.gd-suggest {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 6px);
    z-index: 30;
    max-height: 232px;
    overflow-y: auto;
    padding: 4px;
    border: 1px solid var(--cg-line);
    border-radius: 10px;
    background: var(--cg-panel);
    box-shadow: var(--cg-shadow);
}

.gd-option {
    display: block;
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--cg-ink);
    font: inherit;
    font-size: 0.94rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.gd-option:hover,
.gd-option.gd-active {
    background: #e5f1ee;
    color: #14503f;
}

.gd-submit {
    min-width: 92px;
}

.gd-rows {
    display: grid;
    gap: 6px;
}

.gd-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--cg-line);
    border-radius: 9px;
    background: var(--cg-panel);
    overflow: hidden;
}

.gd-row-empty {
    background: repeating-linear-gradient(135deg, #fbfcfa, #fbfcfa 8px, #f4f6f2 8px, #f4f6f2 16px);
    border-style: dashed;
}

.gd-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(29, 127, 98, 0.22), rgba(18, 122, 137, 0.12));
    transition: width 0.3s ease;
}

.gd-name,
.gd-dist,
.gd-arrow,
.gd-prox {
    position: relative;
    z-index: 1;
}

.gd-name {
    flex: 1;
    font-size: 0.96rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gd-dist {
    color: var(--cg-muted);
    font-size: 0.86rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.gd-arrow {
    display: flex;
    width: 24px;
    align-items: center;
    justify-content: center;
    color: var(--cg-ink);
    font-size: 1.05rem;
    line-height: 1;
}

.gd-arrow svg {
    display: block;
    width: 19px;
    height: 19px;
}

.gd-prox {
    min-width: 46px;
    text-align: right;
    color: var(--cg-green);
    font-size: 0.92rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.gd-p1 .gd-fill {
    background: linear-gradient(90deg, rgba(189, 60, 55, 0.24), rgba(189, 60, 55, 0.1));
}

.gd-p1 .gd-prox {
    color: var(--cg-red);
}

.gd-p2 .gd-fill {
    background: linear-gradient(90deg, rgba(196, 122, 23, 0.26), rgba(196, 122, 23, 0.1));
}

.gd-p2 .gd-prox {
    color: var(--cg-amber);
}

.gd-p3 .gd-fill {
    background: linear-gradient(90deg, rgba(18, 122, 137, 0.26), rgba(18, 122, 137, 0.1));
}

.gd-p3 .gd-prox {
    color: var(--cg-teal);
}

.gd-row-hit {
    border-color: var(--cg-green);
    background: #e3f3ec;
}

.gd-row-hit .gd-fill {
    background: linear-gradient(90deg, rgba(29, 127, 98, 0.34), rgba(29, 127, 98, 0.2));
}

.gd-shake {
    animation: gd-shake 0.3s ease;
}

@keyframes gd-shake {
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.gd-status {
    min-height: 20px;
    margin: 8px 2px 0;
    color: var(--cg-muted);
    font-size: 0.88rem;
    font-weight: 600;
}

.gd-result {
    margin-top: 10px;
    padding: 14px;
    border: 1px solid var(--cg-line);
    border-radius: 12px;
    background: var(--cg-panel);
    box-shadow: var(--cg-shadow);
    text-align: center;
    animation: gd-rise 0.25s ease;
}

@keyframes gd-rise {
    from { opacity: 0; transform: translateY(8px); }
}

.gd-result-kicker {
    display: block;
    color: var(--cg-teal);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.gd-result strong {
    display: block;
    margin: 3px 0 2px;
    font-size: 1.3rem;
}

.gd-result p {
    margin: 0 0 10px;
    color: var(--cg-muted);
    font-size: 0.88rem;
}

.gd-result-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.gd-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(20, 26, 30, 0.55);
}

.gd-modal-card {
    position: relative;
    max-width: 420px;
    width: 100%;
    padding: 20px 22px;
    border-radius: 12px;
    background: var(--cg-panel);
    border: 1px solid var(--cg-line);
    box-shadow: var(--cg-shadow);
}

.gd-modal-card h2 {
    margin: 0 0 10px;
    font-size: 1.15rem;
}

.gd-modal-card p {
    margin: 0 0 10px;
    color: var(--cg-muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.gd-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--cg-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.gd-close:hover {
    color: var(--cg-ink);
    background: var(--cg-bg);
}

@media (max-width: 640px) {
    .gd-shell {
        padding: 8px 6px 20px;
    }

    .gd-stage {
        height: 210px;
    }

    .gd-stat {
        min-width: 52px;
        padding: 5px 7px;
    }

    .gd-stat strong {
        font-size: 15px;
    }

    .gd-input {
        height: 44px;
        font-size: 0.95rem;
    }

    .gd-submit {
        min-width: 76px;
        padding: 10px;
    }

    .gd-row {
        min-height: 38px;
        gap: 7px;
        padding: 0 9px;
    }

    .gd-name {
        font-size: 0.88rem;
    }

    .gd-dist,
    .gd-prox {
        font-size: 0.8rem;
    }

    .gd-rows {
        gap: 5px;
    }
}
