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

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

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

.pg-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);
}

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

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

.pg-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;
}

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

.pg-btn:disabled {
    opacity: 0.55;
    cursor: default;
    transform: none;
}

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

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

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

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

.pg-stage {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    aspect-ratio: 1;
    height: auto;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #241a33;
    background: linear-gradient(165deg, #2a2140, #14101f);
    box-shadow: var(--cg-shadow);
}

.pg-frame {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pg-frame img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.pg-placeholder {
    display: none;
    padding: 10px 16px;
    border: 1px dashed rgba(210, 200, 240, 0.35);
    border-radius: 10px;
    color: #cfc4e8;
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pg-frame-empty {
    background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.03) 12px, transparent 12px, transparent 24px);
}

.pg-frame-empty .pg-placeholder {
    display: block;
}

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

.pg-dots {
    display: flex;
    gap: 6px;
    margin: 10px 0 8px;
}

.pg-dot {
    min-width: 54px;
    padding: 7px 10px;
    border: 1px solid var(--cg-line);
    border-radius: 99px;
    background: var(--cg-panel);
    color: var(--cg-muted);
    font-size: 0.78rem;
    font-weight: 900;
    text-align: center;
}

.pg-dot-active {
    border-color: var(--cg-teal);
    color: var(--cg-teal);
    box-shadow: 0 0 0 3px rgba(18, 122, 137, 0.13);
}

.pg-dot-done {
    border-color: #8cbfae;
    background: #e6f3ee;
    color: #14503f;
}

.pg-entry {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.pg-input {
    flex: 1;
    height: 46px;
    min-width: 0;
    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;
}

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

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

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

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

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

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

.pg-reveal {
    padding: 12px 14px 14px;
    border: 1px solid var(--cg-line);
    border-radius: 12px;
    background: var(--cg-panel);
    box-shadow: var(--cg-shadow);
    animation: pg-rise 0.25s ease;
}

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

.pg-score-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.pg-score-head span {
    color: var(--cg-teal);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.pg-score-head strong {
    font-size: 1.5rem;
    line-height: 1;
}

.pg-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0;
}

.pg-chip {
    padding: 5px 10px;
    border-radius: 99px;
    font-size: 0.78rem;
    font-weight: 800;
}

.pg-chip-hit {
    border: 1px solid #85bda9;
    background: #e3f3ec;
    color: #14503f;
}

.pg-chip-miss {
    border: 1px solid var(--cg-line);
    background: #f3f4f1;
    color: var(--cg-muted);
    text-decoration: line-through;
}

.pg-actual {
    margin: 0 0 10px;
    color: var(--cg-ink);
    font-size: 0.88rem;
    line-height: 1.4;
}

.pg-credit {
    color: var(--cg-muted);
    font-size: 0.74rem;
    font-weight: 800;
}

.pg-result,
.pg-offline {
    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;
}

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

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

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

.pg-offline p {
    margin-bottom: 0;
}

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

.pg-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);
}

.pg-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);
}

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

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

.pg-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;
}

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

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

    .pg-stage {
        max-width: 300px;
    }

    .pg-shell[data-state="done"] .pg-stage {
        max-width: 210px;
    }

    .pg-shell[data-state="done"] .pg-status {
        display: none;
    }

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

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

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

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

    .pg-dots {
        margin: 8px 0 6px;
    }

    .pg-chip {
        font-size: 0.74rem;
    }

    .pg-actual {
        font-size: 0.82rem;
    }
}
