body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 20px;
}
.header { margin-bottom: 10px; text-align: center; }
.botones-top { display: flex; gap: 10px; margin-bottom: 15px; flex-wrap: wrap; justify-content: center;}

button {
    background-color: #fff; border: 1px solid #ccc; padding: 10px 15px;
    font-size: 14px; font-weight: bold; border-radius: 5px; cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
button:hover { background-color: #e9e9e9; }
button:disabled { background-color: #eee; cursor: not-allowed; color: #999; }
.btn-girar { background-color: #DFF0D8; font-size: 16px; }
.btn-girar:hover { background-color: #d0e9c6; }
.btn-guardar { background-color: #337ab7; color: white; border: none; }
.btn-guardar:hover { background-color: #286090; }

#estado { font-size: 18px; font-weight: bold; color: #333; margin: 5px 0 15px 0; height: 24px; text-align: center;}

.ruleta-container { position: relative; width: 600px; height: 600px; max-width: 100%; aspect-ratio: 1; }
canvas { width: 100%; height: 100%; }

.flecha {
    position: absolute; right: 0; top: 50%; transform: translateY(-50%);
    width: 0; height: 0; 
    border-top: 15px solid transparent; border-bottom: 15px solid transparent; border-right: 35px solid black;
}

/* Modales */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 1000; justify-content: center; align-items: center;
}
.modal-content {
    background: white; padding: 25px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    max-width: 550px; width: 90%; max-height: 90vh; overflow-y: auto; position: relative;
}
.modal-titulo { font-size: 20px; font-weight: bold; margin-bottom: 15px; text-align: center; }

/* Editor y Opciones */
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px;}
.editor-row { display: flex; align-items: center; gap: 5px; font-size: 14px;}
.editor-row input[type="text"] { width: 100px; padding: 4px; }
.editor-row input[type="number"] { width: 50px; padding: 4px; }
.opciones-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 15px;}
.opciones-extra { margin-top: 15px; border-top: 2px solid #eee; padding-top: 15px; }
.botones-gens { grid-column: 1 / -1; display: flex; justify-content: center; gap: 10px; margin-bottom: 5px;}
.btn-small { padding: 4px 8px; font-size: 12px; }

/* Historial y Resultados */
#listaHistorial { width: 100%; height: 200px; overflow-y: auto; border: 1px solid #ccc; padding: 10px; background: #f9f9f9; margin-bottom: 15px;}
.res-content { text-align: center; cursor: pointer; }
.res-content img { width: 220px; height: 220px; object-fit: contain;}
.res-nombre { font-size: 24px; font-weight: bold; margin-bottom: 5px; }
.res-poke { font-size: 18px; color: #555; margin-bottom: 15px; }
.res-hint { font-size: 14px; color: #999; font-style: italic; margin-top: 15px; }

/* Grupos */
.grupos-container { 
    display: flex; flex-wrap: wrap; gap: 15px; justify-content: center; 
    width: 100%; margin-top: 20px; 
}
.grupo-card { 
    background: white; border: 1px solid #ccc; border-radius: 8px; 
    padding: 15px; width: 200px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
}
.grupo-titulo { 
    font-weight: bold; font-size: 16px; margin-bottom: 10px; 
    text-align: center; border-bottom: 2px solid #337ab7; padding-bottom: 5px;
}
.grupo-lista { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.grupo-lista li { margin-bottom: 8px; display: flex; align-items: center; gap: 8px; border-bottom: 1px dashed #eee; padding-bottom: 4px;}
.grupo-lista img { width: 35px; height: 35px; object-fit: contain; }