/* Importazione Font Google: Cinzel per i titoli, Inter per la lettura */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Inter:wght@300;400;500;600&display=swap');

/* ===== BACKGROUND GENERALE ===== */
body {
    background-image: url("/assets/worlds/default/background.gif");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    /* Font Inter per la massima leggibilità */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #e6e6e6;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== MENU GENERALE ===== */
.menu {
    background: transparent;
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
}

.menu a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    padding: 8px 12px;
    transition: all 0.2s;
}

.menu a:hover {
    color: #ffd700;
    transform: scale(1.1); /* Ridotto scale da 2 a 1.1 per evitare glitch grafici */
}

/* ===== BOX GENERICI ===== */
.box {
    background: rgba(20, 20, 25, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 0 10px rgba(0,0,0,0.6), inset 0 0 10px rgba(255,255,255,0.05);
}

/* ===== MENU TOP ===== */
.topmenu {
    background: linear-gradient(to bottom, #2c2c34, #15151a);
    border-bottom: 2px solid #444;
}

/* ===== LINK ===== */
a {
    color: #c9b37a;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #ffd86b;
    text-shadow: 0 0 5px rgba(255, 220, 120, 0.6);
}

/* ===== MENU LATERALI ===== */
.menu-item {
    padding: 6px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item a {
    display: block;
}

/* ===== TITOLI ===== */
h1, h2, h3 {
    font-family: 'Cinzel', serif; /* Font epico per i titoli */
    color: #ffd86b;
    font-weight: normal;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 4px;
    letter-spacing: 1px;
}

/* ===== CENTRO CONTENUTO ===== */
.center {
    min-height: 500px;
    overflow-y: auto;
}

/* ===== PANNELLO DESTRO ===== */
.right {
    font-size: 0.9em;
}

/* ===== FOOTER ===== */
.footer {
    background: linear-gradient(to bottom, #2c2c34, #15151a);
    padding: 10px; /* Aumentato padding */
    border-top: 2px solid #444;
}

/* ===== SCROLLBAR MODERNA ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #111;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* ===== CHARACTERS PAGE ===== */
.characters-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px;
}

.character-card {
    background: rgba(20, 20, 25, 0.85);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 12px rgba(0,0,0,0.6);
    transition: 0.2s;
    text-align: center;
    position: relative;
}

.character-card:hover {
    transform: scale(1.03);
    box-shadow: 0 0 18px rgba(0,0,0,0.8);
}

.character-avatar {
    height: 140px;
    background-size: cover;
    background-position: center;
}

.character-info {
    padding: 10px;
    font-size: 14px;
}

.character-info h3 {
    margin: 0 0 8px 0;
    color: #ffd86b;
}

.char-row {
    margin-bottom: 4px;
}

.char-row span {
    color: #aaa;
}

.healthbar {
    width: 100%;
    height: 10px;
    background: #222;
    border-radius: 4px;
    margin-top: 6px;
}

.healthvalue {
    height: 100%;
    background: #2ecc71;
    border-radius: 4px;
}

.new-character {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #aaa;
    cursor: pointer;
    background: #111;
}

.new-character-icon {
    font-size: 50px;
    margin-bottom: 10px;
}

/* ===== WATERMARKS & RIBBONS ===== */
.watermark {
    position: absolute;
    top: 16px;
    right: -60px;
    width: 220px;
    text-align: center;
    transform: rotate(45deg);
    padding: 6px 0;
    font-size: 12px;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
    pointer-events: none;
}

.wm-red { background: #c0392b; }
.wm-orange { background: #e67e22; }
.wm-green { background: #27ae60; }

.wm-maintenance {
    font-weight: 900;
    color: #ffffff;
    background: repeating-linear-gradient(45deg, #f1c40f, #f1c40f 12px, #000 12px, #000 24px);
    border-top: 2px solid rgba(0,0,0,0.5);
    border-bottom: 2px solid rgba(0,0,0,0.5);
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

/* ===== CHAT ===== */
.chat-container {
    height: 40%;
    max-height: 300px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    text-align: left;
    font-size: 13px;
    word-break: break-word;
    min-height: 0;
}

/* ===== BUTTONS ===== */
button {
    margin-left: 6px;
    padding: 6px 12px;
    background: #333;
    color: #ffd86b;
    border: 1px solid #555;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    transition: background 0.3s ease, transform 0.2s ease;
}

button:hover {
    background: #444;
    transform: scale(1.05);
}

/* ===== BAN STYLE ===== */
.watermark.wm-ban {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-25deg);
    font-size: 48px;
    font-weight: 900;
    color: #ff0000 !important;
    text-shadow: 2px 2px 4px #fff, 2px 2px 6px rgba(0,0,0,0.7);
    z-index: 999;
}

/* --- DOCUMENTATION & AMBIENT STYLE (Migliorata Leggibilità) --- */

.center.box h1 {
    font-family: 'Cinzel', serif;
    color: #f1e5ac;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 30px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.doc-grid {
    display: grid;
    grid-template-columns: 30% 1fr;
    gap: 30px;
    align-items: start;
}

.doc-sidebar {
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 4px;
    padding: 15px;
    position: sticky;
    top: 20px;
}

.doc-sidebar a {
    display: block;
    padding: 12px 15px;
    margin-bottom: 5px;
    color: #e2c06d;
    font-family: 'Cinzel', serif;
    font-size: 13px;
    border-left: 2px solid transparent;
    transition: all 0.3s ease;
}

.doc-sidebar a:hover {
    background: rgba(212, 175, 55, 0.1);
    color: #f1e5ac;
    border-left: 2px solid #d4af37;
    padding-left: 20px;
}

.capitolo {
    background: rgba(26, 29, 33, 0.7); /* Leggermente più opaco per contrasto */
    border: 1px solid rgba(212, 175, 55, 0.1);
    border-top: 3px solid #d4af37;
    padding: 40px;
    border-radius: 4px;
    min-height: 500px;
    line-height: 1.8; /* Interlinea aumentata per non affaticare l'occhio */
    color: #efefef; /* Grigio chiarissimo per ridurre lo stress visivo rispetto al bianco puro */
    font-size: 17px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: left;
}

.capitolo h2 {
    font-family: 'Cinzel', serif;
    color: #f1e5ac;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.capitolo p {
    margin-bottom: 20px;
    /* Rimosso text-align: justify per evitare spazi irregolari brutti sul web */
}

.capitolo strong {
    color: #e2c06d;
    font-weight: 600;
}

/* Immagini capitoli */
.capitolo img {
    display: block;
    margin: 20px auto;
    border: 3px solid #1a1d21;
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.3), 0 10px 20px rgba(0,0,0,0.5);
    border-radius: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .doc-grid { grid-template-columns: 1fr; }
    .characters-container { grid-template-columns: repeat(1, 1fr); }
    .doc-sidebar { position: relative; top: 0; }
}