.fp-game-box {
    width: min(100%, 680px);
    margin: 0 auto 22px;
    padding: clamp(18px, 3vw, 26px);
    background:
        radial-gradient(circle at top right, rgba(220, 38, 38, .10), transparent 36%),
        #fff;
    border: 1px solid rgba(17, 24, 39, .08);
    border-radius: 24px;
    box-shadow: 0 16px 42px rgba(17, 24, 39, .08);
}

.fp-game-selector-label {
    display: block;
    margin-bottom: 10px;
    color: #374151;
    font-size: .9rem;
    font-weight: 900;
    text-align: left;
}

.fp-game-selector-control {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}


.fp-game-selector-control select {
    width: 100%;
    min-height: 60px;
    padding: 0 52px 0 16px;
    color: #111827;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 17px;
    font: inherit;
    font-weight: 850;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.fp-game-selector-control select:hover,
.fp-game-selector-control select:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, .10);
    outline: none;
}

.fp-game-selector-description {
    margin: 12px 2px 0;
    color: #6b7280;
    font-size: .92rem;
    line-height: 1.55;
    text-align: left;
}

.fp-game-box .fp-game-reward {
    display: flex;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    margin: 16px auto 0;
    text-align: center;
}

.fp-game-box .fp-game-reward span {
    text-align: center;
}


.fp-game-content {
    width: 100%;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(17, 24, 39, .08);
}

.fp-game-content button:focus-visible,
.fp-game-content select:focus-visible {
    outline: 3px solid rgba(220, 38, 38, .28);
    outline-offset: 3px;
}

.fp-live-game-toolbar {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 12px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.fp-live-game-field {
    display: grid;
    min-width: 165px;
    gap: 7px;
    text-align: left;
}

.fp-live-game-field label {
    color: #4b5563;
    font-size: .8rem;
    font-weight: 900;
}

.fp-live-game-field select {
    min-height: 46px;
    padding: 0 38px 0 13px;
    color: #111827;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 13px;
    font-weight: 750;
}

.fp-live-game-status {
    min-height: 30px;
    margin-top: 18px;
    color: #111827;
    font-size: 1rem;
    font-weight: 850;
    text-align: center;
}

.fp-live-game-timer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto 20px;
    padding: 8px 14px;
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 999px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 1.05rem;
    font-weight: 900;
}

.fp-live-score {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 0 0 20px;
    flex-wrap: wrap;
}

.fp-live-score-card {
    min-width: 125px;
    padding: 10px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    text-align: center;
}

.fp-live-score-card small {
    display: block;
    color: #6b7280;
    font-weight: 700;
}

.fp-live-score-card strong {
    display: block;
    margin-top: 2px;
    color: #111827;
    font-size: 1.4rem;
}

.fp-tic-board {
    --tic-size: 3;
    display: grid;
    grid-template-columns: repeat(var(--tic-size), minmax(0, 92px));
    justify-content: center;
    width: 100%;
    gap: 9px;
}

.fp-tic-board.is-4x4 {
    --tic-size: 4;
    max-width: 420px;
    margin: 0 auto;
}

.fp-tic-board.is-4x4 .fp-tic-cell {
    border-radius: 14px;
    font-size: clamp(1.55rem, 5vw, 2.7rem);
}

.fp-tic-cell {
    aspect-ratio: 1;
    color: #dc2626;
    background: #f3f4f6;
    border: 0;
    border-radius: 19px;
    box-shadow: inset 0 0 0 1px rgba(17, 24, 39, .06);
    font-size: clamp(2rem, 7vw, 3.4rem);
    font-weight: 900;
    transition: transform .18s ease, background .18s ease;
}

.fp-tic-cell:hover:not(:disabled) {
    background: #fee2e2;
    transform: translateY(-2px);
}

.fp-tic-cell.is-o {
    color: #2563eb;
}

.fp-connect-board {
    display: grid;
    grid-template-columns: repeat(7, minmax(32px, 53px));
    justify-content: center;
    gap: clamp(4px, 1vw, 7px);
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    padding: clamp(9px, 2vw, 14px);
    background: #1d4ed8;
    border-radius: 21px;
    box-shadow: inset 0 -7px 0 rgba(0, 0, 0, .12);
}

.fp-connect-cell {
    min-width: 0;
    aspect-ratio: 1;
    background: #eff6ff;
    border: 0;
    border-radius: 50%;
    box-shadow: inset 0 3px 7px rgba(0, 0, 0, .18);
}

.fp-connect-cell.is-p1 {
    background: #ef4444;
}

.fp-connect-cell.is-p2 {
    background: #facc15;
}

.fp-memory-info {
    display: flex;
    justify-content: center;
    gap: 9px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.fp-memory-board {
    --memory-columns: 4;
    display: grid;
    grid-template-columns: repeat(var(--memory-columns), minmax(0, 1fr));
    justify-content: center;
    width: min(100%, 620px);
    margin: 0 auto;
    gap: 8px;
}

.fp-memory-board[data-pairs="8"] {
    --memory-columns: 4;
    max-width: 420px;
}

.fp-memory-board[data-pairs="16"] {
    --memory-columns: 8;
}

.fp-memory-board[data-pairs="30"] {
    --memory-columns: 10;
}

.fp-memory-card {
    aspect-ratio: 1;
    color: transparent;
    background: linear-gradient(145deg, #dc2626, #991b1b);
    border: 0;
    border-radius: 16px;
    box-shadow: 0 7px 18px rgba(153, 27, 27, .17);
    font-size: clamp(1.5rem, 5vw, 2.4rem);
    transition: transform .2s ease, background .2s ease;
}

.fp-memory-card::before {
    color: #fff;
    content: "?";
    font-size: 1.45rem;
    font-weight: 900;
}

.fp-memory-card.is-visible,
.fp-memory-card.is-matched {
    color: inherit;
    background: #fff7ed;
    box-shadow: inset 0 0 0 2px #fed7aa;
    transform: rotateY(180deg);
}

.fp-memory-card.is-visible::before,
.fp-memory-card.is-matched::before {
    content: "";
}

.fp-memory-card.is-matched {
    opacity: .72;
}

.fp-countdown-wrap {
    text-align: center;
}

.fp-countdown-target {
    margin-bottom: 10px;
    color: #6b7280;
    font-weight: 800;
}

.fp-countdown-display {
    margin: 10px 0 24px;
    color: #dc2626;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: clamp(2.5rem, 9vw, 4.8rem);
    font-weight: 950;
    letter-spacing: -.05em;
}

.fp-countdown-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.fp-countdown-round {
    width: 88px;
    height: 88px;
    color: #fff;
    border: 0;
    border-radius: 50%;
    box-shadow: 0 11px 25px rgba(17, 24, 39, .15);
    font-weight: 900;
}

.fp-countdown-round.is-go {
    background: #16a34a;
}

.fp-countdown-round.is-stop {
    background: #dc2626;
}

.fp-live-game-win,
.fp-live-game-loss {
    display: inline-block;
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    font-weight: 900;
}

.fp-live-game-win {
    color: #166534;
    background: #dcfce7;
    border: 1px solid #86efac;
}

.fp-live-game-loss {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
}

@media (max-width: 575.98px) {
    .fp-game-box,
    .fp-game-content {
        padding: 16px 12px;
        border-radius: 20px;
    }

    .fp-live-game-field {
        width: 100%;
        min-width: 0;
    }

    .fp-live-game-toolbar > .btn {
        width: 100%;
    }

    .fp-tic-board {
        grid-template-columns: repeat(var(--tic-size), minmax(0, 1fr));
        max-width: 330px;
        margin: 0 auto;
    }

    .fp-tic-board.is-4x4 {
        max-width: 350px;
    }

    .fp-connect-board {
        grid-template-columns: repeat(7, minmax(28px, 40px));
    }

    .fp-memory-board[data-pairs="8"] {
        --memory-columns: 4;
    }

    .fp-memory-board[data-pairs="16"] {
        --memory-columns: 4;
    }

    .fp-memory-board[data-pairs="30"] {
        --memory-columns: 6;
    }

    .fp-memory-card {
        border-radius: 11px;
        font-size: clamp(1rem, 5vw, 1.8rem);
    }
}
