.fp-shell {
    max-width: 520px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: Inter, Arial, sans-serif;
    color: var(--cg-ink);
}

.fp-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.fp-statline {
    display: flex;
    gap: 8px;
}

.fp-stat {
    background: var(--cg-panel);
    border: 1px solid var(--cg-line);
    border-radius: 10px;
    padding: 6px 12px;
    text-align: center;
    min-width: 64px;
}

.fp-stat span {
    display: block;
    color: var(--cg-muted);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.fp-stat strong {
    font-size: 1.05rem;
}

.fp-actions {
    display: flex;
    gap: 8px;
}

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

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

.fp-btn:active {
    transform: translateY(0);
}

.fp-icon-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 1.05rem;
    line-height: 1;
}

.fp-muted {
    color: var(--cg-muted);
    text-decoration: line-through;
}

.fp-statusline {
    display: flex;
    gap: 8px;
}

.fp-pill {
    flex: 1;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    background: var(--cg-panel);
    border: 1px solid var(--cg-line);
    border-radius: 10px;
    padding: 8px 10px;
}

.fp-pill span {
    color: var(--cg-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.fp-pill strong {
    font-size: 1.1rem;
    font-variant-numeric: tabular-nums;
}

.fp-stage {
    position: relative;
}

.fp-board {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--cg-panel);
    border: 1px solid var(--cg-line);
    border-radius: 14px;
    box-shadow: var(--cg-shadow);
    touch-action: none;
    overflow: hidden;
}

.fp-tile {
    position: absolute;
    top: 0;
    left: 0;
    width: 25%;
    height: 25%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    transition: transform 0.14s ease;
    font: inherit;
}

.fp-face {
    position: absolute;
    inset: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(180deg, var(--cg-teal), var(--cg-blue));
    color: #fff;
    font-size: clamp(1.4rem, 6.5vw, 2.1rem);
    font-weight: 900;
    box-shadow: 0 3px 8px rgba(33, 43, 40, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    transition: background 0.2s ease, filter 0.1s ease;
}

.fp-tile:hover .fp-face {
    filter: brightness(1.08);
}

.fp-tile:active .fp-face {
    filter: brightness(0.94);
}

.fp-home .fp-face {
    background: linear-gradient(180deg, var(--cg-green), #14604b);
}

.fp-result {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(246, 247, 242, 0.92);
    border-radius: 14px;
    text-align: center;
    z-index: 3;
}

.fp-result strong {
    font-size: 1.7rem;
    color: var(--cg-green);
}

.fp-result p {
    margin: 0;
    color: var(--cg-ink);
    font-weight: 700;
}

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

.fp-primary:hover {
    background: var(--cg-teal);
    border-color: var(--cg-teal);
}

.fp-controls {
    display: flex;
    gap: 8px;
}

.fp-mode-btn {
    flex: 1;
    padding: 11px 10px;
}

.fp-active {
    background: var(--cg-ink);
    border-color: var(--cg-ink);
    color: #fff;
}

.fp-active:hover {
    background: var(--cg-teal);
    border-color: var(--cg-teal);
}

.fp-hint {
    margin: 0;
    text-align: center;
    color: var(--cg-muted);
    font-size: 0.85rem;
}

.fp-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(30, 37, 40, 0.5);
    z-index: 50;
}

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

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

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

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

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

.fp-hidden {
    display: none;
}

@media (max-width: 640px) {
    .fp-shell {
        gap: 9px;
    }

    .fp-stat {
        min-width: 52px;
        padding: 5px 8px;
    }

    .fp-stat strong {
        font-size: 0.95rem;
    }

    .fp-pill strong {
        font-size: 1rem;
    }

    .fp-hint {
        font-size: 0.78rem;
    }
}
