.gf-shell {
    --gf-cw: 60px;
    --gf-ch: 85px;
    --gf-felt: #1f6b3f;
    max-width: 880px;
    margin: 0 auto;
    padding: 0 0 26px;
    color: var(--cg-ink);
    font-family: Inter, Arial, sans-serif;
}

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

.gf-stats {
    display: flex;
    align-items: stretch;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

.gf-stat {
    flex: 0 1 auto;
    min-width: 74px;
    padding: 7px 10px;
    border: 1px solid var(--cg-line);
    border-radius: 8px;
    background: var(--cg-panel);
    box-shadow: 0 8px 18px rgba(33, 43, 40, 0.07);
}

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

.gf-stat strong {
    display: block;
    margin-top: 2px;
    font-size: 18px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.gf-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gf-btn,
.gf-chip,
.gf-close {
    min-height: 44px;
    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;
    box-shadow: 0 6px 14px rgba(33, 43, 40, 0.07);
    transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.gf-btn {
    padding: 0 14px;
}

.gf-btn:hover,
.gf-chip:hover,
.gf-close:hover {
    transform: translateY(-1px);
    border-color: var(--cg-teal);
}

.gf-btn:focus-visible,
.gf-chip:focus-visible,
.gf-close:focus-visible,
.gf-table:focus-visible {
    outline: 3px solid rgba(18, 122, 137, 0.45);
    outline-offset: 2px;
}

.gf-icon {
    width: 44px;
    min-width: 44px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    font-size: 1.05rem;
}

.gf-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

.gf-primary:hover {
    border-color: transparent;
    filter: brightness(1.07);
}

.gf-tablewrap {
    padding: 12px;
    overflow: hidden;
    border: 1px solid #0f4227;
    border-radius: 14px;
    background:
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.022) 0 3px, rgba(0, 0, 0, 0.02) 3px 6px),
        radial-gradient(120% 96% at 50% -4%, #2f8f56 0%, var(--gf-felt) 54%, #12492c 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.13), inset 0 0 60px rgba(0, 0, 0, 0.3), var(--cg-shadow);
}

.gf-table {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 0.68;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

.gf-layer {
    position: absolute;
    inset: 0;
}

.gf-slot,
.gf-card,
.gf-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--gf-cw);
    height: var(--gf-ch);
    border-radius: calc(var(--gf-cw) * 0.09);
}

.gf-slot {
    display: grid;
    place-items: center;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.15);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.22);
}

.gf-slot-stock {
    cursor: pointer;
}

.gf-slot-clear {
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.06);
}

.gf-slot .gf-mark {
    color: rgba(255, 255, 255, 0.26);
    font-size: calc(var(--gf-cw) * 0.42);
    font-style: normal;
    line-height: 1;
}

.gf-empty .gf-mark {
    opacity: 0.55;
}

.gf-badge {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--gf-cw);
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: calc(var(--gf-cw) * 0.19);
    font-weight: 800;
    white-space: nowrap;
    pointer-events: none;
}

.gf-ring {
    z-index: 990;
    border: 3px solid #ffd66b;
    border-radius: calc(var(--gf-cw) * 0.12);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25), 0 0 16px rgba(255, 214, 107, 0.5);
    pointer-events: none;
}

.gf-card {
    transition: transform 0.19s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.2s ease;
    will-change: transform;
    -webkit-user-drag: none;
}

.gf-bottom,
.gf-top {
    cursor: pointer;
}

.gf-buried::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(9, 42, 26, 0.07) 0 30%, rgba(9, 42, 26, 0.2) 100%);
}

.gf-hide {
    opacity: 0;
    pointer-events: none;
}

.gf-face,
.gf-back {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    overflow: hidden;
}

.gf-face {
    background: linear-gradient(168deg, #ffffff 0%, #fbfaf4 62%, #f1efe4 100%);
    border: 1px solid #c9cdc2;
    box-shadow: 0 2px 5px rgba(6, 26, 19, 0.38);
    color: #23282b;
}

.gf-red .gf-face {
    color: #c0322b;
}

.gf-back {
    display: none;
    background:
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.08) 0 4px, transparent 4px 8px),
        repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.08) 0 4px, transparent 4px 8px),
        linear-gradient(160deg, #3d6f52, #235036 60%, #163b26);
    border: 1px solid #123322;
    box-shadow: 0 2px 5px rgba(6, 26, 19, 0.38);
}

.gf-back::after {
    content: '';
    position: absolute;
    inset: 8%;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: calc(var(--gf-cw) * 0.05);
}

.gf-down .gf-face {
    display: none;
}

.gf-down .gf-back {
    display: block;
}

.gf-hot .gf-face {
    border-color: #e0b12f;
    box-shadow: 0 0 0 2px rgba(255, 214, 107, 0.92), 0 8px 16px rgba(0, 0, 0, 0.36);
}

.gf-top .gf-face {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7), 0 8px 18px rgba(0, 0, 0, 0.42);
}

.gf-ix {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 0.95;
}

.gf-tl {
    left: 6%;
    top: 3.5%;
}

.gf-br {
    right: 6%;
    bottom: 3.5%;
    transform: rotate(180deg);
}

.gf-ix b {
    font-size: calc(var(--gf-cw) * 0.3);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.gf-ix i {
    margin-top: 1px;
    font-size: calc(var(--gf-cw) * 0.23);
    font-style: normal;
}

.gf-pips {
    position: absolute;
    left: 3%;
    right: 3%;
    top: 8%;
    bottom: 8%;
}

.gf-pip {
    position: absolute;
    font-size: calc(var(--gf-cw) * 0.22);
    font-style: normal;
    line-height: 1;
    transform: translate(-50%, -50%);
}

.gf-pip.gf-flip {
    transform: translate(-50%, -50%) rotate(180deg);
}

.gf-big {
    position: absolute;
    left: 50%;
    top: 50%;
    font-size: calc(var(--gf-cw) * 0.5);
    font-style: normal;
    line-height: 1;
    opacity: 0.92;
    transform: translate(-50%, -50%);
}

.gf-alt {
    display: none;
}

.gf-compact .gf-pips {
    display: none;
}

.gf-compact .gf-alt {
    display: block;
}

.gf-court {
    position: absolute;
    left: 20%;
    right: 20%;
    top: 19%;
    bottom: 19%;
    display: grid;
    place-items: center;
    border-radius: calc(var(--gf-cw) * 0.05);
    overflow: hidden;
}

.gf-court::before,
.gf-court::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.gf-court::before {
    background: currentColor;
    opacity: 0.07;
}

.gf-court::after {
    border: 1px solid currentColor;
    opacity: 0.32;
}

.gf-court b {
    position: relative;
    z-index: 1;
    font-size: calc(var(--gf-cw) * 0.44);
    line-height: 1.05;
}

.gf-court i {
    position: absolute;
    z-index: 1;
    right: 6%;
    bottom: 2%;
    font-size: calc(var(--gf-cw) * 0.19);
    font-style: normal;
}

.gf-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 8px 14px;
    border: 1px solid var(--cg-line);
    border-radius: 10px;
    background: var(--cg-panel);
    box-shadow: 0 8px 18px rgba(33, 43, 40, 0.06);
    flex-wrap: wrap;
}

.gf-hint-lab {
    color: var(--cg-muted);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gf-targets {
    display: flex;
    gap: 6px;
}

.gf-tgt {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    padding: 0 6px;
    border: 1px solid var(--cg-line);
    border-radius: 8px;
    background: #f1f4ef;
    color: var(--cg-muted);
    font-size: 0.95rem;
    font-weight: 900;
}

.gf-tgt-live {
    border-color: #1d7f62;
    background: #e2f4ec;
    color: #12603f;
    box-shadow: 0 0 0 2px rgba(29, 127, 98, 0.18);
}

.gf-wrap-note {
    color: var(--cg-muted);
    font-size: 0.78rem;
    font-weight: 700;
    margin-left: auto;
}

.gf-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.gf-seg {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 6px 14px rgba(33, 43, 40, 0.07);
}

.gf-seg .gf-chip {
    min-width: 46px;
    padding: 0 14px;
    border-radius: 0;
    box-shadow: none;
}

.gf-seg .gf-chip + .gf-chip {
    border-left: 0;
}

.gf-chip[aria-pressed='true'] {
    background: var(--cg-ink);
    border-color: var(--cg-ink);
    color: #fff;
}

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

.gf-result {
    margin-top: 12px;
    padding: 16px;
    border: 1px solid #b9d6c9;
    border-radius: 12px;
    background: linear-gradient(135deg, #eef8f3, #ffffff 60%);
    box-shadow: var(--cg-shadow);
    text-align: center;
    animation: gf-rise 0.25s ease;
}

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

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

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

.gf-result p {
    margin: 0 0 12px;
    color: var(--cg-muted);
    font-size: 0.9rem;
}

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

.gf-shell[data-state='dead'] .gf-result {
    border-color: #e2d3ae;
    background: linear-gradient(135deg, #fdf7e8, #ffffff 60%);
}

.gf-shell[data-state='dead'] .gf-kicker {
    color: var(--cg-amber);
}

.gf-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(16, 30, 25, 0.55);
}

.gf-modal-card {
    position: relative;
    width: min(100%, 460px);
    max-height: 86vh;
    overflow-y: auto;
    padding: 22px;
    border: 1px solid var(--cg-line);
    border-radius: 12px;
    background: var(--cg-panel);
    box-shadow: 0 24px 70px rgba(16, 30, 25, 0.3);
}

.gf-modal-card h2 {
    margin: 0 44px 10px 0;
    font-size: 1.2rem;
}

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

.gf-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    padding: 0;
    font-size: 22px;
    line-height: 1;
}

@media (max-width: 640px) {
    .gf-shell {
        padding-bottom: 74px;
    }

    .gf-topbar {
        flex-wrap: nowrap;
        gap: 8px;
    }

    .gf-stat {
        min-width: 50px;
        padding: 6px 6px;
    }

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

    .gf-stat-wide {
        display: none;
    }

    .gf-btn,
    .gf-chip,
    .gf-close {
        min-height: 40px;
        font-size: 0.82rem;
    }

    .gf-icon {
        width: 40px;
        min-width: 40px;
    }

    .gf-actions {
        gap: 6px;
    }

    .gf-tablewrap {
        padding: 7px;
        border-radius: 10px;
    }

    .gf-table {
        aspect-ratio: 1 / 0.89;
    }

    .gf-wide-only {
        display: none;
    }

    .gf-btn {
        padding: 0 11px;
    }

    .gf-seg .gf-chip {
        min-width: 40px;
        padding: 0 10px;
    }

    .gf-controls {
        gap: 6px;
    }

    .gf-hint {
        gap: 8px;
        padding: 7px 10px;
    }

    .gf-wrap-note {
        flex: 1 1 100%;
        margin-left: 0;
        font-size: 0.72rem;
    }
}
