.ffp-game {
    --ffp-ink: #202124;
    --ffp-muted: #5f6368;
    --ffp-line: #dadce0;
    --ffp-panel: #ffffff;
    --ffp-soft: #f8f9fa;
    color: var(--ffp-ink);
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
    margin: 24px 0;
    position: relative;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

.ffp-game::before,
.ffp-game::after {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.ffp-game[style*="--ffp-page-width-desktop"],
.ffp-book-library[style*="--ffp-page-width-desktop"],
.ffp-player-settings[style*="--ffp-page-width-desktop"],
.ffp-adventure-archive[style*="--ffp-page-width-desktop"] {
    width: var(--ffp-page-width-desktop);
    max-width: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

@media (max-width: 1024px) {
    .ffp-game[style*="--ffp-page-width-desktop"],
    .ffp-book-library[style*="--ffp-page-width-desktop"],
    .ffp-player-settings[style*="--ffp-page-width-desktop"],
    .ffp-adventure-archive[style*="--ffp-page-width-desktop"] {
        width: var(--ffp-page-width-tablet, var(--ffp-page-width-desktop));
    }
}

@media (max-width: 720px) {
    .ffp-game[style*="--ffp-page-width-desktop"],
    .ffp-book-library[style*="--ffp-page-width-desktop"],
    .ffp-player-settings[style*="--ffp-page-width-desktop"],
    .ffp-adventure-archive[style*="--ffp-page-width-desktop"] {
        width: var(--ffp-page-width-mobile, var(--ffp-page-width-tablet, var(--ffp-page-width-desktop)));
    }
}

.ffp-game.ffp-night {
    --ffp-ink: #e8eaed;
    --ffp-muted: #bdc1c6;
    --ffp-line: #3c4043;
    --ffp-panel: #202124;
    --ffp-soft: #2d2f31;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

.ffp-player-settings.ffp-night {
    --ffp-ink: #e8eaed;
    --ffp-muted: #bdc1c6;
    --ffp-line: #3c4043;
    --ffp-panel: #202124;
    --ffp-soft: #2d2f31;
}

body:has(.ffp-game.ffp-night),
body:has(.ffp-game.ffp-night) .wp-site-blocks,
body:has(.ffp-player-settings.ffp-night),
body:has(.ffp-player-settings.ffp-night) .wp-site-blocks {
    background: #111315;
    color: #e8eaed;
}

body:has(.ffp-game.ffp-night) .has-base-background-color,
body:has(.ffp-game.ffp-night) .wp-block-template-part,
body:has(.ffp-game.ffp-night) .wp-block-group.has-background,
body:has(.ffp-player-settings.ffp-night) .has-base-background-color,
body:has(.ffp-player-settings.ffp-night) .wp-block-template-part,
body:has(.ffp-player-settings.ffp-night) .wp-block-group.has-background {
    background-color: #111315 !important;
    color: #f1f3f4 !important;
}

body:has(.ffp-game.ffp-night) .wp-block-site-title,
body:has(.ffp-game.ffp-night) .wp-block-site-title a,
body:has(.ffp-game.ffp-night) .wp-block-navigation a,
body:has(.ffp-game.ffp-night) header a,
body:has(.ffp-game.ffp-night) header,
body:has(.ffp-player-settings.ffp-night) .wp-block-site-title,
body:has(.ffp-player-settings.ffp-night) .wp-block-site-title a,
body:has(.ffp-player-settings.ffp-night) .wp-block-navigation a,
body:has(.ffp-player-settings.ffp-night) header a,
body:has(.ffp-player-settings.ffp-night) header {
    color: #f1f3f4 !important;
}

body:has(.ffp-game.ffp-night) .wp-block-navigation__responsive-container.is-menu-open,
body:has(.ffp-game.ffp-night) .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
body:has(.ffp-player-settings.ffp-night) .wp-block-navigation__responsive-container.is-menu-open,
body:has(.ffp-player-settings.ffp-night) .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
    background: #111315 !important;
    color: #f1f3f4 !important;
}

body:has(.ffp-game.ffp-night) .wp-block-navigation__responsive-container.is-menu-open a,
body:has(.ffp-game.ffp-night) .wp-block-navigation__responsive-container.is-menu-open button,
body:has(.ffp-game.ffp-night) .wp-block-navigation__responsive-container-close svg,
body:has(.ffp-player-settings.ffp-night) .wp-block-navigation__responsive-container.is-menu-open a,
body:has(.ffp-player-settings.ffp-night) .wp-block-navigation__responsive-container.is-menu-open button,
body:has(.ffp-player-settings.ffp-night) .wp-block-navigation__responsive-container-close svg {
    color: #f1f3f4 !important;
    fill: currentColor !important;
}

body.ffp-modal-open {
    padding-right: 0;
}

html:has(.ffp-game),
html:has(.ffp-book-library) {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

body:has(.ffp-game) .wp-site-blocks > main,
body:has(.ffp-game) .wp-block-post-content,
body:has(.ffp-game) .entry-content,
body:has(.ffp-game) main:not(.ffp-chapter),
body:has(.ffp-game) article:not(.ffp-book-card),
body:has(.ffp-game) .wp-site-blocks > .wp-block-group,
body:has(.ffp-game) .wp-block-group:has(.ffp-game),
body:has(.ffp-game) .wp-block-post-content:has(.ffp-game),
body:has(.ffp-game) .entry-content:has(.ffp-game) {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

body:has(.ffp-game) :where(.wp-site-blocks, .wp-block-post-content, .entry-content, main.wp-block-group, .wp-block-group, .is-layout-constrained, .has-global-padding):has(.ffp-game) {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

body:has(.ffp-game) :where(.wp-block-post-content, .entry-content, main.wp-block-group, .wp-block-group):has(.ffp-game)::before,
body:has(.ffp-game) :where(.wp-block-post-content, .entry-content, main.wp-block-group, .wp-block-group):has(.ffp-game)::after {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.ffp-game > .ffp-sidebar > .ffp-state,
.ffp-game > .ffp-chapter {
    border-color: transparent !important;
    box-shadow: none !important;
}

.ffp-sidebar {
    display: grid;
    gap: 14px;
    align-content: start;
}

.ffp-state,
.ffp-chapter {
    background: var(--ffp-panel);
    border: 1px solid var(--ffp-line);
    border-radius: 8px;
    padding: 18px;
}

.ffp-state {
    font-size: var(--ffp-sidebar-text-size, 13px);
}

.ffp-chapter header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.ffp-state h3,
.ffp-chapter h2 {
    margin-top: 0;
    color: var(--ffp-ink);
}

.ffp-chapter header span {
    color: var(--ffp-muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.ffp-stats {
    display: grid;
    gap: 8px;
    padding-bottom: 10px;
}

.ffp-stats div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--ffp-line);
    padding-bottom: 8px;
}

.ffp-stats-wrap summary {
    gap: 0;
}

.ffp-stats-wrap summary > span {
    min-width: 0;
    margin-right: 8px;
}

.ffp-stats-edit-open {
    width: calc(var(--ffp-stats-editor-icon-size, 18px) + 10px) !important;
    height: calc(var(--ffp-stats-editor-icon-size, 18px) + 10px);
    min-width: calc(var(--ffp-stats-editor-icon-size, 18px) + 10px);
    margin-left: auto;
    padding: 5px !important;
    display: inline-grid;
    place-items: center;
    border-radius: 6px;
    text-align: center !important;
    box-shadow: none !important;
    outline: 0 !important;
}

.ffp-stats-wrap:not([open]) .ffp-stats-edit-open {
    display: none;
}

.ffp-stats-edit-open svg {
    width: var(--ffp-stats-editor-icon-size, 18px);
    height: var(--ffp-stats-editor-icon-size, 18px);
    display: block;
}

.ffp-night .ffp-stats-edit-open {
    background: #2d2f31 !important;
    border-color: #3c4043 !important;
    color: #e8eaed !important;
    box-shadow: none !important;
}

.ffp-night .ffp-stats-edit-open:hover,
.ffp-night .ffp-stats-edit-open:focus-visible {
    background: #34383d !important;
    color: #f1f3f4 !important;
    box-shadow: none !important;
}

.ffp-stats-editor-form {
    order: 3;
    display: grid;
    gap: 10px;
}

.ffp-stats-editor-head,
.ffp-stats-editor-row {
    display: grid;
    grid-template-columns: minmax(100px, 1fr) minmax(82px, 110px) minmax(82px, 110px);
    gap: 10px;
    align-items: end;
}

.ffp-stats-editor-head {
    color: var(--ffp-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.ffp-stats-editor-row {
    border-top: 1px solid var(--ffp-line);
    padding-top: 10px;
}

.ffp-stats-editor-row strong {
    color: var(--ffp-ink);
}

.ffp-stats-editor-row label {
    display: grid;
    gap: 4px;
    color: var(--ffp-muted);
    font-size: 12px;
}

.ffp-stats-editor-row input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--ffp-line);
    border-radius: 6px;
    background: var(--ffp-soft);
    color: var(--ffp-ink);
    padding: 8px 9px;
}

.ffp-stats-editor-form button[type="submit"] {
    width: 100%;
    border: 1px solid var(--ffp-line);
    background: var(--ffp-soft);
    color: var(--ffp-ink);
    border-radius: 6px;
    padding: 9px 11px;
    cursor: pointer;
}

.ffp-inventory {
    margin-top: 18px;
}

.ffp-state .ffp-inventory {
    margin-top: 0;
}

.ffp-inventory h4 {
    margin-bottom: 8px;
}

.ffp-inventory ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.ffp-inventory li {
    margin-bottom: 6px;
}

.ffp-item-open {
    border: 0;
    background: transparent;
    color: #1f6feb;
    cursor: pointer;
    padding: 0;
    text-align: left;
}

.ffp-inventory-inline {
    line-height: 1.7;
    margin-top: 8px;
    padding-bottom: 10px;
}

.ffp-inventory-inline .ffp-item-open {
    display: inline;
}

.ffp-inventory-inline .ffp-item-open:not(:last-child)::after {
    content: ",";
    color: var(--ffp-muted);
}

.ffp-inventory-inline .ffp-item-open:not(:last-child) {
    margin-right: 4px;
}

.ffp-character-preview {
    display: grid;
    gap: 10px;
    padding-bottom: 10px;
}

.ffp-character-description-open {
    width: 100%;
    border: 1px solid var(--ffp-line);
    background: var(--ffp-soft);
    color: var(--ffp-ink);
    border-radius: 6px;
    padding: 8px 10px;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
    margin: 0 0 10px;
}

.ffp-character-open {
    border: 1px solid var(--ffp-line);
    background: var(--ffp-soft);
    border-radius: 8px;
    padding: 8px;
    cursor: zoom-in;
}

.ffp-character-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
}

.ffp-character-placeholder {
    min-height: 150px;
    display: grid;
    place-items: center;
    color: var(--ffp-muted);
}

.ffp-character-modal {
    position: fixed;
    inset: 0;
    background: rgba(32, 33, 36, 0.38);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 22px;
    box-sizing: border-box;
    z-index: 9999;
    overflow-y: auto;
}

.ffp-character-modal[hidden] {
    display: none;
}

.ffp-character-dialog {
    width: min(var(--ffp-modal-width, 640px), calc(100vw - 28px));
    max-height: calc(100vh - 80px);
    overflow: auto;
    background: var(--ffp-panel);
    border: 1px solid var(--ffp-line);
    border-radius: 8px;
    padding: 22px;
    position: relative;
    box-shadow: 0 18px 70px rgba(32, 33, 36, 0.24);
}

.ffp-character-modal-image {
    margin: 0 0 16px;
}

.ffp-character-mannequin {
    min-height: 300px;
    border: 1px solid var(--ffp-line);
    border-radius: 8px;
    background: var(--ffp-soft);
    display: grid;
    place-items: center;
    color: var(--ffp-muted);
    text-align: center;
}

.ffp-character-mannequin span {
    width: 88px;
    height: 180px;
    border-radius: 999px 999px 36px 36px;
    border: 2px solid currentColor;
    opacity: 0.45;
}

.ffp-equip-slot {
    border-top: 1px solid var(--ffp-line);
    padding-top: 12px;
    margin-top: 12px;
}

.ffp-equip-slot h4 {
    margin: 0 0 8px;
}

.ffp-equip-form {
    margin: 0 0 8px;
}

.ffp-equipment-updating .ffp-equip-form button[disabled] {
    opacity: 0.72;
    cursor: wait;
}

.ffp-inventory-more summary {
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: var(--ffp-soft);
    display: grid;
    place-items: center;
    margin-top: 6px;
}

.ffp-side-menu {
    margin-top: 0;
    font-size: 14px;
}

.ffp-side-menu h4 {
    margin: 0 0 10px;
}

.ffp-side-menu form {
    margin: 0 0 8px;
}

.ffp-menu-section {
    border-top: 1px solid var(--ffp-line);
    padding: 0;
}

.ffp-menu-section summary {
    cursor: pointer;
    color: var(--ffp-ink);
    font-size: var(--ffp-sidebar-heading-size, 14px);
    font-weight: 800;
    letter-spacing: 0;
    list-style: none;
    min-height: 48px;
    display: flex;
    align-items: center;
    text-transform: uppercase;
}

.ffp-menu-section,
.ffp-menu-section summary {
    outline: 0 !important;
}

.ffp-menu-section:focus,
.ffp-menu-section:focus-visible {
    outline: 0 !important;
    box-shadow: none !important;
}

.ffp-menu-section summary:focus,
.ffp-menu-section summary:focus-visible {
    outline: 0 !important;
    border-radius: 4px;
    box-shadow: inset 0 0 0 var(--ffp-sidebar-focus-border-width, 1px) var(--ffp-sidebar-focus-border-color, #34383d) !important;
}

.ffp-menu-section summary::-webkit-details-marker {
    display: none;
}

.ffp-menu-section summary::before {
    content: "›";
    display: inline-block;
    margin-right: 6px;
    transition: transform 0.16s ease;
}

.ffp-menu-section[open] summary::before {
    transform: rotate(90deg);
}

.ffp-menu-section > :not(summary) {
    margin-top: 8px;
    font-size: var(--ffp-sidebar-text-size, 13px);
}

.ffp-maps p {
    color: var(--ffp-muted);
    font-size: var(--ffp-sidebar-text-size, 13px);
    line-height: 1.45;
    margin: 0 0 10px;
}

.ffp-menu-actions form {
    padding-bottom: 10px;
}

.ffp-side-menu button,
.ffp-stats-toggle button,
.ffp-rediscover button,
.ffp-see-image button,
.ffp-start-form button,
.ffp-player-settings button {
    width: 100%;
    border: 1px solid var(--ffp-line);
    background: var(--ffp-soft);
    color: var(--ffp-ink);
    border-radius: 6px;
    padding: 9px 11px;
    cursor: pointer;
    text-align: left;
    font-size: var(--ffp-sidebar-text-size, 13px);
}

.ffp-stats-wrap,
.ffp-inventory {
    font-size: var(--ffp-sidebar-text-size, 13px);
}

.ffp-side-menu button:hover,
.ffp-stats-toggle button:hover,
.ffp-rediscover button:hover,
.ffp-see-image button:hover,
.ffp-start-form button:hover,
.ffp-player-settings button:hover {
    border-color: #1f6feb;
}

.ffp-route-stack {
    display: grid;
    justify-items: center;
    gap: 7px;
    margin: 0;
    flex: 0 0 auto;
}

.ffp-route-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
}

.ffp-side-menu > .ffp-route-controls {
    display: none;
}

.ffp-chapter-route-controls {
    margin: 0;
}

.ffp-route-controls form {
    margin: 0;
}

.ffp-route-arrow {
    width: 30px !important;
    height: 30px;
    border-radius: 999px !important;
    text-align: center !important;
    padding: 0 !important;
    color: var(--ffp-ink) !important;
}

.ffp-route-dots {
    display: flex;
    gap: 6px;
}

.ffp-route-dots span {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: var(--ffp-soft);
    border: 1px solid var(--ffp-line);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 12px;
}

.ffp-route-path {
    margin-bottom: 0;
}

.ffp-route-slider {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
    margin: 0 0 10px;
}

.ffp-route-slider input[type="range"] {
    width: 100%;
}

.ffp-route-slider output {
    min-width: 30px;
    height: 30px;
    border-radius: 999px;
    background: var(--ffp-soft);
    border: 1px solid var(--ffp-line);
    display: grid;
    place-items: center;
    font-weight: 700;
}

.ffp-route-arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.ffp-quick-image,
.ffp-quick-text {
    margin: 0;
}

.ffp-quick-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.ffp-quick-image button,
.ffp-quick-text button {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid var(--ffp-line);
    border-radius: 999px;
    background: var(--ffp-soft);
    color: var(--ffp-ink);
    padding: 0;
    cursor: pointer;
}

.ffp-quick-image svg,
.ffp-quick-text svg {
    width: 18px;
    height: 18px;
    display: block;
}

.ffp-quick-image button:hover,
.ffp-quick-text button:hover {
    border-color: #1f6feb;
}

.ffp-route-path summary {
    cursor: pointer;
}

.ffp-route-list {
    display: grid;
    gap: 8px;
    margin: 12px 0 10px;
    max-height: 126px;
    overflow-y: auto;
    padding: 2px 2px 8px;
    scrollbar-color: var(--ffp-muted) var(--ffp-soft);
}

.ffp-route-list:has(.ffp-previous-route[open]) > .ffp-route-line {
    display: none;
}

.ffp-route-list form {
    margin: 0;
}

.ffp-route-line {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.ffp-previous-route summary {
    cursor: pointer;
    color: var(--ffp-muted);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}

.ffp-route-link {
    width: auto !important;
    min-width: 30px;
    height: 30px;
    border-radius: 999px !important;
    padding: 0 10px !important;
    text-align: center !important;
    font-weight: 700;
}

.ffp-route-link.is-current {
    border-color: #1f6feb;
    color: #1f6feb;
    background: #fff;
}

.ffp-god-jump {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 76px;
    gap: 6px;
    margin: 0;
    align-items: end;
}

.ffp-route-jump-block {
    border-top: 1px solid var(--ffp-line);
    margin: 8px 0 10px;
    padding-top: 10px;
}

.ffp-god-jump label {
    display: grid;
    gap: 4px;
    margin: 0;
    font-size: 12px;
    color: var(--ffp-muted);
}

.ffp-god-jump input {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--ffp-line);
    border-radius: 6px;
    padding: 8px 9px;
    min-height: 38px;
    box-sizing: border-box;
    background: var(--ffp-soft);
    color: var(--ffp-ink);
}

.ffp-god-jump button {
    align-self: end;
    width: 76px !important;
    min-width: 0 !important;
    min-height: 38px;
    padding: 8px 9px !important;
    box-sizing: border-box;
    text-align: center !important;
    white-space: nowrap;
}

.ffp-setting-note {
    margin: 6px 0 0;
    color: var(--ffp-muted, #5f6368);
    font-size: 13px;
    line-height: 1.35;
}

.ffp-image-open {
    border: 0;
    background: transparent;
    padding: 0;
    display: block;
    width: min(100%, var(--ffp-chapter-image-width, 420px));
    margin: 8px auto 18px;
    cursor: zoom-in;
}

.ffp-image-frame-thumbnail {
    --ffp-chapter-image-width: 180px;
}

.ffp-image-frame-medium {
    --ffp-chapter-image-width: 420px;
}

.ffp-image-frame-large {
    --ffp-chapter-image-width: 640px;
}

.ffp-image-frame-full {
    --ffp-chapter-image-width: 100%;
}

.ffp-image {
    width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 0;
}

.ffp-image-error {
    border: 1px solid #d63638;
    background: #fcf0f1;
    color: #8a2424;
    border-radius: 6px;
    padding: 12px;
    margin: 8px 0 18px;
}

.ffp-result-notice {
    border: 1px solid var(--ffp-result-notice-color, #1f6feb);
    border-radius: 8px;
    background: rgba(31, 111, 235, 0.08);
    color: var(--ffp-result-notice-color, #1f6feb);
    font-size: var(--ffp-result-notice-size, 16px);
    font-weight: 800;
    padding: 10px 12px;
    margin: 12px 0 16px;
}

.ffp-text {
    font-size: var(--ffp-text-size-desktop, 17px);
    line-height: 1.7;
}

.ffp-choices {
    display: grid;
    gap: 10px;
    margin-top: 24px;
}

.ffp-rediscover,
.ffp-see-image,
.ffp-start-form {
    margin: 14px 0;
}

.ffp-thought-actions {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.ffp-thought-actions .ffp-rediscover,
.ffp-thought-actions .ffp-see-image {
    margin: 0;
}

.ffp-thought-actions .ffp-rediscover button,
.ffp-thought-actions .ffp-see-image button {
    border-color: var(--ffp-action-border-color, #c94a4a);
    border-width: var(--ffp-action-border-width, 1px);
}

.ffp-equipment-error {
    margin: 8px 0 10px;
    border: 1px solid #d63638;
    border-radius: 6px;
    background: rgba(214, 54, 56, 0.12);
    color: var(--ffp-ink);
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.35;
}

.ffp-rediscover button:disabled {
    cursor: not-allowed;
    color: var(--ffp-muted);
    background: var(--ffp-soft);
}

.ffp-start-game {
    grid-template-columns: minmax(0, 760px);
}

.ffp-start-panel {
    text-align: left;
}

.ffp-setup-panel {
    max-width: 860px;
}

.ffp-setup-header {
    display: block;
    text-align: left;
}

.ffp-setup-header h2 {
    margin-top: 0;
    margin-left: 0;
    max-width: 100%;
    padding-right: 32px;
    text-align: left;
    overflow-wrap: anywhere;
}

.ffp-setup-intro {
    margin: 10px 0 18px;
}

.ffp-setup-group {
    border: 1px solid var(--ffp-line);
    border-radius: 8px;
    padding: 14px;
    margin: 0 0 14px;
    background: var(--ffp-soft);
}

.ffp-setup-group h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: var(--ffp-ink);
}

.ffp-setup-budget {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 4px 0 10px;
    padding: 6px 10px;
    border: 1px solid var(--ffp-line);
    border-radius: 999px;
    background: rgba(31, 111, 235, 0.08);
    color: var(--ffp-ink);
    font-size: 13px;
    font-weight: 700;
}

.ffp-setup-option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 9px 0;
    border-top: 1px solid var(--ffp-line);
}

.ffp-setup-option:first-of-type {
    border-top: 0;
}

.ffp-setup-option span {
    display: grid;
    gap: 3px;
}

.ffp-setup-option em {
    color: var(--ffp-muted);
    font-style: normal;
    font-size: 13px;
}

.ffp-setup-option-disabled {
    opacity: 0.45;
}

.ffp-setup-option-disabled span::after {
    content: "Most nem választható";
    color: var(--ffp-muted);
    font-size: 12px;
}

.ffp-character-start-panel {
    max-width: 760px;
}

.ffp-character-start-preview {
    margin: 14px 0;
    max-width: 280px;
}

.ffp-character-start-preview img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.ffp-choices form {
    margin: 0;
}

.ffp-choices button {
    width: 100%;
    border: 1px solid #1f6feb;
    background: #1f6feb;
    color: #fff;
    border-radius: 6px;
    padding: 11px 14px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.ffp-choice-target {
    margin-left: auto;
    white-space: nowrap;
    opacity: 0.9;
}

.ffp-choices button:disabled {
    cursor: not-allowed;
    background: var(--ffp-soft);
    border-color: var(--ffp-line);
    color: var(--ffp-muted);
}

.ffp-combat-panel {
    border: 1px solid var(--ffp-line);
    background: var(--ffp-soft);
    border-radius: 8px;
    padding: 14px;
    margin: 18px 0;
}

.ffp-combat-panel h3 {
    margin: 0 0 10px;
    color: var(--ffp-ink);
}

.ffp-combat-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 12px;
    font-weight: 700;
}

.ffp-combatant {
    display: grid;
    gap: 3px;
}

.ffp-enemy-combatant {
    text-align: right;
}

.ffp-combatant small {
    color: var(--ffp-muted);
    font-size: 12px;
    font-weight: 500;
}

.ffp-dice-stage {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    perspective: 500px;
    margin: 10px 0 12px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    width: 100%;
}

.ffp-dice-group {
    display: inline-flex;
    gap: 10px;
    align-items: center;
}

.ffp-dice-equipment {
    margin-left: 14px;
}

.ffp-dice-equipment .ffp-die {
    border-color: #d63638;
    box-shadow: 0 8px 0 rgba(214, 54, 56, 0.2);
}

.ffp-dice-enemy {
    margin-left: auto;
    justify-content: flex-end;
}

.ffp-die {
    width: 42px;
    height: 42px;
    display: block;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--ffp-line);
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.12);
    position: relative;
    transform: rotateX(0) rotateY(0);
}

.ffp-die::before {
    content: "";
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #202124;
    top: 17px;
    left: 17px;
}

.ffp-die[data-value="1"]::before {
    box-shadow: none;
}

.ffp-die[data-value="2"]::before {
    box-shadow: -9px -9px 0 #202124, 9px 9px 0 #202124;
    background: transparent;
}

.ffp-die[data-value="3"]::before {
    box-shadow: -9px -9px 0 #202124, 9px 9px 0 #202124;
}

.ffp-die[data-value="4"]::before {
    background: transparent;
    box-shadow: -9px -9px 0 #202124, 9px -9px 0 #202124, -9px 9px 0 #202124, 9px 9px 0 #202124;
}

.ffp-die[data-value="5"]::before {
    box-shadow: -9px -9px 0 #202124, 9px -9px 0 #202124, -9px 9px 0 #202124, 9px 9px 0 #202124;
}

.ffp-die[data-value="6"]::before {
    background: transparent;
    box-shadow: -9px -10px 0 #202124, -9px 0 0 #202124, -9px 10px 0 #202124, 9px -10px 0 #202124, 9px 0 0 #202124, 9px 10px 0 #202124;
}

.ffp-combat-log {
    margin: 0 0 12px 20px;
    line-height: 1.5;
}

.ffp-combat-actions {
    display: grid;
    gap: 12px;
    row-gap: 12px;
}

.ffp-combat-roll {
    margin: 0;
}

.ffp-combat-roll + .ffp-combat-roll {
    margin-top: 2px;
}

.ffp-combat-roll button {
    width: 100%;
    border: 1px solid #1f6feb;
    background: #1f6feb;
    color: #fff;
    border-radius: 6px;
    padding: 11px 14px;
    font-weight: 700;
    cursor: pointer;
}

.ffp-dice-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    perspective: 900px;
    z-index: 10020;
}

.ffp-dice-cube {
    position: absolute;
    left: calc(14vw + var(--i) * 7vw);
    top: calc(74vh - var(--i) * 3vh);
    width: 58px;
    height: 58px;
    animation: ffp-dice-fly 1.25s cubic-bezier(.17,.84,.28,1) forwards;
    transform-style: preserve-3d;
}

.ffp-dice-cube b {
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid rgba(32, 33, 36, 0.24);
    box-shadow: inset 0 0 18px rgba(31, 111, 235, 0.08);
}

.ffp-dice-cube b::before {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #202124;
    left: 23px;
    top: 23px;
}

.ffp-dice-cube .front { transform: translateZ(29px); }
.ffp-dice-cube .back { transform: rotateY(180deg) translateZ(29px); }
.ffp-dice-cube .right { transform: rotateY(90deg) translateZ(29px); }
.ffp-dice-cube .left { transform: rotateY(-90deg) translateZ(29px); }
.ffp-dice-cube .top { transform: rotateX(90deg) translateZ(29px); }
.ffp-dice-cube .bottom { transform: rotateX(-90deg) translateZ(29px); }

.ffp-dice-cube .back::before { box-shadow: -12px -12px 0 #202124, 12px 12px 0 #202124; }
.ffp-dice-cube .right::before { box-shadow: -12px -12px 0 #202124, 12px -12px 0 #202124, -12px 12px 0 #202124, 12px 12px 0 #202124; }
.ffp-dice-cube .left::before { box-shadow: -12px -12px 0 #202124, 12px -12px 0 #202124; }
.ffp-dice-cube .top::before { box-shadow: -12px -12px 0 #202124, 12px -12px 0 #202124, -12px 12px 0 #202124, 12px 12px 0 #202124; }
.ffp-dice-cube .bottom::before {
    background: transparent;
    box-shadow: -13px -14px 0 #202124, -13px 0 0 #202124, -13px 14px 0 #202124, 13px -14px 0 #202124, 13px 0 0 #202124, 13px 14px 0 #202124;
}

.ffp-night .ffp-dice-cube b {
    background: #f4f6fb;
    box-shadow: 0 12px 0 rgba(0, 0, 0, 0.4), 0 0 28px rgba(129, 163, 255, 0.22);
}

@keyframes ffp-dice-fly {
    0% {
        opacity: 0;
        transform: translate3d(0, 0, 140px) rotateX(0) rotateY(0) scale(1.15);
    }
    15% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate3d(54vw, -54vh, -360px) rotateX(900deg) rotateY(760deg) scale(0.34);
    }
}

.ffp-last,
.ffp-ending {
    margin-top: 16px;
    background: var(--ffp-soft);
    border: 1px solid var(--ffp-line);
    border-radius: 6px;
    padding: 10px;
    font-size: var(--ffp-sidebar-text-size, 13px);
    line-height: 1.45;
}

.ffp-book-library {
    --ffp-ink: #202124;
    --ffp-muted: #5f6368;
    --ffp-line: #dadce0;
    --ffp-panel: #ffffff;
    --ffp-soft: #f8f9fa;
    color: var(--ffp-ink);
    margin: 24px 0;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

.ffp-book-library.ffp-night {
    --ffp-ink: #e8eaed;
    --ffp-muted: #bdc1c6;
    --ffp-line: #3c4043;
    --ffp-panel: #202124;
    --ffp-soft: #2d2f31;
}

body:has(.ffp-book-library.ffp-night),
body:has(.ffp-book-library.ffp-night) .wp-site-blocks {
    background: #111315;
    color: #e8eaed;
}

body:has(.ffp-book-library.ffp-night) .has-base-background-color,
body:has(.ffp-book-library.ffp-night) .wp-block-template-part,
body:has(.ffp-book-library.ffp-night) .wp-block-group.has-background {
    background-color: #111315 !important;
    color: #f1f3f4 !important;
}

body:has(.ffp-book-library.ffp-night) .wp-block-site-title,
body:has(.ffp-book-library.ffp-night) .wp-block-site-title a,
body:has(.ffp-book-library.ffp-night) .wp-block-navigation a,
body:has(.ffp-book-library.ffp-night) header a,
body:has(.ffp-book-library.ffp-night) header {
    color: #f1f3f4 !important;
}

body:has(.ffp-book-library.ffp-night) .wp-block-navigation__responsive-container.is-menu-open,
body:has(.ffp-book-library.ffp-night) .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
body:has(.ffp-book-library.ffp-night) .wp-block-navigation__responsive-container.is-menu-open a,
body:has(.ffp-book-library.ffp-night) .wp-block-navigation__responsive-container.is-menu-open button,
body:has(.ffp-book-library.ffp-night) .wp-block-navigation__responsive-container-close svg {
    background: #111315 !important;
    color: #f1f3f4 !important;
    fill: currentColor !important;
}

body:has(.ffp-book-library) .wp-site-blocks > main,
body:has(.ffp-book-library) .wp-block-post-content,
body:has(.ffp-book-library) .entry-content,
body:has(.ffp-book-library) main:not(.ffp-book-library),
body:has(.ffp-book-library) article:not(.ffp-book-card),
body:has(.ffp-book-library) .wp-site-blocks > .wp-block-group,
body:has(.ffp-book-library) .wp-block-group:has(.ffp-book-library),
body:has(.ffp-book-library) .wp-block-post-content:has(.ffp-book-library),
body:has(.ffp-book-library) .entry-content:has(.ffp-book-library) {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

body:has(.ffp-book-library) :where(.wp-site-blocks, .wp-block-post-content, .entry-content, main.wp-block-group, .wp-block-group, .is-layout-constrained, .has-global-padding):has(.ffp-book-library) {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

body:has(.ffp-book-library) :where(.wp-block-post-content, .entry-content, main.wp-block-group, .wp-block-group):has(.ffp-book-library)::before,
body:has(.ffp-book-library) :where(.wp-block-post-content, .entry-content, main.wp-block-group, .wp-block-group):has(.ffp-book-library)::after {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.ffp-book-library-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.ffp-book-library-head h2 {
    margin: 0;
    color: var(--ffp-ink);
}

.ffp-book-library-head label {
    display: grid;
    gap: 5px;
    min-width: min(280px, 100%);
    color: var(--ffp-muted);
    font-size: 13px;
    font-weight: 700;
}

.ffp-book-filter {
    border: 1px solid var(--ffp-line);
    border-radius: 6px;
    padding: 9px 10px;
    background: var(--ffp-panel);
    color: var(--ffp-ink);
}

.ffp-book-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.ffp-book-card {
    background: var(--ffp-panel);
    border: 1px solid var(--ffp-line);
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    max-width: none;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ffp-book-cover {
    aspect-ratio: 2 / 3;
    display: grid;
    place-items: center;
    background: var(--ffp-soft);
    color: var(--ffp-muted);
    text-decoration: none;
    font-weight: 700;
    text-align: center;
}

.ffp-book-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ffp-book-meta {
    padding: 14px;
    display: flex;
    flex: 1;
    flex-direction: column;
}

.ffp-book-meta h3 {
    margin: 0 0 6px;
    color: var(--ffp-ink);
}

.ffp-book-meta a {
    color: inherit;
}

.ffp-book-author {
    margin: 0 0 10px;
    color: var(--ffp-muted);
}

.ffp-book-blurb {
    margin: 10px 0;
    color: var(--ffp-ink);
}

.ffp-book-blurb summary {
    cursor: pointer;
    font-weight: 700;
}

.ffp-book-start {
    display: block;
    margin-top: auto;
    border: 1px solid #1f6feb;
    border-radius: 6px;
    padding: 9px 12px;
    text-align: center;
    text-decoration: none;
    color: #fff !important;
    background: #1f6feb;
    font-weight: 700;
}

@media (max-width: 720px) {
    .ffp-book-library-head {
        display: grid;
    }

    .ffp-book-grid {
        grid-template-columns: 1fr;
    }
}

.ffp-info-block {
    background: var(--ffp-panel);
    border: 1px solid var(--ffp-line);
    border-radius: 8px;
    padding: 12px;
}

.ffp-info-block h3,
.ffp-info-block > summary {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 800;
    color: var(--ffp-ink);
}

.ffp-loader {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(248, 249, 250, 0.82);
    backdrop-filter: blur(2px);
    z-index: 10000;
}

.ffp-night .ffp-loader {
    background: rgba(17, 19, 21, 0.78);
}

.ffp-is-loading .ffp-loader {
    display: flex;
}

.ffp-loader-card {
    max-width: 320px;
    background: #fff;
    border: 1px solid var(--ffp-line);
    border-radius: 8px;
    padding: 22px;
    text-align: center;
    box-shadow: 0 18px 60px rgba(32, 33, 36, 0.14);
}

.ffp-loader-card span {
    display: inline-block;
    width: 48px;
    height: 48px;
    border: 4px solid #d8e2ff;
    border-top-color: #1f6feb;
    border-radius: 50%;
    animation: ffp-spin 0.8s linear infinite;
    margin-bottom: 12px;
}

.ffp-loader-card strong,
.ffp-loader-card p {
    display: block;
    margin: 0;
}

.ffp-loader-quote {
    margin: 16px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--ffp-line);
    color: var(--ffp-muted);
}

.ffp-loader-quote blockquote {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 15px;
    line-height: 1.45;
    font-style: italic;
}

.ffp-loader-quote figcaption {
    margin-top: 7px;
    font-size: 12px;
    font-weight: 700;
    color: var(--ffp-ink);
}

.ffp-combat-loading .ffp-loader-card strong,
.ffp-combat-loading .ffp-loader-card p,
.ffp-combat-loading .ffp-loader-quote {
    display: none;
}

.ffp-item-modal,
.ffp-memory-modal {
    position: fixed;
    inset: 0;
    background: rgba(32, 33, 36, 0.38);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 22px;
    box-sizing: border-box;
    z-index: 9999;
    overflow-y: auto;
}

.ffp-item-modal[hidden],
.ffp-memory-modal[hidden],
.ffp-map-modal[hidden] {
    display: none;
}

.ffp-image-modal {
    position: fixed;
    inset: 0;
    background: rgba(32, 33, 36, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 32px;
    box-sizing: border-box;
    z-index: 10000;
    overflow: auto;
}

.ffp-image-modal[hidden] {
    display: none;
}

.ffp-image-dialog {
    width: min(1024px, calc(100vw - 32px));
    max-height: calc(100vh - 112px);
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    touch-action: none;
    user-select: none;
}

.ffp-image-dialog img {
    max-width: 100%;
    max-height: calc(100vh - 112px);
    height: auto;
    border-radius: 8px;
    box-shadow: 0 18px 70px rgba(0, 0, 0, 0.34);
    cursor: zoom-in;
    transform-origin: center center;
    transition: transform 0.08s ease-out;
    will-change: transform;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: none;
}

.ffp-image-modal.ffp-image-zoomed .ffp-image-dialog img {
    cursor: grab;
}

.ffp-image-modal.ffp-image-panning .ffp-image-dialog img {
    cursor: grabbing;
    transition: none;
}

@media (min-width: 769px) {
    .ffp-chapter-image-modal .ffp-image-dialog {
        width: auto;
        max-width: calc(100vw - 64px);
        background: var(--ffp-panel, #fff);
        border: 1px solid var(--ffp-line, #dadce0);
        border-radius: 10px;
        padding: 22px;
        box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
    }

    .ffp-chapter-image-modal .ffp-image-dialog img {
        max-height: calc(100vh - 156px);
    }

    .ffp-chapter-image-modal .ffp-image-close {
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 560px) {
    .ffp-stats-editor-head {
        display: none;
    }

    .ffp-stats-editor-row {
        grid-template-columns: 1fr 1fr;
    }

    .ffp-stats-editor-row strong {
        grid-column: 1 / -1;
    }
}

.ffp-image-close {
    position: absolute;
    top: 10px;
    right: 10px;
    border: 0;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 999px;
    width: 34px;
    height: 34px;
    cursor: pointer;
    z-index: 2;
}

.ffp-item-dialog {
    width: min(var(--ffp-modal-width, 640px), calc(100vw - 28px));
    max-height: calc(100vh - 80px);
    overflow: auto;
    background: #fff;
    border: 1px solid var(--ffp-line);
    border-radius: 8px;
    padding: 22px;
    position: relative;
    margin: auto 0;
    box-shadow: 0 18px 70px rgba(32, 33, 36, 0.24);
    display: flex;
    flex-direction: column;
}

.ffp-item-dialog h3 {
    order: 2;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
    margin: 0 40px 14px 0;
}

.ffp-item-close {
    position: absolute;
    top: 10px;
    right: 10px;
    border: 0;
    background: var(--ffp-soft);
    border-radius: 999px;
    width: 30px;
    height: 30px;
    cursor: pointer;
}

.ffp-item-image {
    width: auto;
    max-width: 100%;
    max-height: min(52vh, 520px);
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    margin: 0 auto;
    display: block;
}

.ffp-item-image-open {
    order: 1;
    width: min(100%, var(--ffp-item-image-width, 420px));
    margin: 0 0 14px;
    align-self: center;
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
}

.ffp-item-image-open.ffp-item-image-frame-thumbnail {
    --ffp-item-image-width: 180px;
}

.ffp-item-image-open.ffp-item-image-frame-medium {
    --ffp-item-image-width: 420px;
}

.ffp-item-image-open.ffp-item-image-frame-large {
    --ffp-item-image-width: 640px;
}

.ffp-map-list {
    display: grid;
    gap: 10px;
}

.ffp-map-open {
    width: 100%;
    border: 1px solid var(--ffp-line);
    background: var(--ffp-soft);
    color: var(--ffp-ink);
    border-radius: 6px;
    padding: 8px;
    display: grid;
    gap: 6px;
    cursor: pointer;
}

.ffp-map-thumb {
    width: 100%;
    max-height: 120px;
    object-fit: contain;
    border-radius: 5px;
}

.ffp-item-description {
    order: 3;
    line-height: 1.65;
}

.ffp-item-name {
    font-weight: 800;
    text-transform: uppercase;
}

.ffp-item-actions {
    order: 4;
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.ffp-item-quantity {
    order: 3;
    color: var(--ffp-muted);
    font-size: 14px;
    font-weight: 700;
}

.ffp-item-action {
    margin: 10px 0;
}

.ffp-item-action button {
    width: 100%;
    border: 1px solid var(--ffp-line);
    background: var(--ffp-soft);
    border-radius: 6px;
    padding: 9px 11px;
    cursor: pointer;
    text-align: left;
}

.ffp-player-settings {
    --ffp-ink: #202124;
    --ffp-muted: #5f6368;
    --ffp-line: #dadce0;
    --ffp-panel: #ffffff;
    --ffp-soft: #f8f9fa;
    border: 1px solid var(--ffp-line, #dadce0);
    border-radius: 8px;
    padding: 18px;
    background: #fff;
    max-width: 980px;
    margin: 24px auto;
}

.ffp-player-settings h3 {
    margin: 0 0 14px;
    color: var(--ffp-ink);
}

.ffp-player-settings-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

.ffp-player-settings-form section {
    border: 1px solid var(--ffp-line, #dadce0);
    border-radius: 8px;
    background: var(--ffp-soft, #f8f9fa);
    padding: 12px;
}

.ffp-player-settings-form h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--ffp-ink);
}

.ffp-player-settings-form label {
    display: grid;
    gap: 6px;
    margin: 0 0 8px;
}

.ffp-player-settings-form label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
}

.ffp-player-settings-form select {
    width: 100%;
}

.ffp-player-settings-form input,
.ffp-player-settings-form select {
    color: var(--ffp-ink);
}

.ffp-player-settings-form > button {
    grid-column: 1 / -1;
    width: auto;
    justify-self: start;
    min-width: 120px;
}

.ffp-night .ffp-item-dialog,
.ffp-night .ffp-character-dialog,
.ffp-night .ffp-loader-card,
.ffp-night .ffp-player-settings,
.ffp-player-settings.ffp-night,
.ffp-night .ffp-player-settings-form section {
    background: var(--ffp-panel);
    color: var(--ffp-ink);
}

.ffp-night .ffp-player-settings-form input,
.ffp-night .ffp-player-settings-form select {
    background: var(--ffp-soft);
    border-color: var(--ffp-line);
    color: var(--ffp-ink);
}

.ffp-player-settings.ffp-night h3,
.ffp-player-settings.ffp-night h4 {
    color: var(--ffp-ink) !important;
}

.ffp-night .ffp-character-dialog,
.ffp-night .ffp-character-dialog h3,
.ffp-night .ffp-character-dialog h4,
.ffp-night .ffp-equip-slot,
.ffp-night .ffp-memory-dialog,
.ffp-night .ffp-memory-dialog h3 {
    color: var(--ffp-ink);
    scrollbar-color: var(--ffp-muted) var(--ffp-panel);
}

.ffp-night .ffp-item-close,
.ffp-night .ffp-side-menu button,
.ffp-night .ffp-memory-open,
.ffp-night .ffp-generated-images-open,
.ffp-night .ffp-duel-images-open,
.ffp-night .ffp-background-story-open,
.ffp-night .ffp-notes-open,
.ffp-night .ffp-rediscover button,
.ffp-night .ffp-see-image button,
.ffp-night .ffp-start-form button {
    background: var(--ffp-soft);
    color: var(--ffp-ink);
}

.ffp-item-local-loader {
    order: 5;
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    background: rgba(255, 255, 255, 0.88);
    border-radius: 8px;
    text-align: center;
}

.ffp-night .ffp-item-local-loader {
    background: rgba(32, 33, 36, 0.9);
    color: var(--ffp-ink);
}

.ffp-night .ffp-item-action button,
.ffp-night .ffp-equip-form button,
.ffp-night .ffp-player-settings button,
.ffp-night .ffp-route-arrow {
    background: var(--ffp-soft);
    border-color: var(--ffp-line);
    color: var(--ffp-ink) !important;
}

.ffp-night .ffp-route-arrow:disabled {
    color: #8f949b !important;
}

.ffp-item-loading .ffp-item-local-loader {
    display: flex;
}

.ffp-character-modal.ffp-sticky-refreshing .ffp-character-dialog {
    opacity: 0.96;
}

.ffp-memory-open,
.ffp-generated-images-open,
.ffp-duel-images-open,
.ffp-background-story-open,
.ffp-notes-open {
    width: 100%;
    border: 1px solid var(--ffp-line);
    background: var(--ffp-soft);
    color: var(--ffp-ink);
    border-radius: 6px;
    padding: 9px 11px;
    cursor: pointer;
    text-align: left;
    margin-top: 8px;
}

.ffp-memory-list {
    margin: 0;
    padding-left: 20px;
    line-height: 1.65;
    order: 2;
}

.ffp-memory-list span {
    color: var(--ffp-muted);
}

.ffp-memory-dialog h3 {
    order: 1;
}

.ffp-background-story-dialog {
    width: min(760px, calc(100vw - 28px));
    max-height: calc(100vh - 72px);
}

.ffp-background-story-body {
    order: 2;
    display: grid;
    gap: 16px;
    line-height: 1.72;
}

.ffp-background-story-figure {
    margin: 0;
}

.ffp-background-story-image-open {
    display: block;
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: zoom-in;
}

.ffp-background-story-image {
    display: block;
    width: min(100%, 560px);
    max-height: 52vh;
    object-fit: contain;
    border-radius: 8px;
    margin: 0 auto;
}

.ffp-background-story-text p {
    margin: 0 0 1em;
}

.ffp-generated-image-strip {
    order: 2;
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 4px 2px 12px;
    scroll-snap-type: none;
    scrollbar-width: thin;
    cursor: grab;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
    user-select: none;
}

.ffp-generated-image-strip.ffp-strip-dragging {
    cursor: grabbing;
}

.ffp-generated-image-strip.ffp-strip-dragging * {
    user-select: none;
}

.ffp-generated-image-card {
    flex: 0 0 min(420px, 82vw);
    margin: 0;
}

.ffp-generated-image-card > .ffp-image-open {
    display: block;
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.ffp-generated-image-card > .ffp-image-open img {
    width: 100%;
    height: auto;
    max-height: 58vh;
    object-fit: contain;
    border-radius: 8px;
    user-select: none;
    -webkit-user-drag: none;
}

.ffp-generated-image-card figcaption {
    margin-top: 7px;
    color: var(--ffp-muted);
    font-size: 13px;
}

.ffp-notes-form {
    order: 2;
    display: grid;
    gap: 12px;
}

.ffp-notes-form textarea {
    width: 100%;
    min-height: min(42vh, 420px);
    box-sizing: border-box;
    border: 1px solid var(--ffp-line);
    border-radius: 6px;
    background: var(--ffp-soft);
    color: var(--ffp-ink);
    padding: 10px;
    resize: vertical;
    font: inherit;
    line-height: 1.55;
}

.ffp-notes-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ffp-notes-actions button {
    border: 1px solid var(--ffp-line);
    background: var(--ffp-soft);
    color: var(--ffp-ink);
    border-radius: 6px;
    padding: 10px 12px;
    cursor: pointer;
    font: inherit;
}

.ffp-notes-actions button:hover {
    filter: brightness(1.08);
}

@media (max-width: 560px) {
    .ffp-notes-actions {
        grid-template-columns: 1fr;
    }
}

.ffp-equipped-check {
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    margin-left: 7px;
    border-radius: 999px;
    background: #16a34a;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.ffp-adventure-archive {
    --ffp-ink: #202124;
    --ffp-muted: #5f6368;
    --ffp-line: #dadce0;
    --ffp-panel: #ffffff;
    --ffp-soft: #f8f9fa;
    color: var(--ffp-ink);
    margin: 24px 0;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

.ffp-adventure-archive.ffp-night {
    --ffp-ink: #e8eaed;
    --ffp-muted: #bdc1c6;
    --ffp-line: #3c4043;
    --ffp-panel: #202124;
    --ffp-soft: #2d2f31;
}

body:has(.ffp-adventure-archive.ffp-night),
body:has(.ffp-adventure-archive.ffp-night) .wp-site-blocks {
    background: #111315;
    color: #e8eaed;
}

body:has(.ffp-adventure-archive.ffp-night) .has-base-background-color,
body:has(.ffp-adventure-archive.ffp-night) .wp-block-template-part,
body:has(.ffp-adventure-archive.ffp-night) .wp-block-group.has-background {
    background-color: #111315 !important;
    color: #f1f3f4 !important;
}

body:has(.ffp-adventure-archive.ffp-night) .wp-block-site-title,
body:has(.ffp-adventure-archive.ffp-night) .wp-block-site-title a,
body:has(.ffp-adventure-archive.ffp-night) .wp-block-navigation a,
body:has(.ffp-adventure-archive.ffp-night) header a,
body:has(.ffp-adventure-archive.ffp-night) header {
    color: #f1f3f4 !important;
}

body:has(.ffp-adventure-archive.ffp-night) .wp-block-navigation__responsive-container.is-menu-open,
body:has(.ffp-adventure-archive.ffp-night) .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
body:has(.ffp-adventure-archive.ffp-night) .wp-block-navigation__responsive-container.is-menu-open a,
body:has(.ffp-adventure-archive.ffp-night) .wp-block-navigation__responsive-container.is-menu-open button,
body:has(.ffp-adventure-archive.ffp-night) .wp-block-navigation__responsive-container-close svg {
    background: #111315 !important;
    color: #f1f3f4 !important;
    fill: currentColor !important;
}

.ffp-archive-head {
    margin-bottom: 18px;
}

.ffp-archive-head span,
.ffp-archive-story-head span,
.ffp-archive-page header span {
    color: var(--ffp-muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.ffp-archive-head h2,
.ffp-archive-story-head h3,
.ffp-archive-page h4 {
    margin: 4px 0 0;
    color: var(--ffp-ink);
}

.ffp-archive-grid {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.ffp-archive-list,
.ffp-archive-reader,
.ffp-archive-story {
    min-width: 0;
}

.ffp-archive-list {
    display: grid;
    gap: 10px;
}

.ffp-archive-list-item {
    display: grid;
    gap: 6px;
}

.ffp-archive-list-item:not(:last-child) {
    border-bottom: 1px solid var(--ffp-line);
    padding-bottom: 12px;
}

.ffp-archive-pick {
    display: grid;
    gap: 4px;
    width: 100%;
    border: 1px solid var(--ffp-line);
    border-radius: 8px;
    background: var(--ffp-panel);
    color: var(--ffp-ink);
    padding: 12px;
    text-align: left;
    cursor: pointer;
}

.ffp-archive-delete-form {
    margin: 0;
}

.ffp-archive-delete {
    width: 100%;
    border: 1px solid var(--ffp-line);
    border-radius: 6px;
    background: var(--ffp-soft);
    color: var(--ffp-muted);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 10px;
    text-align: center;
}

.ffp-archive-delete:hover,
.ffp-archive-delete:focus-visible {
    border-color: #c94a4a;
    color: #c94a4a;
}

.ffp-archive-pick.is-active {
    border-color: #1f6feb;
    box-shadow: inset 3px 0 0 #1f6feb;
}

.ffp-archive-pick span,
.ffp-archive-pick small {
    color: var(--ffp-muted);
}

.ffp-archive-story {
    display: none;
    border: 1px solid var(--ffp-line);
    border-radius: 8px;
    background: var(--ffp-panel);
    padding: 18px;
}

.ffp-archive-story.is-active {
    display: block;
}

.ffp-archive-story-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.ffp-archive-story-head strong {
    color: var(--ffp-muted);
    white-space: nowrap;
}

.ffp-archive-page {
    display: none;
}

.ffp-archive-page.is-active {
    display: block;
}

.ffp-archive-page figure {
    margin: 14px auto 18px;
    width: min(100%, 520px);
}

.ffp-archive-page img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.ffp-archive-text {
    line-height: 1.7;
}

.ffp-archive-note,
.ffp-archive-empty {
    border: 1px solid var(--ffp-line);
    border-radius: 8px;
    background: var(--ffp-soft);
    color: var(--ffp-ink);
    padding: 10px 12px;
}

.ffp-archive-duel {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--ffp-muted) 26%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--ffp-soft) 76%, transparent);
}

.ffp-archive-duel h5 {
    margin: 0 0 10px;
    color: var(--ffp-ink);
}

.ffp-archive-duel article {
    display: grid;
    gap: 8px;
    padding: 10px 0;
    border-top: 1px solid color-mix(in srgb, var(--ffp-muted) 18%, transparent);
}

.ffp-archive-duel article:first-of-type {
    border-top: 0;
}

.ffp-archive-duel img {
    max-width: 180px;
    border-radius: 6px;
}

.ffp-archive-nav {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    gap: 10px;
    align-items: center;
    margin-top: 18px;
}

.ffp-archive-nav button {
    width: 44px;
    height: 40px;
    border: 1px solid var(--ffp-line);
    border-radius: 999px;
    background: var(--ffp-soft);
    color: var(--ffp-ink);
    cursor: pointer;
    font-size: 22px;
}

.ffp-archive-nav button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ffp-archive-nav output {
    text-align: center;
    color: var(--ffp-muted);
    font-weight: 800;
}

.ffp-equip-form button {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ffp-new-item-kicker {
    order: 1;
    color: #1f6feb;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.ffp-item-local-loader span {
    width: 40px;
    height: 40px;
    border: 4px solid #d8e2ff;
    border-top-color: #1f6feb;
    border-radius: 50%;
    animation: ffp-spin 0.8s linear infinite;
}

.ffp-generation-debug {
    position: fixed;
    top: 84px;
    right: 16px;
    z-index: 9998;
    width: min(320px, calc(100vw - 24px));
    display: grid;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--ffp-line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--ffp-panel) 92%, transparent);
    color: var(--ffp-ink);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
    font-size: 11px;
}

.ffp-generation-debug strong {
    font-size: 12px;
    text-transform: uppercase;
}

.ffp-generation-debug small {
    color: var(--ffp-muted);
}

.ffp-debug-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 8px;
    border: 1px solid var(--ffp-line);
    border-radius: 6px;
    background: var(--ffp-soft);
    color: var(--ffp-ink);
    text-decoration: none;
    font-weight: 700;
}

.ffp-debug-edit:hover,
.ffp-debug-edit:focus {
    color: var(--ffp-ink);
    border-color: var(--ffp-action);
}

.ffp-debug-copy {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 8px;
    align-items: center;
    padding: 6px 8px;
    border: 1px solid var(--ffp-line);
    border-radius: 6px;
    background: var(--ffp-soft);
    color: var(--ffp-ink);
    cursor: copy;
    text-align: left;
}

.ffp-debug-copy code {
    font-size: 11px;
}

.ffp-debug-copy em {
    grid-column: 1 / -1;
    color: var(--ffp-muted);
    font-style: normal;
}

.ffp-debug-copy-wide {
    grid-template-columns: minmax(0, 1fr) auto;
}

.ffp-debug-copy-wide span {
    min-width: 0;
}

.ffp-debug-copy.is-copied {
    border-color: #2ea043;
}

@media (max-width: 680px) {
    .ffp-item-modal {
        padding: 28px 14px;
    }

    .ffp-image-modal {
        padding: 36px 16px;
        align-items: center;
    }

    .ffp-item-dialog {
        max-height: calc(100vh - 56px);
    }

    .ffp-image-dialog,
    .ffp-image-dialog img {
        max-height: calc(100vh - 72px);
    }

    .ffp-player-settings-form {
        grid-template-columns: 1fr;
    }

    .ffp-archive-grid {
        grid-template-columns: 1fr;
    }

    .ffp-archive-list {
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    }

    .ffp-archive-story {
        padding: 14px;
    }

    .ffp-generation-debug {
        top: auto;
        right: 12px;
        bottom: 12px;
    }
}

.ffp-loader-card p {
    color: var(--ffp-muted);
    margin-top: 6px;
}

.ffp-ai-duel-panel {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid color-mix(in srgb, var(--ffp-muted) 24%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--ffp-panel) 88%, var(--ffp-ink) 12%);
}

.ffp-ai-duel-head,
.ffp-ai-duel-grid,
.ffp-ai-duel-actions {
    display: grid;
    gap: 10px;
}

.ffp-ai-duel-head {
    grid-template-columns: 1fr auto;
    align-items: start;
    margin-bottom: 12px;
}

.ffp-ai-duel-head span,
.ffp-ai-duel-head strong,
.ffp-ai-duel-traits {
    color: var(--ffp-muted);
    font-size: .82em;
}

.ffp-ai-duel-head h3 {
    margin: 2px 0 0;
    color: var(--ffp-ink);
}

.ffp-ai-duel-profile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.ffp-ai-duel-profile {
    margin-top: 12px;
}

.ffp-ai-duel-profile-image-form {
    margin: 0;
}

.ffp-ai-duel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ffp-ai-duel-card,
.ffp-ai-duel-profile,
.ffp-ai-duel-log li {
    border-radius: 6px;
    background: color-mix(in srgb, var(--ffp-soft) 82%, transparent);
    padding: 10px;
}

.ffp-ai-duel-card p,
.ffp-ai-duel-profile p {
    margin: 6px 0 0;
}

.ffp-ai-duel-actions {
    margin-top: 12px;
}

.ffp-ai-duel-action-group {
    border: 1px solid color-mix(in srgb, #f4c542 28%, transparent);
    border-radius: 8px;
    padding: 8px;
}

.ffp-ai-duel-action-group-player {
    border-color: color-mix(in srgb, #f4c542 72%, transparent);
}

.ffp-ai-duel-action-group-enemy {
    border-color: color-mix(in srgb, #7a5738 72%, transparent);
}

.ffp-ai-duel-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.ffp-ai-duel-actions form {
    margin: 0;
}

.ffp-ai-duel-actions button,
.ffp-ai-duel-enemy-action-card {
    width: 100%;
    min-height: 54px;
    box-sizing: border-box;
    padding: 8px 10px;
    text-align: left;
    font-family: inherit;
    font-size: .88em;
    line-height: 1.25;
    background: #f2f3f3;
    color: #12161a;
    border: 1px solid color-mix(in srgb, var(--ffp-muted) 20%, transparent);
    border-radius: 2px;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}

.ffp-ai-duel-actions button:hover,
.ffp-ai-duel-actions button:focus-visible {
    border-color: color-mix(in srgb, #f4c542 72%, var(--ffp-line));
    box-shadow: 0 8px 22px rgba(244, 197, 66, .18), inset 0 0 0 1px rgba(244, 197, 66, .18);
    transform: translateY(-1px);
}

.ffp-ai-duel-flee-actions {
    display: grid;
    gap: 8px;
    border: 1px solid color-mix(in srgb, var(--ffp-muted) 26%, transparent);
    border-radius: 8px;
    padding: 8px;
    background: color-mix(in srgb, var(--ffp-soft) 70%, transparent);
}

.ffp-ai-duel-flee-actions > strong {
    color: var(--ffp-muted);
    font-size: .84em;
    text-transform: uppercase;
}

.ffp-ai-duel-enemy-actions {
    border: 1px solid color-mix(in srgb, #a85d43 45%, var(--ffp-line));
    border-radius: 8px;
    background: color-mix(in srgb, var(--ffp-soft) 70%, transparent);
    overflow: hidden;
}

.ffp-ai-duel-enemy-actions > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 22px;
    padding: 9px 10px;
    color: var(--ffp-muted);
    cursor: pointer;
    font-size: .84em;
    font-weight: 800;
    line-height: 1.2;
    list-style: none;
    text-transform: uppercase;
    white-space: nowrap;
}

.ffp-ai-duel-enemy-actions > summary::-webkit-details-marker {
    display: none;
}

.ffp-ai-duel-enemy-actions > summary::after {
    content: '▸';
    flex: 0 0 auto;
    transition: transform .16s ease;
}

.ffp-ai-duel-enemy-actions[open] > summary::after {
    transform: rotate(90deg);
}

.ffp-ai-duel-enemy-actions > summary small {
    margin: 0 0 0 auto;
    opacity: .72;
    text-transform: none;
}

.ffp-ai-duel-enemy-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    padding: 0 8px 8px;
}

.ffp-ai-duel-enemy-action-grid > p {
    grid-column: 1 / -1;
    margin: 4px 2px;
    color: var(--ffp-muted);
}

.ffp-ai-duel-enemy-action-card {
    align-self: start;
}

.ffp-ai-duel-enemy-action-card.is-selected {
    border: 2px solid #d7473a;
    background: #fff0ed;
    box-shadow: 0 0 0 2px rgba(215, 71, 58, .22), 0 8px 22px rgba(215, 71, 58, .2);
}

.ffp-ai-duel-enemy-action-card small {
    display: block;
    margin-top: 3px;
    opacity: .76;
}

.ffp-ai-duel-action-main {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.06em;
    line-height: 1.2;
    font-weight: 800;
}

.ffp-ai-duel-action-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    color: currentColor;
}

.ffp-ai-duel-action-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.ffp-ai-duel-actions small {
    display: block;
    margin-top: 3px;
    opacity: .76;
}

.ffp-ai-duel-action-summary {
    display: block;
    margin-top: 6px;
    color: #202428;
    background: rgba(0, 0, 0, .07);
    border-radius: 4px;
    padding: 3px 5px;
    font-size: .82em;
    font-style: normal;
    font-weight: 700;
}

.ffp-ai-duel-log {
    margin: 12px 0 0;
    display: grid;
    gap: 10px;
}

.ffp-ai-duel-entry {
    position: relative;
    border-radius: 6px;
    background: color-mix(in srgb, var(--ffp-soft) 82%, transparent);
    padding: 11px;
}

.ffp-ai-duel-entry-head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin-bottom: 6px;
}

.ffp-ai-duel-entry-head > strong {
    margin-right: auto;
}

.ffp-ai-duel-entry-eye,
.ffp-ai-duel-entry-image-form button {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid color-mix(in srgb, var(--ffp-muted) 28%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--ffp-panel) 72%, transparent);
    color: var(--ffp-ink);
    cursor: pointer;
}

.ffp-ai-duel-entry-eye svg,
.ffp-ai-duel-entry-image-form svg {
    width: 17px;
    height: 17px;
}

.ffp-ai-duel-entry-image-form {
    margin: 0;
    margin-left: auto;
    flex: 0 0 auto;
}

.ffp-ai-duel-entry-head .ffp-ai-duel-entry-eye {
    margin-left: auto;
    flex: 0 0 auto;
}

.ffp-ai-duel-entry-text p {
    margin: 0 0 7px;
    color: var(--ffp-muted);
    font-size: .9em;
}

.ffp-ai-duel-entry-text p:last-child {
    margin-bottom: 0;
}

.ffp-ai-duel-calculation {
    margin-top: 7px;
}

.ffp-ai-duel-calculation > summary {
    display: inline-grid;
    place-items: center;
    width: 23px;
    height: 23px;
    border: 1px solid color-mix(in srgb, var(--ffp-muted) 32%, transparent);
    border-radius: 5px;
    color: var(--ffp-muted);
    cursor: pointer;
    list-style: none;
}

.ffp-ai-duel-calculation > summary::-webkit-details-marker {
    display: none;
}

.ffp-ai-duel-calculation > summary svg {
    width: 15px;
    height: 15px;
}

.ffp-ai-duel-calculation pre {
    max-height: 360px;
    margin: 7px 0 0;
    padding: 9px;
    overflow: auto;
    border: 1px solid color-mix(in srgb, var(--ffp-muted) 20%, transparent);
    border-radius: 5px;
    background: color-mix(in srgb, #000 18%, var(--ffp-panel));
    color: var(--ffp-ink);
    font-size: 10px;
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-word;
}

.ffp-ai-duel-defeated-event {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border-left: 3px solid #a94b42;
    border-radius: 4px;
    background: color-mix(in srgb, #a94b42 12%, var(--ffp-soft));
    color: var(--ffp-ink);
    font-size: .82em;
}

.ffp-ai-duel-defeated-event > span {
    color: #d36a60;
    font-size: 1.25em;
}

.ffp-ai-duel-entry-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(110px, 22%);
    gap: 14px;
    align-items: start;
}

.ffp-ai-duel-entry-preview {
    justify-self: end;
    width: 100%;
    max-width: 180px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
}

.ffp-ai-duel-entry-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    height: auto;
    object-fit: cover;
    border-radius: 6px;
}

.ffp-ai-duel-initiative-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #f4c542;
    font-size: .82em;
    font-weight: 800;
    white-space: nowrap;
    text-align: center;
}

.ffp-ai-duel-initiative-icon,
.ffp-ai-duel-initiative-icon svg {
    display: inline-block;
    width: 18px;
    height: 18px;
}

.ffp-ai-duel-event-grid {
    display: none;
}

.ffp-ai-duel-finished {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid color-mix(in srgb, #f4c542 45%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--ffp-soft) 86%, transparent);
}

.ffp-ai-duel-finished h4 {
    margin: 0 0 8px;
    color: var(--ffp-ink);
}

.ffp-ai-duel-finished form {
    margin: 10px 0 0;
}

.ffp-ai-duel-finished button {
    width: 100%;
}

@keyframes ffp-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 760px) {
    .ffp-game {
        grid-template-columns: 1fr;
    }

    .ffp-chapter {
        order: 1;
    }

    .ffp-state {
        order: 2;
    }

    .ffp-sidebar {
        order: 2;
    }

    .ffp-info-block {
        grid-column: auto;
    }

    .ffp-image-open {
        width: 100%;
    }

    .ffp-text {
        font-size: var(--ffp-text-size-mobile, 16px);
    }

    .ffp-ai-duel-head,
    .ffp-ai-duel-grid,
    .ffp-ai-duel-event-grid,
    .ffp-ai-duel-entry-body {
        grid-template-columns: 1fr;
    }

    .ffp-ai-duel-entry-preview {
        justify-self: start;
        max-width: 140px;
    }
}
