:root {
    --game-primary: #c90c0f;
    --game-secondary: #f4c430;
}

body.fr-page {
    margin: 0;
    min-height: 100vh;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    color: #f4ead5;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 18% 12%, rgba(76, 175, 103, 0.22), transparent 44%),
        radial-gradient(circle at 86% 8%, rgba(201, 12, 15, 0.16), transparent 46%),
        linear-gradient(180deg, #0f3d2e 0%, #164a38 46%, #0a241c 100%);
}

body.fr-page.game-menu-active {
    overflow-y: auto;
    overflow-x: hidden;
}

body.fr-page.game-menu-active #game-header {
    display: none !important;
}

.fr-page .game-screen {
    display: none;
    min-height: 100vh;
}

.fr-page .game-screen.active {
    display: block;
}

body.fr-page.with-game-header .fr-shell {
    padding-top: 5.5rem;
}

.fr-shell {
    max-width: min(860px, 96vw);
    margin: 0 auto;
    padding: 1.1rem 0.75rem 2.5rem;
}

.fr-hud {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    max-width: 560px;
    margin: 0 auto 0.85rem;
    padding: 0.55rem 0.7rem;
    background: linear-gradient(180deg, #1a6b4a, #0f3d2e);
    border: 3px solid #0a241c;
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 24px rgba(0, 0, 0, 0.35);
}

.fr-lcd {
    min-width: 4.6rem;
    padding: 0.2rem 0.45rem;
    background: #071610;
    color: #f5c518;
    font-family: "Courier New", ui-monospace, monospace;
    font-size: 1.15rem;
    font-weight: 700;
    text-align: center;
    border-radius: 6px;
    box-shadow: inset 0 0 0 2px #7f1d1d, inset 0 8px 16px rgba(0, 0, 0, 0.45);
}

.fr-lcd span {
    display: block;
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #f4c430;
}

.fr-chip {
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fde68a;
    font-weight: 700;
}

.fr-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
    margin: 0 auto 0.85rem;
    max-width: 560px;
}

.fr-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    min-height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(244, 196, 48, 0.28);
    background: rgba(7, 22, 16, 0.75) !important;
    color: #f4ead5 !important;
    font-weight: 700;
    cursor: pointer;
}

.fr-tool-btn:hover {
    border-color: #f5c518;
    color: #f5c518 !important;
}

.fr-tool-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.fr-status {
    text-align: center;
    min-height: 1.4rem;
    margin: 0 auto 0.75rem;
    color: #fde68a;
    font-weight: 700;
}

.fr-status.is-bad {
    color: #fecaca;
}

.fr-pond-wrap {
    display: flex;
    justify-content: center;
    padding: 0.35rem 0.25rem 0.85rem;
}

.fr-pond {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
    overflow-x: auto;
    padding: 1.1rem 0.7rem 1.3rem;
    max-width: 100%;
    background:
        radial-gradient(circle at 20% 30%, rgba(76, 175, 103, 0.35), transparent 55%),
        linear-gradient(180deg, #1a6b4a, #0f3d2e);
    border: 4px solid #0a241c;
    border-radius: 18px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 16px 32px rgba(0, 0, 0, 0.4);
}

.fr-pond.is-circular {
    position: relative;
    width: min(420px, 90vw);
    height: min(420px, 90vw);
    flex-wrap: unset;
    overflow: visible;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, #2e8b63 0%, #164a38 58%, #0a241c 100%);
}

.fr-pad {
    position: relative;
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 3px solid #2d6a3a;
    background:
        radial-gradient(circle at 35% 30%, #8fd98a, #3d9b5c 62%, #2d6a3a);
    color: #14301c;
    font-weight: 800;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 0 #1f4d2c;
}

.fr-pond.is-circular .fr-pad {
    position: absolute;
    width: 48px;
    height: 48px;
    margin: 0;
    transform: translate(-50%, -50%);
}

.fr-pad.is-target {
    box-shadow: 0 0 0 4px #f4c430, 0 6px 0 #1f4d2c;
    border-color: #f4c430;
}

.fr-pad.is-current {
    z-index: 2;
}

.fr-frog {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.45rem;
    line-height: 1;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
    pointer-events: none;
}

.fr-jumps {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
    max-width: 420px;
    margin: 0.35rem auto 0;
}

.fr-jump-btn {
    min-width: 64px;
    min-height: 44px;
    padding: 0.45rem 0.85rem;
    border-radius: 10px;
    border: 2px solid #c90c0f;
    background: #fff !important;
    color: #c90c0f !important;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
}

.fr-jump-btn:hover,
.fr-jump-btn.is-hint {
    background: #c90c0f !important;
    color: #fff !important;
}

.fr-jump-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.fr-hint {
    text-align: center;
    color: #d7f0d4;
    font-size: 0.92rem;
    margin: 0.85rem auto 0;
    max-width: 36rem;
}

.fr-settings-panel__label {
    margin: 0 0 0.45rem;
    color: #1a120c;
    font-weight: 600;
}

.fr-settings-panel__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

#settingsModal .fr-settings-panel__note {
    margin: 0.75rem 0 0;
    color: #7f1d1d;
    font-size: 0.9rem;
}

.difficulty-pill {
    padding: 0.45rem 0.75rem;
    min-height: 44px;
    border-radius: 999px;
    border: 2px solid #c90c0f;
    background: #fff !important;
    color: #c90c0f !important;
    font-weight: 700;
    cursor: pointer;
}

.difficulty-pill.is-selected,
.difficulty-pill:hover {
    background: #c90c0f !important;
    color: #fff !important;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 12000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    color: #1a1a1a;
    border-radius: 1rem;
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 760px;
}

.modal-header,
.modal-footer {
    padding: 1.1rem 1.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.modal-header {
    border-bottom: 2px solid #eee;
}

.modal-header h2 {
    margin: 0;
    color: #c90c0f;
    font-size: 1.35rem;
}

.modal-close {
    background: #fff !important;
    border: 2px solid #c90c0f;
    color: #c90c0f !important;
    border-radius: 8px;
    cursor: pointer;
    padding: 0.35rem 0.55rem;
}

.modal-close:hover {
    background: #c90c0f !important;
    color: #fff !important;
}

.modal-body {
    padding: 1.2rem 1.4rem;
}

.modal-footer {
    border-top: 2px solid #eee;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.help-section {
    margin-bottom: 1.1rem;
}

.help-section h3 {
    color: #c90c0f;
    margin: 0 0 0.4rem;
}

.help-section ul {
    margin: 0.3rem 0 0;
    padding-left: 1.2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 0.85rem;
    text-align: center;
}

.stat-value {
    font-size: 1.6rem;
    color: #c90c0f;
    font-weight: 700;
}

.stat-label {
    color: #64748b;
    font-size: 0.85rem;
}

.difficulty-stats {
    display: grid;
    gap: 0.45rem;
}

.difficulty-stats div {
    display: flex;
    justify-content: space-between;
    padding: 0.45rem 0.55rem;
    background: #f8fafc;
    border-radius: 8px;
}

.result-message {
    font-size: 1.05rem;
    margin: 0 0 1rem;
}

.win-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    text-align: center;
}

.win-stat strong {
    display: block;
    font-size: 1.35rem;
    color: #c90c0f;
}

.win-stat span {
    color: #64748b;
    font-size: 0.82rem;
}

.fr-page .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.1rem;
    border-radius: 0.55rem;
    border: 2px solid transparent;
    font-weight: 700;
    cursor: pointer;
}

.fr-page .btn-primary {
    background: #c90c0f !important;
    color: #fff !important;
    border-color: #c90c0f;
}

.fr-page .btn-secondary {
    background: #fff !important;
    color: #c90c0f !important;
    border-color: #c90c0f;
}

.fr-page .btn-secondary:hover {
    background: #c90c0f !important;
    color: #fff !important;
}

@media (max-width: 640px) {
    body.fr-page.with-game-header .fr-shell {
        padding-top: 0.75rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .fr-hud {
        max-width: 100%;
    }

    .fr-lcd {
        min-width: 0;
        flex: 1 1 0;
    }

    .fr-pad {
        width: 44px;
        height: 44px;
        font-size: 0.85rem;
    }
}
