:root {
    --pokerole-red: #e63946;
    --teal-stat: #2a9d8f;
    --brown-skill: #a67c52;
    --bg-dark: #1b1b1b;
    --card-light: #f1f1f1;
    --text-main: #333;
}

body {
    margin: 0; padding: 0; font-family: 'Helvetica Neue', sans-serif;
    background-color: var(--bg-dark); color: var(--text-main);
    height: 100vh; overflow: hidden;
}

#app-content {
    height: calc(100vh - 70px);
    overflow-y: auto;
    padding: 15px;
    box-sizing: border-box;
}

.view { display: none; }
.view.active { display: block; }

/* NAVBAR */
#bottom-nav {
    position: fixed; bottom: 0; width: 100%; height: 70px;
    background: #222; display: flex; border-top: 2px solid var(--pokerole-red);
}

.nav-item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; color: #888;
}

.nav-item.active { color: var(--pokerole-red); background: rgba(255,255,255,0.05); }
.nav-icon { font-size: 1.5em; }
.nav-label { font-size: 0.7em; font-weight: bold; }

/* LAYOUT SCHEDA ALLENATORE (Img 1 e 2) */
.trainer-header-card {
    background: #e9ecef; border-radius: 15px; border: 3px solid #444;
    overflow: hidden; margin-bottom: 15px;
}

.red-bar { background: var(--pokerole-red); color: white; padding: 8px 15px; font-weight: bold; }

.attr-grid {
    display: grid;
    grid-template-columns: 1fr; /* <--- MODIFICATO DA 1fr 1fr A 1fr */
    gap: 10px;
    margin-top: 15px;
}

.attr-box {
    background: var(--teal-stat); color: white; border-radius: 12px;
    padding: 10px; text-align: center; border: 2px solid #333;
}

.skill-row {
    display: flex; justify-content: space-between; align-items: center;
    background: #ddd; margin-bottom: 4px; padding: 5px 10px; border-radius: 5px;
}

/* DOTS */
.dot-container { display: flex; gap: 3px; }
.dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid #333; background: white; }
.dot.filled { background: #3498db; }

/* ZAINO (Img 3) */
.bag-pocket {
    background: #ced4da; border: 2px solid #6c757d;
    border-radius: 10px; padding: 15px; margin-bottom: 15px;
}

/* Modifiche ai bottoni base */
.btn-main {
    background: var(--teal-stat); color: white; border: 2px solid #222;
    padding: 12px; border-radius: 10px; font-weight: bold; width: 100%; cursor: pointer;
}
.btn-back {
    background: transparent; color: var(--text-main); border: 2px solid #888;
    padding: 5px 15px; border-radius: 5px; cursor: pointer; margin-bottom: 10px; font-weight: bold;
}
.search-item {
    background: #fff; border: 2px solid #ddd; padding: 12px 15px;
    border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between;
}
.input-text {
    width: 100%; padding: 10px; border: 2px solid #ccc; border-radius: 8px;
    box-sizing: border-box; outline: none;
}

/* Fix per i 10 pallini in fila sugli schermi mobile */
.poke-dot {
    width: 10px !important;
    height: 10px !important;
    margin: 1px;
}
/* Pulsanti +/- per le statistiche */
.btn-dot-control {
    background: #444; color: white; border: none; border-radius: 4px;
    width: 24px; height: 24px; font-weight: bold; cursor: pointer;
    display: flex; justify-content: center; align-items: center;
    font-size: 1.2em; line-height: 1; padding: 0;
}
.btn-dot-control:active { background: var(--pokerole-red); }

/* Mantiene tutto su una riga */
.stat-controls-wrapper {
    display: flex; align-items: center; gap: 8px; justify-content: space-between;
}
/* Stile Capsule per HP e WILL */
.capsule-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 12px;
    border-radius: 25px; /* Arrotondamento massimo */
    border: 3px solid #333;
    font-weight: bold;
    box-shadow: 2px 2px 0px rgba(0,0,0,0.2);
}

.hp-bg { background: linear-gradient(to bottom, #ff6b6b, #ee5253); color: white; }
.will-bg { background: linear-gradient(to bottom, #54a0ff, #2e86de); color: white; }

.capsule-label { font-size: 0.7em; letter-spacing: 1px; }

.capsule-stat input {
    width: 45px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 10px;
    color: white;
    text-align: center;
    font-weight: bold;
    font-size: 1.1em;
    outline: none;
}

/* Effetto profondità allo schermo Poketch */
.poketch-screen {
    background: #87c095;
    border-radius: 20px;
    padding: 15px;
    height: 380px;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.4);
    border: 4px solid #1a3322;
}

.poketch-app-card {
    background: rgba(255,255,255,0.3);
    border: 2px solid #1a3322;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    transition: transform 0.1s;
}
.poketch-app-card:active { transform: scale(0.9); }
.app-icon-circle {
    width: 45px; height: 45px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5em; border: 2px solid #1a3322; margin-bottom: 5px;
    box-shadow: 2px 2px 0px #1a3322;
}
.poketch-app-card span { font-size: 0.6em; font-weight: bold; color: #1a3322; }

/* --- FIX NAVBAR E SCROLL --- */
#app-content {
    height: 100vh;
    overflow-y: auto;
    padding: 15px;
    padding-bottom: 100px; /* <--- Questo crea il vuoto a fine pagina per la navbar! */
    box-sizing: border-box;
}

/* Fix per evitare che gli input di testo allarghino le schermate */
.input-mini, .input-text {
    min-width: 0;
}

/* --- FIX BOTTONI E PALLINI (Grid Layout) --- */
.stat-controls-wrapper {
    display: grid;
    grid-template-columns: 24px 1fr 24px; /* Fissa i bottoni a 24px, il resto ai pallini */
    align-items: center;
    gap: 8px;
    width: 100%;
}

.btn-dot-control {
    background: #444; color: white; border: none; border-radius: 4px;
    width: 24px; height: 24px; font-weight: bold; cursor: pointer;
    display: flex; justify-content: center; align-items: center;
    font-size: 1.2em; padding: 0; margin: 0;
}

.dot-container {
    display: flex;
    gap: 3px;
    flex-wrap: wrap; /* Permette ai pallini di andare a capo */
    justify-content: center;
}

.dot {
    width: 12px; height: 12px; border-radius: 50%;
    border: 2px solid #2c3e50; background: white; cursor: pointer;
}
.dot.filled { background: #3498db; }

/* Pallini più piccoli per la scheda Pokémon (che ne ha 10) */
.poke-dot {
    width: 10px !important;
    height: 10px !important;
}