@font-face {
    font-family: 'Bakemono';
    src: url('assets/Bakemono-Text-Bold-TRIAL.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@400;600;700;900&family=Roboto:wght@400;500;700&display=swap');

:root {
    --vermelho: #a51f2b;
    --vermelho-escuro: #741923;
    --bege: #f5efe3;
    --papel: #fffaf0;
    --preto: #282421;
    --dourado: #c49a54;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bege);
    color: var(--preto);
    font-family: 'Noto Sans JP', sans-serif;
}

button, input {
    font: inherit;
}

.hero {
    background: var(--vermelho-escuro);
    color: white;
    padding: 55px 20px;
    text-align: center;
    border-bottom: 6px solid var(--dourado);
}

.hero h1 {
    font-family: 'Noto Serif JP', serif;
    font-size: clamp(32px, 6vw, 58px);
    margin-bottom: 8px;
}

.hero p {
    color: #f3dfc2;
    font-size: 16px;
}

.container {
    width: min(1500px, 94%);
    margin: 35px auto;
}

.section-title {
    font-family: 'Noto Serif JP', serif;
    color: var(--vermelho-escuro);
    margin-bottom: 20px;
    font-size: 25px;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 18px;
}

.theme-card {
    background: var(--papel);
    border: 1px solid #e5d8c4;
    border-bottom: 4px solid var(--vermelho);
    border-radius: 12px;
    padding: 22px;
    cursor: pointer;
    transition: 0.2s;
    text-align: left;
}

.theme-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px #00000018;
}

.theme-card .emoji {
    font-size: 35px;
    display: block;
    margin-bottom: 12px;
}

.theme-card .number {
    color: var(--vermelho);
    font-weight: bold;
    font-size: 12px;
}

.theme-card h3 {
    margin-top: 6px;
    font-size: 17px;
}

.search {
    width: 100%;
    padding: 15px;
    border: 1px solid #d7c7ae;
    border-radius: 10px;
    background: var(--papel);
    margin-bottom: 25px;
    outline-color: var(--vermelho);
}

footer {
    background: var(--vermelho-escuro);
    color: white;
    text-align: center;
    padding: 25px;
    margin-top: 60px;
}

@media (max-width: 600px) {
    .hero {
        padding: 40px 15px;
    }

    .theme-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .theme-card {
        padding: 15px;
    }
}
/* GALERIA DE IMAGENS */

.image-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.gallery-item {
    position: relative;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px;
    overflow: hidden;
}

.gallery-item img {
    display: block;
    width: 100%;
    height: 400px;
    object-fit: contain;
    border-radius: 8px;
    background: transparent;
}
.gallery-item p {
    margin-top: 10px;
    text-align: center;
}
/* ORGANIZAÇÃO DAS PÁGINAS DOS TEMAS */

.container {
    width: 100%;
    max-width: 1500px;
    padding: 35px 45px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.container h1 {
    font-family: 'Noto Serif JP', serif;
    font-weight: 600;
    font-size: clamp(28px, 3vw, 38px);
    margin-top: 25px;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.container h2 {
    font-family: 'Noto Serif JP', serif;
    font-weight: 500;
    font-size: 24px;
    margin-top: 35px;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.container p {
    line-height: 1.8;
    margin-bottom: 20px;
}

.container .theme-card {
    margin-bottom: 20px;
}


html, body {
    min-height: 100%;
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
}

body {
    -webkit-overflow-scrolling: touch;
}
/* SEÇÕES DA ENCICLOPÉDIA */

.theme-introduction,
.content-section {
    background: var(--papel);
    border: 1px solid #e5d8c4;
    border-left: 5px solid var(--vermelho);
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
}

.theme-sections {
    margin-top: 40px;
}

.content-section h2 {
    color: var(--vermelho-escuro);
    margin-top: 0;
}

.content-section p {
    line-height: 1.9;
}
.gallery-item.sortable-ghost {
    opacity: 0.3;
}

.gallery-item.sortable-chosen {
    cursor: grabbing;
}

.gallery-item.sortable-drag {
    opacity: 0.9;
}
.gallery-item .theme-card {
    position: absolute;
    right: 20px;
    top: 20px;
    z-index: 2;
    margin: 0;

    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
}

.gallery-item:hover .theme-card,
.gallery-item.selecionada .theme-card {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
/* CAPA DOS TEMAS */

.theme-cover {
    display: grid;
    grid-template-columns: 0.85fr 1.4fr;
    gap: 30px;
    align-items: center;
    margin: 25px 0 35px;
}

.theme-cover-title h1 {
    font-family: 'Bakemono', sans-serif;
    font-size: clamp(38px, 4.5vw, 58px);
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1.2;
    color: var(--vermelho-escuro);
    margin: 0;
}

.theme-cover-image {
    position: relative;
    height: 560px;
    min-height: 0;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(150, 120, 90, 0.10);
    border: 1px dashed rgba(100, 70, 50, 0.4);
}
.theme-cover-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
}
.theme-cover-image .theme-card {
    position: absolute;
    right: 15px;
    bottom: 15px;
    z-index: 2;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.theme-cover-image:hover .theme-card {
    opacity: 1;
    visibility: visible;
}
@media (hover: none) and (pointer: coarse) {
    .theme-cover-image .theme-card {
        opacity: 1;
        visibility: visible;
    }
}

.cover-placeholder {
    min-height: 560px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--vermelho-escuro);
    font-size: 38px;
    text-align: center;
}

.cover-placeholder p {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
}
.title-decoration {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    margin-bottom: 18px;
}

.title-decoration span:first-child {
    width: 65px;
    height: 4px;
    background: var(--vermelho-escuro);
    border-radius: 5px;
}

.title-decoration span:last-child {
    flex: 1;
    height: 1px;
    background: rgba(120, 80, 55, 0.4);
}

.theme-japanese-title {
    font-family: 'Bakemono', sans-serif;
    font-size: 20px;
    color: var(--vermelho-escuro);
    margin-bottom: 12px;
}

.theme-number {
    font-size: 12px;
    letter-spacing: 2px;
    color: #887B69;
    font-weight: 600;
}
/* GALERIA DE IMAGENS ADICIONAIS */

.extra-image-gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 25px;
}

.extra-image-item img {
    width: 100%;
    height: 420px;
    object-fit: contain;
    border-radius: 10px;
    cursor: zoom-in;
}

@media (max-width: 1000px) {
    .extra-image-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .extra-image-gallery {
        grid-template-columns: 1fr;
    }
}

.extra-image-item {
    text-align: center;
}

.extra-image-item img {
    display: block;
    width: 100%;
    height: 350px;
    object-fit: contain;
    border-radius: 10px;
    cursor: zoom-in;
}

.extra-image-item p {
    margin-top: 10px;
    color: var(--texto);
}

/* SUPERZOOM */

.image-zoom {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
}

.image-zoom img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    transform-origin: center;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.image-zoom img:active {
    cursor: grabbing;
}

/* CONTROLES */

.zoom-controls {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: rgba(35, 35, 35, 0.95);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 14px;
    z-index: 2;
}

.zoom-controls button {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 8px;
    background: #f5ead8;
    color: #35271d;
    font-size: 25px;
    cursor: pointer;
}

.zoom-controls button:hover {
    background: #e6cba8;
}

.zoom-level {
    color: white;
    min-width: 55px;
    text-align: center;
    font-size: 15px;
}

.zoom-close {
    margin-left: 8px;
}

@media (max-width: 600px) {
    .zoom-controls {
        bottom: 15px;
        gap: 7px;
        padding: 8px;
    }

    .zoom-controls button {
        width: 38px;
        height: 38px;
    }
}
/* IMAGENS DENTRO DOS BLOCOS */

.extra-section {
    margin-top: 35px;
    padding: 25px;
    border: 1px solid rgba(120, 90, 60, 0.2);
    border-radius: 12px;
}

.extra-section .extra-image-gallery {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 25px;
}

.extra-section .extra-image-item img {
    height: 520px;
    width: 100%;
    object-fit: contain;
}

@media (max-width: 700px) {
    .extra-section .extra-image-item img {
        height: 320px;
    }
}

/* =================================
   CATEGORIAS DO GUIA DO JAPÃO
================================= */

.theme-categories {
    margin: 45px 0;
}

.theme-categories > h2 {
    color: #71352e;
    font-family: 'Noto Serif JP', serif;
    font-size: 28px;
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 2px solid #b34b40;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.category-card {
    background: #f8f1e5;
    border: 1px solid #d9c6aa;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(80, 45, 25, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    min-width: 0;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(80, 45, 25, 0.13);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 16px;
    border-bottom: 1px solid #dfcbb3;
}

.category-icon {
    font-size: 32px;
}

.category-header h3 {
    color: #71352e;
    font-family: 'Noto Serif JP', serif;
    font-size: 20px;
    margin: 0 0 5px;
}

.category-header p {
    color: #806c5a;
    font-size: 13px;
    margin: 0;
}

.category-content {
    min-height: 90px;
    padding: 18px 0;
}

.category-empty {
    color: #a08d7b;
    font-size: 14px;
    font-style: italic;
}

.category-item {
    padding: 12px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.45);
    border-radius: 8px;
}

.category-item h4 {
    color: #71352e;
    margin: 0 0 8px;
}

.category-item p {
    line-height: 1.7;
    margin: 0;
}

.category-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.category-card > .theme-card {
    width: 100%;
    margin-top: 8px;
}

/* TABLETS */
@media (max-width: 1000px) {
    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* CELULARES */
@media (max-width: 600px) {
    .category-grid {
        grid-template-columns: 1fr;
    }

    .category-card {
        padding: 18px;
    }
}
/* =================================
   FORMULÁRIO DAS CATEGORIAS
================================= */

.category-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(35, 23, 18, 0.72);
    backdrop-filter: blur(5px);
}

.category-modal-content {
    position: relative;
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 35px;
    background: #f8f1e5;
    border: 2px solid #c9a982;
    border-radius: 16px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.3);
}

.category-modal-icon {
    display: block;
    text-align: center;
    font-size: 35px;
}

.category-modal-content h2 {
    color: #71352e;
    text-align: center;
    font-family: 'Noto Serif JP', serif;
    margin: 12px 0 5px;
}

.category-modal-subtitle {
    color: #806c5a;
    text-align: center;
    margin-bottom: 28px;
}

.category-modal-content label {
    display: block;
    color: #71352e;
    font-weight: bold;
    margin: 16px 0 8px;
}

.category-modal-content input,
.category-modal-content textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 13px;
    color: #49352b;
    background: #fffaf2;
    border: 1px solid #d9c6aa;
    border-radius: 8px;
    font: inherit;
    outline: none;
}

.category-modal-content input:focus,
.category-modal-content textarea:focus {
    border-color: #a7463c;
    box-shadow: 0 0 0 3px rgba(167, 70, 60, 0.12);
}

.category-modal-content textarea {
    resize: vertical;
    line-height: 1.6;
}

.category-modal-close {
    position: absolute;
    top: 15px;
    right: 18px;
    border: none;
    background: transparent;
    color: #71352e;
    font-size: 23px;
    cursor: pointer;
}

.category-modal-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 25px;
}

.category-modal-actions button {
    padding: 12px 18px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.category-cancel {
    background: #e5d8c6;
    color: #604b3c;
}

.category-save {
    background: #873d35;
    color: white;
}

.category-save:hover {
    background: #692d28;
}

.category-save:disabled {
    opacity: 0.6;
    cursor: wait;
}

@media (max-width: 600px) {
    .category-modal-content {
        padding: 28px 20px;
    }
}
/* PRONÚNCIA DO VOCABULÁRIO */

.vocab-romaji {
    color: #a7463c;
    font-size: 14px;
    font-style: italic;
    margin: 5px 0 8px;
    letter-spacing: 0.4px;
}
/* VOCABULÁRIO — VISUAL DOS CARTÕES */

.vocab-item {
    padding: 18px;
    margin-bottom: 14px;
    background: #fffaf2;
    border: 1px solid #ead9c2;
    border-radius: 10px;
}

.vocab-item h4 {
    color: #71352e;
    font-family: 'Noto Serif JP', serif;
    font-size: 23px;
    margin-bottom: 10px;
}

.vocab-item .vocab-romaji {
    font-size: 14px;
    margin: 5px 0;
}

.vocab-item > p:not(.vocab-romaji) {
    font-size: 17px;
    color: #49352b;
    margin-top: 8px;
}

/* Botões discretos */

.vocab-item .category-item-actions {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.vocab-item:hover .category-item-actions,
.vocab-item:focus-within .category-item-actions {
    opacity: 1;
}

/* Celular: botões sempre acessíveis */

@media (hover: none) {
    .vocab-item .category-item-actions {
        opacity: 1;
    }
}
/* TEXTO — CARTÕES DE LEITURA */

.texto-item {
    padding: 22px;
    margin-bottom: 16px;
    background: #fffaf2;
    border: 1px solid #ead9c2;
    border-left: 4px solid #a7463c;
    border-radius: 8px;
}

.texto-item h4 {
    color: #71352e;
    font-family: 'Noto Serif JP', serif;
    font-size: 21px;
    margin-bottom: 14px;
}

.texto-item > p {
    color: #49352b;
    font-size: 16px;
    line-height: 1.9;
    white-space: pre-wrap;
}

.texto-item .category-item-actions {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.texto-item:hover .category-item-actions,
.texto-item:focus-within .category-item-actions {
    opacity: 1;
}

@media (hover: none) {
    .texto-item .category-item-actions {
        opacity: 1;
    }
}
/* TABELA — CARTÕES ORGANIZADOS */
.tabela-item {
    padding: 20px;
    margin-bottom: 16px;
    background: #fffaf2;
    border: 1px solid #ead9c2;
    border-top: 3px solid #a7463c;
    border-radius: 10px;
}

.tabela-item h4 {
    color: #71352e;
    font-family: 'Noto Serif JP', serif;
    font-size: 21px;
    margin-bottom: 12px;
}

.tabela-item > p {
    color: #49352b;
    font-size: 15px;
    line-height: 1.8;
    white-space: pre-wrap;
}

.tabela-item .category-item-actions {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tabela-item:hover .category-item-actions,
.tabela-item:focus-within .category-item-actions {
    opacity: 1;
}

@media (hover: none) {
    .tabela-item .category-item-actions {
        opacity: 1;
    }
}
/* TABELA JAPONESA */

.tabela-container {
    width: 100%;
    overflow-x: auto;
    margin: 15px 0;
    border: 1px solid #d9c6aa;
    border-radius: 10px;
}

.tabela-japones {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    background: #fffaf2;
    color: #49352b;
    text-align: left;
}

.tabela-japones th {
    background: #71352e;
    color: #fffaf2;
    padding: 14px;
    font-family: 'Noto Serif JP', serif;
    font-size: 15px;
    white-space: nowrap;
}

.tabela-japones td {
    padding: 16px 14px;
    border-bottom: 1px solid #ead9c2;
    font-size: 15px;
    vertical-align: middle;
}

.tabela-japones th:nth-child(1),
.tabela-japones td:nth-child(1) {
    width: 30%;
}

.tabela-japones th:nth-child(2),
.tabela-japones td:nth-child(2) {
    width: 25%;
}

.tabela-japones th:nth-child(3),
.tabela-japones td:nth-child(3) {
    width: 30%;
}

.tabela-japones th:last-child,
.tabela-japones td:last-child {
    width: 90px;
}

.tabela-japones tr:last-child td {
    border-bottom: none;
}

.tabela-japones tbody tr:hover {
    background: #f5ead9;
}

.tabela-japones td:first-child {
    font-size: 18px;
    font-weight: bold;
    color: #71352e;
}

.tabela-japones td:nth-child(2) {
    color: #a7463c;
    font-style: italic;
}

.tabela-japones .category-item-actions {
    display: flex;
    flex-direction: row;
    gap: 6px;
}

.tabela-japones .category-item-actions .theme-card {
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 15px;
}

/* GALERIA DENTRO DAS CATEGORIAS */

.category-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 15px 0;
}

.category-gallery-item {
    overflow: hidden;
    background: #fffaf2;
    border: 1px solid #ead9c2;
    border-radius: 10px;
    padding: 10px;
}

.category-gallery-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    border-radius: 7px;
}

.category-gallery-item p {
    color: #49352b;
    font-size: 14px;
    line-height: 1.5;
    margin: 10px 2px;
}

.category-gallery-item .theme-card {
    margin-top: 8px;
    width: 100%;
}

@media (max-width: 600px) {
    .category-gallery {
        grid-template-columns: 1fr;
    }

    .category-gallery-item img {
        height: 220px;
    }
}

/* DIÁLOGOS JAPONESES */

.dialogo-item {
    padding: 22px;
    margin-bottom: 18px;
    background: #fffaf2;
    border: 1px solid #ead9c2;
    border-radius: 12px;
}

.dialogo-item h4 {
    color: #71352e;
    font-family: 'Noto Serif JP', serif;
    font-size: 22px;
    margin-bottom: 15px;
}

.dialogo-falantes {
    color: #a7463c;
    font-size: 14px;
    margin-bottom: 16px;
}

.dialogo-versao {
    padding: 14px;
    margin-top: 12px;
    background: #f8f1e5;
    border-left: 4px solid #a7463c;
    border-radius: 7px;
}

.dialogo-versao h5 {
    color: #71352e;
    font-size: 15px;
    margin-bottom: 8px;
}

.dialogo-versao p {
    color: #49352b;
    font-size: 16px;
    line-height: 1.8;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.dialogo-item .category-item-actions {
    margin-top: 15px;
}

/* CURIOSIDADES DO JAPÃO */

.curiosidade-item {
    padding: 22px;
    margin-bottom: 18px;
    background: #fffaf2;
    border: 1px solid #ead9c2;
    border-left: 5px solid #b58a45;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(80, 45, 25, 0.06);
}

.curiosidade-item h4 {
    color: #71352e;
    font-family: 'Noto Serif JP', serif;
    font-size: 21px;
    margin-bottom: 14px;
}

.curiosidade-item > p {
    color: #49352b;
    font-size: 16px;
    line-height: 1.9;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.curiosidade-item .category-item-actions {
    margin-top: 15px;
}
/* BOTÕES DE AÇÃO DAS CATEGORIAS */

.category-item-actions {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.category-item:hover .category-item-actions,
.category-item:focus-within .category-item-actions {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Em celulares, manter os botões visíveis */
@media (hover: none) {
    .category-item-actions {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

/* BOTÕES DA TABELA */

.tabela-japones .category-item-actions {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.tabela-japones tbody tr:hover .category-item-actions,
.tabela-japones .category-item-actions:focus-within {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

@media (hover: none) {
    .tabela-japones .category-item-actions {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}
/* PALAVRAS-CHAVE — CARTÕES COMPACTOS */

.palavra-chave-item {
    height: fit-content;
    min-height: 0;
    align-self: start;
    padding: 10px 14px;
    margin-bottom: 8px;
    background: #fffaf2;
    border: 1px solid #ead9c2;
    border-left: 3px solid #a7463c;
    border-radius: 8px;
}

.palavra-chave-item h4 {
    color: #71352e;
    font-size: 17px;
    margin: 0 0 5px;
}

.palavra-chave-item > p {
    color: #49352b;
    font-size: 14px;
    margin: 0;
    line-height: 1.5;
}
/* TESTE DE ESPAÇAMENTO DAS PALAVRAS-CHAVE */
.category-content:has(.palavra-chave-item) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.palavra-chave-item {
    width: 100%;
    box-sizing: border-box;
    height: auto !important;
    min-height: 0 !important;
    align-self: flex-start;
    margin: 0 !important;
}
/* BOTÕES FLUTUANTES DAS PALAVRAS-CHAVE */
.palavra-chave-item {
    position: relative;
}

.palavra-chave-item .category-item-actions {
    display: flex;
    position: absolute;
    right: 8px;
    bottom: 8px;
    margin: 0;
    padding: 4px;
    background: #fffaf2;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
}

.palavra-chave-item:hover .category-item-actions,
.palavra-chave-item:focus-within .category-item-actions {
    opacity: 1;
    visibility: visible;
}

@media (hover: none) {
    .palavra-chave-item .category-item-actions {
        opacity: 1;
        visibility: visible;
    }
}
/* DESTAQUE DA PESQUISA */
.search-result-item mark {
    background: #f3d58a;
    color: #7a241e;
    font-weight: bold;
    padding: 2px 4px;
    border-radius: 4px;
}
/* RESULTADOS DA PESQUISA */
#resultadosPesquisa {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.search-result-item {
    background: #fffaf0;
    border: 1px solid #d8c5a0;
    border-left: 5px solid #8b2924;
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.search-result-item h3 {
    color: #70251f;
    margin: 0 0 10px;
}

.search-result-item p {
    color: #40372e;
    line-height: 1.6;
}

.search-result-item small {
    display: block;
    color: #806b50;
    margin: 12px 0;
}

.search-result-item button {
    margin-top: 8px;
}
/* MINI-HISTÓRIAS — VISUAL DE MANGÁ */

.dialogo-historia {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 18px;
}

.dialogo-fala {
    background: #f8f1e5;
    border: 1px solid #d8c6a5;
    border-radius: 12px;
    padding: 15px;
    max-width: 85%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.dialogo-fala:nth-child(even) {
    align-self: flex-end;
    background: #f3e5dc;
}

.dialogo-fala strong {
    display: block;
    color: #8b2525;
    margin-bottom: 10px;
}

.fala-japones {
    font-size: 1.25rem;
    font-weight: bold;
    color: #29211c;
    margin: 6px 0;
}

.fala-romaji {
    color: #8b684c;
    margin: 6px 0;
}

.fala-traducao {
    color: #51463c;
    margin: 6px 0;
}
/* AVATARES DOS PERSONAGENS */

.dialogo-personagem {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.dialogo-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #8b2525;
    background: #f8f1e5;
}

.dialogo-personagem strong {
    margin: 0;
}
.simulador-cenario {
    width: 100%;
    height: 380px;
    overflow: hidden;
    border-radius: 14px;
    margin-bottom: 25px;
    border: 2px solid var(--dourado);
}

.simulador-cenario img {
    width: 100%;
    height: 100%;
    object-fit: cover;
object-position: center 25%;
    display: block;
}
/* BIBLIOTECA DE GUIAS ILUSTRADOS */

.biblioteca-container {
    margin: 30px auto;
    width: 90%;
    max-width: 1100px;
}

.biblioteca-acoes {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin: 20px 0;
}

.biblioteca-acoes input {
    flex: 1;
    min-width: 220px;
    padding: 12px;
    border: 1px solid #c49a54;
    border-radius: 8px;
    background: #fffaf0;
    font-size: 16px;
}

#gradeBiblioteca {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.biblioteca-card {
    background: #fffaf0;
    border: 1px solid #c49a54;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}

.biblioteca-card img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}

.biblioteca-card h3 {
    color: #a51f2b;
    margin-top: 12px;
}
/* VISUALIZADOR DA BIBLIOTECA */

#visualizadorBiblioteca {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(30, 20, 15, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

.visualizador-conteudo {
    width: 100%;
    max-width: 1000px;
    text-align: center;
    background: #f5efe3;
    padding: 20px;
    border-radius: 12px;
}

.visualizador-conteudo img {
    display: block;
    max-width: 100%;
    max-height: 75vh;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 20px auto 0;
}

.visualizador-conteudo h2 {
    color: #a51f2b;
}

@media (max-width: 600px) {
    #visualizadorBiblioteca {
        padding: 8px;
    }

    .visualizador-conteudo {
        padding: 12px;
    }

    .visualizador-conteudo img {
        max-height: 80vh;
    }
}
/* CONTROLES DE ZOOM DA BIBLIOTECA */

.controles-zoom {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
}

.controles-zoom button {
    background: #a51f2b;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 22px;
    cursor: pointer;
}

.controles-zoom button:hover {
    background: #7d1720;
}

#nivelZoom {
    color: #a51f2b;
    font-weight: bold;
    min-width: 55px;
}

.area-imagem-zoom {
    width: 100%;
    max-height: 75vh;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: #fffaf0;
    border-radius: 8px;
    padding: 10px;
}

.area-imagem-zoom img {
    display: block;
    max-width: 100%;
    max-height: none;
    width: auto;
    height: auto;
    object-fit: contain;
    transform-origin: top center;
    transition: transform 0.2s ease;
}

@media (max-width: 600px) {
    .controles-zoom {
        gap: 8px;
    }

    .controles-zoom button {
        padding: 10px 15px;
    }

    .area-imagem-zoom {
        max-height: 80vh;
    }
}
/* AJUSTES GERAIS PARA CELULARES */

@media (max-width: 600px) {

    .container {
        padding: 20px 14px;
    }

    .container h1 {
        font-size: 27px;
    }

    .container h2 {
        font-size: 21px;
    }

    .theme-introduction,
    .content-section {
        padding: 16px;
        margin: 18px 0;
    }

    .theme-cover {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .theme-cover-image {
        height: 300px;
    }

    .cover-placeholder {
        min-height: 300px;
    }

}
/* CORREÇÃO DO ESPAÇAMENTO DA GALERIA NO CELULAR */

@media (max-width: 600px) {
    .category-gallery-item {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-self: start;
        height: auto;
    }

    .category-gallery-item p {
        margin: 8px 2px 0;
    }
}
/* GALERIA: UMA IMAGEM POR LINHA NO CELULAR */

@media (max-width: 600px) {
    .category-gallery {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    .category-gallery-item {
        width: 100%;
        box-sizing: border-box;
    }

    .category-gallery-item img {
        width: 100%;
        height: auto;
        object-fit: contain;
    }
}
/* GALERIA PRINCIPAL NO CELULAR */

@media (max-width: 600px) {
    .image-gallery {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .gallery-item {
        width: 100%;
        box-sizing: border-box;
    }

    .gallery-item img {
        width: 100%;
        height: auto;
        object-fit: contain;
    }
}
/* OPÇÕES DOS ITENS AO TOCAR NO CELULAR */

@media (max-width: 600px) {

    .category-item .category-item-actions {
        display: none;
    }

    .category-item.selecionado .category-item-actions {
        display: flex;
    }

}