#adventurebook_page {
    margin: 0;
    padding: 0;
    border: none;
    width: 100%;
    min-height:400px;
    position: relative;
    text-align: left;
}

.adventurebook_character_overview
{
    text-align: left;
}

.adventurebook_character_overview_name {
    font-weight: bold;
    font-size: medium;
}

.adventurebook_character_actions {
    margin: 4px;
}


#adventurebook_content {
    container-type: inline-size;
}


#adventurebook_character {
    display: block;
    float: right;
    border: 1px solid #444444;
    border-radius: 8px;
    min-width: 200px;
    max-width: 200px;
    margin-left: 4px;
}

#adventurebook_character_topbar {
    display: none;
}

/* Ab 400px oder weniger: Container weg, Top-Bar fixiert sichtbar */
@container (max-width: 700px) {
    #adventurebook_character {
        display: none;
    }

    #adventurebook_character_topbar {
        display: block;
        bottom: 100%; /* oberhalb des Elements */
        left: 0;
        width: 100%;
        background: #eee;
        color: #000;
        padding: 0;
        font-size: 14px;
        text-align: center;
        cursor: pointer;
    }
}

#adventurebook_character_details {
    background: #eee;
    overflow: auto;
    padding: 4px;
}

/* Gutenberg-Galerie (Block) */
#adventurebook_content .wp-block-gallery .blocks-gallery-grid,
#adventurebook_content .wp-block-gallery.is-layout-flex {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: var(--wp--style--block-gap, .5rem);
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Klassische Shortcode-Galerie */
#adventurebook_content .gallery {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
#adventurebook_content .gallery .gallery-item {
    /* Fallback: 3 Spalten, wird vom class "gallery-columns-N" normalerweise gesetzt */
    width: calc(33.333% - .5rem);
}
#adventurebook_content .gallery.gallery-columns-2 .gallery-item { width: calc(50% - .5rem); }
#adventurebook_content .gallery.gallery-columns-3 .gallery-item { width: calc(33.333% - .5rem); }
#adventurebook_content .gallery.gallery-columns-4 .gallery-item { width: calc(25% - .5rem); }
#adventurebook_content .gallery .gallery-item img {
    display: block;
    width: 100%;
    height: auto;
}


#adventurebook_content ul {
    margin: 0px;
}

.adventurebook-inner-content {
    overflow:hidden;
}

.adventurebook-inner-content p {
    padding:0;
    margin:0;
}


.adventurebook-shop-content {
    clear: both;
    overflow: auto;
}

.adventurebook_hidden {
    display: none;
}

.adventurebook_noliststyle {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

/* class for <ul> item lists */
.adventurebook_items {
    list-style-type: none;
    margin: 0;
    padding-bottom: 4px;
    padding-top: 4px;
    clear: both;
    overflow: auto;
    text-align: left;
}

.adventurebook_items li {
    margin-left: 0;
    padding-bottom: 2px;
}

.adventurebook_shop_items li {
    padding-bottom: 2px;
    border-bottom: 1px solid #cccccc;
    margin-left: 0;
}

.adventurebook_equipped_slotname {
    font-weight: bold;
    margin-left: 8px;
    cursor: pointer;
}

.adventurebook_equipped_itemname {
    cursor: pointer;
}

.adventurebook_float_right {
    float: right;
    margin-right: 8px;
}

.adventurebook-decisions {
    list-style-type: none;
    margin: 0;
    padding: 0;
    clear: both;
    overflow: auto;
}

.adventurebook-decisions ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.adventurebook-decisions li {
    margin-bottom: 4px;
    padding: 0;
}

.adventurebook-decision-option {
    margin: 2px;
    padding: 2px;
}

.adventurebook-decision-option td {
    vertical-align: top;
}

#adventurebook-decision-options-container {
    margin: 0;
    padding:0;
}
#adventurebook-decision-options-container tr {
    margin: 0;
    padding:0;
}
#adventurebook-decision-options-container td {
    margin: 0;
    padding:0;
}

.adventurebook_decision-options-container-single {
    border: 1px solid #999999;
    width: 100%;

}

.adventurebook_small {
    clear: both;
    display: block;
    font-size: small;
    line-height: 1.0em;
    vertical-align: top;
}

.adventurebook_small_info {
    font-size: small;
}

.adventurebook_inner_content {
    margin: 0;
    padding: 0;
}

.adventurebook_inner_content p {
    margin-bottom: 4px;
}


.adventurebook_inner_content p::first-letter {
    font-size: 3em;
    float: left;
    line-height: 1;
    margin-right: 0.1em;
    font-weight: bold;
}

.adventurebook_enemies {
    clear: both;
    overflow: auto;
}

.adventurebook_enemy {
    font-weight: bold;
}

.adventurebook_enemy_image {
    float: left;
}

.adventurebook_enemy_name {
    font-weight: bold;
    font-size: large;
    text-align: left;
    overflow: hidden;
    cursor: pointer;
}


.adventurebook_enemy_description {
    font-size: small;
    color: #555555;
    margin-left:34px;
    text-align: left;
}

.adventurebook_item_list_small {
    width: 50%;
    float: left;
    text-align: left;
}

.adventurebook_item_list_small li {
    list-style-type: none;
}

.adventurebook_item_actions {
    text-align: left;
    margin-left:34px;
}

.adventurebook_item {
    clear: both;
}

.adventurebook_item_info {
    margin-left:4px;
    border-left: 1px solid #444444;
    padding-left: 4px;
}

.adventurebook_item_image {
    float: left;
    margin-top:8px;
}

.adventurebook_item_image img {
    width: 32px;
    height: 32px;
    vertical-align:middle;
    margin-right:4px;
}

.adventurebook_item_name {
    font-size: medium;
    text-align: left;
    font-weight: bold;
    overflow: hidden;
    cursor: pointer;
}

.adventurebook_item_toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9em;
    line-height: 1;
    margin-left: 6px;
    padding: 0;
}

.adventurebook_combat_stats {
    margin: 0;
    padding: 0;
}

/* the toggle needs to be at the right side of the item name */
#adventurebook_toggle_character_details {
    float: right;
    margin-right: 4px;
    margin-top: 4px;
    font-size: small;
}

.adventurebook_item_stats {
    font-size: small;
    color: #333333;
    margin-left:34px;
    text-align: left;
}

.adventurebook_item_description {
    font-size: small;
    color: #555555;
    margin-left:34px;
    text-align: left;
}

#adventurebook_character_title {
    margin-top: 8px;
    margin-bottom: 8px;
}

#adventurebook_character_title_topbar {
    margin: 0;
}

.adventurebook_items {
    font-size: small;
}

.adventurebook_items_list {
    width: 100%;
}

.adventurebook_items_list ul
{
    margin: 0;
    padding: 0;
}

.adventurebook_items_list_title {
    border-top: 1px solid #444444;
    border-bottom: 1px solid #444444;
    font-weight: bold;
    font-size: medium;
}

#adventurebook_combat_log {
    margin-top: 8px;
    clear: both;
}

.adventurebook_combat_log_important {
    color: red;
}

.button {
    background-color: #4CAF50;
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
}

.adventurebook_action_button_small {
    cursor: pointer;
    border: 1px solid #AAAAAA;
    background-color: #EEEEEE;
    color: black;
    border-radius: 4px;
    padding: 2px;
    text-decoration: none!important;
    font-size: 12px;
    margin-right: 2px;
}

.adventurebook_action_button
{
    cursor: pointer;
    border: 1px solid #AAAAAA;
    background-color: #EEEEEE;
    color: black;
    border-radius: 4px;
    padding: 4px;
    text-decoration: none!important;
    font-size: small;
    margin-right: 2px;
}


.adventurebook_script_action_button
{
    cursor: pointer;
    border: 1px solid #AAAAAA;
    background-color: #EEEEEE;
    color: black;
    border-radius: 4px;
    padding: 4px;
    margin-top:4px;
    text-decoration: none!important;
    font-size: small;
}

.adventurebook_action_button:hover
{
    color: red;
}

.adventurebook_error {
    color: red;
    font-weight: bold;
    text-align: center;
}

.adventurebook_message {
    color: green;
    font-weight: bold;
    text-align: center;
}

.adventurebook_script_output {
    margin: 0;
    color: #555555;
}

.adventurebook_script_output_line {

}

#adventurebook_fixed_height_container {
    overflow-y: scroll;
}

#adventurebook_container {
    position: relative;
    border: 0;

    /* Scrollbars ausblenden */
    scrollbar-width: none;       /* Firefox */
    -ms-overflow-style: none;    /* IE/Edge Legacy */
}
#adventurebook_container::-webkit-scrollbar {
    display: none;               /* Chrome, Safari, Edge */
}

#adventurebook_scroll_indicator {
    position: absolute;
    text-align: center;
    font-size: 14px;
    color: #000066;
    display: none;               /* standardmäßig versteckt */
    animation: adventurebook_bounce 1s infinite;
}

/* kleine Animation */
@keyframes adventurebook_bounce {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}


@media (max-width: 600px) {
    #adventurebook_container {
        flex-direction: column;
    }
}

#adventurebook_container img {
    width: 200px;
    max-width: 200px;
    height: 200px;
    float:left;
    object-fit: cover;        /* skaliert proportional, schneidet überstehende Ränder ab */
    object-position: center;  /* zentriert den Ausschnitt */
    margin-right: 8px;
    margin-bottom: 16px;
    margin-top: 4px;
}
/* ab hier die Überschreibung für schmale Screens */
@container (max-width: 600px) {
    #adventurebook_container img {
        width: 100px;
        max-width: 100px;
        height: 100px;
    }
}

#adventurebook_container div {
    margin: 0;
}

.adventurebook_footer {
    clear: both;
    text-align: center;
    border-top: 1px solid #444444;
    font-size: small;
}
#adventurebook_page_title {
    display: inline-block;
    margin-right: 10px;
    vertical-align: middle;
}

#adventurebook_play_audio {
    min-width: 130px;
    min-height: 32px;
    display: inline-block;
    vertical-align: middle;
    padding: 5px 12px;
    font-size: 15px;
    border: 1px solid #444;
    border-radius: 6px;
    background: #f4f4f4;
    color: #222;
    cursor: pointer;
}
#adventurebook_play_audio.playing {
    background: #357a38;
    color: #fff;
    border-color: #2e6930;
}

#adventurebook_content .adventurebook_decision_button {
    /* display: block;*/
    margin: 0;
    padding: 6px 10px;
    cursor: pointer;
}

#adventurebook_content .decision_number {
    font-weight: bold;
    color: #888;
    margin-right: 4px;
}

.script-command input:nth-of-type(1) {
        width: 100px;
}

.script-command input:nth-of-type(2) {
        width: 200px;
}

.script-command input:nth-of-type(3) {
        width: 400px;
}

#script_commands_textarea {
    /* text is not wrapped but a scrollbar appears */
    white-space: pre;
    overflow-x: auto;
    resize: vertical;
    display: block;
    width: 100%;
    height: 200px;
    font-family: monospace;
    font-size: 14px;
    margin-top: 8px;
    margin-bottom: 8px;
}

.adventurebook_list_compact {
    margin: 0 0 0 8px;
    padding: 0;
    list-style-type: disc;
}

.adventurebook_list_compact li {
    margin: 0;
    padding: 0;
}

.post-type-adventurebook_page .column-page_id {
    width: 80px;
}

.adventurebook_inline_editing {
    text-align: center;
}

/* --- Adventurebook Inline Edit Modal --- */

#ab-inline-style-helper {} /* dummy for sorting in WP minifiers */

/* Overlay */
.ab-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 10px;
    animation: abFadeIn 0.2s ease-in-out;
}

/* Modal box */
.ab-modal-content {
    background: #1e1e1e;
    color: #ddd;
    border-radius: 16px;
    width: 90%;
    max-width: 640px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    padding: 20px;
    position: relative;
    animation: abSlideIn 0.25s ease-out;
    max-height: 85vh;
    overflow-y: auto;
    font-size: 15px;
}

/* Close button */
.ab-modal-close {
    position: absolute;
    top: 12px;
    right: 18px;
    color: #bbb;
    font-size: 22px;
    cursor: pointer;
    transition: color 0.2s;
}
.ab-modal-close:hover {
    color: #fff;
}

/* Headings */
.ab-modal-content h3 {
    color: #ffd27f;
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 18px;
}

/* Inputs */
.ab-modal-content input,
.ab-modal-content textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #555;
    background: #2c2c2c;
    color: #eee;
    margin-bottom: 12px;
    font-family: inherit;
    font-size: 14px;
}
.ab-modal-content textarea {
    min-height: 180px;
    resize: vertical;
}

/* Buttons */
.ab-modal-content button,
.adventurebook_inline_edit_tools .ab-inline-edit {
    background: linear-gradient(180deg, #444, #2a2a2a);
    color: #fff;
    border: 1px solid #666;
    border-radius: 10px;
    padding: 4px 7px;
    margin: 3px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-weight: 500;
    font-size: small;
}
.ab-modal-content button:hover,
.adventurebook_inline_edit_tools .ab-inline-edit:hover {
    background: linear-gradient(180deg, #666, #333);
}
.ab-modal-content button:active,
.adventurebook_inline_edit_tools .ab-inline-edit:active {
    transform: scale(0.97);
}

/* Inline edit toolbar */
.adventurebook_inline_edit_tools {
    text-align: center;
    margin-top: 25px;
    border-top: 1px solid #444;
    padding-top: 15px;
}
.adventurebook_inline_edit_tools h4 {
    color: #ccc;
    margin-bottom: 10px;
    font-size: 15px;
}

/* Messages */
#ab-modal-body .success {
    color: #8f8;
    text-align: center;
}
#ab-modal-body .error {
    color: #f88;
    text-align: center;
}

/* Animations */
@keyframes abFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes abSlideIn {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* --- Mobile optimization --- */
@media (max-width: 600px) {
    .ab-modal-content {
        width: 100%;
        height: auto;
        max-height: 90vh;
        border-radius: 10px;
        padding: 15px;
        font-size: 14px;
    }

    .ab-modal-close {
        top: 10px;
        right: 12px;
        font-size: 20px;
    }

    .ab-modal-content h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .ab-modal-content textarea {
        min-height: 140px;
    }

    .adventurebook_inline_edit_tools h4 {
        font-size: 14px;
    }

}

.ab-jump-container select {
    background: #2b2b2b;
    border: 1px solid #555;
    color: #eee;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 14px;
}
.ab-jump-container select:focus {
    outline: none;
    border-color: #888;
}
.ab-jump-container label {
    color: #ccc;
    font-size: 14px;
}
