/* ===========================
   STORY MODE – CONTENITORE
   =========================== */

.story-container {
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
    border-radius: 14px;
    padding: 8px 8px 10px 8px;
    min-height: 100vh;

    display: flex;
    flex-direction: column;
    gap: 8px;
}

.story-container h2 {
    font-size: 1.4rem;
    text-align: center;
    margin: 0 0 4px 0;
}

.story-container > p {
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0;
}

/* ===========================
   SCELTA VARIANTE (RAPIDA / LUNGA)
   =========================== */

.variant-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.variant-card {
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.18);
    padding: 8px 10px;
}

.variant-card h3 {
    font-size: 1rem;
    margin: 0 0 4px 0;
}

.variant-card p {
    font-size: 0.82rem;
    line-height: 1.4;
    opacity: 0.95;
    margin: 0 0 4px 0;
}

/* ===========================
   CHAT FISSA (STORIA & BATTAGLIA)
   =========================== */

.story-chat-fixed {
    height: 55vh; /* default: story */
    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 12px;
    padding: 6px 8px;

    overflow-y: auto;
    scroll-behavior: smooth;

    display: flex;
    flex-direction: column;

    flex-shrink: 0;
}

/* Contenuto ancorato in basso */
.chat-content {
    margin-top: auto;
    display: flex;
    flex-direction: column;
}

/* Riga messaggio */
.chat-line {
    margin-bottom: 8px;
}

.chat-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

/* Bolla */
.chat-bubble {
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 5px 8px;
    max-width: 78%;
    border: 1px solid rgba(255,255,255,0.18);
}

.chat-name {
    font-size: 0.72rem;
    font-weight: bold;
    opacity: 0.9;
    margin-bottom: 2px;
}

.chat-text {
    font-size: 0.8rem;
    line-height: 1.35;
}

/* ===========================
   AVATAR SPEAKER (SENZA IMMAGINI)
   =========================== */

.chat-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 18px;

    box-shadow: 0 0 5px rgba(255,255,255,0.3);
    border: 2px solid rgba(255,255,255,0.4);
}

.chat-avatar::after {
    position: absolute;
    top: 4px;
    left: 7px;
    font-size: 18px;
}

/* Colori speaker */
.speaker-narrator {
    background: linear-gradient(135deg, #333, #555);
}
.speaker-narrator::after {
    content: "᛫";
}

.speaker-lagertha {
    background: linear-gradient(135deg, #7ac7ff, #349fe3);
}
.speaker-lagertha::after {
    content: "ᛟ";
}

.speaker-wolf {
    background: linear-gradient(135deg, #aaa, #777);
}
.speaker-wolf::after {
    content: "🐺";
}

.speaker-raider {
    background: linear-gradient(135deg, #8c2e2e, #b43737);
}
.speaker-raider::after {
    content: "ᚦ";
}

.speaker-berserker {
    background: linear-gradient(135deg, #e38a31, #c86a10);
}
.speaker-berserker::after {
    content: "🔥";
}

.speaker-shadowKing {
    background: linear-gradient(135deg, #3e2c63, #1c0e33);
}
.speaker-shadowKing::after {
    content: "☠️";
}

.speaker-valhalla {
    background: linear-gradient(135deg, #f5d97a, #d7b84e);
}
.speaker-valhalla::after {
    content: "✨";
}

/* ===========================
   COMANDI IN BASSO (STORIA)
   =========================== */

.story-controls {
    display: flex;
    flex-direction: column;
    gap: 6px;

    margin-top: 8px;
    flex-shrink: 0;
}

.story-container button {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    border-radius: 999px;
    border: none;
    padding: 8px 14px;
    background: linear-gradient(135deg, #2b6aa8, #3f90c9);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(0,0,0,0.5);
    transition: 0.15s ease;
}

.story-container button:active {
    transform: scale(0.96);
    opacity: 0.9;
}

/* ===========================
   BATTLE CONTAINER – FULL SCREEN
   =========================== */

.battle-container {
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(4px);
    border-radius: 0; /* a schermo intero su mobile */

    height: 100vh;
    max-height: 100vh;
    padding: 6px 6px 10px 6px;

    display: flex;
    flex-direction: column;
    gap: 6px;

    overflow: hidden; /* niente scroll esterno */
}

.battle-container h2 {
    font-size: 1.1rem;
    text-align: center;
    margin: 0;
    flex-shrink: 0;
}

/* STATUS COMPATTO */
.battle-status {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.status-block {
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 4px 6px 6px 6px;
    border: 1px solid rgba(255,255,255,0.16);
}

.status-block h3 {
    font-size: 0.9rem;
    margin: 0 0 2px 0;
}

.status-block p {
    font-size: 0.75rem;
    margin: 0 0 2px 0;
}

/* BARRE HP CON GRADIENTI */
.hp-bar {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
}

.hp-fill {
    height: 100%;
    width: 100%;
    border-radius: 999px;
    transition: width 0.2s ease-out;
}

.hp-player {
    background: linear-gradient(90deg, #32d67b, #3fd4ff);
}

.hp-enemy {
    background: linear-gradient(90deg, #ff4949, #a03cff);
}

/* CHAT BATTAGLIA PIÙ PICCOLA */
.battle-container .story-chat-fixed {
    height: 45vh; /* più bassa della storia per far stare tutto */
    padding: 4px 6px;
}

.battle-container .chat-bubble {
    max-width: 82%;
    padding: 4px 7px;
}

.battle-container .chat-name {
    font-size: 0.7rem;
}

.battle-container .chat-text {
    font-size: 0.78rem;
}

/* COMANDI BATTAGLIA SEMPRE IN BASSO */

.battle-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;

    margin-top: 4px;
    flex-shrink: 0;
}

.battle-container button {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    border-radius: 999px;
    border: none;
    padding: 7px 6px;
    background: linear-gradient(135deg, #2b6aa8, #3f90c9);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(0,0,0,0.6);
    transition: 0.15s ease;
}

.battle-container button:active {
    transform: scale(0.96);
    opacity: 0.9;
}

/* ===========================
   RESPONSIVE
   =========================== */

@media (min-width: 768px) {

    .story-container {
        max-width: 900px;
        margin: 0 auto;
        border-radius: 18px;
    }

    .battle-container {
        max-width: 900px;
        margin: 0 auto;
        border-radius: 18px;
    }

    .battle-status {
        flex-direction: row;
        justify-content: space-between;
    }
}
