/* Book start */
.book {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 0.1rem;
    background: #f5e5c0;
    width: 100%;
    max-width: 600px;
    border: 6px solid #55331c;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
    position: relative;
    margin-top: 2px;
    margin-bottom: 2px;
    max-height: 600px;
}

.book::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: #c7b58a;
    transform: translateX(-1px);
}

.spell-output {
    padding: 0.1rem 0.3rem;
    margin: 0.1rem;
    width: 90%;
    border-radius: 5px;
    z-index: 1;
    letter-spacing: 2px;
    height: 48px;
    align-content: center;
    justify-self: center;
    text-align: center;

    background: rgba(80, 80, 80, 0.1);
    border: 2px solid rgba(80, 80, 80, 0.3);
    font-family: "Cinzel", serif;
    color: #222;
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow:
        0 0 2px #000,
        0 0 4px rgba(0, 224, 255, 0.8),
        0 0 6px rgba(0, 255, 255, 0.4),
        0 0 10px rgba(0, 255, 255, 0.3);
}

.button-grid {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
    /* gap: 0.25rem; */
    gap: 8px;
    width: 100%;
    padding: 0.25rem;
}

.button-grid button {
    width: 48px;
    height: 48px;
    background: #fdf6e3;
    border: 2px solid #55331c;
    border-radius: 6px;
    color: #1c1b1a;
    font-size: 1.2rem;
    font-weight: bold;
    font-family: "Cinzel", serif;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 6px #c4b998, 0 2px 4px rgba(0, 0, 0, 0.4);
    position: relative;
}

.button-grid button::after {
    content: attr(data-score);
    position: absolute;
    font-size: 0.8rem;
    top: 0px;
    right: 6px;
    color: #996633;
}

.pager {
    display: flex;
    justify-content: space-between;
    gap: 0.25rem;
    width: 90%;
    z-index: 1;
}

.pager button {
    flex: 1;
    background: rgba(80, 80, 80, 0.1);
    color: #55331c;
    border: 2px solid #55331c;
    border-radius: 6px;
    font-family: "Cinzel", serif;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0.25rem;
}

/* end of book */
/* bottom action buttons */
.action-button {
    flex: 1;
    letter-spacing: 1.5px;
    font-weight: bold;
    padding: 0.6rem 0;
    font-family: "Cinzel", serif;
    border-radius: 6px;
    border: 2px solid #55331c;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: all 0.2s ease-in-out;
    margin: 5px;
    max-width: 250px;
}

.cast-button {
    background: linear-gradient(to bottom, #fff6e3, #e0cfa0);
    color: #3b2615;
    letter-spacing: 1.5px;
    text-shadow: 0 0 1px #000, 0 0 4px #00e0ff,
        0 0 6px rgba(0, 224, 255, 0.6), 0 0 10px rgba(0, 255, 255, 0.3);
    box-shadow: inset 0 0 6px rgba(0, 255, 255, 0.15);
}

.discard-button {
    background: linear-gradient(to bottom, #7c4a27, #3b2615);
    color: #fbe2c8;
    text-shadow: 0 1px 0 #000;
}

/* end of action buttons */
/* Start of Character Stats */
.bar {
    width: 15%;
    /* height: 0.6rem; */
    background-color: #1a1a1a;
    border-radius: 4px;
    border: 2px solid #444;
    overflow: hidden;
    margin: 0.1rem 0;
    align-content: end;
}

.avatar-container .avatar-thumb {
    order: 2;
}

.avatar-container .bar:nth-child(2) {
    order: 1;
    /* Blue (Mana) */
}

.avatar-container .bar:nth-child(3) {
    order: 3;
    /* Red (HP) */
}

.bar-inner.hp {
    background: #bb0a1e;
    height: 100%;
}

.bar-inner.mana {
    background: #1fbfff;
    height: 100%;
}

.label {
    color: #00e0ff;
    font-family: "Cinzel", serif;
    font-weight: bold;
    letter-spacing: 0.5px;
    text-align: center;
    text-shadow: 0 0 4px rgba(0, 224, 255, 0.6);
}

.rune.active {
    background: #7e3e1d;
    /* deep wood brown */
    color: #00e0ff;
    /* bright blue highlight like player name */
    border-color: #00e0ff;
    box-shadow:
        inset 0 0 6px #00e0ff,
        0 0 6px rgba(0, 224, 255, 0.6),
        0 0 10px rgba(0, 224, 255, 0.4);
    transform: translateY(-2px) scale(1.05);
    transition: transform 0.15s ease, box-shadow 0.3s ease;
}

.rune.active::after {
    color: #1fbfff;
}

/* == Damage Display == */
.floating-text {
    justify-self: center;
    color: #fff;
    font-weight: bold;
    /* font-size: 1.4rem; */
    font-size: xx-large;
    margin-top: 30%;
    pointer-events: none;
    text-shadow:
        0 0 5px rgba(255, 0, 0, 0.6),
        0 0 10px rgba(255, 0, 0, 0.5),
        0 0 20px rgba(200, 0, 0, 0.4);
    /* animation: float-up 5s ease-out forwards; */
    z-index: 10;
    font-family: 'Cinzel', serif;
}

.floating-text.heal {
    color: #2ecc71;
    text-shadow: 0 0 6px rgba(0, 255, 100, 0.5);
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal p {
    font-family: 'Merriweather', serif;
    font-size: 0.9rem;
    line-height: 1.4rem;
}

.modal-content h2 {
    font-family: 'Cinzel', serif;
    color: #00e0ff;
    font-weight: bold;
    text-shadow: 0 0 6px rgba(0, 224, 255, 0.4);
}

.modal {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.modal.show {
    display: flex;
    /* or block depending on layout */
    opacity: 1;
}


.modal-content {
    /* background: url('../board/menuWood.png') center/cover no-repeat; */
    background-image: url('./assets/board/wood-texture.png');
    padding: 20px;
    border-radius: 15px;
    max-width: 500px;
    border: 15px solid rgba(0, 0, 0, 0.1);
    width: 90%;
    color: #f8f8f2;
    text-align: center;
    box-shadow:
        inset 0 1px 20px rgba(0, 0, 0, 0.8),
        inset 0 -2px 35px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(0, 224, 255, 0.4);
}

.modal-button-wrapper {
    display: flex;
    justify-content: center;
}